-
Notifications
You must be signed in to change notification settings - Fork 102
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
Make initial frame content useful #12
Open
dracos
wants to merge
1
commit into
hotwired:main
Choose a base branch
from
dracos:patch-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you feel about declaring both, with the Set aside link wrapped in a
<noscript>
element?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spinner could be confusing if it is shown and the JavaScript does not run for whatever reason, and the user waits and thinks something is happening when it is not, so I think it would be best if the spinner was only shown if the relevant JavaScript is running. Similarly, JavaScript might be enabled (so
noscript
would not be shown) but something goes wrong loading/running the JavaScript, and then the user has no way to proceed, so I don't think wrapping it innoscript
is the best way to proceed.But yes, the spinner could be present initially in the HTML if you had, I dunno e.g.
with some CSS like
and then the JS that kicks off the fetch / some event handler at that point / whatever shows
#set_aside_tray .fetch-show
and hides#set_aside_tray .fetch-hide
– and then if something goes wrong fetching the page it can revert back to showing the link easily enough, which would also be a good thing, more robust and resilient.Hope that's helpful.
PS I realise this is only an early example in the documentation, but I really do think it's worthwhile to have something robust like this in such an example, because it might well be used as a template in many implementations. And going by the past N years of much web development I don't want people to start using the good ideas of this but still make something that is a bunch of non-working spinners :)