Repository navigation
feat(dashboard): add InfoTip so numbers can explain themselves (slice 67C) - #268
Merged
Merged
Conversation
…hemselves on touch and keyboard
…heir numbers through InfoTip
…rs, make measuring idempotent, close on resize, test keyboard reachability
…acement, tidy CollapsibleCard wrapper
…o the Detail screen total lookup still works
…and guard infoTipUtils as a pure module
…ta, decision 311 The stub promised a Tab and Enter test that jsdom cannot honestly give and named CollapsibleCard.headerExtra, which would nest buttons; both are corrected. Records the tap-to-reveal hint change for the owner to confirm.
Resolves the four documentation conflicts (CHANGELOG, DECISIONS, GROWTH, PROGRESS) by keeping both slices' entries; 67B first, then 67C.
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 and why
Slice 67C (third of four in SLICE-67). Numbers on the dashboard need a consistent way to explain themselves. This adds one dependency-free tooltip primitive,
InfoTip, and anexplainprop on the three card components. Nothing rendersexplainyet; the screens adopt it in 67D.InfoTip: a native<button type="button">witharia-describedbypointing at arole="tooltip"span kept in the DOM and toggled withhidden(announced once, noaria-live, noaria-expanded). Tap toggles; Escape closes and keeps focus on the trigger; an outside press, a resize or an orientation change also closes it. 44 px target. The tip stays 8 px inside the viewport.infoTipUtils.ts(pure, in the determinism guard's module list):clampShift(rect, viewportWidth)plus theaboutLabel/explainLabelsentence templates used by the consumers and their tests.StatTile.hintrenders throughInfoTip;StatTile,StatCardandCollapsibleCardgained anexplainprop. OnCollapsibleCardthe tip is a sibling of the toggle (insideheaderExtrait would nest buttons).useId); the clamp is a pure function with literal-number tests.Decision for the owner
StatTile.hintused to be always-visible small text; it is now behind the info button (tap to reveal). That is what the slice plan asks for ("behind an (i) icon") and it keeps compact cards less crowded at 390 px, but the captions on the database stats panel (data / index sizes, cluster quota) are no longer visible at a glance and find-in-page will not see them. Please confirm this before merging; the alternative is to keep the hint visible and useexplainonly for new explanations.Verification
./scripts/ci/quality-gates.sh: all gates passed (500 frontend tests, coverage 97.4 / 93.01 / 98.44 / 98.59 against the 95/90/95/95 floors; ruff, mypy, bandit, xenon, backend 986 tests, audits).CollapsibleCardheader toggle 882 x 44 beside a 44 x 44 button. Keyboard-only pass: Tab to the trigger, Enter opens, Space toggles, Escape closes, focus stays on the trigger. The browser pass used temporaryexplainprops that were reverted, since no screen uses them yet.tabIndex={-1}on the trigger fails the keyboard test; not resetting the shift on close fails the measurement test.Notes for the reviewer
user-eventis not a dependency and jsdom does not turn Enter or Space into a click). The clause now says the jsdom tests own focusability, toggle and Escape, and Enter/Space is observed once in a real browser. Decision #311.StatCardlabel stays a direct text child so the merged 67A test that finds the Total value through the label keeps working.hintandexplainare set a tile shows two 44 px buttons (owner decision in 67D); a duplicate-id guard for caller-supplied ids.Complexity
Automatically refreshed by CI for product-code changes.
Functions above the JavaScript threshold
ExperimentDetailScreen.tsx:50— CC 118SearchExplorerScreen.tsx:35— CC 38labels.ts:35— CC 29ExplorePanels.tsx:414— CC 29LoadingFeedbackPanel.tsx:41— CC 28ExperimentsScreen.tsx:64— CC 21VectorDbStatsPanel.tsx:83— CC 18ExperimentControlButtons.tsx:54— CC 14loadWalkthruResults.ts:37— CC 14ExperimentsScreen.tsx:467— CC 13Functions above the cognitive-complexity threshold
ExperimentDetailScreen.tsx:50— cognitive 63LoadingFeedbackPanel.tsx:41— cognitive 27labels.ts:35— cognitive 25ExplorePanels.tsx:414— cognitive 23markdown.ts:59— cognitive 20SearchExplorerScreen.tsx:35— cognitive 17steps.ts:63— cognitive 16