Skip to content

Add Projects panel to Usage & Spend pane - #2985

Merged
steipete merged 4 commits into
steipete:mainfrom
Yuxin-Qiao:feat/spend-projects-pane
Aug 17, 2026
Merged

Add Projects panel to Usage & Spend pane#2985
steipete merged 4 commits into
steipete:mainfrom
Yuxin-Qiao:feat/spend-projects-pane

Conversation

@Yuxin-Qiao

Copy link
Copy Markdown
Contributor

Summary

  • Adds a Projects panel to the Usage & Spend settings pane, ranked by estimated spend per currency group, rendered only when project rows exist (Codex sources today). Each row shows rank, a folder icon, project name, provider/subscription caption, and window-scoped cost, reusing the panel/list idioms of the adjacent Models panel.
  • Makes both the Models and Projects lists expandable: they previously hard-truncated at 8 rows; a Show all (N) / Show less toggle now reveals the full list.
  • Adds the two new keys (Show all (%d), Show less) to all 23 app locales.

Commands run

  • swift build --build-tests
  • swift test --filter SpendDashboardModelTests — 39 passed
  • node Scripts/check-app-locales.mjs — 22 catalogs OK
  • swiftformat Sources Tests / swiftlint --strict — clean
  • ./Scripts/test.sh (full sharded suite) — green, 803s, 0 failures

Notes

  • Stacked on the model PR (feat/spend-projects-model); merge that first.
  • The Projects panel header key lands in the chart-localization PR (fix/chart-menu-localization); if this merges first, the header falls back to the English key until that PR lands.
  • Screenshots: added in a follow-up comment once the app-bundle QA run completes.

@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

@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: 69f9415e45

ℹ️ 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".

for project in input.snapshot.projects {
let name = project.name.trimmingCharacters(in: .whitespacesAndNewlines)
guard !name.isEmpty else { continue }
let key = Key(sourceID: input.id, name: name)

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 Use project paths as aggregation keys

When one Codex account contains distinct projects with the same basename, such as /work/app and /personal/app, the scanner emits separate breakdowns keyed by canonical path but names both app; this name-only key merges their spend into one row and retains only the first path. Include the canonical project path in the aggregation key and row identity so these projects remain separate.

Useful? React with 👍 / 👎.

let key = Key(sourceID: input.id, name: name)
var aggregate = aggregates[key] ?? Accumulator(
provider: input.provider,
providerName: input.modelProviderName,

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 Preserve the subscription name in project captions

With multiple Codex accounts, the controller sets displayName to the account-specific label but sets modelProviderName to the generic Codex label; using the latter here therefore gives every project the same caption even though rows are attributed to separate subscriptions. Use the input's account-specific display name for project rows so users can tell which subscription incurred each cost.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. 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 16, 2026
@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 16, 2026, 11:11 PM ET / August 17, 2026, 03:11 UTC.

ClawSweeper review

What this changes

Adds a Projects panel and expandable Models/Projects lists to the Usage & Spend settings pane, including localized expansion controls.

Merge readiness

Blocked until real behavior proof is added - 12 items remain

Keep open: current main has the project-data prerequisite but not this settings UI, so the PR remains necessary. It still exposes two source-proven attribution defects, duplicates unreleased changelog content, and lacks required app-bundle proof.

Likely related people: Yuxin-Qiao (project-row implementation, high confidence) and steipete (recent merged-area owner, high confidence).

Priority: P2
Reviewed head: 00dcee89a075aa2702cece1a41d2390ed566ec84

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The feature is coherent, but unresolved attribution defects and missing real UI proof keep it from being quality-ready.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: Missing: tests are supplemental, and the supplied PR body/comments contain no redacted after-fix app-bundle evidence for the Projects panel or collapsed/expanded lists on the current head. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦪 silver shellfish (2/6) 3 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: Missing: tests are supplemental, and the supplied PR body/comments contain no redacted after-fix app-bundle evidence for the Projects panel or collapsed/expanded lists on the current head. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 7 items Project paths can collide: Current main keys project aggregation by source ID and basename, while retaining the canonical path only as metadata; two same-named projects in one account therefore merge before this PR renders them.
Project captions lose account identity: The controller assigns the generic Codex descriptor as modelProviderName, and project aggregation uses it instead of the account-specific display name; the new panel displays that field as its caption.
PR renders the affected fields: The current head presents each project row and displays row.providerName as its subtitle, making the shared-model attribution defects user-visible.
Findings 3 actionable findings [P2] Key project rows by canonical path
[P2] Keep account labels in project captions
[P2] Remove the duplicate project-model release note
Security None None.

How this fits together

Usage & Spend turns local provider history into per-currency provider, model, and project totals, then renders those totals in the settings pane. This PR adds the project presentation layer, so aggregation and account-attribution mistakes become visible to users.

flowchart LR
A[Local usage history] --> B[Spend dashboard controller]
B --> C[Project cost aggregation]
C --> D[Currency groups]
D --> E[Usage and Spend settings]
E --> F[Projects panel]
E --> G[Expandable model list]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: Missing: tests are supplemental, and the supplied PR body/comments contain no redacted after-fix app-bundle evidence for the Projects panel or collapsed/expanded lists on the current head. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Key project rows by canonical path (P2) - The new panel renders ProjectRow values, but current aggregation keys and identifies them by source ID plus basename. Two paths such as /work/app and /personal/app under one account therefore merge into one displayed spend row. Include the canonical path in the aggregation key and identity, with regression coverage.
  • Keep account labels in project captions (P2) - This displays row.providerName, while the Codex controller supplies the generic descriptor as modelProviderName and project aggregation retains that field. Multiple Codex subscriptions will all read “Codex”; carry the account-specific display name into project rows instead.
  • Remove the duplicate project-model release note (P2) - This adds a new Added block containing the Add project rows to spend dashboard model #2984 entry even though current main already has that exact unreleased entry below the Fixed section. Keep one normalized Added section and add only this PR’s note.
  • Resolve merge risk (P1) - Projects with the same basename under one Codex account are merged into one spend row, producing an incorrect total.
  • Resolve merge risk (P1) - Projects from separate Codex subscriptions are captioned only as “Codex,” so users cannot identify which subscription incurred the cost.
  • Resolve merge risk (P1) - The branch duplicates the Add project rows to spend dashboard model #2984 unreleased changelog note.
  • Resolve merge risk (P1) - No redacted after-fix app-bundle proof verifies the new panel and expansion controls on the current head.
  • Complete next step (P2) - The remaining code repairs are concrete, but the external contributor must also provide real app-bundle proof that automation cannot supply on their behalf.
  • Improve patch quality - Use canonical project paths and account display names in the project-row model, with focused regression tests.
  • Improve patch quality - Rebase the unreleased changelog block so the Add project rows to spend dashboard model #2984 entry appears only once.
  • Improve patch quality - Attach redacted app-bundle proof showing project rows plus collapsed and expanded lists; updating the PR body triggers re-review, or a maintainer can request @clawsweeper re-review.

Findings

  • [P2] Key project rows by canonical path — Sources/CodexBar/PreferencesSpendDashboardPane.swift:592
  • [P2] Keep account labels in project captions — Sources/CodexBar/PreferencesSpendDashboardPane.swift:606
  • [P2] Remove the duplicate project-model release note — CHANGELOG.md:4-6
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Changed surface 25 files, +135 / -1 The feature changes one settings view, 23 localization catalogs, and release notes.
Production versus tests production +135, tests +0 The visible settings feature adds no focused regression coverage for project identity or account captions.

Merge-risk options

Maintainer options:

  1. Repair attribution before merge (recommended)
    Use canonical project paths in aggregation and row identity, retain account display names for captions, remove the duplicate changelog block, and attach redacted app-bundle proof.
  2. Pause the feature
    Do not land the panel until project totals and subscription attribution are reliable for existing multi-project and multi-account users.

Technical review

Best possible solution:

Preserve distinct project paths and account-specific captions in the shared project model, retain one clean release-note entry, and verify the completed panel in a freshly built app bundle.

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

Yes, from source: provide two distinct canonical paths with the same basename for one Codex account, or two Codex accounts with distinct display names; current aggregation and captions produce the wrong rows.

Is this the best way to solve the issue?

No: the panel is the appropriate surface, but it must consume path-distinct, account-labeled project rows and be proven in the built app before merge.

Full review comments:

  • [P2] Key project rows by canonical path — Sources/CodexBar/PreferencesSpendDashboardPane.swift:592
    The new panel renders ProjectRow values, but current aggregation keys and identifies them by source ID plus basename. Two paths such as /work/app and /personal/app under one account therefore merge into one displayed spend row. Include the canonical path in the aggregation key and identity, with regression coverage.
    Confidence: 0.99
  • [P2] Keep account labels in project captions — Sources/CodexBar/PreferencesSpendDashboardPane.swift:606
    This displays row.providerName, while the Codex controller supplies the generic descriptor as modelProviderName and project aggregation retains that field. Multiple Codex subscriptions will all read “Codex”; carry the account-specific display name into project rows instead.
    Confidence: 0.99
  • [P2] Remove the duplicate project-model release note — CHANGELOG.md:4-6
    This adds a new Added block containing the Add project rows to spend dashboard model #2984 entry even though current main already has that exact unreleased entry below the Fixed section. Keep one normalized Added section and add only this PR’s note.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Incorrect project totals and subscription captions affect a bounded settings-pane feature but do not make the app unusable.
  • merge-risk: 🚨 compatibility: Merging would expose misleading spend attribution for existing users with same-named projects or multiple Codex accounts.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Missing: tests are supplemental, and the supplied PR body/comments contain no redacted after-fix app-bundle evidence for the Projects panel or collapsed/expanded lists on the current head. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • Yuxin-Qiao: Authored the merged project-row source commit that this UI consumes. (role: introduced project-row behavior; confidence: high; commits: a0a3877122d5; files: Sources/CodexBar/SpendDashboardModel.swift)
  • steipete: Merged the project-model and localization prerequisites into current main and authored the current-head integration merges. (role: recent merged-area contributor; confidence: high; commits: dbd54a8bcc8e, 45ca0b4ef8c1; files: Sources/CodexBar/SpendDashboardModel.swift, Sources/CodexBar/PreferencesSpendDashboardPane.swift, CHANGELOG.md)

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 (3 earlier review cycles)
  • reviewed 2026-08-16T19:22:31.778Z sha 69f9415 :: needs real behavior proof before merge. :: [P2] Key project rows by canonical path | [P2] Keep account labels in project captions
  • reviewed 2026-08-17T01:15:16.867Z sha 13c12e3 :: needs real behavior proof before merge. :: [P2] Key project rows by canonical path | [P2] Keep account labels in project captions
  • reviewed 2026-08-17T02:35:39.744Z sha d41d897 :: needs real behavior proof before merge. :: [P2] Key project rows by canonical path | [P2] Keep account labels in project captions | [P2] Deduplicate the 0.51.1 Added section

# Conflicts:
#	CHANGELOG.md
#	Sources/CodexBar/Resources/ar.lproj/Localizable.strings
#	Sources/CodexBar/Resources/ca.lproj/Localizable.strings
#	Sources/CodexBar/Resources/de.lproj/Localizable.strings
#	Sources/CodexBar/Resources/en.lproj/Localizable.strings
#	Sources/CodexBar/Resources/es.lproj/Localizable.strings
#	Sources/CodexBar/Resources/fa.lproj/Localizable.strings
#	Sources/CodexBar/Resources/fr.lproj/Localizable.strings
#	Sources/CodexBar/Resources/gl.lproj/Localizable.strings
#	Sources/CodexBar/Resources/id.lproj/Localizable.strings
#	Sources/CodexBar/Resources/it.lproj/Localizable.strings
#	Sources/CodexBar/Resources/ja.lproj/Localizable.strings
#	Sources/CodexBar/Resources/ko.lproj/Localizable.strings
#	Sources/CodexBar/Resources/nl.lproj/Localizable.strings
#	Sources/CodexBar/Resources/pl.lproj/Localizable.strings
#	Sources/CodexBar/Resources/pt-BR.lproj/Localizable.strings
#	Sources/CodexBar/Resources/ru.lproj/Localizable.strings
#	Sources/CodexBar/Resources/sv.lproj/Localizable.strings
#	Sources/CodexBar/Resources/th.lproj/Localizable.strings
#	Sources/CodexBar/Resources/tr.lproj/Localizable.strings
#	Sources/CodexBar/Resources/uk.lproj/Localizable.strings
#	Sources/CodexBar/Resources/vi.lproj/Localizable.strings
#	Sources/CodexBar/Resources/zh-Hans.lproj/Localizable.strings
#	Sources/CodexBar/Resources/zh-Hant.lproj/Localizable.strings
@steipete
steipete merged commit 03047cd into steipete:main Aug 17, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants