Skip to content

Phase 8 - Refactoring: Terminal and Input actor setup #184

Draft
lorenzoberts wants to merge 9 commits into
lorenzo/actor-refactor-phase-7from
lorenzo/actor-refactor-phase-8
Draft

Phase 8 - Refactoring: Terminal and Input actor setup #184
lorenzoberts wants to merge 9 commits into
lorenzo/actor-refactor-phase-7from
lorenzo/actor-refactor-phase-8

Conversation

@lorenzoberts

Copy link
Copy Markdown
Collaborator

No description provided.

This commit introduces the initial input protocol types for the Phase 8
refactor. It defines raw terminal events, semantic input events, input context,
key binding timing, and a mapper that translates terminal input into application
intent while preserving current screen-specific bindings.

It also adds mapper coverage for popup handling, edit mode, function keys,
release filtering, resize and tick events, details modifiers, and the gg chord.

This commit is part of the architecture's refactoring phase 8.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit moves crossterm event reading behind the input protocol boundary.
The new terminal event source converts raw crossterm events into TerminalEvent
values, filters key release events, and preserves key state so the existing
handler flow can continue to receive KeyEvent during the transition.

It also adds coverage for key conversion, release filtering, resize events, and
ignored terminal events.

This commit is part of the architecture's refactoring phase 8.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit moves the lazy screen update logic out of the handler loop and into
App::process_system_updates. The main loop still preserves the existing input
dispatch behavior, but non-input updates such as initial mailing list loading,
latest patchset loading, and empty bookmark fallback now live behind an App
boundary.

It also adds App::input_context as the state projection that will feed the
input mapper once the remaining handlers consume semantic InputEvent values.

This commit is part of the architecture's refactoring phase 8.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit updates the popup input boundary to consume semantic InputEvent
values instead of raw crossterm KeyEvent values. Help, info, and review trailer
popups now handle navigation through the shared input protocol while preserving
the existing popup scroll behavior.

It also adds a temporary raw-key bridge in the handler loop so popup input can
move to InputEvent before the screen handlers are migrated.

This commit is part of the architecture's refactoring phase 8.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit updates the mailing list, bookmarked patchsets, and edit config
handlers to consume semantic InputEvent values instead of raw crossterm
KeyEvent values. The existing handler loop now uses the input mapper for these
screens while preserving the current behavior and leaving the more complex
latest and details screens on the temporary raw-key path.

This commit is part of the architecture's refactoring phase 8.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit updates the latest patchsets handler to consume semantic InputEvent
values instead of raw crossterm KeyEvent values. The handler loop now routes the
latest screen through the input mapper while preserving existing navigation,
pagination, loading, and patchset error handling behavior.

This commit is part of the architecture's refactoring phase 8.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit updates the patchset details handler to consume semantic InputEvent
values instead of raw crossterm KeyEvent values. Details-specific input such as
preview scrolling, panning, toggles, modifiers, review trailers, and action
consolidation now flows through the shared input protocol.

It also removes the nested gg key polling from the handler, relying on the
stateful input mapper instead, and moves the post-user-IO Enter wait behind the
terminal event source boundary.

This commit is part of the architecture's refactoring phase 8.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit updates the main handler loop to translate TerminalEvent values
into semantic InputEvent values before dispatching to popups or screen handlers.
The old raw-key bridge is removed, so run_app now uses the input context and
mapper as the single path between terminal events and application input
handling.

It also removes the temporary KeyEvent reconstruction helper from KeyInput now
that handlers no longer consume raw crossterm input.

This commit is part of the architecture's refactoring phase 8.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit removes transitional input helpers that are no longer needed after
the main loop was wired through InputEvent. Test-only constructors are limited
to test builds, KeyInput no longer preserves unused crossterm key state, and
the input module now documents the actor-free protocol boundary introduced in
Phase 8.

It also adjusts App::input_context to satisfy the repository clippy rules.

This commit completes the architecture's refactoring phase 8.

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
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