Skip to content

Fix reset timestamp truncation in menu card metric rows - #2846

Merged
steipete merged 2 commits into
steipete:mainfrom
Yuxin-Qiao:fix/metric-row-reset-text-truncation
Aug 10, 2026
Merged

Fix reset timestamp truncation in menu card metric rows#2846
steipete merged 2 commits into
steipete:mainfrom
Yuxin-Qiao:fix/metric-row-reset-text-truncation

Conversation

@Yuxin-Qiao

@Yuxin-Qiao Yuxin-Qiao commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix reset timestamp truncation in menu card metric rows.
  • Keep both the metric and reset timestamp readable.

Note

  • Privacy-sensitive screenshots were removed from this PR description.

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 10, 2026
@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed August 10, 2026, 5:36 PM ET / 21:36 UTC.

ClawSweeper review

What this changes

The PR makes usage-card metric headers keep a single row when the primary metric and reset text fit, then stack them when a localized reset timestamp would crowd the metric.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

The final rebased head resolves the prior title-width concern with a fit-based stacked fallback; no actionable correctness or security defect remains. This PR is still necessary because current main retains the truncation-prone single row, and the owner has explicitly requested review of the exact head.

Priority: P2
Reviewed head: 46ebfbef687c8a72e635f40e627343973e6ea078

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused layout repair with direct visual proof, a regression test, and no remaining actionable review finding.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The PR body provides signed synthetic before/after captures from the actual usage-card view at the standard width, directly showing the localized reset text become readable after the responsive fallback.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The PR body provides signed synthetic before/after captures from the actual usage-card view at the standard width, directly showing the localized reset text become readable after the responsive fallback.
Evidence reviewed 5 items Current-main behavior: Current main renders the metric title and reset text in one HStack; the reset label receives only remaining width, which supports the reported constrained-width truncation path.
Responsive repair: The PR head uses ViewThatFits: the first branch requires both labels at intrinsic width, while the fallback gives the title a full row and bounds the trailing reset text to two lines.
Focused regression coverage: A standard-width mixed-language layout test verifies the constrained case selects one compact additional row without relying on glyph-width assumptions.
Findings None None.
Security None None.

How this fits together

CodexBar turns provider usage data into menu-bar cards. A metric row renders the primary quota label, optional reset time, and progress bar that users use to understand account limits.

flowchart LR
A[Provider usage data] --> B[Usage card model]
B --> C[Metric header]
C --> D{Both labels fit?}
D -->|Yes| E[Single-line header]
D -->|No| F[Stacked compact header]
E --> G[Menu card and progress bar]
F --> G
Loading

Before merge

  • Complete next step (P2) - No mechanical repair remains; this is ready for normal maintainer merge review once required checks complete.
Agent review details

Security

None.

Review metrics

None.

Technical review

Best possible solution:

Land the responsive header and its standard-width regression coverage once the required checks complete, preserving the existing compact one-row appearance for short content.

Do we have a high-confidence way to reproduce the issue?

Yes—current main's residual-width reset label can be exercised at the standard card width with a long localized reset string; the PR also supplies signed before/after captures and a focused layout test. The review did not execute tests because this is a read-only checkout review.

Is this the best way to solve the issue?

Yes—the fit-based one-row-or-stacked layout is a narrow maintainable fix that preserves short-content behavior and avoids language-specific width heuristics.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b43ba3a02c4e.

Labels

Label justifications:

  • P2: This corrects a localized menu-card readability defect with limited blast radius.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR body provides signed synthetic before/after captures from the actual usage-card view at the standard width, directly showing the localized reset text become readable after the responsive fallback.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides signed synthetic before/after captures from the actual usage-card view at the standard width, directly showing the localized reset text become readable after the responsive fallback.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR body provides signed synthetic before/after captures from the actual usage-card view at the standard width, directly showing the localized reset text become readable after the responsive fallback.

Evidence

What I checked:

Likely related people:

  • steipete: Peter Steinberger authored the current menu-card simplification history and the final preservation commit on this PR head. (role: recent area contributor and final patch author; confidence: high; commits: b82594e2a0c0, 46ebfbef687c; files: Sources/CodexBar/MenuCardView.swift)
  • Yuxin-Qiao: Yuxin Qiao recently changed this menu-card renderer on main and authored the implementation commit beneath the final head commit. (role: recent area contributor; confidence: high; commits: 4f0ac0680cd2, 1e85c7fb35ec; files: Sources/CodexBar/MenuCardView.swift, Tests/CodexBarTests/UsageMenuCardLayoutTests.swift)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-08-10T16:18:05.202Z sha af5cf5c :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-10T16:40:30.598Z sha a3296d1 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-10T18:57:31.226Z sha dce6bfb :: needs real behavior proof before merge. :: [P2] Reserve width for the metric title
  • reviewed 2026-08-10T21:12:35.943Z sha 4728b2f :: needs maintainer review before merge. :: none

@Yuxin-Qiao
Yuxin-Qiao force-pushed the fix/metric-row-reset-text-truncation branch from a3296d1 to dce6bfb Compare August 10, 2026 18:49

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dce6bfb8b6

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/CodexBar/MenuCardView.swift Outdated
.foregroundStyle(MenuHighlightStyle.secondary(self.isHighlighted))
.lineLimit(2)
.multilineTextAlignment(.trailing)
.layoutPriority(1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reserve width for the metric title

When the reset label is long—such as an absolute date in German/Spanish or a provider-supplied reset description—giving it the sole higher layout priority lets it claim nearly the entire standard 296-point card row before presentation.titleText is measured. The metric name and percentage can consequently collapse to an ellipsis, replacing the original reset-label truncation with loss of the primary usage value; use a balanced layout or reserve a minimum width for the title while still allowing the reset text to wrap.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. label Aug 10, 2026
@steipete
steipete force-pushed the fix/metric-row-reset-text-truncation branch from dce6bfb to 4728b2f Compare August 10, 2026 21:07
@steipete

Copy link
Copy Markdown
Owner

@clawsweeper re-review

The reset-only priority finding is addressed at head 4728b2f3e06895f2fac14d542898296527acfc51: short content keeps the one-row layout, while constrained content uses a compact stacked fallback that preserves both the primary metric and bounded reset text. The PR body includes signed synthetic before/after captures at the standard 296-point width. Please review this exact head.

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 10, 2026
@steipete
steipete force-pushed the fix/metric-row-reset-text-truncation branch from 4728b2f to 46ebfbe Compare August 10, 2026 21:33
@steipete

Copy link
Copy Markdown
Owner

@clawsweeper re-review

Rebased onto current main without changing the responsive MenuCardView patch (46ebfbef687c8a72e635f40e627343973e6ea078; patch ID unchanged). The signed before/after proof and focused regression remain applicable. Please review this exact head; fresh CI is running.

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete merged commit bff43f8 into steipete:main Aug 10, 2026
9 checks passed
@steipete

Copy link
Copy Markdown
Owner

Merged as bff43f8a2cc736a9dd248f6fb275f594b3a472c7.

Proof:

  • final head 46ebfbef687c8a72e635f40e627343973e6ea078, based on exact then-current main b43ba3a02c4e66f36448a9360766f95e3573a9c1
  • focused layout + architecture suites: 47/47 passed
  • full suite: 839 selections across 70 groups, all first-pass clean; zero retries or timeouts
  • make check: zero violations
  • structured autoreview: TruffleHog clean; no accepted/actionable findings
  • exact-head CI run https://github.com/steipete/CodexBar/actions/runs/31434384052: lint, both macOS shards, Linux x64/arm64, musl, GitGuardian, and aggregate lint-build-test all passed
  • exact-head ClawSweeper review found no actionable issue and accepted the signed screenshot proof

Signed visual proof used the actual UsageMenuCardView at the standard 296-point width in a Developer-ID-signed DEBUG bundle with fully synthetic data. Current main truncated the Chinese reset timestamp; the responsive layout retained the complete primary metric and reset string with only a 3-point height increase.

Before: https://github.com/user-attachments/assets/02cfaab7-78c8-4f86-bce8-8bd055c93a71

After: https://github.com/user-attachments/assets/caa8e768-5bf3-45db-adef-29218bfde1c9

The original reset-only priority approach was replaced after review showed it could truncate the primary metric. The final fit-based single-row/stacked fallback preserves both values without hardcoded localization widths. All temporary proof scaffolding was removed before publication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants