Skip to content

refactor(flterm): separate controller and view responsibilities - #143

Merged
elias8 merged 1 commit into
mainfrom
refactor/flterm-controller-view-boundary
Aug 14, 2026
Merged

refactor(flterm): separate controller and view responsibilities#143
elias8 merged 1 commit into
mainfrom
refactor/flterm-controller-view-boundary

Conversation

@elias8

@elias8 elias8 commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Separate terminal-session behavior from Flutter view state so TerminalController owns libghostty state, geometry, selection, and backend callbacks while TerminalView owns focus, text input, scrolling, gestures, and rendering lifecycle.

  • Keep TerminalController as an abstract contract for application-level test doubles; move focus and soft-keyboard control to TerminalView, make callbacks setter-only, stop exporting KeyboardState and TerminalScrollPosition, and reject concurrent view attachments.
  • Route measured geometry through one controller-owned transaction, emit in-band resize output before backend onResize, and keep terminal, mouse, and selection geometry synchronized.
  • Harden input and lifecycle handling across AltGr, IME newline/deletion pairing, lock modifiers, mouse and stylus button transitions, gesture ownership, controller swaps, and font-data changes, with focused coverage for each behavior.

Supersedes #119

@elias8 elias8 added pkg:flterm Flutter terminal widget package refactor Code restructuring without behavior change labels Aug 13, 2026
@elias8
elias8 force-pushed the refactor/flterm-controller-view-boundary branch 2 times, most recently from 8663478 to a966c28 Compare August 14, 2026 13:42
@elias8
elias8 force-pushed the refactor/flterm-controller-view-boundary branch from a966c28 to bf6ea62 Compare August 14, 2026 13:55
@elias8 elias8 added the breaking Contains breaking API changes label Aug 14, 2026
@elias8 elias8 changed the title refactor(flterm): establish controller and view boundaries refactor(flterm): separate controller and view responsibilities Aug 14, 2026
@elias8
elias8 merged commit e4f31cf into main Aug 14, 2026
21 checks passed
@elias8
elias8 deleted the refactor/flterm-controller-view-boundary branch August 14, 2026 14:43
elias8 added a commit that referenced this pull request Aug 14, 2026
…es (#144)

Follow-up to #143.

Refine flterm’s internal architecture around clearer ownership
boundaries and consistent domain-oriented naming. The matching source,
tests, and benchmark references now follow those boundaries while
preserving terminal behavior and controller/view lifecycle contracts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Contains breaking API changes pkg:flterm Flutter terminal widget package refactor Code restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant