Repository navigation
feat(priority): pin metrics to a Pinned section at the top of Priority - #1553
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Important
Two edge cases need attention: healthy pinned metrics cannot be copied as a Priority screenshot, and pinning an exhausted balance removes its Used Up status without preserving that status in Pinned.
Reviewed changes: Reviewed the complete pinning feature, including layout persistence, dashboard classification, rendering, screenshot integration, tests, and documentation.
- Pin controls and storage: Account metric rows gain persisted, undoable pins; hiding a metric removes its pin, and registry reload filters removed accounts.
- Priority presentation: Pins appear in dashboard order above existing sections and are excluded from Running Out and Used Up; menu-bar selection remains unchanged.
- Coverage and documentation: Four regression tests cover core pin behavior, and the README and behavior docs explain the feature. Changed Swift files passed syntax parsing on Linux; macOS build, tests, and UI validation could not be run here.
gpt-6-astra | 𝕏
…mits Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Important
No new issues found in this delta. The existing screenshot-availability and exhausted-balance presentation threads remain unresolved, so this is not an approval.
Reviewed changes: Reviewed 91a16cd..5a1ab0d, focusing on the revised All Clear rule and its callers.
- Moved the All Clear decision into the board. Replaced
hasCompleteUsageand the view's pin-severity check withshowsClearRow, which considers running-low limits whether pinned or not. - Extended regression coverage. Added an assertion that pinning the remaining running-low metric does not expose All Clear, and updated the unavailable-account assertion.
- Simplified dashboard documentation. Removed the visual comparison between Pinned and Running Out rows.
- Validated Swift syntax. All four changed Swift files passed syntax parsing; macOS build, tests, and UI validation could not run on Linux.
gpt-6-astra | 𝕏
…copied Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Important
Pins-only screenshot copying is fixed, but the empty-balance color fix still needs a visible zero-fraction indicator.
Reviewed changes: Reviewed 5a1ab0d..11a5342, focusing on screenshot availability and the updated severity-to-rendering path.
- Enabled pins-only copying. Added
hasRowsand used it for the footer's screenshot button without changing summary classification. - Propagated Priority severity. Derived pinned severity from
PriorityItem.Reasonand passed explicit severity into the shared limit row. - Added regression coverage. Covered empty-balance classification and healthy-pin copying; the color assertion checks model state rather than rendered output.
- Validated Swift syntax. All four changed Swift files passed syntax parsing. macOS build, tests, and rendering validation were unavailable on this Linux runner.
gpt-6-astra | 𝕏

TL;DR
Every metric row on an account's page gets a pin beside its show/hide switch. Pinned metrics, from every account, get their own Pinned section at the top of the Priority tab.
What was happening
What this changes
pin/pin.fillbutton just left of the switch, styled like the row's drag handle. No tooltip. It is disabled while the metric is hidden.priorityPinIDs, next to the hidden metrics from feat(accounts): hide and reorder an account's metrics from its page #1540, so they survive a restart and take part in ⌘Z undo. Hiding a metric unpins it, and showing it again does not bring the pin back. Pins of a removed account are dropped the same way its hidden metrics are.showsClearRow, which replaceshasCompleteUsage, its only reader). It counts pinned limits, so a pinned limit that is running out keeps All Clear away, the same as it would unpinned.Heads-up
0% leftor$0 leftand its reset, instead of in the faded Used Up list. If Robin wants an extra red marker for that empty state, it's a small follow-up. This is the closest match to "any pinned [metric] will get its own section".pinnedMetricIDs. That's why the new field has a different name: an upgrade does not turn old stars into pins (covered by a test).Tests
New
MetricPinTestscovers saving per account and metric across a restart (old stars ignored), hide-unpins and hidden-can't-pin, Pinned order (account order, then metric order, never by name) with no duplicates under Running Out or Used Up, and removing an account removing its pins.On the Mac mini (macOS 15.7.7,
nice -n 10 script/test_quiet.sh --filter, one suite at a time):.listedonly,PriorityBoardTestsfails twice (the empty balance colour and the pins-only copy). WithshowsClearRowignoring pinned limits, the All Clear assertion fails (1 failure). With the tests only,MetricPinTestsfails to compile on main. With the API present but the behaviour reverted (hiding doesn't unpin, a hidden metric can be pinned, pinned metrics stay in Running Out/Used Up, a removed account's pins are kept), it ran 4 tests with 6 failures across the hide, no-duplicate, and removal tests.Screenshots
These are offscreen renders from the mini with two accounts: Claude "Personal" (Sonnet hidden) and ChatGPT "Work". After the change, Personal Session and Weekly and Work Weekly are pinned. Weekly at 24% left moves out of Running Out and into Pinned.
Note
Low Risk
User-facing layout and Priority UI only; pin state is local persistence with no auth or fetch-path changes.
Overview
Adds metric pinning so limits you care about stay visible on the Priority tab even when they are healthy.
On each account's metrics page, a pin control beside the show/hide switch toggles persistence in layout state (
priorityPinIDs, undo-aware, distinct from legacy menu-barpinnedMetricIDs). Hiding a metric unpins it; only shown metrics can be pinned.Priority now opens with a Pinned section (dashboard account order, then metric order) using the same row styling as Running Out, with severity from the metric's level—including used-up pins as red limit rows instead of the Used Up list. Pinned IDs are excluded from Running Out and Used Up. All Clear visibility uses new
showsClearRowso pinned running-low limits still suppress it; Copy Priority Screenshot appears whenever the tab has pinned rows or a listed summary (hasRows).Docs and changelog describe hide/pin/order behavior; MetricPinTests and PriorityBoardTests cover persistence, hide interactions, ordering, and account removal.
Reviewed by Cursor Bugbot for commit 11a5342. Bugbot is set up for automated code reviews on this repo. Configure here.