Skip to content

Phase 11 - Refactoring: UI Actor creation#187

Draft
lorenzoberts wants to merge 6 commits into
lorenzo/actor-refactor-phase-10from
lorenzo/actor-refactor-phase-11
Draft

Phase 11 - Refactoring: UI Actor creation#187
lorenzoberts wants to merge 6 commits into
lorenzo/actor-refactor-phase-10from
lorenzo/actor-refactor-phase-11

Conversation

@lorenzoberts

Copy link
Copy Markdown
Collaborator

No description provided.

This commit introduces the paint-ready data model for the UI actor boundary.
UiScene and its per-screen scene types describe what the terminal painter needs
for one frame, without embedding Ratatui or application state. UiError and
UiTheme complete the actor scaffold alongside the existing terminal and input
protocols.

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

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit moves popup state and scroll bounds into an owned AppPopup enum in
the application layer, replacing the self-rendering PopUp trait object in
AppState. The UI layer now paints popups by matching on AppPopup variants
instead of dispatching through dynamic objects, keeping popup data on the app
side of the UI boundary.

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

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit replaces the thin AppState reference wrapper with an owned
AppViewModel that carries a per-screen ScreenViewModel discriminant and an
optional PopupViewModel. Projection from AppState is centralized so UI modules
receive only the data their screen needs, and cross-cutting display values are
pre-computed before rendering.

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

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
…subdirectory

This commit splits UI presentation into composition and painting. UiCore turns
an AppViewModel into a UiScene; the painter maps that scene onto a Ratatui
frame without making layout or widget decisions. Screen modules move under
ui/screens/, each exposing scene building and paint entry points, so the
two-stage ViewModel → Scene → terminal draw pipeline is explicit in the module
structure.

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

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
…Snapshot to UiScene

This commit narrows the terminal actor boundary to drawing pre-composed UI
scenes. TerminalFrame::Main now carries a UiScene instead of an application
render snapshot, and the terminal session paints directly through the UI
painter. AppRenderSnapshot and the inline draw path inside the terminal layer
are removed so scene composition stays entirely on the UI side.

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

Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit promotes the UI layer to a dedicated actor with UiMessage,
UiHandle, and a BuildScene request path. run_app now projects application state
into a view model and asks the UI actor to build each frame's scene before
handing it to the terminal actor, matching the spawn-and-shutdown lifecycle
already used by the terminal and input actors.

This commit completes the architecture's refactoring phase 11.

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