Repository navigation
Conversation
31a04fe to
1a53c53
Compare
1a53c53 to
31a04fe
Compare
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4956/ |
b0ea827 to
fafc6af
Compare
fafc6af to
1845ce9
Compare
| > a.property-anchor:focus-visible { | ||
| outline: none; |
There was a problem hiding this comment.
Severity: P3 (Low)
Add a browser regression test that tabs to a property permalink with the design system enabled and verifies that one visible focus ring surrounds the icon. This rule removes the shared outline, but the existing copy and hover checks would still pass if keyboard users lost their only focus indicator.
Generated by Libra. React with 👍 or 👎 to give feedback on this comment.
There was a problem hiding this comment.
Agreed that only a browser can check this. The unit tests render Razor to a string, and the visual-regression harness has no API operation page; it also times out on /api locally, because the server generates the API on the first request. I checked it with Playwright instead: on the Reindex page with the design-system stylesheets, I tabbed into the page, focused a permalink and took enlarged screenshots before #4956, as pushed, and with 1845ce9. Now one ring surrounds the icon (the ::after outline, 2px solid), and the anchor's computed outline is none. The forced-colours ring is unaffected. A lasting test belongs in a browser journey with the design-system flag on, which I'd rather add with the API journeys than in this PR.
1845ce9 to
8e415d0
Compare
42d24ac to
4e9ade4
Compare
4e9ade4 to
8444d0b
Compare
8444d0b to
ed0c934
Compare
ed0c934 to
6a59b3b
Compare
6a59b3b to
42f9740
Compare
The largest API pages repeat the property row thousands of times. Each row printed its JSON path twice, in the permalink's `aria-label` and in the name's tooltip. The tooltip now reads the path from the `aria-label` in `tooltip.ts`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n screen A top-level name has no path to show, but hovering it still queued a tooltip and closed the one keyboard focus had opened. The copy test now opens the tooltip, presses and clicks the permalink, and reads the text on screen, so it fails if pointerdown closes the tooltip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tips win Since #5024 the permalink names a map key "additional property" for screen readers while the page shows "*", so the path read from the label now maps those segments back. A property name with its own data-tooltip, such as a map key row, keeps it even when the label repeats its name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A key row without a JSON path is labelled "additional property", which read as the path "*". The map key row snapshots from #5024 now show the bare permalink with its Copy link tooltip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
42f9740 to
4886159
Compare
Each property row on an API page now prints its JSON path once, not twice: the name's tooltip reads it from the permalink's label instead of carrying its own copy. This makes API HTML about 2.4% smaller. The rows look and behave the same.
Affects: API reference, Site UI
Stack: 3 of 4, on top of #4955 and #4953, under #4959.
Prompt summary: Take two parts of #4945 into their own PR on top of the sidebar stack: printing each property path once, and drawing the link icon on the anchor. The other parts of #4945 (WebMarkupMin) stay out. The link icon part has since landed on its own in #5072, so this PR keeps the path part. The goal behind both is elastic/docs-eng-team#1183: bring API pages under Googlebot's 2 MB HTML limit.
Why
The largest API pages repeat the property row partial thousands of times. Each row printed its JSON path twice, in the permalink's
aria-labeland in the name's tooltip withdata-tooltipanddata-tooltip-theme.What
A property row prints its path once
The permalink keeps the full path in its
aria-label, so screen readers still announcedest.index. The name's<code>no longer has its owndata-tooltipanddata-tooltip-theme.tooltip.tsnow also targets a property name, reads the path from the permalink just before it, and shows it in the mono theme.Edge cases keep their current tooltips
A top-level field, whose path is its name, still shows no tooltip, and hovering it does not close a tooltip opened by keyboard focus elsewhere. The label names a map key
additional propertyfor screen readers (#5024), sotooltip.tsshows those segments as*, as the page does. A map key row (property name*) keeps its own path tooltip, which always wins over the label; one without a path shows none.Results
Measured in an isolated build of
docs/together with the link icon change, before #5072 split that out: the two made API HTML 4% smaller and took API pages over 2 MB from 68 to 58. #5072 alone was estimated at 1.6% on amainbuild, so this PR accounts for roughly 2.4%. Not re-measured after the split.Out of scope: the WebMarkupMin minification from #4945, and the whitespace collapse #4944 made alongside these changes.
Verify
Check on the preview
dest.indexfor its path tooltip; hover a top-level field and no tooltip shows.aggregationsshows its path with*for the map key.🤖 Generated with Claude Code