Skip to content

feat: Add split tab keyboard shortcut (to mirror Superhuman)#171

Open
mickn wants to merge 8 commits into
ankitvgupta:mainfrom
mickn:codex/split-tab-shortcut
Open

feat: Add split tab keyboard shortcut (to mirror Superhuman)#171
mickn wants to merge 8 commits into
ankitvgupta:mainfrom
mickn:codex/split-tab-shortcut

Conversation

@mickn

@mickn mickn commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds Tab / Shift+Tab navigation for inbox split tabs only when Superhuman Keyboard Shortcuts are enabled.
  • Leaves Gmail Keyboard Shortcuts mode on native Tab focus traversal; Gmail-style split cycling via ` / ~ is unchanged.
  • Keeps keyboard-selected tabs visually identical to clicked tabs by avoiding an extra focus-ring border.
  • Adds E2E coverage for Superhuman Tab cycling and for Gmail mode not switching tabs on Tab.

Test Plan

  • npm run build
  • npx playwright test tests/e2e/inbox-tabs.spec.ts --project=e2e
  • npm run typecheck:web
  • git diff --check

@mickn mickn changed the title [codex] Add split tab keyboard shortcut feat: Add split tab keyboard shortcut Jun 3, 2026
@mickn
mickn marked this pull request as ready for review June 3, 2026 18:57
@greptile-apps

greptile-apps Bot commented Jun 3, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds Tab / Shift+Tab keyboard navigation for inbox split tabs in Superhuman keyboard mode, mirroring Superhuman's section-cycling UX. It wires up ARIA roles (role="tablist", role="tab", aria-selected, data-split-tab-id) in SplitTabs.tsx to enable DOM targeting, implements focusSplitTab via requestAnimationFrame, and guards the shortcut behind isSuperhuman && !showSettings && mode === "normal".

  • cycleSplit gains an options.focusTab flag so Gmail's `/~ cycling does not trigger focusSplitTab, preserving the existing Gmail keyboard flow.
  • Three new E2E tests cover Superhuman Tab cycling, Gmail mode pass-through, and compose-mode non-interception, with a custom expectNoVisibleBoxShadow helper that handles multiple Chromium-normalised representations.

Confidence Score: 5/5

Safe to merge — the shortcut is narrowly gated and the prior concerns raised in review threads have been correctly addressed in this revision.

The Tab handler is guarded by three independent conditions (isSuperhuman, !showSettings, mode === normal), so it cannot fire in Gmail mode, settings, or while compose is open. The options.focusTab flag on cycleSplit correctly restricts focusSplitTab to the new Superhuman path and leaves the Gmail backtick/tilde flow untouched. E2E tests cover all three cases, and the expectNoVisibleBoxShadow helper is robust to Chromium-normalised computed values.

No files require special attention.

Important Files Changed

Filename Overview
src/renderer/components/SplitTabs.tsx Adds splitId, role=tab, aria-selected, and data-split-tab-id props to Tab buttons and wraps the container in role=tablist — clean ARIA/DOM hookup enabling both the keyboard shortcut and the E2E tests to target tabs by role/data attribute.
src/renderer/hooks/useKeyboardShortcuts.ts Introduces focusSplitTab helper and a Tab/Shift+Tab case gated behind isSuperhuman && !showSettings && mode === normal. The options.focusTab flag on cycleSplit correctly prevents focusSplitTab from firing during Gmail backtick/tilde cycling, and the mode === normal guard prevents Tab from being swallowed when compose is open.
tests/e2e/inbox-tabs.spec.ts Adds three well-structured E2E tests for Tab cycling in Superhuman mode, Gmail mode native Tab pass-through, and compose-mode non-interception. Uses Zustand store helpers to set bindings and inspect currentSplitId without relying on brittle UI coupling.

Reviews (8): Last reviewed commit: "Simplify focusSplitTab to a direct attri..." | Re-trigger Greptile

Comment thread src/renderer/hooks/useKeyboardShortcuts.ts
Comment thread src/renderer/hooks/useKeyboardShortcuts.ts
Comment thread tests/e2e/inbox-tabs.spec.ts Outdated

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

Comment thread src/renderer/hooks/useKeyboardShortcuts.ts
@mickn mickn changed the title feat: Add split tab keyboard shortcut feat: Add split tab keyboard shortcut (to mirror Superhuman) Jun 3, 2026
@ankitvgupta

Copy link
Copy Markdown
Owner

nice, recommend using /reviewloop to handle the review comments, and consider the /review skill in gstack as well. will plan to get this in soon

Comment thread src/renderer/hooks/useKeyboardShortcuts.ts Outdated
mickn and others added 4 commits June 12, 2026 15:43
Replace querySelectorAll + linear scan with a single
querySelector('[data-split-tab-id="..."]'), using CSS.escape since custom
split IDs are user-derived.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mickn

mickn commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

nice, recommend using /reviewloop to handle the review comments, and consider the /review skill in gstack as well. will plan to get this in soon

all comments are addressed 👍

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