Skip to content

Fix preview-cleanup pt2 - #333

Merged
reakaleek merged 1 commit into
mainfrom
reakaleek-patch-1
Jan 23, 2025
Merged

reakaleek merged 1 commit into
mainfrom
reakaleek-patch-1

Conversation

@reakaleek

Copy link
Copy Markdown
Member

No description provided.

@reakaleek
reakaleek requested a review from a team January 23, 2025 14:11
@reakaleek reakaleek added the automation packaging, ci/cd. label Jan 23, 2025
@reakaleek
reakaleek merged commit e7c4f02 into main Jan 23, 2025
@reakaleek
reakaleek deleted the reakaleek-patch-1 branch January 23, 2025 14:14
@reakaleek
reakaleek temporarily deployed to preview-333 January 23, 2025 14:15 — with GitHub Actions Inactive
@reakaleek reakaleek changed the title Fix preview-cleanup Fix preview-cleanup pt2 Jan 23, 2025
@reakaleek reakaleek added changelog:skip and removed automation packaging, ci/cd. labels Jan 24, 2025
reakaleek added a commit that referenced this pull request Nov 19, 2026
The tooltip used #333 and #fff, so it stayed dark grey in every theme. It now reads --color-emphasis and --color-on-emphasis, as the DS tooltip did. The token test now scans Assets/tooltip.css, which it skipped before.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
reakaleek added a commit that referenced this pull request Nov 19, 2026
* Export floating.ts place() for the tooltip

The tooltip reuses the menus' placement code. place() now resolves with where the element went, since flip can move it below its anchor and the tooltip's arrow has to follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Replace tippy.js with a Floating UI tooltip on data-tooltip

Tooltips now go through floating.ts like every other floating element, and tippy.js and Popper v2 leave the bundle. One delegated listener set and one shared manual popover cover every [data-tooltip], on every page of both bundles. A manual popover sits in the top layer above an open modal dialog, so tippy's appendTo-the-dialog workaround goes away, and it never closes an open menu.

data-tooltip was already the attribute of the CSS-only tooltips (CLI modifier badges, the code copy button), so those move onto the shared tooltip and their ::after CSS goes, as does the design system Tooltip primitive's own bubble. One tooltip system remains.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep a dismissed tooltip away until the pointer leaves its target

A copy button swaps its icon under a resting pointer, which fires a fresh pointerover inside the same target, so a tooltip put away with Escape or a click came straight back. It now stays away until the pointer leaves, as a mouseenter-based tooltip did.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Document the one data-tooltip tooltip

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Drop the last tippy.js mention from tooltip.css

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: read tooltip colours from role tokens (per review by Libra)

The tooltip used #333 and #fff, so it stayed dark grey in every theme. It now reads --color-emphasis and --color-on-emphasis, as the DS tooltip did. The token test now scans Assets/tooltip.css, which it skipped before.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix: hide an open tooltip when its target loses its text (per review by Libra)

A chip that resizes until its title fits drops data-tooltip, but its tooltip stayed until the pointer left. The tracking callback now checks that the target still matches the tooltip selector.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix: show a queued tooltip at once on keyboard focus (per review by Libra)

The focus handler returned when the pointer had already queued a tooltip for the same control, so the keyboard user waited out the hover delay. Only an already visible tooltip is skipped now.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix: keep Escape from blocking a later hover (per review by Libra)

Escape on a tooltip that keyboard focus opened marked the target dismissed, and only a pointerout clears that. The pointer had never entered, so the first hover showed nothing. The handler now tracks the hovered target and dismisses only when the pointer is on it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix: give the tooltip colour fallbacks in the legacy bundle (per review by Libra)

With NAVIGATION_PREVIEW off, styles.css loads tooltip.css without the theme that defines --color-emphasis, so the tooltip was transparent. It now falls back to --color-grey-130 and --color-white, which the legacy theme emits.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix: treat a hovered nested target as inside the dismissed one (per review by Libra)

Escape on a chip's tooltip while the pointer sat on the count inside it matched only the exact hovered element, so moving from the count to the chip reopened the tooltip. Escape now dismisses when the hovered target is the chip or any target nested in it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* test: check the tooltip colours in Chrome on the legacy bundle (per review by Libra)

The isolated site loads styles.css unless the navigation preview flag is on, so it exercises the fallback tokens. The test moves a real pointer over the copy button and reads the computed colours of the tooltip and its arrow. A journey file can read computed styles but not assert on one, so this is a C# test, like ApiExampleScrollingTests.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix: register TooltipColorTests in the site shard (per review by Libra)

The journeys workflow requires every test class to be in exactly one shard, so the unlisted class failed the plan job before any browser journey ran. The test opens a docs page and waits on no API spec, so it joins the site shard.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix: normalise computed colours before reading their alpha (per review by Libra)

Chrome can serialise a translucent colour as oklab(... / 0.5) or color(srgb ... / 0.5), which the rgba() prefix check read as opaque. Each colour now goes through a canvas pixel, which gives sRGB bytes with an exact alpha whatever the syntax.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix: assert a minimum contrast ratio for the tooltip text (per review by Libra)

Comparing the two colour strings passed for a text colour almost identical to the background. The test now computes the WCAG contrast of the text, blended over the background, and requires 4.5:1, the AA level for normal-size text. The label is formatted with the invariant culture, so a comma-decimal locale does not print 4,5.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix: read the tooltip colours after its fade-in and assert its opacity (per review by Libra)

The colours were read the moment the tooltip was placed, while its opacity transition was still running, and the popover's own opacity was never checked. A tooltip that settled at opacity 0.2 passed every assertion. The test now waits for the tooltip's animations to finish and asserts it ends fully opaque.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix: show the tooltip when focus lands inside its target (per review by Libra)

The focus handler asked the data-tooltip ancestor whether it matched :focus-visible, so tabbing to a link inside a target, such as the optional endpoint segment, showed nothing. It now asks the element that took focus.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix: keep the tooltip open while the pointer is on it (per review by Libra)

The tooltip ignored the pointer and closed as soon as it left the trigger, which fails the hoverable requirement of WCAG 1.4.13 and makes long text hard to read with a magnifier. A mouse leaving the trigger now has 150ms to reach the tooltip, and a pointer on it keeps it open. A touch, which cannot reach it, still closes at once, and a click inside the tooltip no longer dismisses it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Revert "fix: keep the tooltip open while the pointer is on it"

This reverts commit a9b5607.

A tooltip that takes pointer events covers the row above its trigger in stacked lists and swallows clicks meant for it. It also closed under a focused trigger and lost text selections. The tooltip goes back to the behaviour of the tippy tooltips it replaces, and the hoverable design is tracked in #4970.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

---------

Co-authored-by: Jan Calanog <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
preview-333 — ae278c28 Deployed Jan 23, 2025 by reakaleek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants