-
Notifications
You must be signed in to change notification settings - Fork 194
Add scroll to text fragment feature #732
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
| @@ -0,0 +1,7 @@ | |||
| name: Scroll to text fragment | |||
| description: Scrolling to a text snippet given in a URL fragment such as `#:~:text=snippet`. | |||
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.
Reviewers, I don't love this description, but can't figure out how to write it in a style more similar to other descriptions. Naming the feature via the syntax is tricky here, and saying what the syntax does is also tricky. Something like this?
A URL fragment on the form
#:~:text=snippetcauses the page to scroll to the snippet of text, if found.
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.
"fragment" in name reads as equivalent to "snippet" in description, but I think it's supported to refer to the segment of a URL named a fragment, so that's a bit confusing.
also, "scroll to" feels overspecific - the spec talks about "emphasizing" or "bringing to the user's attention"; I'm not sure we would call the id fragment of HTML "scroll to id fragment".
How about
name: Link to text snippet
description: A URL fragment on the form `#:~:text=snippet` allows to link directly to the snippet of text, if found."Link to text snippet" could also be "Text snippet URL fragment", not sure how widely known the term "url fragment" is
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.
I agree that "scroll to" isn't the whole story, as implemented in Chrome the text is also highlighted. I'm a bit wary of picking a name that's never been used before however. Both https://developer.mozilla.org/en-US/docs/Web/Text_fragments and https://web.dev/articles/text-fragments both call this "text fragments", perhaps that would be best?
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.
About the description, here's MDN:
Text fragments allow linking directly to a specific portion of text in a web document, without requiring the author to annotate it with an ID, using particular syntax in the URL fragment. Supporting browsers are free to choose how to draw attention to the linked text, e.g. with a color highlight and/or scrolling to the content on the page.
And here's web.dev:
Text Fragments let you specify a text snippet in the URL fragment. When navigating to a URL with such a text fragment, the browser can emphasize and/or bring it to the user's attention.
I'll try something...
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.
Tried.
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 new description looks good; I'm not convinced by the name - it feels too generic (although I appreciate the precedent set by MDN/web.dev)
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.
I agree it's a bit generic, but what to call it? Link to text fragment?
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 "link to" feels a bit... extra. I don't think we would call the age-old #id syntax "Link to fragment identifier", it's a part of a URL so of course it can be linked.
| @@ -0,0 +1,7 @@ | |||
| name: Text fragments | |||
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.
If we want to honor the precedent of MDN with "text fragments", maybe we could add some specificity to the end:
| name: Text fragments | |
| name: Text fragments in URLs |
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.
Hmm, what about our principle of shortest plausible name?
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.
"URL references for text fragments"?
Maybe it helps to think about a name for this feature when also thinking about how we used to only have links to ids before. I would have called that "URL references to fragment identifiers" and not just "Fragment identifiers", I assume.
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.
Just "fragment identifiers" is what I would call that actually. I remember that from https://www.w3.org/TR/media-frags/ where "media fragments" were defined.
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.
Hmm, what about our principle of shortest plausible name?
I guess I thought the existing name wasn't completely credible. Over in #732 (comment) you seemed unimpressed with "text fragments" alone. 😄
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.
I should have shut up 😆
"Text fragments" is a bit generic, but it is the best name I can come up.
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.
OK, let's merge this as written. If it ends up being too vague when it is presented to developers, I'm sure we'll get feedback about it.
Co-authored-by: Daniel D. Beck <[email protected]>
Co-authored-by: Daniel D. Beck <[email protected]>
|
There is also |
|
@Elchi3 I didn't know about |
| @@ -0,0 +1,7 @@ | |||
| name: Text fragments | |||
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.
OK, let's merge this as written. If it ends up being too vague when it is presented to developers, I'm sure we'll get feedback about it.
No description provided.