Skip to content

Reduce hosted chart submenu stalls - #1384

Merged
steipete merged 1 commit into
mainfrom
perf/hosted-submenu-refresh
Jun 10, 2026
Merged

Reduce hosted chart submenu stalls#1384
steipete merged 1 commit into
mainfrom
perf/hosted-submenu-refresh

Conversation

@steipete

Copy link
Copy Markdown
Owner

Summary

  • skip the duplicate hosted-chart fitting pass on submenu open
  • retain unchanged hosted chart views across refreshes using content, account, time-range, and width signatures
  • precompute plan utilization chart models once per hosted view and replace quadratic duplicate merging
  • preserve z.ai dynamic height updates while avoiding unnecessary chart reconstruction

Closes #1379.

Validation

  • swift test --filter StatusMenuHostedSubmenuRefreshTests
  • swift test --filter PlanUtilizationHistoryChartMenuViewTests
  • swift test --filter UsageStorePlanUtilization
  • swift test --filter UsageStorePlanUtilizationClaudeIdentityTests
  • make check
  • swift test — 3,430 tests in 394 suites passed
  • structured Codex autoreview — clean after fixing z.ai height/time invalidation and account-scoped utilization invalidation

No live provider, browser-cookie, or Keychain probe was run.

@clawsweeper

clawsweeper Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed June 10, 2026, 6:10 AM ET / 10:10 UTC.

Summary
The PR caches unchanged hosted chart submenus with render signatures, skips redundant post-hydration sizing, precomputes plan-utilization chart models, and adds focused submenu/chart tests.

Reproducibility: no. live reproduction was performed in this read-only review. Source inspection confirms the current-main duplicate hydration/height refresh, unconditional hosted-submenu rebuild, and body-time model recomputation paths described by the linked issue.

Review metrics: none identified.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🌊 off-meta tidepool
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Mantis proof suggestion
A short desktop recording could materially show the menu-stall improvement because the change affects visible hosted submenu open, hover, and refresh behavior. A maintainer can ask Mantis to capture proof by posting a new PR comment that starts with the OpenClaw Mantis account mention, followed by:

visual task: record opening and hovering hosted chart submenus after this PR and confirm unchanged refreshes do not visibly rebuild or stall.

Risk before merge

  • [P1] I did not run Swift tests or packaged live menu timing in this read-only review; validation is based on the PR body plus source and test inspection.
  • [P1] The PR intentionally caches hosted submenu views, so any missed signature input could leave stale chart content visible until the next invalidation; the diff includes targeted account, cost, z.ai time, and width coverage for the main cases I checked.

Maintainer options:

  1. Decide the mitigation before merge
    Land this PR after normal maintainer and CI validation if the focused tests pass, then let it close the linked issue at Chart submenu expand clicks pay synchronous hosted-view hydration twice, plus full rehydrate on every refresh tick #1379.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P2] No repair lane is needed; this is an owner-authored implementation PR with no discrete ClawSweeper-fixable blocker found.

Security
Cleared: The diff is Swift menu/view/test code plus a changelog entry and does not change credentials, CI, dependencies, network fetches, or release scripts.

Review details

Best possible solution:

Land this PR after normal maintainer and CI validation if the focused tests pass, then let it close the linked issue at #1379.

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

No live reproduction was performed in this read-only review. Source inspection confirms the current-main duplicate hydration/height refresh, unconditional hosted-submenu rebuild, and body-time model recomputation paths described by the linked issue.

Is this the best way to solve the issue?

Yes. The PR targets the hot paths with hosted-view signatures and chart model precomputation while adding focused state-seam tests, which is narrower than broad AppKit or refresh-scheduler rewrites.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against f51db0e892ef.

Label changes

Label changes:

  • add P2: This PR fixes a normal-priority menu responsiveness bug with a clear source path and limited blast radius.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The real behavior proof gate does not apply because this is an owner-authored PR; the body lists focused test validation and explicitly says no live provider, browser-cookie, or Keychain probe was run.

Label justifications:

  • P2: This PR fixes a normal-priority menu responsiveness bug with a clear source path and limited blast radius.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The real behavior proof gate does not apply because this is an owner-authored PR; the body lists focused test validation and explicitly says no live provider, browser-cookie, or Keychain probe was run.
Evidence reviewed

What I checked:

Likely related people:

  • steipete: Current-main blame for the hosted submenu and plan-utilization chart files points to Peter Steinberger in the v0.32.5 snapshot, and the PR commit is also authored by Peter Steinberger. (role: current area contributor; confidence: high; commits: 920997c6a365, 68f4bdac54fe; files: Sources/CodexBar/StatusItemController+HostedSubmenus.swift, Sources/CodexBar/PlanUtilizationHistoryChartMenuView.swift, Sources/CodexBar/StatusItemController+Menu.swift)
  • jangisaac-dev: The recent open-menu refresh deferral commit changed the nearby menu-tracking path and explicitly kept hosted submenu updates immediate. (role: recent adjacent contributor; confidence: medium; commits: e97bfb0db9eb; files: Sources/CodexBar/StatusItemController+MenuTracking.swift, Tests/CodexBarTests/StatusMenuOpenRefreshTests.swift)
  • hhh2210: The linked issue by hhh2210 scoped the hosted submenu stall root causes that this PR addresses and is credited in the changelog entry. (role: reporter and source-inspection contributor; confidence: medium; files: Sources/CodexBar/StatusItemController+Menu.swift, Sources/CodexBar/StatusItemController+HostedSubmenus.swift, Sources/CodexBar/PlanUtilizationHistoryChartMenuView.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added 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. P2 Normal priority bug or improvement with limited blast radius. labels Jun 10, 2026
@steipete
steipete merged commit 7c0ed03 into main Jun 10, 2026
7 checks passed
@steipete
steipete deleted the perf/hosted-submenu-refresh branch June 10, 2026 10:55
@steipete

Copy link
Copy Markdown
Owner Author

Landed as 7c0ed03.

Verification:

  • swift test --filter StatusMenuHostedSubmenuRefreshTests — 6 tests passed.
  • swift test --filter PlanUtilizationHistoryChartMenuViewTests — passed.
  • swift test --filter UsageStorePlanUtilizationClaudeIdentityTests — 8 tests passed.
  • make check — SwiftFormat clean; SwiftLint 0 violations.
  • swift test — 3,430 tests in 394 suites passed.
  • Structured autoreview on the branch against origin/main — clean; no accepted/actionable findings.
  • CI push run https://github.com/steipete/CodexBar/actions/runs/27268817310 — macOS, Linux x64, and Linux arm64 passed.
  • CI pull-request run https://github.com/steipete/CodexBar/actions/runs/27268829864 — macOS, Linux x64, and Linux arm64 passed.
  • GitGuardian passed.

Caveat: no live provider, browser-cookie, or Keychain probe was run; validation covered the hosted-menu identity/height seams, utilization model selection, formatting/lint, and the full test matrix.

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. 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.

Chart submenu expand clicks pay synchronous hosted-view hydration twice, plus full rehydrate on every refresh tick

1 participant