Phase 4 - Refactoring: Simplifying App#180
Open
lorenzoberts wants to merge 7 commits into
Open
Conversation
This commit renames MailingListSelection, LatestPatchsets, DetailsActions, EditConfig, and BookmarkedPatchsets to *State types to clarify they hold UI screen state. This commit is part of the architecture's refactoring phase 4. Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit introduces AppState (navigation, lore UI, user lore, config UI, config, popup) and AppServices (lore, shell, fs, env). It also moves check_external_deps to main.rs. This commit is part of the architecture's refactoring phase 4. Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit introduces render/trait.rs with RenderError and a mockable RenderServiceApi. ShellRenderService wraps Arc<dyn ShellTrait> and reuses app cover/patch renderer helpers plus split_cover for parity with the details screen. This commit is part of the architecture's refactoring phase 4. Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commit adds render to AppServices and pass ShellRenderService from main (sharing shell Arc with LoreService). Besides that, init_details_actions delegates preview strings to render_patchset_preview; It also emoves direct cover/patch render calls from App. This commit is part of the architecture's refactoring phase 4. Signed-off-by: lorenzoberts <lorenzobs@usp.br>
…fig flow This commit replaces per-field Ok chains with a single draft + apply path. Also avoids mutating the buffer during consolidation. This commit is part of the architecture's refactoring phase 4. Signed-off-by: lorenzoberts <lorenzobs@usp.br>
This commmit splits consolidate_patchset_actions into sync_patchset_bookmark, execute_reviewed_reply, and execute_apply_patchset so bookmark sync, reviewed reply, and apply are separate steps. It also adds commands with PatchsetCommand and placeholder AppCommand for a future App actor protocol. This commit is part of the architecture's refactoring phase 4. Signed-off-by: lorenzoberts <lorenzobs@usp.br>
Thi commit introduces AppViewModel as a read-only view of AppState, App::to_view_model, and switch draw_ui and screen render helpers to take &AppViewModel so the UI layer does not depend on the orchestrator struct. It tighten lifetimes on footer Span return types where they borrow state. This commit is part of the architecture's refactoring phase 4. Signed-off-by: lorenzoberts <lorenzobs@usp.br>
lorenzoberts
marked this pull request as ready for review
May 2, 2026 18:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Decompose the monolithic App struct into explicit state containers and remove infrastructure coupling, so the app layer is ready to become an actor. Screens should hold UI state, services should hold dependencies, and the UI layer should not need to import the orchestrator directly.
What this PR does
Renames screen structs to *State suffix (MailingListSelectionState, LatestPatchsetsState, etc.) and splits App into AppState (navigation, lore UI, user lore, config UI, popup) and AppServices (lore, shell, fs, env, render). check_external_deps moves to main.rs startup.
Introduces RenderServiceApi with ShellRenderService for patchset preview, ConfigUpdateDraft/apply_update for the edit-config flow, and PatchsetCommand/AppCommand enums as scaffolding for a future App actor protocol. consolidate_patchset_actions splits into sync_patchset_bookmark, execute_reviewed_reply, and execute_apply_patchset.
Adds AppViewModel as a read-only view of AppState — draw_ui and all screen render helpers take AppViewModel instead of App, breaking the app ↔ ui import cycle. Runtime behavior is unchanged.