feat: per-widget Eye toggle to hide amounts (replace global Costs toggle)#214
Merged
Merged
Conversation
Replace the single header "Costs visible" toggle with a per-widget Eye /
Eye-slash icon (where the info "i" used to be) on all 8 project KPI cards,
so each widget's amount can be hidden individually. Hidden state is local
to the component and resets on reload.
- ProjectKPICards: drop the InfoTooltip ("i") and its tooltip data; add a
VisibilityToggle and per-card hiddenCards state; mask the value (and the
£ breakdown) when a card is hidden.
- ProjectHeader: remove the "Costs visible" button. showCosts/showPrices
are retained for the PDF export ("Without Financials") and the Spend vs
Budget chart.
- useProjectDetailsStore: default showCosts to true now that the global
toggle is gone (costs visible by default; export still hides temporarily).
Fixes #213
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces the global “Costs visible” header toggle with per-widget Eye/Eye-slash controls on each KPI card, enabling independent masking of each KPI’s displayed amount while keeping PDF export behavior intact.
Changes:
- Add per-card visibility toggles to all 8 KPI cards and mask the main value (and financial breakdown) when hidden.
- Remove the global “Costs visible” button from the project header UI.
- Flip
showCostsdefault totruein the project details store to match the new UX baseline while retaining its use for export/chart gating.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/hooks/useProjectDetailsStore.ts |
Changes default internal cost visibility to true to align with removal of the global toggle. |
src/components/projects/ProjectKPICards.tsx |
Replaces info tooltips with per-card Eye toggles and implements per-widget masking state. |
src/components/projects/ProjectHeader.tsx |
Removes the global “Costs visible” button while keeping PDF export controls. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
financialKpis is statically typed with a breakdown property, so the `'breakdown' in kpi` runtime guard was redundant. Access kpi.breakdown directly (still nullable). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
BenGWeeks
approved these changes
Jun 22, 2026
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
Replaces the single global "Costs visible" toggle in the project header with a per-widget Eye / Eye-slash icon on each of the 8 KPI cards, so individual amounts can be hidden independently (e.g. hide Actual Cost while Budget Cost stays visible).
Implements #213 with the agreed scoping decisions:
Changes
src/components/projects/ProjectKPICards.tsxInfoTooltip("i") component and all per-card tooltip data.VisibilityToggle(Eye/Eye-slash) andhiddenCardslocal state (keyed by KPI label).•••••and hide its £ breakdown.src/components/projects/ProjectHeader.tsx— remove the "Costs visible" button.showCosts/showPricesare retained because they still drive the PDF export ("Without Financials") and the Spend vs Budget chart.src/hooks/useProjectDetailsStore.ts— defaultshowCoststotrue(costs visible by default now the global toggle is gone; export still toggles it off temporarily while printing).Behaviour notes (reviewer, please sanity-check)
Test plan
bun run typecheck— cleanbun run lint— 0 errorsbun run test— 54/54 passbun run build— compiles successfully•••••) and toggles to eye-slash; clicking again revealsFixes #213
🤖 Generated with Claude Code