You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(renderer): remove the keyboard-handlers barrel and partial re-exports - #27986
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)
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 | 4 | 1
❌ Failed checks (1 inconclusive)
Check name
Status
Explanation
Resolution
Docstring Coverage
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
The title clearly identifies the main change: removing the keyboard-handlers barrel and related re-export shims.
Description check
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsandruntime/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.
pty-dispatcher,pty-output-processor,pty-transport-types,terminal-paste-limits/-executor/-chunks/-model, the lifecycle primitives,remote-runtime-terminal-snapshot-state, and thelocal-structured-session-tabs-sync/*modules, now import from those modules. The five modules keep all their own exports.await import()destructures are split per defining module. A test that dynamically imported./pty-transportforregisterEagerPtyBuffernow imports./pty-dispatcher. Two structured-launch tests stopped mockinglocal-structured-session-ownerwith 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/runtimeplus every other changed test file: 820 files and 7380 tests pass.pnpm tc,pnpm lintandpnpm 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
Notes
Renderer-only import changes. SSH, wire, mobile and platforms are not affected.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)