-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
[docs] Improve demo source discoverability #14635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Details of bundle changes.Comparing: bfa9167...f93c992
|
|
I like the idea, my favorite solution is probably https://semantic-ui.com. They show the source code tooltip when one demo is hovered. As soon as the user interacts with the icon button, they increase his expertise level with a cookie: The tooltip will never be shown again. |
That is the part that I've currently disabled by default ( |
1be9fd4 to
b10b6f9
Compare
When I view the source for demo, it no longer shows the tooltip for that demo, but it does for all others on the page. Is that intended / unavoidable? |
That would imply it should only be shown on the first hover. Is this intended? Might be confusing if people hover over the demo very quickly and the tooltip flashes. Now it won't be shown again. I feel like coupling it directly to "the user actually used this once" is the safer route here. Although it might be annoying if people know about it and never use it. |
|
I was just suggesting something more concise for the cookie name. The "and interacted with it" part is implicit - that's how we know it was seen, not just displayed. |
|
I guess so. |
Co-Authored-By: eps1lon <[email protected]>
|
In case it was missed because I edited my comment, rather than adding a new one:
|
Right. Since the other demos didn't update they still have the outdated cookie value. Might be a better idea to put this into a store anyway and initialize from there. Basically set up an app wide state about capabilities the user has discovered. This touches on a related issue I have with handling the theme currently. Since this issue only occurs on the first interaction with it I would keep this as-is and revisit it later when we improve state initialization from cookies. |
|
@eps1lon We should be able to use the |
This is what I'm getting at. The current infrastructure is problematic (throwaway component that has no clear purpose) and has some actual issues. I need to gather my thoughts about this later. |

Puts emphasis on the toggle demo source button when hovering over the demo itself.
I experimented with opacity but this doesn't translate very well to the dark theme: Light theme has default .54 opacity meaning we can highlight it by increasing it. However, the dark theme already is at 1 so we can't emphasize it more.
I settled on switching from the
defaultcolor toprimarywhen hovering over the demo. This is following material design.This also includes showing the tooltip on hover. This features is disabled for now. Should we only display the tooltip when the toggle was never clicked? How do we persist this? cookies, localStore?