feat(docs): improve a11y and lazy-load Inkeep search widget#6723
feat(docs): improve a11y and lazy-load Inkeep search widget#6723FarhanAliRaza wants to merge 4 commits into
Conversation
Add accessible names to icon-only controls (copy-code, clear-input, search) and card overlay links, mark the feedback thumbs as a labeled group, and make the mobile nav overlay a real button. Defer mounting the ~276 KB Inkeep widget (and its Google Fonts stylesheet) until the user activates search: render a lightweight placeholder trigger that mirrors the widget styling to avoid layout shift, forward Cmd/Ctrl+K to it, and mount the real widget with its controlled modal starting open so the same interaction opens search.
Merging this PR will not alter performance
Comparing Footnotes
|
Greptile SummaryThis PR improves accessibility across the docs site and defers loading the ~276 KB Inkeep search widget until first user interaction. The a11y fixes (accessible labels on copy/clear/search controls,
Confidence Score: 5/5Safe to merge; all changes are additive a11y attributes and a well-isolated lazy-load wrapper with no server-side state involved. The a11y additions are mechanical and low-risk. The Inkeep lazy-load refactor is self-contained within the Search component, uses only client-side state, and is backed by new tests. The one open question is whether the CSS direct-child selector correctly hides the placeholder in the live DOM — if it does not, the worst outcome is a cosmetic duplicate trigger, not breakage of core functionality. docs/app/reflex_docs/views/inkeep.py — verify the :has(>) selector matches the actual DOM depth of Inkeep's shadow host. Important Files Changed
Reviews (4): Last reviewed commit: "fix(docs): match Inkeep kbd hint to the ..." | Re-trigger Greptile |
A React-rendered inline <script> tag does not execute on client navigation, so Cmd/Ctrl+K never opened search before the widget mounted and the placeholder always showed the Mac glyph. Move the shortcut forwarder and platform-aware hint correction into a useEffect so they run reliably on mount; non-Mac platforms now show "Ctrl K".
| class_name=( | ||
| "flex flex-row items-center justify-center xl:justify-start gap-2 rounded-lg " | ||
| "h-8 min-h-8 w-8 xl:w-40 px-0 xl:px-2 " | ||
| "bg-secondary-1 dark:bg-secondary-2 hover:bg-secondary-2 dark:hover:bg-secondary-3 " | ||
| "text-secondary-11 text-sm font-medium leading-6 border-none cursor-pointer " | ||
| "shadow-[0_-1px_0_0_rgba(0,0,0,0.08)_inset,0_0_0_1px_rgba(0,0,0,0.08)_inset,0_1px_2px_0_rgba(0,0,0,0.02),0_1px_4px_0_rgba(0,0,0,0.02)] " | ||
| "dark:shadow-[0_-1px_0_0_rgba(255,255,255,0.06)_inset,0_0_0_1px_rgba(255,255,255,0.04)_inset]" | ||
| ), |
There was a problem hiding this comment.
the text color in the placeholder doesn't quite match the text color after the widget loads
before load
after load
There's also a little blip between the hiding of the placeholder and the showing of the actual widget that would be nice to eliminate if possible
Screen.Recording.2026-07-09.at.3.40.59.PM.mov
Inkeep's base styles give the inner <kbd> keys a monospace font stack,
so the shortcut hint visibly changed font and width ("Ctrl K" ->
monospace "CtrlK") when the real widget replaced the placeholder. Make
the keys inherit the wrapper's font, and mirror the widget's two-key
2px-gap markup in the placeholder so the handoff is pixel-identical.
Add accessible names to icon-only controls (copy-code, clear-input, search) and card overlay links, mark the feedback thumbs as a labeled group, and make the mobile nav overlay a real button.
Defer mounting the ~276 KB Inkeep widget (and its Google Fonts stylesheet) until the user activates search: render a lightweight placeholder trigger that mirrors the widget styling to avoid layout shift, forward Cmd/Ctrl+K to it, and mount the real widget with its controlled modal starting open so the same interaction opens search.
All Submissions:
Type of change
Please delete options that are not relevant.
New Feature Submission:
Changes To Core Features: