Skip to content

Fix Compact usage notice focus and older-host compatibility - #26747

Merged
AmethystLiang merged 2 commits into
mainfrom
fix-compact-usage-notice
Oct 9, 2026
Merged

AmethystLiang merged 2 commits into
mainfrom
fix-compact-usage-notice

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​179 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​174
Prod 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​108 $\color{#cf222e}{\Huge{\mathbf{−}}}$​85 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​23

ELI5

The Compact usage tip is easier to read and no longer disrupts the Usage menu. Changing the display mode also works when a browser reconnects to an older Orca host.

What Changed

  • Keep the usage trigger and menu mounted when the tip is dismissed or a display mode is chosen, preserving keyboard focus.
  • Treat a missing Compact-tip flag from an older host as dismissed, overriding stale browser cache so mode changes do not send an unsupported field.
  • Clarify the title, show Detailed as a small badge, lift the card with a token-based gradient, and right-align a higher-contrast Got it button. Update all six translations.

Why

Switching between two notice wrapper components remounted the menu. A single stable card fixes that without special focus restoration. Taking the notice flag from the active host prevents stale cached eligibility from breaking older hosts' strict preference validation, without changing the wire contract.

Linked Issue

Follow-up to #26726.

Visual Proof

Before final visual refinements: user-provided screenshot. After: full hidden Electron window from a clean temporary profile. Screenshots attached below.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

560 tests across 68 files passed: status-bar components, web preload APIs, and workspace-preference hydration. pnpm tc:web, pnpm tc:node, and pnpm run check:code-quality:changed passed after rebasing onto main. Commit hooks passed lint and formatting.

macOS Electron CDP: inspected the rendered card and idle button; choosing Detailed keeps the same Usage trigger, open menu, and focus while dismissing the tip. Earlier checks covered Compact selection and Escape. Added regression tests for dismissal/menu identity and a newer-to-older host cache transition against the older strict schema.

Linux/Windows and a live older SSH host were not manually exercised. No platform-specific behavior or wire fields added. Full lint, packaged build, and broader test suite are left to CI.

Review

Self-reviewed: no remaining blocking findings. Reuses the existing card, Badge, Button, and theme tokens; no new derived-state effects or parallel notice implementation. Saved display-mode choices remain unchanged.

Agent skill upstream boundary

  • Not applicable: no upstream skill source copied.

Notes

Mixed-version hosts covered by regression tests. Folder workspaces and git-provider behavior are unaffected. Screenshots use a clean profile rather than exposing personal terminal content.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Before/after screenshots attached
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • Full lint, typecheck, test, and build gates: CI will cover; focused local checks passed as listed above

@AmethystLiang

Copy link
Copy Markdown
Contributor Author

Attachments

Before final refinements / After (clean Electron profile)

Screenshot 2026-10-08 at 9.48.12 PM.png pr-after.png
Screenshot 2026-10-08 at 9.48.12 PM.png pr-after.png

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5f8833ac-f8b2-468c-8bf2-3441060208f0
📥 Commits

Reviewing files that changed from the base of the PR and between 435bc80 and 15b7e8b.

📒 Files selected for processing (4)
  • src/renderer/src/components/status-bar/StatusBarUsageChangeNoticeCard.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageChangeNotices.test.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageChangeNotices.tsx
  • src/renderer/src/components/status-bar/UsagePercentageDisplayChangeNotice.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/renderer/src/components/status-bar/StatusBarUsageChangeNoticeCard.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageChangeNotices.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageChangeNotices.test.tsx
  • src/renderer/src/components/status-bar/UsagePercentageDisplayChangeNotice.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The status-bar notice card now accepts rich descriptions and uses a notice key to associate its delay with the current notice. The compact usage notice includes a translated Detailed badge, and the percentage-change notice provides card props through a shared hook. Host-state normalization sets a default for the compact-notice dismissal field. Tests cover notice rendering, timing, focus, menu behavior, and state handling across host schemas.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 15b7e

The usage notice now restarts its delay when switching between notices and keeps the trigger, menu, and focus mounted. No merge-blocking risk was found.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly identifies the two main changes: fixing Compact usage notice focus and maintaining compatibility with older hosts.
Description check Passed The description is complete and aligned with the template. It explains the user impact, implementation, motivation, linked issue, visual proof, testing, review notes, compatibility considerations, and…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d6c08a07-9dfd-434d-a97b-ec67d113a9de
📥 Commits

Reviewing files that changed from the base of the PR and between b71e538 and 435bc80.

📒 Files selected for processing (13)
  • src/renderer/src/assets/main.css
  • src/renderer/src/components/status-bar/StatusBarUsageChangeNoticeCard.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageChangeNotices.test.tsx
  • src/renderer/src/components/status-bar/StatusBarUsageChangeNotices.tsx
  • src/renderer/src/components/status-bar/UsagePercentageDisplayChangeNotice.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/web/preload-api/web-preference-normalization.ts
  • src/renderer/src/web/preload-api/web-ui-compact-notice.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@AmethystLiang
AmethystLiang merged commit f3c0390 into main Oct 9, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant