Repository navigation
feat(#123): make the token inspector a click-only dialog - #129
Merged
Merged
Conversation
Rename `TokenTooltip.svelte` to `TokenDialog.svelte`, its class to `.token-dialog`, and the page state `HoverState`/`hover`/`hoverQueryId` to `InspectorState`/`inspector`/`queryId`. The two query locals become `query` so the counter keeps its new name without shadowing. No behaviour change; verified with check, lint, prettier and 680 tests. Plan: 1 Slice: 1/3 Kind: mechanical
Hover and keyboard focus only outline a token now: cool blue when a click can open the inspector, light red when the position does nothing, and the darker solid outline marks the open position. TokenChips and InlineTokens lose their hover props and the chip's native title. A click, Enter or Space opens a non-modal role="dialog" named "Token inspector"; Escape, the close button and a pointer-down outside close it, with token targets and Diffuse exempt, so opening another token replaces it in one gesture. Both e2e pin helpers now target the dialog, and the Advanced/About copy follows the click path. Verified with check, lint, prettier, 680 tests and all 10 e2e tests. Plan: 1 Slice: 2/3 Kind: behavioral
The clamp now learns the vertical flip: a token with less than 160 px of room below anchors the dialog by `bottom`, capping its height to the room above. `box-sizing: border-box` plus a width capped at `vw - 16` and `left >= 8` keeps all four edges inside at 360 px. Opening is a 100 ms keyframe, switched off under `prefers-reduced-motion: reduce`. The docs that still said "hover inspector" now say click. Verified with check, lint, prettier and 680 tests; a 360x480 Playwright run opened a bottom-row token above it inside all four edges, and Escape, × and an outside click each closed it with t-max unchanged. Plan: 1 Slice: 3/3 Kind: behavioral
Park the plan's six Not doing lines, add the click-only inspector to the map, add the session noticed line on the slice-2 churn, and bump to 1.21.0. The issue carries no Compost field, so nothing is deleted. Verified with check, lint, prettier and 680 tests; 15 changed lines. E2E passed 10/10 in slice 2, and a 360x480 Playwright check confirmed AC1 and AC4 in slice 3. Plan: 1 Slice: 3/3 Kind: mechanical
Contributor
Author
|
Reviewed commit: 29ff4cc Verdict: approve Blockers
Stewardship notes
What could be deleted or simplified
|
Move focus into the dialog only on a keyboard open (Enter/Space), so a pointer pin still leaves focus where it was. Token targets carry one `data-inspect-target` attribute for the outside-pointerdown exemption, the impossible null-target guard goes, and the stale "hover tooltip" comments plus the AGENT_CONTEXT "on hover" line now say click/dialog. AC1 now has a recorded e2e run: t-max 1 before and after Escape, × and an outside click, plus the keyboard-open focus assertion. Verified with check, lint, prettier, 680 tests and 11 e2e tests. Plan: 1 Slice: review Kind: behavioral Fixes: review 1
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.
What grew
Hovering no longer inspects: it only outlines a token, cool blue where a click will open the inspector and light red where there is nothing to inspect, with a darker solid outline on the pinned token. Click, Enter or Space opens
TokenDialog, a named, non-modal dialog; Escape, its × and a pointer-down outside close it, while jumping, flipping and wheeling leave it alone. The dialog caps itself to the viewport at 360 px, flips above a token in the bottom row, and opens with a 100 ms keyframe that switches off under reduced motion. Both e2e pin helpers now find it byrole="dialog".How to try
npm run dev, open http://localhost:5173.Read first
src/lib/components/TokenDialog.sveltefor the dialog contract and the clamp, then theinspectableguard and outside-pointerdown exemption list insrc/routes/+page.svelte.Noticed: slice 2 measured 310 changed lines against the plan's ~150 estimate, mostly because the outline rules, the outside-pointerdown exemption list and the dialog chrome each rewrote in place; slices 1 and 3 landed at 121 and 56 against ~140 and ~60.
Closes #123
Next:
/review <pr>; after merge,/retrospective 123.