Repository navigation
Add an "About the Annotation editor" link above the editor toolbar, behind a flag - #7594
Merged
Merged
Conversation
WCAG 3.3.2 asks for a cue for the purpose of the annotation editor's text field that is always visible. The only cue the field has is its placeholder, which goes away as soon as there is text in it. Show an info icon that links to the Help Center article about the editor. It is in a row of its own above the toolbar, so it is a separate tab stop that comes before the formatting buttons, and it is there for as long as the editor is open, including in preview mode. The article opens in a new tab, so the draft is not lost. The icon is `InfoIcon` from the shared icon set, at 16px inside a 24px link, in the same grey as the toolbar icons. This is behind the `annotation_editor_info` feature flag, which is off by default, so it can be released before it has been approved. Like the "Formatting help" link, it is not shown when the Help panel is disabled, because that setting exists to remove links to external websites. Part of hypothesis/product-backlog#1753 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7594 +/- ##
=======================================
Coverage 99.62% 99.62%
=======================================
Files 286 286
Lines 12056 12061 +5
Branches 2932 2935 +3
=======================================
+ Hits 12011 12016 +5
Misses 45 45 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
karenrasmussen
approved these changes
Nov 11, 2026
This was referenced Nov 12, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds an "About the Annotation editor" link above the annotation editor's toolbar. It is behind a feature flag that is off by default, so merging this changes nothing for users.
Part of hypothesis/product-backlog#1753
Why
WCAG 3.3.2 asks for a cue for the purpose of the editor's text field that is always visible. The only cue the field has today is its placeholder ("Enter comment"), which goes away as soon as there is text in it.
What changes
When the flag is on, the editor shows an info icon that links to the Help Center article about the editor, https://web.hypothes.is/help/using-the-annotation-editor/
target="_blank",rel="noopener noreferrer"), so the draft is not lost.title): "About the Annotation editor"aria-label): "About the Annotation editor. Learn what this text field is for. Opens Help Center article in a new tab."The "Formatting help" link in the toolbar is not changed. It is a separate thing.
MarkdownEditorgets ashowEditorInfoLinkprop (defaultfalse), in the same way asshowHelpLinkandmentionsEnabled.AnnotationEditorreads the flag from the store and passes it down.The icon
The icon follows the decision from the 10 November product meeting: a plain info "i" on a filled grey circle, instead of the text field pictogram with a red badge that is in the issue. The pictogram read as a notification. There is no red in this.
InfoIconfrom@hypothesis/frontend-shared, which the sidebar already uses for "About thumbnail descriptions". There is no new icon component and no change to dependencies.text-grey-7(#595959), andgrey-9(#202020) on hover. These are the colors of the toolbar's icon buttons. Links in the sidebar are red by default, so the link sets the grey itself and a test checks that the rendered color is a grey.Contrast (WCAG relative luminance):
#595959on the card background#FFFFFF#595959#202020on#FFFFFF, and the "i" on itThe two ratios are the same number because the "i" is a hole in the shared icon, not a white shape. What shows through it is the card background, which is white (
bg-whiteonCard).How it is gated
The link is shown when the
annotation_editor_infofeature flag is on. The flag is added to h in hypothesis/h#10226.This is safe to ship before the h change: the client treats a flag it does not get from h as off.
To turn it on: in h admin, on the feature flags page, enable
annotation_editor_infofor everyone, first-party users, admins, staff, or a cohort. It will go to staging first, for a screenshot review, before the flag is turned on anywhere in production.One more condition: like the "Formatting help" link, this link is not shown when the Help panel is disabled (
enableHelpPanel: falsein the service config), even if the flag is on. That setting exists to remove links to external websites (see 61708eb).Testing
New tests:
MarkdownEditor: the link is not rendered by default and the output is the same as with the prop set tofalse;href,target,rel,titleandaria-label; the icon is the info icon, 16px, and grey; the link comes before the toolbar in DOM order and is the first tab stop; arrow keys in the toolbar do not reach it; it stays in preview mode; the "Formatting help" link is unaffected.AnnotationEditor: the link is off by default, off when only other flags are on, on withannotation_editor_info, off when the Help panel is disabled, and it is in the DOM before the toolbar when the real editor is rendered.checkAccessibilityscenarios with the link shown, in both test files.Run locally:
yarn checkformatting,yarn lint,yarn typecheck: all pass.yarn test(the whole suite): 4390 passed.yarn buildon this branch and on main: the boot script is the same in both apart from the asset manifest that is embedded in it, where only the cache-busting hashes ofsidebar.bundle.js,sidebar.cssandui-playground.css(and their source maps) differ. Nothing undersrc/boot, no build configuration and no dependency is touched.Measured in the test runner's headless Chromium with the built sidebar CSS, in a container with the card's classes: the icon's left edge is in line with the left edge of the toolbar and of the text above it, there are 8px between the icon and the toolbar, the rendered color is
rgb(89, 89, 89), and the accessible name that axe-core computes is thearia-labelabove.Not verified
🤖 Generated with Claude Code