Skip to content

fix(shortcuts): switch panes with Mod+Shift+arrows from the empty message box - #827

Merged
devswha merged 4 commits into
devswha:mainfrom
sergiorademacher:fix/pane-shortcut-empty-composer
Oct 11, 2026
Merged

devswha merged 4 commits into
devswha:mainfrom
sergiorademacher:fix/pane-shortcut-empty-composer

Conversation

@sergiorademacher

Copy link
Copy Markdown
Contributor

Change

Mod+Shift+↑/↓ switch panes from the terminal view, but not from the chat view. The chat view puts the focus in the message box, and #298 leaves Mod+Shift+arrows to every text field (keepsArrowsForText), so in chat the shortcut never reaches selectAdjacentPane.

#298 kept the arrows in the message box for two reasons: they select text, and switching would leave a message behind. An empty field has neither, so keepsArrowsForText now returns false when the target's value is "". A field with text keeps the arrows as before. Contenteditable targets have no value and are unchanged.

One condition in src/lib/shortcuts.ts, plus tests, docs/guide.md and a changelog line.

Validation

  • scripts/ui-regression.ts: new check after the switch to chat. From the empty message box, Ctrl+Shift+↓ leaves the pane; with a draft, it stays.
    • Without the fix: Timed out: the empty message box leaves the pane.
    • With the fix: PASS pane shortcut from the empty message box; a draft keeps text selection, and the full script passes.
  • src/lib/shortcuts.test.ts: empty textarea and empty text input switch panes; fields with text keep the arrows. The new expectations fail without the fix.
  • bun run generate:types --check, bun run typecheck, bun run build, bun run test:unit (2720 pass, 0 fail).
  • Not checked: a real Mac.
  • Unrelated: one of three ui-regression.ts runs failed earlier, at the palette check a scroll under a resting pointer leaves the arrow's selection alone (line 308), with and without this change. The other runs passed it.

🤖 Generated with Claude Code

…sage box

The chat view puts the focus in the message box, and devswha#298 leaves
Mod+Shift+arrows to every text field, so the pane shortcut worked from
the terminal but never from chat. An empty field has nothing to select:
the arrows now switch panes from it. A field with text keeps them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 68f4037a-f27f-4ec5-898a-4ed496fc52a6

📥 Commits

Reviewing files that changed from the base of the PR and between e804ad1 and 7d0f251.


📒 Files selected for processing (5)
  • CHANGELOG.md
  • docs/guide.md
  • scripts/ui-regression.ts
  • src/lib/shortcuts.test.ts
  • src/lib/shortcuts.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 49694bbe-dd96-4c72-92c6-0994a575d275



📥 Commits

Reviewing files that changed from the base of the PR and between 4cf5b96 and e804ad1.




📒 Files selected for processing (5)
  • CHANGELOG.md
  • docs/guide.md
  • scripts/ui-regression.ts
  • src/lib/shortcuts.test.ts
  • src/lib/shortcuts.ts



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





📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Mod+Shift+↑/↓ now switches panes when the message box is empty. When it contains a draft, the shortcuts continue to select text instead.
    • Keyboard shortcuts now remain available to the active input method while it is composing text.
📝 Summary
📝 Summary

Walkthrough

Mod+Shift+arrow shortcuts switch panes when a text field is empty. Populated fields retain text selection behavior. Unit and browser regression coverage, the keyboard guide, and the changelog reflect this behavior.

Changes

Pane-switch shortcuts

Layer / File(s) Summary
Empty-field shortcut policy
src/lib/shortcuts.ts, src/lib/shortcuts.test.ts
Shortcut handling now checks whether a text field is empty. Tests cover empty and populated text fields, including the composer.
Composer regression coverage and guidance
scripts/ui-regression.ts, docs/guide.md, CHANGELOG.md
The browser regression checks pane switching from an empty composer and text selection with a draft. The guide and changelog describe the shortcut behavior.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: devswha





Merge Risk: ⚪ Minimal · up to e804a

The change enables pane switching from an empty composer while preserving draft selection; no concrete user-facing regression is established, so it appears ready for normal checks.

Pre-merge checks | Passed 4 | Failed 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 3 files. (2 skipped: 2 … 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: enabling pane switching with Mod+Shift+arrows from an empty message box.
Description check Passed The description includes the required Change and Validation sections. It explains the problem, resulting behavior, tests, build checks, UI regression results, and known limitations. It does not includ…
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 3 files. (2 skipped: 2 unsupported.)






✨ Finishing Touches
🧪 Generate unit tests (beta)
  • 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.

@devswha
devswha merged commit f6244ff into devswha:main Oct 11, 2026
9 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.

2 participants