Skip to content

Fix terminal split shortcuts and improve split pane styling#225

Merged
AviPeltz merged 2 commits into
mainfrom
fix/terminal-split-shortcuts-and-styling
Dec 1, 2025
Merged

Fix terminal split shortcuts and improve split pane styling#225
AviPeltz merged 2 commits into
mainfrom
fix/terminal-split-shortcuts-and-styling

Conversation

@AviPeltz
Copy link
Copy Markdown
Collaborator

@AviPeltz AviPeltz commented Dec 1, 2025

  • Fix keyboard shortcuts (⌘D, ⌘⇧D) not working with multiple terminal tabs

    • Properly copy modifier keys when re-dispatching keyboard events from xterm
    • Handle split operations when active tab is a child within a group
    • Support splitting when a terminal group is selected (uses last-focused child)
  • Improve split terminal pane styling

    • Add overflow:hidden to fix border radius mismatch on pane headers
    • Smaller, properly-sized close button with hover state (bg-white/10)
    • Show controls on hover, focus-within, and when pane is focused (accessibility)
    • Softer borders, slimmer toolbar, muted title text
  • Change sidebar toggle shortcut from ⌘S to ⌘B

  • Add comprehensive tests for split operations (13 total tests)

    • Group uses last-focused child from history
    • Group falls back to first child when history is empty
    • Child tab splits within group without explicit path
    • Tests for both vertical and horizontal split paths

🤖 Generated with Claude Code

Description

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes

Summary by CodeRabbit

  • Bug Fixes

    • Preserve modifier keys when re-dispatching terminal hotkeys.
    • Improved split behavior: splitting a group uses last-focused child (with sensible fallbacks) and correctly updates layouts.
  • Style

    • Refined window controls visibility with hover/focus animations and reduced toolbar height.
    • Updated window title, drop-target visuals, and small toolbar button/icon sizing.
  • Chores

    • Changed sidebar toggle hotkey to Meta+B.

✏️ Tip: You can customize this high-level summary in your review settings.

- Fix keyboard shortcuts (⌘D, ⌘⇧D) not working with multiple terminal tabs
  - Properly copy modifier keys when re-dispatching keyboard events from xterm
  - Handle split operations when active tab is a child within a group
  - Support splitting when a terminal group is selected (uses last-focused child)

- Improve split terminal pane styling
  - Add overflow:hidden to fix border radius mismatch on pane headers
  - Smaller, properly-sized close button with hover state (bg-white/10)
  - Show controls on hover, focus-within, and when pane is focused (accessibility)
  - Softer borders, slimmer toolbar, muted title text

- Change sidebar toggle shortcut from ⌘S to ⌘B

- Add comprehensive tests for split operations (13 total tests)
  - Group uses last-focused child from history
  - Group falls back to first child when history is empty
  - Child tab splits within group without explicit path
  - Tests for both vertical and horizontal split paths

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
website Ready Ready Preview Comment Dec 1, 2025 11:31pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 1, 2025

Walkthrough

Replaces a custom Button with native buttons in the group tab toolbar, updates mosaic window styling, improves terminal hotkey re-dispatch to copy modifier properties, enhances tab-splitting to choose children from group history (with helpers), expands split-related tests, and changes TOGGLE_SIDEBAR hotkey from meta+s to meta+b.

Changes

Cohort / File(s) Summary
Group tab UI
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/GroupTabView/GroupTabPane.tsx
Replaced custom Button usage with native button (type="button") in toolbar controls, adjusted classes and icon size (size-4 → size-3.5); preserved close handler behavior.
Mosaic theme CSS
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/GroupTabView/mosaic-theme.css
Updated window border/radius defaults, added overflow:hidden, focused-window border rule, reduced toolbar height (32→28px), controls visibility via opacity transitions, adjusted title styling and focus color, changed drop-target visuals and outlines.
Terminal keyboard handling
apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/helpers.ts
When redispatching app hotkeys, construct and dispatch a new KeyboardEvent copying explicit properties (key, code, keyCode, which, ctrlKey, shiftKey, altKey, metaKey, repeat) with bubbles/cancelable true.
Hotkeys config
apps/desktop/src/shared/hotkeys.ts
TOGGLE_SIDEBAR key changed from meta+smeta+b; SPLIT_HORIZONTAL and SPLIT_VERTICAL labels/descriptions updated to "Split Right" / "Split Down".
Split operations logic
apps/desktop/src/renderer/stores/tabs/helpers/split-operations.ts
Added internal helpers (findPathInLayout, findFirstTabInLayout, findChildTabToSplit) and reorganized vertical/horizontal split flows to: prefer provided sourceTabId, use history-last-focused child when active tab is a group, fall back to first child, handle splitting a child inside a group, and convert single tabs into groups when needed.
Split tests
apps/desktop/src/renderer/stores/tabs/store.test.ts
Expanded tests for splitTabVertical/splitTabHorizontal covering history-based child selection, fallback to first child, splitting child-in-group scenarios, new child creation under group, layout structure assertions, and active tab preservation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas needing extra attention:
    • apps/desktop/src/renderer/stores/tabs/helpers/split-operations.ts — path-finding helpers and multiple branching split scenarios.
    • apps/desktop/src/renderer/stores/tabs/store.test.ts — many new assertions; ensure test setup matches intended history/layout states.
    • apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/helpers.ts — verify all modifier keys and event properties are preserved across platforms.
    • mosaic-theme.css — verify visual/interaction effects (hover/focus visibility) in dark/light themes.

Possibly related PRs

  • xterm ui #115 — touches GroupTabPane and mosaic-theme assets (direct UI overlap).
  • hotkey pane #108 — related to hotkey handling and split-tab hooks (keyboard + split behavior overlap).
  • tabs interaction #111 — modifies tab/group splitting and tabs store helpers (split logic and tests overlap).

Poem

🐰 I hopped through panes and tiny springs,

splitting paths with history's wings,
Meta+b now opens wide the door,
buttons native, styles tidied more,
modifiers kept true — a rabbit's cheer! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: fixing terminal split shortcuts and improving split pane styling, which align with the primary objectives of the pull request.
Description check ✅ Passed The pull request description provides comprehensive details about all changes, covers required template sections (Type of Change with selections, comprehensive notes), and clearly explains the purpose and scope of the changes.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/terminal-split-shortcuts-and-styling

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 30a193c and 2e7c7a1.

📒 Files selected for processing (1)
  • apps/desktop/src/shared/hotkeys.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
apps/desktop/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)

For Electron interprocess communication, ALWAYS use tRPC as defined in src/lib/trpc

Files:

  • apps/desktop/src/shared/hotkeys.ts
apps/desktop/**/*.{ts,tsx}

📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)

apps/desktop/**/*.{ts,tsx}: Please use alias as defined in tsconfig.json when possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary

Files:

  • apps/desktop/src/shared/hotkeys.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Avoid using any type - use explicit types instead for type safety
Use camelCase for variable and function names following existing codebase patterns
Keep diffs minimal with targeted edits only - avoid unnecessary changes when making modifications
Follow existing patterns and match the codebase style when writing new code

Files:

  • apps/desktop/src/shared/hotkeys.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (3)
apps/desktop/src/shared/hotkeys.ts (3)

88-88: LGTM! Improved shortcut choice.

Changing from meta+s to meta+b avoids conflicts with the common Save shortcut and aligns with conventions used in other development tools.


94-96: LGTM! Clearer, more intuitive labels.

The updated label and description are more concise and better communicate the split direction to users.


100-102: LGTM! Consistent with the horizontal split improvements.

The updated label and description match the clarity improvements made to SPLIT_HORIZONTAL, providing a better user experience.


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 and usage tips.

More intuitive labels that describe the action rather than technical terms.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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