Skip to content

P1010: derive history Vim scrolling from arrow identities - #1367

Merged
trissim merged 1 commit into
mainfrom
work/commander-screen--P1010--toad
Oct 30, 2026
Merged

trissim merged 1 commit into
mainfrom
work/commander-screen--P1010--toad

Conversation

@trissim

@trissim trissim commented Oct 30, 2026

Copy link
Copy Markdown

Summary

1 commit, 2 files, +1/-3. Delete HistoryWindow's two hand-written Vim direction letters and advance the existing Textual lock from bea0d377 to main 832b0f6d. Textual #213 is already merged (head bdfff5f63acd430264d2a705efd99f2057c619b9, merge c12f573a16ba59b1d75e22ef3593222903ef56d0); #214 adds the shared native-text-key capability at 832b0f6d. This is P1010's Toad companion, not a second implementation of the Textual change.

Before / after

Before: HistoryWindow(NativeMethodKeys, WorkspaceHosted, MroProjection, VerticalScroll) declared j/k locally at history_anchor.py:644–645, beside its inherited up/down bindings. The two independently editable copies restated the arrow spelling declared by Textual's NavigationKey members.

After: the same class and the same action_scroll_up/action_scroll_down overrides remain. VerticalScroll's arrow bindings project through EditingMode/VimMode and NavigationKey, so Vim gets j/k from the arrow identities and Standard does not. HistoryWindow's lazy-boundary preparation remains in those existing action overrides. Its unrelated ctrl+d, ctrl+u and G bindings are unchanged. No wrapper, new state, fallback, event rewrite or compatibility path.

Deleted: two ModeBinding lines in src/toad/widgets/history_anchor.py. Lock change: one line replaced in uv.lock. No edits to keymap.py, question_actions.py, permissions.py or terminal.py; Toad #1338 owns the first three, #1366 owns the Terminal correction. Pair this with #1366 before claiming full text-entry safety or installing the completed navigation workflow.

Slop: MEMB-3; fact = Vim spelling of a vertical arrow; at = history_anchor.py:644–645 before this commit; derive = subclass/base-method; by = Textual NavigationKey members, VimMode.navigation_spellings, Binding.for_mode and inherited VerticalScroll bindings. Paper1 Theorems 4.6/4.7: another widget spelling is outside supply; the arrow declaration supplies it without that copy.

Source evidence

NRA's existing Package/Repository parsed current Textual main 832b0f6d (257 production modules) and Toad main 35770a0 (308 production modules), with zero parse omissions. Retained map enumerates relevant declarations, imports, bases, writes, decisions and consumers. HistoryWindow retains NativeMethodKeys and VerticalScroll; NativeMethodKeys.method_key_owners returns its actual MRO, so the inherited native declarations are retained rather than replaced by the deleted aliases. The existing HistoryWindow scroll overrides still call _scroll_or_prepare before super(). Dynamic aliases, monkeypatches and downstream third-party widgets are not statically proved. No full NRA gate ran locally.

The remaining paired-main copied-letter search currently finds HistoryWindow's two lines and the two question_actions.py definitions owned by #1338. This PR removes the former; it does not pretend the latter disappeared before #1338 lands. Whole-pair zero-copy and live acceptance remain integration work.

Verification and scope

Assumed:

HistoryWindow had up/down arrows and still kept a handwritten j/k address book. Two entries deleted; the arrows remember their own names.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 13:59

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@trissim
trissim enabled auto-merge October 30, 2026 14:00
@trissim
trissim merged commit 8549d15 into main Oct 30, 2026
2 of 3 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.

2 participants