Improve usage detail layout - #2182
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fcb293fca1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| (current.detailLeftText == nil) == (candidate.detailLeftText == nil) && | ||
| (current.detailRightText == nil) == (candidate.detailRightText == nil) && | ||
| (current.detailRightSecondaryText == nil) == (candidate.detailRightSecondaryText == nil) && |
There was a problem hiding this comment.
Re-measure when metric detail text changes rows
With the new MetricDetailRow, rows without detailRightSecondaryText can change height based on the actual detail strings because ViewThatFits falls back from one row to two rows when the text no longer fits. This compatibility check still only compares whether the detail fields are nil, so an open live card can accept a refresh that changes detailLeftText/detailRightText from short to long as the same layout; the existing NSMenuItem height is then not rebuilt/re-measured and the new second row can be clipped until the menu is reopened. Reject compatibility or compare enough text shape to cover the one-row/two-row transition.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Thanks — this was addressed in a959cade. hasCompatibleMetricLayout now compares normalized text shapes for detailLeftText and detailRightText, so wording or shape changes reject compatibility and trigger remeasurement, while numeric-only substitutions remain compatible. UsageMenuCardLayoutTests covers short text, same-shape numeric updates, and longer text that can cross the one-row/two-row boundary. The fix remains present in the current head, 23d748f8.
Split usage pace ETA and run-out risk across two rows. Show all reset-credit expiries with consistent compact dates. Keep Preferences, accessibility, and height fingerprints aligned.
fcb293f to
6aadf0d
Compare
Reject live metric updates when adaptive detail text can change row count. Add regression coverage for short-to-long detail transitions.
Normalize numeric detail changes to stable text shapes so refreshes do not retain stale data. Preserve remeasurement for wording changes and cover compatible text shapes with a regression test. Focused tests and make check pass. Full make test remains blocked by existing Claude credentials test failures.
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 7:02 PM ET / 23:02 UTC. ClawSweeper reviewWhat this changesThis PR separates pace ETA and run-out risk into stable menu and Preferences rows, and shows every Codex reset-credit expiry as an individual compact line. Merge readinessThis PR is still necessary: current main and v0.46.0 retain the older combined pace-risk line and truncated reset-credit summary. The prior dynamic-height concern is resolved at the current head, checks are green, and no discrete repair remains; it needs ordinary maintainer review. Priority: P3 Review scores
Verification
How this fits togetherCodexBar turns provider usage snapshots into a shared menu-card model. That model supplies pace, run-out risk, and reset-credit details to both the menu-bar card and the Preferences provider-detail view. flowchart LR
A[Provider usage snapshot] --> B[Usage card model]
B --> C[Pace and expiry formatter]
C --> D[Menu card layout]
C --> E[Preferences layout]
D --> F[Menu bar usage details]
E --> G[Settings usage details]
Before merge
Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Merge the focused shared-model and rendering update after maintainer review, retaining the compatibility guard and regression coverage for live menu-card height changes. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refines existing UI presentation rather than repairing a separately reported failure. The supplied screenshot directly shows the intended menu-card result. Is this the best way to solve the issue? Yes: the shared presentation-model field keeps the menu and Preferences views aligned, and the revised compatibility check covers the previously identified live remeasurement boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8ef86077e70a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
…-layout # Conflicts: # Sources/CodexBar/MenuCardHeightFingerprint.swift # Sources/CodexBar/MenuCardView.swift
Preserve the adaptive menu-card detail layout and run-out risk presentation while adopting main's refactored primary metric model.
|
The layout direction from this PR landed via #2620 in condensed form: used% and reset now live in the title row, and all pace detail folds into a single meta line under the bar — the maintainer wanted one line rather than the stacked block, but your structural cleanups carried over and the changelog credits you. Thanks @jack24254029! Closing in favor of the landed shape; please try it in 0.47.1. |
Summary
Tests
Screenshots