Skip to content

refactor(renderer): remove the keyboard-handlers barrel and partial re-exports - #27986

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-3-5f
Oct 12, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-3-5f

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 77 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​186 $\color{#cf222e}{\Huge{\mathbf{−}}}$​192 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6
Prod 59 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​78 $\color{#cf222e}{\Huge{\mathbf{−}}}$​205 $\color{#cf222e}{\Huge{\mathbf{−}}}$​127

ELI5

The last renderer barrel, components/terminal-pane/keyboard-handlers.ts, only re-exported the terminal keyboard hook and its shortcut matchers. Five other modules hold real code but also re-exported names from neighbouring modules: pty-transport.ts, terminal-paste-coordinator.ts, use-terminal-pane-lifecycle.ts, runtime/remote-runtime-terminal-multiplexer.ts and runtime/local-structured-session-tabs-sync.ts. This PR deletes the barrel and those re-export lines, and points importers at the defining modules.

What Changed

Users see no difference.

  • Importers of the re-exported names, such as pty-dispatcher, pty-output-processor, pty-transport-types, terminal-paste-limits/-executor/-chunks/-model, the lifecycle primitives, remote-runtime-terminal-snapshot-state, and the local-structured-session-tabs-sync/* modules, now import from those modules. The five modules keep all their own exports.
  • Tests: mocks and await import() destructures are split per defining module. A test that dynamically imported ./pty-transport for registerEagerPtyBuffer now imports ./pty-dispatcher. Two structured-launch tests stopped mocking local-structured-session-owner with a wrong value, so they use the real constant. One stale-stream test stopped replacing the snapshot-state module, because its other exports are needed.

Net: production −127 (+78/−205), tests −6.

Why

Phase 3.99 / AGENTS.md rule: no barrels and no re-export shims. With direct imports, each import line names the module a file really depends on, and each test mocks the module the code under test actually calls. One barrel per PR keeps every review mechanical.

Linked Issue

N/A, internal Phase 3.99 cleanup (PR 3.5f).

Visual Proof

N/A, no UI or behaviour change.

Testing

  • No import or mock of a removed re-export through its old path remains, and keyboard-handlers (the module) is gone.

  • pnpm test src/renderer/src/components/terminal-pane src/renderer/src/runtime plus every other changed test file: 820 files and 7380 tests pass.

  • pnpm tc, pnpm lint and pnpm run check:code-quality:changed (0 findings) pass on the whole barrel stack.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

P0/P1 review: my own review plus an independent reviewer.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Renderer-only import changes. SSH, wire, mobile and platforms are not affected.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dd890aa4-7e73-4420-bc17-fd5a30d8952c

📥 Commits

Reviewing files that changed from the base of the PR and between 0eaa04c and 4ec4949.


📒 Files selected for processing (136)
  • src/renderer/src/components/TerminalSearch.tsx
  • src/renderer/src/components/dashboard-popout/preview-terminal-paste.ts
  • src/renderer/src/components/dashboard-popout/remote-runtime-terminal-preview-api.test.ts
  • src/renderer/src/components/dashboard-popout/remote-runtime-terminal-preview-api.ts
  • src/renderer/src/components/native-chat/structured-agent-session-status-bridge-failed-start.test.tsx
  • src/renderer/src/components/native-chat/structured-agent-session-status-bridge-unconfirmed-start.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-provisional-launch.test.tsx
  • src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.test.tsx
  • src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.tsx
  • src/renderer/src/components/terminal-pane/expand-collapse-render-stability.test.ts
  • src/renderer/src/components/terminal-pane/issue-21762-tracking-mode-middle-click-double-paste.repro.test.ts
  • src/renderer/src/components/terminal-pane/keyboard-handlers-ime-composing-chord.test.tsx
  • src/renderer/src/components/terminal-pane/keyboard-handlers-ime-enter-keyup.test.tsx
  • src/renderer/src/components/terminal-pane/keyboard-handlers-ime.test.tsx
  • src/renderer/src/components/terminal-pane/keyboard-handlers.test.ts
  • src/renderer/src/components/terminal-pane/keyboard-handlers.ts
  • src/renderer/src/components/terminal-pane/parked-terminal-byte-watcher.ts
  • src/renderer/src/components/terminal-pane/pty-connection-startup-command-delivery.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection-types.ts
  • src/renderer/src/components/terminal-pane/pty-connection/deferred-cold-restore-and-snapshot.ts
  • src/renderer/src/components/terminal-pane/pty-connection/e2e-terminal-pty-harness.ts
  • src/renderer/src/components/terminal-pane/pty-connection/hidden-output-snapshot-serialize.ts
  • src/renderer/src/components/terminal-pane/pty-connection/park-reveal-snapshot-verdict.ts
  • src/renderer/src/components/terminal-pane/pty-connection/reattach-payload-context.ts
  • src/renderer/src/components/terminal-pane/pty-connection/reattach-result-handler.ts
  • src/renderer/src/components/terminal-pane/pty-connection/sleeping-record-access.ts
  • src/renderer/src/components/terminal-pane/pty-connection/transport-output-callbacks.ts
  • src/renderer/src/components/terminal-pane/pty-side-effect-pending-census.test.ts
  • src/renderer/src/components/terminal-pane/pty-transport-eager-buffer-replay.test.ts
  • src/renderer/src/components/terminal-pane/pty-transport-handler-suspension.test.ts
  • src/renderer/src/components/terminal-pane/pty-transport-output-side-effects.test.ts
  • src/renderer/src/components/terminal-pane/pty-transport-types.ts
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/renderer/src/components/terminal-pane/remote-park-reveal-unverifiable-retry.test.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-input-journal.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-input-fallback.test.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-resubscribe-failure-recovery-routing.test.ts
  • src/renderer/src/components/terminal-pane/terminal-agent-paste-bracketing.test.ts
  • src/renderer/src/components/terminal-pane/terminal-appearance.ts
  • src/renderer/src/components/terminal-pane/terminal-captured-input-dispatch.test.ts
  • src/renderer/src/components/terminal-pane/terminal-captured-input-dispatch.ts
  • src/renderer/src/components/terminal-pane/terminal-clipboard-paste.ts
  • src/renderer/src/components/terminal-pane/terminal-drop-path-writer.ts
  • src/renderer/src/components/terminal-pane/terminal-drop-target.ts
  • src/renderer/src/components/terminal-pane/terminal-drop-transport-owner.ts
  • src/renderer/src/components/terminal-pane/terminal-ime-composition-route.test.ts
  • src/renderer/src/components/terminal-pane/terminal-ime-composition-route.ts
  • src/renderer/src/components/terminal-pane/terminal-ime-deferred-newline.test.ts
  • src/renderer/src/components/terminal-pane/terminal-ime-user-input-provenance.test.ts
  • src/renderer/src/components/terminal-pane/terminal-keyboard-action-dispatch.ts
  • src/renderer/src/components/terminal-pane/terminal-keyboard-dependencies.ts
  • src/renderer/src/components/terminal-pane/terminal-keyboard-runtime.ts
  • src/renderer/src/components/terminal-pane/terminal-mode-2031-replies.ts
  • src/renderer/src/components/terminal-pane/terminal-native-file-drop-destination.ts
  • src/renderer/src/components/terminal-pane/terminal-native-file-drop.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-element-file-drop.test.tsx
  • src/renderer/src/components/terminal-pane/terminal-pane-lifecycle-primitives.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-lifecycle-types.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-menu-paste.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-paste-dispatch.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-paste-execution.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.test.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-split-with-inherited-cwd.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-split-writer-paths.test.ts
  • src/renderer/src/components/terminal-pane/terminal-paste-chunks.ts
  • src/renderer/src/components/terminal-pane/terminal-paste-coordinator.test.ts
  • src/renderer/src/components/terminal-pane/terminal-paste-coordinator.ts
  • src/renderer/src/components/terminal-pane/terminal-paste-executor-default-yield.test.ts
  • src/renderer/src/components/terminal-pane/terminal-paste-multiline-policy.test.ts
  • src/renderer/src/components/terminal-pane/terminal-paste-operation-order.test.ts
  • src/renderer/src/components/terminal-pane/terminal-programmatic-text-paste.test.ts
  • src/renderer/src/components/terminal-pane/terminal-programmatic-text-paste.ts
  • src/renderer/src/components/terminal-pane/terminal-pty-paste-writer.ts
  • src/renderer/src/components/terminal-pane/terminal-shutdown-layout-capture.ts
  • src/renderer/src/components/terminal-pane/terminal-startup-command-paste.ts
  • src/renderer/src/components/terminal-pane/terminal-title-tracker-parity.test.ts
  • src/renderer/src/components/terminal-pane/use-mobile-overlay-ticks.perf.test.tsx
  • src/renderer/src/components/terminal-pane/use-mobile-overlay-ticks.ts
  • src/renderer/src/components/terminal-pane/use-terminal-context-menu-trigger.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-context-menu.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-file-drop-owner.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-foundation.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-global-effects-paste-events.test.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-global-effects.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-global-listeners.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.test.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-split-actions.ts
  • src/renderer/src/lib/activate-ai-vault-structured-session-host.test.ts
  • src/renderer/src/lib/activate-ai-vault-structured-session.ts
  • src/renderer/src/lib/agent-status.test.ts
  • src/renderer/src/lib/launch-agent-structured-chat-guard.test.ts
  • src/renderer/src/lib/new-agent-prompt-outcome.test.ts
  • src/renderer/src/lib/structured-agent-session-launch-after-failure.test.ts
  • src/renderer/src/lib/structured-agent-session-launch-cancellation.test.ts
  • src/renderer/src/lib/structured-agent-session-launch-close-race.test.ts
  • src/renderer/src/lib/structured-agent-session-launch-different-request.test.ts
  • src/renderer/src/lib/structured-agent-session-launch-exited-owner.test.ts
  • src/renderer/src/lib/structured-agent-session-launch-join-delivery.test.ts
  • src/renderer/src/lib/structured-agent-session-launch-options.test.ts
  • src/renderer/src/lib/structured-agent-session-launch-registered-agent.test.ts
  • src/renderer/src/lib/structured-agent-session-launch-reload.test.ts
  • src/renderer/src/lib/structured-agent-session-launch-resume-identity.test.ts
  • src/renderer/src/lib/structured-agent-session-launch-unconfirmed-or-retried.test.ts
  • src/renderer/src/lib/structured-agent-session-launch.test.ts
  • src/renderer/src/lib/structured-agent-session-new-chat-own-launch.test.ts
  • src/renderer/src/runtime/local-structured-session-empty-worktree-visibility.test.ts
  • src/renderer/src/runtime/local-structured-session-retired-epoch-repair.test.ts
  • src/renderer/src/runtime/local-structured-session-reveal-visibility.test.ts
  • src/renderer/src/runtime/local-structured-session-tabs-host-isolation.test.ts
  • src/renderer/src/runtime/local-structured-session-tabs-sync.test.ts
  • src/renderer/src/runtime/local-structured-session-tabs-sync.ts
  • src/renderer/src/runtime/local-structured-session-unverifiable-inventory.test.ts
  • src/renderer/src/runtime/remote-runtime-snapshot-outcome.test.ts
  • src/renderer/src/runtime/remote-runtime-terminal-frame-drop-resync.test.ts
  • src/renderer/src/runtime/remote-runtime-terminal-multiplexer.ts
  • src/renderer/src/runtime/remote-runtime-terminal-snapshot-kitty-flags.test.ts
  • src/renderer/src/runtime/remote-runtime-terminal-stale-stream-frames.test.ts
  • src/renderer/src/runtime/remote-runtime-terminal-stall-recovery.test.ts
  • src/renderer/src/runtime/structured-session-tab-inventory.test.ts
  • src/renderer/src/runtime/structured-session-tab-inventory.ts
  • src/renderer/src/store/slices/runtime-pane-title-sort-epoch.test.ts
  • src/renderer/src/store/slices/store-session-terminal-reconnect.test.ts
  • src/renderer/src/store/slices/terminal-tab-id-hydration.test.ts
  • src/renderer/src/store/slices/terminal-tab-title-batch.test.ts
  • src/renderer/src/store/slices/terminals-explicit-empty-hydration.test.ts
  • src/renderer/src/store/slices/terminals-hydration-canonical-pty-overlap.test.ts
  • src/renderer/src/store/slices/terminals-hydration-canonical-rows.test.ts
  • src/renderer/src/store/slices/terminals-hydration.test.ts
  • src/renderer/src/store/terminals/terminal-pane-hibernation.ts
  • src/renderer/src/store/terminals/terminal-shutdown-guards-identity.test.ts
  • src/renderer/src/store/terminals/terminal-shutdown-guards.ts
  • tests/e2e/structured-session-reopened-tab-close.unit.test.ts
  • tests/e2e/structured-session-tab-close-stale-frame.unit.test.ts
  • tests/e2e/terminal-binding-crash-hydration.unit.test.ts

💤 Files with no reviewable changes (7)
  • src/renderer/src/components/terminal-pane/keyboard-handlers.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts
  • src/renderer/src/components/terminal-pane/pty-transport.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-input-fallback.test.ts
  • src/renderer/src/runtime/local-structured-session-tabs-sync.ts
  • src/renderer/src/components/terminal-pane/terminal-paste-coordinator.ts
  • src/renderer/src/runtime/remote-runtime-terminal-multiplexer.ts

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



📝 Walkthrough

Walkthrough

The change updates imports across terminal, remote-runtime, keyboard, paste, lifecycle, and structured-session code to target dedicated modules. It also removes re-exports from the keyboard, PTY transport, terminal paste coordinator, lifecycle hook, structured-session sync, and remote terminal multiplexer modules. The summaries report no runtime behavior changes.


Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 4ec49

The changes are reported to leave terminal, paste, keyboard, remote-runtime, and structured-session behavior unchanged. No concrete user-facing merge risk was established.

Pre-merge checks | Passed 4 | Inconclusive 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage Inconclusive 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 3 functions across 50 files. (79 skipped: … 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 identifies the main change: removing the keyboard-handlers barrel and related re-export shims.
Description check Passed The description is complete and aligned with the template. It explains the change, rationale, testing, lack of user-visible impact, review scope, and checklist status. The N/A issue note is justified …
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 3 functions across 50 files. (79 skipped: 79 over the file limit.)


✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • 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.

@OrcaWin
OrcaWin merged commit 61aaa98 into main Oct 12, 2026
46 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.

1 participant