Skip to content

feat(web): add configurable composer focus shortcut - #10910

Open
kcybe wants to merge 1 commit into
pingdotgg:mainfrom
kcybe:feat/composer-focus-keybinding
Open

feat(web): add configurable composer focus shortcut#10910
kcybe wants to merge 1 commit into
pingdotgg:mainfrom
kcybe:feat/composer-focus-keybinding

Conversation

@kcybe

@kcybe kcybe commented Sep 9, 2026

Copy link
Copy Markdown

What Changed

Add composer.focus to Settings → Keybindings → Add keybinding on web and desktop. Users choose the shortcut; there is no default. The existing chat shortcut handler focuses the composer at the end of its draft, including when a terminal has focus.

Why

There was no configurable shortcut to return to the composer. This reuses the existing command list, settings editor, and composer focus method without adding another event listener.

Validation

  • 84 focused tests passed across keybinding resolution, Settings command options, and contract decoding, including macOS/Windows/Linux modifier matching.
  • Web typecheck and targeted lint/format checks passed (existing unrelated lint warnings and typecheck suggestions remain).
  • Playwright against an isolated local server with copied data: configured the shortcut through Settings, verified persistence after reload, focused from a terminal without changing the draft, typed at the end, and removed the binding to verify it no longer moves focus.
  • Browser-tested the shared web/desktop renderer; the native Electron shell was not launched. No provider, mobile UI, or connection-mode changes.

UI Changes

Before After
Before: no composer focus command After: Composer Focus command available

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Model: GPT-6. Harness: Codex in T3 Code.

Summary by CodeRabbit

  • New Features

    • Added a configurable composer focus keyboard shortcut that moves focus to the current thread’s composer, including from a terminal.
    • Added composer.focus to the available keybinding commands. No shortcut is assigned by default; users can configure one in Settings → Keybindings.
  • Documentation

    • Documented the composer focus command and configuration steps.
  • Tests

    • Added coverage for custom shortcuts across macOS, Windows, and Linux.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Sep 9, 2026
@kcybe
kcybe marked this pull request as ready for review September 9, 2026 09:02
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Review Change StackReview 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: Advanced

Run ID: a2d2aa92-d8e0-45a7-bd53-41c5344b916e

📥 Commits

Reviewing files that changed from the base of the PR and between 6c58362 and 79a3167.

📒 Files selected for processing (6)
  • apps/web/src/components/ChatView.tsx
  • apps/web/src/components/settings/KeybindingsSettings.logic.test.ts
  • apps/web/src/keybindings.test.ts
  • docs/user/keybindings.md
  • packages/contracts/src/keybindings.test.ts
  • packages/contracts/src/keybindings.ts

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


📝 Walkthrough

Walkthrough

The PR adds the composer.focus keybinding command, handles it in ChatView, tests custom cross-platform bindings, and documents configuration in Settings.

Changes

Composer focus keybinding

Layer / File(s) Summary
Keybinding command contract
packages/contracts/src/keybindings.ts, packages/contracts/src/keybindings.test.ts, apps/web/src/components/settings/KeybindingsSettings.logic.test.ts
The keybinding schema accepts composer.focus. Contract and settings tests verify parsing and command options.
Composer focus handling
apps/web/src/components/ChatView.tsx, apps/web/src/keybindings.test.ts, docs/user/keybindings.md
ChatView handles the command by focusing the composer. Tests cover custom bindings across platforms and terminal focus states. Documentation describes setup and behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 79a31

This adds an optional composer-focus shortcut without changing default bindings. The configured command is accepted, resolved across platforms, and focuses the composer as intended, with no current merge-blocking risk identified.

Suggested reviewers: 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 1 functions across 5 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description includes the required What Changed, Why, UI Changes, and Checklist sections. It explains the implementation, scope, validation, and UI impact. It includes before-and-after screenshots;…
Title check ✅ Passed The title clearly and concisely identifies the main change: a configurable composer focus shortcut in the web application.
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.
Full details: Docstring Coverage

Explanation

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 1 functions across 5 files. (1 skipped: 1 unsupported.)

  • 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:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant