fix(health): make +N more and the critical/warning pills interactive#37
Merged
Conversation
Reported via Habr (#34): on the Health dashboard the "+N more" indicator and the "N critical / N warning" header pills looked actionable but did nothing. - BloatCard's "+N more" is now a button that expands the list to all rows (and collapses again); tone is still computed over all rows so severity doesn't drift when expanding. - The critical/warning header pills are now buttons that scroll to the first card of that severity and briefly flash it. Card roots carry data-card-tone (CardShell) and DOM order matches display order, so the first match is the first such card; the scroll respects prefers-reduced-motion. Also stubs window.localStorage in BloatCard.test (the runner doesn't expose it, which crashed any card test rendering ActionButton via isEasyMode) — fixes two pre-existing failures in that file. Fixes #34 Signed-off-by: exzvor <exzvor@gmail.com>
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.
Summary
Reported via Habr (#34): on the Health dashboard the "+N more" indicator and the header "N critical / N warning" pills looked actionable but did nothing.
data-card-tone(set inCardShell); DOM order matches the dashboard display order, so the first match is the first such card. The scroll respectsprefers-reduced-motion. The "ok" pill stays a non-interactive label.Related issue
Fixes #34
Tests
BloatCard.test: clicking "+N more" expands to all rows and collapses back. Also stubswindow.localStorage(the runner doesn't expose it, which crashed any card test renderingActionButtonviaisEasyMode) — fixes two pre-existing failures in that file.HealthHeader.test:jumpToTonescrolls to + flashes the first card of the tone; no-op (no throw) when no such card exists.Self-verification
npm run typecheck/npm run lintclean (incl.design.css)npm run testgreen (health: HealthHeader 10, BloatCard 5, CardShell 7)Notes for reviewer
Scope: this targets exactly the two reported affordances. BloatCard is the only card that renders a "+N more" today; the other cards silently
.slice()without an indicator — adding "+N more" to them is a separate enhancement (left out to keep this focused). The pill jump uses adata-card-toneDOM marker +scrollIntoView(no new store), and a transient.health-card-flashCSS pulse (static ring under reduced-motion).jumpToToneis exported only so it can be unit-tested without seeding the health store.