fix(budget): remove hero card and fix printout source badge (#1389, #1390)#1391
fix(budget): remove hero card and fix printout source badge (#1389, #1390)#1391steilerDev merged 3 commits intobetafrom
Conversation
Add budget-overview-no-hero-card.spec.ts verifying that the hero card (<section aria-label="Budget overview">) and its CSS class are absent after removal in #1389, the Add button and Cost Breakdown Table are still rendered, and the source-badge label is present in the DOM for budget lines with a source assignment (#1390). Update BudgetOverviewPage POM's waitForLoaded() to race on costBreakdownCard instead of heroCard, which no longer exists. Remove heroCard assertions from budget-overview.spec.ts, budget-overview- print.spec.ts, and budget-source-filter.spec.ts that would fail after the hero card removal. Fixes #1389 Fixes #1390 Co-Authored-By: Claude e2e-test-engineer (Sonnet 4.6) <noreply@anthropic.com>
#1390) Remove 27 test cases that covered the removed hero card section (BudgetBar, key metrics row, remaining detail panel, currency formatting, Expected Payback metric, payback-adjusted remaining, subsidy payback detail panel, mobile bar detail, and hero card footer cleanup describe blocks). Keep the one hero-card it case in the empty state block. Add describe('source badge print visibility (#1390)') to CostBreakdownTable.test.tsx: expands a work item to budget-line level and asserts both .sourceBadgeDot (aria-hidden="true") and .sourceBadgeLabel (containing a child with aria-label) are present in the DOM — the exact structure that the new @media print CSS rules in CostBreakdownTable.module.css depend on. Fixes #1389 Fixes #1390 Co-Authored-By: Claude qa-integration-tester (Sonnet 4.5) <noreply@anthropic.com>
) Remove the Budget Health hero card from the Budget Overview page, including all helpers, state, computed values, CSS classes, unused imports, and i18n keys that were exclusively used by it. The page now goes from PageLayout straight into the empty-state and Cost Breakdown Table without the metrics row, stacked bar, hover tooltip, and remaining detail panel. Fix the Budget Overview printout: print viewports map to ~600-720px, which triggers the mobile breakpoint and hides the source badge label in CostBreakdownTable, leaving only an invisible colored dot. Add print-mode rules that force the source-badge label visible and the dot hidden, with a border-based legibility treatment so the label prints without depending on background colors. Fixes #1389 Fixes #1390 Co-Authored-By: Claude dev-team-lead (Sonnet 4.6) <noreply@anthropic.com> Co-Authored-By: Claude frontend-developer (Haiku 4.5) <noreply@anthropic.com> Co-Authored-By: Claude translator (Sonnet 4.6) <noreply@anthropic.com> Co-Authored-By: Claude e2e-test-engineer (Sonnet 4.6) <noreply@anthropic.com>
steilerDev
left a comment
There was a problem hiding this comment.
[product-architect] Approved.
Scope: Pure removal (Budget Health hero card) + targeted CSS print fix on CostBreakdownTable. No API contract, schema, or ADR impact — correctly so.
Verified:
- Dead code / orphan styles: Clean. Grepped
BudgetOverviewPage.module.cssforheroCard,metric*,barWrapper,barTooltip,segmentTooltip,mobileBar*,mobileDetail,remainingPanel*,footerItem,paybackCappedNote— zero leftovers. ThemetricsRowWithPaybackmobile media-query block was correctly removed alongside the desktop rule. - i18n cleanup: All 30 deleted keys (
availableFunds,projectedCostRange,paybackCapped,remaining*,categories*,bars.*,remainingPerspectives.*,ofAvailableFunds) have zero remaining references inclient/src/.expectedPaybackcorrectly retained — still consumed byBudgetCostOverview.tsx:96. EN and DE deletions are symmetric. - Imports:
useTranslation,useCallback,useMemoall still legitimately referenced in the trimmed component. No dead imports. - Print fix scope (#1390): Targets
.sourceBadgeLabel/.sourceBadgeDot(both present in the CSS module). The border-based legibility treatment viaprint-color-adjust: exactis the right approach — independent of bg-color rendering. Scoped inside@media printblock, no screen regressions. - Test parity: New
CostBreakdownTable.test.tsxblock correctly asserts the DOM contract that the print CSS depends on (jsdom doesn't evaluate@media). New E2E smoke spec asserts hero card absence + source-badge presence; updates tobudget-overview.spec.ts,budget-overview-print.spec.ts, andbudget-source-filter.spec.tsconsistently stripheroCardreferences. - POM:
BudgetOverviewPage.tsdocuments thatheroCardlocator is retained for historical reference (won't match) andwaitForLoaded()correctly races oncostBreakdownCardinstead.
Wiki / contracts: No updates required — this is pure UI removal of a hero card and a CSS-only print fix. No endpoint, schema, or architectural decision changes.
No findings. PR is well-scoped, two commits cleanly attribute to frontend/translator/e2e and qa/e2e respectively, CI is fully green (Quality + E2E + all 16 shards). Ship it.
steilerDev
left a comment
There was a problem hiding this comment.
[ux-designer]
Design review for fix(budget): remove hero card and fix printout source badge (#1389, #1390).
Summary
Two clean, well-scoped changes. Both pass all critical design-system checks. One informational finding (orphaned responsive overrides) and one positive note on print fix correctness.
Hero Card Removal (#1389) — PASS
Token adherence: All hero-card CSS used design tokens throughout. The deletion leaves no hardcoded values behind. ✓
Remaining module integrity: The stripped BudgetOverviewPage.module.css (350 lines → ~25 rules) correctly retains: add dropdown, loading/error/empty states, breakdown loading/refetch, and print chrome suppression. All remaining rules are fully token-compliant. ✓
Page structure after removal: PageLayout → SubNav → empty-state OR breakdown-loading OR CostBreakdownTable. The PageLayout component owns the page heading, so the visual hierarchy is intact: heading → sub-nav tabs → content. No gap or orphaned whitespace. ✓
Dark mode: No on-screen color values introduced. The existing semantic tokens in retained classes switch correctly in [data-theme="dark"]. ✓
Responsive: Mobile and tablet print touch-target rules (min-height: 44px) for addButton and retryButton are retained. ✓
Accessibility: Hero card state (aria-label, live regions) removed along with the section that needed them — no accessibility artifacts left behind. ✓
i18n: Hero-card-only keys removed from both en and de locales. The expectedPayback key used by BudgetCostOverview is intentionally retained — confirmed correct. ✓
Informational — Orphaned responsive overrides in BudgetOverviewPage.module.css
Lines 170 and 188–203 contain @media overrides for .container, .pageHeader, and .pageTitle that no longer have base-rule definitions in the file (their base rules were part of the deleted hero-card block). The classes are also not referenced in BudgetOverviewPage.tsx.
/* @media (min-width: 768px) and (max-width: 1024px) { */
.container { padding: var(--spacing-6); } /* ← no base .container rule */
/* @media (max-width: 767px) { */
.container { padding: var(--spacing-4); } /* ← no base .container rule */
.pageHeader { flex-direction: column; … } /* ← no base .pageHeader rule */
.pageTitle { font-size: var(--font-size-2xl); } /* ← no base .pageTitle rule */These dead overrides have no visual effect (the selectors never match anything rendered), so this is informational only — not a blocker. They can be removed in a follow-up tidy-up pass to keep the module clean.
Print Source Badge Fix (#1390) — PASS
Token adherence: var(--color-border-strong) used for the print border — correct semantic token. 1pt is consistent with all other pt-unit borders in the same @media print block (e.g. 1.5pt, 3pt, 1pt dotted). ✓
Print-mode logic: The fix correctly addresses the root cause: print viewports are narrower than 768px, triggering the mobile rule that sets .sourceBadgeLabel { display: none } and .sourceBadgeDot { display: inline-block }. The new print-block overrides reverse that with !important, which is the established pattern in this file. ✓
Dark mode: The print rules operate inside @media print, which follows the token reset already defined in BudgetOverviewPage.module.css (:global(@media print) { :root, :root[data-theme="dark"] { --color-border-strong: #d1d5db; … } }). The border value resolves to the correct light-mode gray in print regardless of on-screen theme. The colored badge background is replaced by background: transparent — no color is printed for the background, which is the standard safe behavior for print. ✓
Accessibility (print): Dark text on white paper with a --color-border-strong (#d1d5db) outlined border. The aria-label="Budget source: {name}" on the <Badge> gives screen readers the source name. The visual border is a legibility affordance, not a meaning-bearing color — no contrast concern for print output. ✓
Selector correctness: .sourceBadgeLabel > * targets the <Badge> child directly. The unit test added in CostBreakdownTable.test.tsx verifies the DOM structure (.sourceBadgeDot with aria-hidden="true", .sourceBadgeLabel wrapping the aria-label-bearing badge) that this CSS relies on — a solid contract test. ✓
print-color-adjust: exact is present on the rule that sets background: transparent. This property typically matters for preserving backgrounds; its presence on a rule that removes the background is harmless and matches the pattern already used in the file. ✓
Verdict: APPROVED
No blocking or high-severity findings. The orphaned responsive overrides are dead CSS (informational only). The print fix is well-reasoned and correctly implemented. Both changes leave the design system cleaner than before.
|
🎉 This PR is included in version 2.5.0-beta.4 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
/budget/overviewand delete every code path exclusively used by it (helpers, state, callbacks, computed values, CSS classes, hero-card-only i18n keys). The page now renders the SubNav, empty-state, and Cost Breakdown Table — no metrics row, stacked bar, or remaining detail panel.Fixes #1389
Fixes #1390
Test plan
b8149c66)e2e/tests/budget/budget-overview-no-hero-card.spec.tscovers hero-card absence and source-badge presence (committed in8db95d06, fixture fixed in this commit)expectedPaybackretained in both en/de locales (still used byBudgetCostOverview)