Skip to content

feat(web): add usage page keybinding - #9434

Open
jakeleventhal wants to merge 4 commits into
pingdotgg:mainfrom
jakeleventhal:feat/usage-page-keybinding
Open

feat(web): add usage page keybinding#9434
jakeleventhal wants to merge 4 commits into
pingdotgg:mainfrom
jakeleventhal:feat/usage-page-keybinding

Conversation

@jakeleventhal

@jakeleventhal jakeleventhal commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

NOTE FROM HUMAN

This PR is much more useful in conjunction with #9263 - I added this PR because if provider limits are there, its something I find myself checking frequently.

The rest of this was AI generated

Opening the Usage page currently requires using the sidebar. This adds a configurable usage.open command that defaults to mod+u and stays inactive while the terminal has focus.

The existing global keybinding dispatcher now navigates to /usage, so web and desktop share the behavior without another event listener or navigation path. The keybinding contract, default synchronization, focused tests, and user docs are updated with it.

Validation:

  • vp test run packages/contracts/src/keybindings.test.ts apps/server/src/keybindings.test.ts apps/web/src/keybindings.test.ts apps/web/src/components/settings/KeybindingsSettings.logic.test.ts
  • vp run -F @t3tools/contracts -F @t3tools/shared -F @t3tools/web -F t3 typecheck
  • focused vp lint
  • focused vp fmt --check

No visual changes.

Generated with gpt-5.6-sol in T3 Code using the Codex harness.

Note

Add usage.open keybinding with default modifier-plus-U shortcut

  • Registers usage.open as a static keybinding command and maps it to modifier-plus-U (outside terminal focus) in the default bindings
  • Implements a global keydown handler in CommandPalette that resolves the shortcut, closes the palette, and navigates to /usage; the binding is skipped when the event is already prevented or composing
  • Extends the shortcut-resolution context with modelPickerOpen so other bindings also receive the current model-picker visibility state
  • Updates tests for command options, default bindings, and rule parsing; documents the shortcut in keybindings and usage docs
  • Risk: existing consumers of the CommandPalette shortcut-resolution context now receive an additional modelPickerOpen field — check CommandPalette.tsx for any resolver that does not tolerate the extra field

Macroscope summarized 7629026.


Note

Low Risk
Low-risk UX addition; outside terminal focus the app now captures mod+u, which could conflict with any other in-app use of that chord.

Overview
Adds a configurable usage.open command (default mod+u, inactive while the terminal has focus) so the Usage page is reachable from the keyboard instead of only the sidebar.

The command is registered in the keybinding contract and shared defaults, wired in the global shortcut listener in CommandPalette to close overlays and navigate to /usage, and covered by contract/server/web tests plus user docs for keybindings and usage.

Reviewed by Cursor Bugbot for commit bf7eedc. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features

    • Added a default Mod+U shortcut to open the Usage page when the terminal is not focused.
    • The shortcut works across web and desktop and can be customized in Settings → Keybindings.
    • Shortcut handling now opens Usage directly, including when another command palette is active.
  • Documentation

    • Updated keybinding and Usage documentation with the new shortcut and customization details.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 3, 2026
@jakeleventhal
jakeleventhal marked this pull request as ready for review September 3, 2026 14:01
@macroscopeapp

macroscopeapp Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a new active mod+u product default and production keyboard-navigation behavior, including event interception and route navigation from the composer context. The change is localized and additive, but the default change and unresolved shortcut-interaction concerns warrant human review.

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bf7eedc. Configure here.

Comment thread apps/web/src/components/CommandPalette.tsx Outdated
@jakeleventhal
jakeleventhal force-pushed the feat/usage-page-keybinding branch from bf7eedc to 8553f4f Compare September 7, 2026 12:50
@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Sep 7, 2026
Comment thread apps/web/src/components/CommandPalette.tsx
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 5fdad04e-aa91-4a85-94d2-cc7c6ede8b91

📥 Commits

Reviewing files that changed from the base of the PR and between 8553f4f and 7629026.

📒 Files selected for processing (1)
  • apps/web/src/components/CommandPalette.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PR adds the usage.open keybinding with mod+u, restricts it when the terminal has focus, and navigates from CommandPalette to /usage. Tests, contracts, and user documentation cover the new command.

Changes

Usage shortcut

Layer / File(s) Summary
Register usage.open binding
packages/contracts/src/keybindings.ts, packages/shared/src/keybindings.ts, packages/contracts/src/keybindings.test.ts
The keybinding contract accepts usage.open. The default binding maps mod+u when the terminal is not focused.
Resolve shortcut context
apps/web/src/keybindings.test.ts, apps/web/src/components/settings/KeybindingsSettings.logic.test.ts
Tests cover shortcut resolution by platform and terminal focus. Keybinding options include usage.open.
Navigate to Usage
apps/web/src/components/CommandPalette.tsx, docs/user/keybindings.md, docs/user/usage.md
CommandPalette handles usage.open, closes the palette, and navigates to /usage. The shortcut context includes model-picker state. Documentation describes the shortcut and customization path.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 76290

This change adds a configurable shortcut for opening the Usage page and closes active overlays before navigating. No current merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant Keyboard
  participant CommandPalette
  participant ShortcutResolver
  participant UsagePage
  Keyboard->>CommandPalette: Press mod+u
  CommandPalette->>ShortcutResolver: Resolve with focus context
  ShortcutResolver-->>CommandPalette: Return usage.open
  CommandPalette->>CommandPalette: Prevent default and close
  CommandPalette->>UsagePage: Navigate to /usage
Loading

Suggested reviewers: t3dotgg, juliusmarminge

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 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 and concisely identifies the main change: adding a keybinding for the Usage page.
Description check ✅ Passed The description explains what changed, why it changed, validation performed, and that there are no visual changes. It does not use the template headings or checklist, but it contains the required info…
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
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant