Skip to content

Align the cost history model scrollbar - #5116

Open
soohanpark wants to merge 1 commit into
steipete:mainfrom
soohanpark:fix/cost-history-model-scroll
Open

soohanpark wants to merge 1 commit into
steipete:mainfrom
soohanpark:fix/cost-history-model-scroll

Conversation

@soohanpark

@soohanpark soohanpark commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

When a day's cost breakdown exceeds four rows, short model names and values can shrink the list to its intrinsic width. That places its scrollbar inside the submenu and can squeeze the token count.

Give the model-row stack the full available width so the scrollbar lines up with the submenu's trailing content edge. Add a regression that measures the native scroll view inside the hosted cost menu.

Verification

  • A native hosted view with synthetic usage on macOS 26.5.2 reproduced the inset scrollbar. In the 320 pt test view the list widened from 68 pt to 288 pt, reaching the expected 16 pt inset on both sides.
  • make check passed. The local SwiftPM test run was blocked by existing type-check errors in SpendDashboardModelTests.swift and PiSessionCostBreakdownTests.swift under Xcode 26.4. The regression's geometry assertions were exercised directly against both revisions.

Packaged app proof

Built and launched the signed debug bundle from a6ca9c80f on macOS 26.5.2. I opened CodexBar menu bar icon → Cost with local synthetic session history containing seven models on the selected day. The live submenu shows the scrollbar aligned with the trailing content edge and the full token values beside each visible model.

The proof instance uses separate preferences, with network and Keychain access disabled. It has no live quota account. The capture masks the desktop outside the menu windows and the debug status item.

Live CodexBar v0.84.1 Cost submenu with the scrollbar at the right edge of the overflowing model list

Before and after

Both renders use synthetic usage and visible scrollbars.

Before After
Scrollbar appears in the middle of the model breakdown Scrollbar aligns with the trailing content edge

@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T11:54:07.489463Z a6ca9c8 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

Expand the cost-history model stack to the available width and add a native layout regression test.

Example: A 320-point cost-history view displays five models with short names.

  • Before: The list can shrink to 68 points, leaving its scrollbar beside the model text.
  • After: The list spans 288 points, aligning the scrollbar with the 16-point trailing content inset.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A minimal, useful correction with actual submenu proof, a focused native regression, passing current-head checks, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The inspected packaged-app screenshot exercises the changed model stack through menu bar icon → Cost on macOS 26.5.2 with seven synthetic models and shows the trailing scrollbar and readable values, resolving the prior hosted-view-only proof gap.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Short model labels can leave the scrollbar floating inside the submenu and squeeze token values.
Reason: The visible layout failure has a minimal correction that preserves the established model-list presentation and defaults.

Merge readiness

✅ Ready for maintainer review

This PR is a focused, correct layout fix that current main still needs; the added packaged-app screenshot clears the earlier proof blocker.

Priority: P3
Reviewed head: a6ca9c80f84acf9e53726f1700fe2025527ba59a

Before merge

None.

Findings

None.

Agent review details

How this fits together

Provider daily usage enters a SwiftUI cost chart hosted in an AppKit submenu, which renders per-model costs and tokens in a bounded scrolling list.

flowchart LR
  A[Daily usage snapshot] --> B[Submenu controller]
  B --> C[Menu hosting view]
  C --> D[Cost history chart]
  D --> E[Model detail stack]
  E --> F[Scrollable model list]
Loading

Technical review

Best possible solution:

Keep the single width constraint and focused geometry regression in the existing chart owner.

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

Current main leaves the model stack intrinsically sized, and the supplied before render demonstrates the short-name overflow case; this review did not execute target code.

Is this the best way to solve the issue?

The constraint fixes the layout directly at its existing owner while preserving scrolling, row heights, and data behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1f6da9bec444.

Provenance checked

  • Per-model detail layout keeps the original intent (c676e16: Introduce vertical cost detail list #513 introduced vertical model detail rows without changing usage data; subsequent scrolling and stable-height work retained that presentation.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 91305ae adds Sources/CodexBar/CostHistoryChartMenuView.swift:135 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 91305aee3492; files: Sources/CodexBar/CostHistoryChartMenuView.swift)
  • iam-brain: Raw commit 3491a35 adds Sources/CodexBar/CostHistoryChartMenuView.swift:204 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3491a35492e7; files: Sources/CodexBar/CostHistoryChartMenuView.swift)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Patch size Production +1; tests +21; deletions 0 The geometry regression exercises a distinct native layout failure without adding production machinery.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P3: This is a localized scrollbar alignment and text-space improvement with no change to usage data or core workflows.
  • 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.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-18T12:07:42.454Z sha a6ca9c8 :: needs real behavior proof before merge. :: none

Reviewed November 18, 2026, 10:15 AM ET / 15:15 UTC (Revision 2).

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added 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 status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Nov 18, 2026

This branch has not been deployed

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

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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.

1 participant