Skip to content

Fix stacked bar corner radius - #3439

Merged
steipete merged 7 commits into
steipete:mainfrom
elijahfriedman:fix/stacked-bar-corner-radius
Sep 5, 2026
Merged

Fix stacked bar corner radius#3439
steipete merged 7 commits into
steipete:mainfrom
elijahfriedman:fix/stacked-bar-corner-radius

Conversation

@elijahfriedman

@elijahfriedman elijahfriedman commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

The daily and hourly spend charts round each provider segment independently, leaving notches at internal stack boundaries and rounded baselines. This fix makes the internal seams and baseline square while preserving rounded outer tops.

The shared selector identifies the highest visible segment per day/hour. Native verification found that clipping alone did not fix the seams: the original rounded mark had already lost those corner pixels. Both charts now disable native mark rounding before applying the per-segment top-only clip. A realistic trailing-zero regression ensures an invisible segment cannot replace the visible top.

Thanks @elijahfriedman for the original contribution. Contributor commits and human credit are preserved, and the Unreleased changelog is updated.

Native behavior proof

SpendStackedChartsNativeProofTests hosts the existing production SpendDashboardCurrencySection in a signed Developer ID XCTest window. It builds the same data through SpendDashboardModel.build for both captures; it does not recreate the chart drawing code. Before uses chart/model source identical to main b921ed2, and after uses the final candidate.

The fixture covers three providers, normal stacks, single visible providers, all-zero buckets, zero-height trailing/middle segments, and very thin segments. Assertions verify all 18 daily and 18 hourly points, contiguous offsets, $137.15 daily total, and $74.40 hourly total. Captures contain synthetic data only.

Before: internal rounded seams

After: flush internal seams

Validation

  • swift test --no-parallel --filter 'SpendStackedBarChartTests|SpendDashboardModelTests': 50 tests in two suites passed.
  • Signed opt-in native proof: one XCTest passed for the baseline and final candidate; both full captures visually inspected, with interior-corner pixel samples confirming the correction.
  • make check: passed, zero violations across 2,128 files.
  • Final managed Codex autoreview: scoped clean at the default P0 threshold.
  • make test: all 1,024 selections across 86 groups passed on the first attempt, with no retries or timeouts.
  • Exact-head CI: all checks passed, including both macOS shards, Linux x64/ARM64/musl, lint, and aggregate gate.
  • Fresh pre-landing P0 autoreview is scoped clean; the candidate combines cleanly with the independent ElevenLabs fix now on main.

@clawsweeper

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

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

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex review: blocked before merge. Reviewed September 5, 2026, 5:39 PM ET / 21:39 UTC.

ClawSweeper review

What this changes

The PR makes daily and hourly spend bars square at provider boundaries and baselines while retaining rounded tops, with shared selection logic and regression coverage.

Merge readiness

Blocked before merge - 1 item remains

The chart fix remains useful: neither current main nor v0.56.6 contains it. No actionable defect was found, and the owner’s native verification supports the rendering correction. Repository policy also prohibits automatic cleanup closure.

Priority: P3
Reviewed head: 6ecb6f8aaa390b0871c00bdbae714d9fce35814d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable rendering fix with native production-view evidence, useful regressions, and no identified correctness blocker.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The owner records signed native before/after rendering through the production dashboard model and currency section at the reviewed head, confirming flush seams with zero and thin segments. Image retrieval failed here, but the complete recorded verification and inspected harness preserve the existing sufficient-proof assessment.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The owner records signed native before/after rendering through the production dashboard model and currency section at the reviewed head, confirming flush seams with zero and thin segments. Image retrieval failed here, but the complete recorded verification and inspected harness preserve the existing sufficient-proof assessment.
Evidence reviewed 7 items Applicable repository policy: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer-note files were found. Applied guidance on shared helpers, focused regression tests, native UI validation, and credential isolation. No tests or builds were executed during this read-only review.
Verified patch boundary: The raw original head records parents b921ed2 and 4171327. Current main directly descends from the first parent. Raw tree comparison confirms the Command Code, Moonshot, version, and Git-fixture changes are already shared with main. ElevenLabs differences are endpoint drift, not evidence that this PR removes main’s work. The supplied test merge is stale and was not used to claim merge-result behavior.
Rendering and model contract: Both charts disable native rounding before applying the shared top-only shape. The selector retains the first maximum stack end, matching the model’s ordered, contiguous stacks and preventing trailing zero-cost segments from replacing the visible top. Chart data, accessibility values, and series remain unchanged.
Findings None None.
Security None None.

How this fits together

CodexBar’s Usage & Spend dashboard turns provider cost history into daily and hourly stacked charts. This change adjusts how those segments are drawn without changing their amounts or offsets.

flowchart LR
  A[Provider cost history] --> B[Spend dashboard model]
  B --> C[Daily and hourly segments]
  C --> D[Select highest segment per bucket]
  D --> E[Square native marks and clip tops]
  E --> F[Usage and Spend charts]
Loading

Before merge

  • Resolve merge risk (P1) - The linked native captures could not be retrieved here; visual assessment relies on the owner’s recorded inspection and the inspected production-view harness.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Chart-specific LOC delta production +46, tests +248 The growth supports one shared rendering correction, five selector regressions, and an opt-in native production-view capture.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Use the shared top-segment selector and top-only clipping in both charts while preserving the existing spend model and accessibility output.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Use the shared top-segment selector and top-only clipping in both charts while preserving the existing spend model and accessibility output.

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

Yes: current main still draws independently rounded provider marks, and the supplied native baseline records the resulting seams. This reviewer inspected the source and harness but did not execute the app.

Is this the best way to solve the issue?

Yes: disabling native rounding before top-only clipping directly addresses the lost corner pixels, with one selector shared by both charts and explicit trailing-zero coverage.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 34ac0879c30f.

Labels

Label justifications:

  • P3: This is a bounded visual correction to chart corners without changing spend calculations or provider operation.
  • 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 owner records signed native before/after rendering through the production dashboard model and currency section at the reviewed head, confirming flush seams with zero and thin segments. Image retrieval failed here, but the complete recorded verification and inspected harness preserve the existing sufficient-proof assessment.
  • proof: sufficient: Contributor real behavior proof is sufficient. The owner records signed native before/after rendering through the production dashboard model and currency section at the reviewed head, confirming flush seams with zero and thin segments. Image retrieval failed here, but the complete recorded verification and inspected harness preserve the existing sufficient-proof assessment.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The owner records signed native before/after rendering through the production dashboard model and currency section at the reviewed head, confirming flush seams with zero and thin segments. Image retrieval failed here, but the complete recorded verification and inspected harness preserve the existing sufficient-proof assessment.

Evidence

What I checked:

  • Applicable repository policy: Read the complete root AGENTS.md; no nested AGENTS.md or maintainer-note files were found. Applied guidance on shared helpers, focused regression tests, native UI validation, and credential isolation. No tests or builds were executed during this read-only review. (AGENTS.md:1, 6ecb6f8aaa39)
  • Verified patch boundary: The raw original head records parents b921ed2 and 4171327. Current main directly descends from the first parent. Raw tree comparison confirms the Command Code, Moonshot, version, and Git-fixture changes are already shared with main. ElevenLabs differences are endpoint drift, not evidence that this PR removes main’s work. The supplied test merge is stale and was not used to claim merge-result behavior. (6ecb6f8aaa39)
  • Rendering and model contract: Both charts disable native rounding before applying the shared top-only shape. The selector retains the first maximum stack end, matching the model’s ordered, contiguous stacks and preventing trailing zero-cost segments from replacing the visible top. Chart data, accessibility values, and series remain unchanged. (Sources/CodexBar/PreferencesSpendDashboardPane.swift:894, 6ecb6f8aaa39)
  • Current-main and release necessity: The chart source on current main and v0.56.6 has the identical blob b29ec8650f975bb1091881d2ecc434695d1fc750. Reading current main confirms neither chart has the new rounding correction; no containing release tag was returned for the PR head. (Sources/CodexBar/PreferencesSpendDashboardPane.swift:881, 1696c7a71c94)
  • Native proof and focused coverage: The complete supplied body and owner comment describe signed native before/after runs of the production SpendDashboardCurrencySection at the reviewed head, with 18 daily and 18 hourly points, zero-height and thin segments, and preserved totals. The inspected harness builds real dashboard model inputs and hosts the production view. The owner reports visually verified square seams and rounded tops: Fix stacked bar corner radius #3439 (comment). Both linked image fetches failed in this review environment; their pixels were not independently inspected. This preserves the existing sufficient-proof assessment rather than treating retrieval failure as missing contributor evidence. (Tests/CodexBarTests/SpendStackedChartsNativeProofTests.swift:24, 6ecb6f8aaa39)
  • Review continuity and validation: The prior completed review covers this same head and contains no findings or published rank-up moves. The supplied body reports 50 focused tests, the full 1,024-selection suite, and make check passing; all nine supplied check runs succeeded. These are reported results, not commands executed by this reviewer. (6ecb6f8aaa39)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Yuxin Qiao: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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 (2 earlier review cycles)
  • reviewed 2026-09-05T15:45:25.223Z sha 4171327 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-05T21:09:42.084Z sha 6ecb6f8 :: needs maintainer review before merge. :: none

steipete and others added 5 commits September 5, 2026 09:58
Retain the API request region when formatting Moonshot balances and deficits, and preserve formatted currency symbols in CLI presentation. China accounts display CNY; international accounts retain USD.

Fixes steipete#3434.

Co-authored-by: Som Samantray <som.samantray@gmail.com>
Preserve the last confirmed Command Code allowance during optional subscription timeouts and calculate monthly usage from fresh credits. Leave unknown monthly windows unavailable instead of displaying an untouched paid grant.

Keep bounded credential-scoped observations, including invalidations, so older responses cannot overwrite newer plans or resurrect cleared allowances. Limit the synthetic endpoint override to debug loopback origins; release builds use the official endpoint.

Include regression coverage, synthetic CLI transport proof, documentation, and an Unreleased changelog entry. Thanks @enieuwy for the original diagnosis and contribution.

Co-authored-by: enieuwy <121954036+enieuwy@users.noreply.github.com>
Retain contributor stack-top selection and clipping, disable built-in mark rounding so internal seams become square, and add signed native proof with realistic zero-height coverage.

Co-authored-by: Elijah Friedman <efriedman810@gmail.com>
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Signed native before/after proof using the production Usage & Spend currency section and synthetic data. The fixture includes three providers, trailing zero-cost segments, and very thin segments. Both daily and hourly charts retain their totals, series, and geometry.

Before (chart/model source identical to main b921ed2):

Before: rounded internal provider boundaries

After (6ecb6f8):

After: square internal boundaries and rounded outer tops

Native proof exposed why clipping alone was insufficient: Swift Charts had already rounded the underlying marks. The final change sets the native corner radius to zero before applying the top-only clipping shape. Both captures were inspected in full and contain synthetic fixture data only.

@steipete
steipete merged commit 211781b into steipete:main Sep 5, 2026
9 checks passed
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Merged as 211781b. Daily and hourly stacked spend bars now have square internal seams and baselines, with rounded outer tops. Native proof exposed the missing step in the original proposal: disabling built-in mark rounding before applying the top-only clip.

Validation: swift test --no-parallel --filter 'SpendStackedBarChartTests|SpendDashboardModelTests' passed 50 tests. make check passed with zero violations across 2,128 files. make test passed all 1,024 selections across 86 groups on the first attempt, with no retries or timeouts. All nine exact-head checks passed in CI run 33991911801. Pre-landing managed Codex review was scoped clean at P0.

The signed native fixture hosts the actual production currency section and passed before and after. Inspected synthetic before/after captures cover three providers, zero-height and thin segments; both attachments are anonymously downloadable with hashes matching the inspected files. Fixture totals and offsets stayed unchanged. The final tree combines cleanly with the independent ElevenLabs fix.

The Unreleased changelog is updated, and @elijahfriedman's contribution and commit credit are preserved.

@elijahfriedman
elijahfriedman deleted the fix/stacked-bar-corner-radius branch September 5, 2026 22:07
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.

4 participants