refactor(workstation): extract changelog local keymap into surfaces/changelog/input.ts - #1801
Conversation
…hangelog/input.ts Moves the contiguous activeView === 'changelog' keymap block (j/k/pgup/pgdn scroll, y/E/c/r workflow keys, loading-state swallow) out of inkInput.ts's router into a new handleChangelogInput handler, mirroring the surfaces/bisect extraction. Wired via a delegating call at the same precedence position. The changelog view's gg/G top/bottom jumps are intentionally left in place — they're nested inside the shared moveToTop/moveToBottom chord handlers alongside blame/file-history branches, not part of the contiguous block, and extracting them would require restructuring those shared handlers.
There was a problem hiding this comment.
🔎 Agent review (sonnet) — LGTM
REVIEW: LGTM
RESOLVES: full
Clean, verbatim extraction of the changelog local keymap into surfaces/changelog/input.ts, mirroring the bisect pattern exactly, with the gg/G exclusion correctly documented in both the code and the extracted module's docstring. All acceptance criteria are met: existing inkInput.test.ts changelog cases are unmodified, new direct unit tests cover the handler, and CI is green.
There was a problem hiding this comment.
🔎 Agent review (sonnet) — LGTM
REVIEW: LGTM
RESOLVES: full
Verbatim extraction of the changelog local keymap into surfaces/changelog/input.ts, wired at the same precedence slot as the bisect pattern; the gg/G exclusion is correctly left in place and clearly documented in both the module docstring and the inkInput.ts comment. Diff is scoped to exactly the 3 relevant files, new unit tests cover the handler in isolation, and jest (438 passed) plus eslint are clean.
There was a problem hiding this comment.
🔎 Agent review (sonnet) — LGTM
REVIEW: LGTM
RESOLVES: full
Clean, verbatim extraction of the changelog local keymap into surfaces/changelog/input.ts, wired at the correct router precedence and mirroring the existing bisect pattern exactly; the gg/G exclusion is explicitly documented in both the module docstring and the call-site comment as required. Diff is tightly scoped to the three relevant files, all changelog behavior is covered by both new isolation tests and unmodified router-level tests, and test:jest/lint pass locally.
…ct-changelog-local-keymap-into-surf # Conflicts: # src/workstation/runtime/inkInput.ts
There was a problem hiding this comment.
🔎 Agent re-review (sonnet, delta) — LGTM
REVIEW: LGTM
RESOLVES: full
The revise cleanly extracts the changelog local keymap into surfaces/changelog/input.ts verbatim, mirrors the bisect pattern, correctly documents (in both code comments and the delegation site) why the gg/G jumps stay in inkInput.ts, and all targeted tests plus lint pass with no errors.
What
Extracts the contiguous
activeView === 'changelog'local keymap block frominkInput.ts's router into a newsrc/workstation/surfaces/changelog/input.ts, exportinghandleChangelogInput(state, inputValue, key, context): LogInkInputEvent[] | null. Wired via a delegating call at the same precedence position (immediately after thehandleBisectInputdelegation, before the bare-gchord handler). Mirrors the existingsurfaces/bisect/input.tsextraction (#1625).Why
Plane: OSS-1062
Sub-item 2/4 of OSS-950 — continuing to slice view-scoped keymaps out of the monolithic
inkInput.tsrouter into per-surface modules.How
src/workstation/surfaces/changelog/input.ts: the changelog keymap block (j/k/pgup/pgdn scroll, arrow-key synonyms, y/E/c/r workflow keys, and the loading-state scroll-key swallow) moved verbatim, with areturn nullfall-through when nothing matches so the router continues.inkInput.ts: replaced the inline block with ahandleChangelogInput(...)delegation at the same precedence slot.gg/Gtop/bottom-jump special-cases ininkInput.ts. They live nested inside the sharedmoveToTop/moveToBottomchord handlers alongside theblame/file-historybranches — not part of the contiguous block being extracted — and pulling them out would require restructuring those shared handlers, which is out of scope for this change.src/workstation/surfaces/changelog/input.test.tswith direct unit coverage of the new handler (mirrorsbisect/input.test.ts), in addition to the existinginkInput.test.tschangelog cases which now exercise the delegation end-to-end.Testing
npx jest src/workstation/runtime/inkInput.test.ts(431 passed, unmodified) andnpx jest src/workstation/surfaces/changelog/input.test.ts(7 new, passed)npm run lint(0 errors, pre-existing warnings only, none in touched files)🤖 Generated by the harbor agent loop. Reviewed by a human before merge.