Skip to content

Expose usage snapshot sharing from the menu overview - #3677

Merged
steipete merged 19 commits into
steipete:mainfrom
Chipagosfinest:fix/overview-share-stats
Sep 19, 2026
Merged

steipete merged 19 commits into
steipete:mainfrom
Chipagosfinest:fix/overview-share-stats

Conversation

@Chipagosfinest

@Chipagosfinest Chipagosfinest commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Overview now offers Share Usage Snapshot…, using the same filtered Usage & Spend sources as its summary. Hidden accounts and providers stay excluded, including during initial loading, and an account's saved history cannot borrow a different account's subscription label.

The existing local preview is shared with Settings. Image copying verifies PNG/TIFF publication, reports success or failure truthfully, and respects Reduce Motion. Export stays local until the user chooses where to share it. Thanks @Chipagosfinest for the original contribution.

Validation:

  • Focused sharing, ownership, architecture, and clipboard tests passed. Both make check and the final full suite passed: 1,219 selections in 112 groups, with no retries or timeouts. All eight CI jobs passed at 40acb895b1979bca5e6afbd5a114b43e863b3bee.
  • Independent Codex review found no actionable findings in the final integration.
  • A Developer-ID-signed native test host opened the actual preview with synthetic data in English and German. The hidden $900 source was excluded; the visible $2 source remained. External Accessibility inspection verified the Copy Image and Copy Stats controls. No live account credentials were used.

Native preview, English:

English preview showing only the visible synthetic source

Native preview, German:

German preview showing only the visible synthetic source

@clawsweeper

clawsweeper Bot commented Sep 16, 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.

@Chipagosfinest
Chipagosfinest marked this pull request as ready for review September 16, 2026 07:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-16T07:14:07.132583Z dac96d9 Draft marked ready
ℹ️ 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.

@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: dac96d99bf

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

extension StatusItemController {
func makeOverviewShareStatsMenuItem(model: SpendDashboardModel) -> NSMenuItem? {
guard ShareStatsPayloadFactory.make(model: model, store: self.store) != nil else { return nil }
let title = L("Share Usage Snapshot…")

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 Add the new share flow strings to localization catalogs

For every non-English locale, this menu item remains in English because Share Usage Snapshot… is absent from all Localizable.strings catalogs, so L can only fall back to the key; the failure alert at lines 185–187 also uses raw English literals. Add the new strings to the localization catalogs and localize the alert title/message so this newly exposed flow follows the selected app language.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. 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. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 10:52 PM ET / September 19, 2026, 02:52 UTC (Revision 13).

ClawSweeper review

What this changes

Adds usage snapshot sharing to Overview through the existing local preview, shares payload construction with Settings, and adds localized commands, source filtering, and clipboard feedback.

Merge readiness

Ready for maintainer review

The menu entry point remains a useful addition beyond current main. No actionable introduced defect was found, the earlier localization concern is resolved, and the supplied native proof supports the feature.

Priority: P3
Reviewed head: 40acb895b1979bca5e6afbd5a114b43e863b3bee

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused integration with convincing native preview evidence, useful regression coverage, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The native host exercises the real Overview action and shared preview with synthetic visible and hidden sources; inspected English and German screenshots show only the visible $2 source and localized controls. Clipboard and ownership tests provide supplemental coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The native host exercises the real Overview action and shared preview with synthetic visible and hidden sources; inspected English and German screenshots show only the visible $2 source and localized controls. Clipboard and ownership tests provide supplemental coverage.
Evidence reviewed 10 items Repository policy and inspection boundary: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer-notes files were found under the affected paths. Applied provider isolation, native UI validation, and test-isolation guidance. Builds and tests were not executed during this read-only review.
Current main still lacks the Overview entry point: Current main calls the existing sharing presenter from Settings but has no Overview sharing command. The branch reuses that presenter rather than creating a competing export implementation.
Latest release comparison: The v0.61.0 Overview source contains the shared spend summary but no sharing action or presentation method. This requested entry point is not already supplied by the inspected release.
Findings None None.
Security None None.

How this fits together

CodexBar collects provider usage into a shared Usage & Spend model. Overview filters that model and passes its aggregate data to a local preview that can copy or save an image.

flowchart TD
  A[Provider usage snapshots] --> B[Shared spend model]
  C[Visible sources and reporting preferences] --> B
  B --> D[Overview summary]
  D --> E[Share command]
  E --> F[Local snapshot preview]
  F --> G[Clipboard or saved image]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta Production +278/-34; tests +469/-11 Production growth includes 23 localization catalogs and the menu integration; most test growth supports isolated native proof and filtering coverage.

Technical review

Best possible solution:

Keep Overview and Settings on one local export path that honors source visibility, account ownership, reporting preferences, and truthful copy feedback.

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

Not applicable as a feature request; current main lacks the Overview command, and supplied native screenshots demonstrate the resulting filtered preview.

Is this the best way to solve the issue?

Yes. Reusing the existing presenter and shared spend model avoids a separate export implementation while preserving current reporting preferences.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6e603f578647.

Labels

Label justifications:

  • P3: This adds a convenient entry point to an existing local sharing feature without an urgent user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The native host exercises the real Overview action and shared preview with synthetic visible and hidden sources; inspected English and German screenshots show only the visible $2 source and localized controls. Clipboard and ownership tests provide supplemental coverage.
  • proof: sufficient: Contributor real behavior proof is sufficient. The native host exercises the real Overview action and shared preview with synthetic visible and hidden sources; inspected English and German screenshots show only the visible $2 source and localized controls. Clipboard and ownership tests provide supplemental coverage.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The native host exercises the real Overview action and shared preview with synthetic visible and hidden sources; inspected English and German screenshots show only the visible $2 source and localized controls. Clipboard and ownership tests provide supplemental coverage.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

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 (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-16T08:55:47.353Z sha 0264b8b :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-16T09:13:36.646Z sha 63147ed :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-16T09:54:41.211Z sha b7d7639 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-16T10:10:01.052Z sha 34cd766 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-16T15:49:07.782Z sha 4570f66 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T16:08:35.053Z sha 3369628 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T03:43:32.505Z sha 6a88e57 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-17T03:56:45.807Z sha 7e8c083 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 16, 2026
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 16, 2026
Localization catalogs conflicted because both sides appended new keys in the
same region; all 23 keep both sets. The gatekeeper allowlist entry main added
for PreferencesSpendDashboardPane.swift:519 is dropped: that construct moved
into ShareStatsPayload.swift on this branch and already has its own entry,
whose anchor shifts 361 -> 372 under the merged file.
…r task

A failed image copy left "Could not copy image" on the button and on its
accessibility label until the window was closed and reopened: only the success
path scheduled a reset, and the preceding cancel() had killed any pending one.
Both outcomes now share makeCopyFeedbackResetTask().

The presentation task's defer cleared whichever handle was stored rather than
its own, so a task resuming from its 50ms sleep after being superseded nil'd
its successor's handle and let a second presentation start concurrently. A
generation token means a task only clears the handle it installed.
… value

StatusItemController was already at exactly the 800-line type_body_length
ceiling, so adding the generation counter as a second stored property tipped it
to 801. Both now live in an OverviewSharePresentation value declared outside
the class body, which restores the count to 800 and keeps the two fields
together where their invariant lives.
@Chipagosfinest

Copy link
Copy Markdown
Contributor Author

Green and ready whenever you have a slot — ClawSweeper has this at "Ready for maintainer review" with no findings, and CI is 9/9 after merging current main.

One note on ordering, since the diff looks larger than it is: of the 44 files, 7 are source. The rest are 23 localization catalogs (one key each), 11 proof artifacts under docs/research, and 3 test files.

#3678 is stacked on this one, so its diff currently carries this PR's changes too — that's most of why it reads as 74 files. Landing this first shrinks #3678 to just the widget entry point, which should make it a much smaller read.

steipete and others added 2 commits September 18, 2026 19:41
Keep Overview and Usage & Spend exports on the same source-owned payload; prevent account history from borrowing another account plan label.

Co-authored-by: Gabriel Pineda <Chipagosfinest@users.noreply.github.com>
Contributor attribution for Overview sharing: Alec Gutman, Chip; this supersedes the name recorded in the preceding integration commit.

Co-authored-by: Alec Gutman, Chip <44984861+Chipagosfinest@users.noreply.github.com>
@steipete
steipete merged commit a696057 into steipete:main Sep 19, 2026
9 checks passed
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: 🐚 platinum hermit Good normal PR readiness with ordinary 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