Context
Render architecture audit from #203. The four modal factories (new task, add agent, create branch, custom action) are currently stored as Option<ModalState> fields on AnotherOneApp and rendered inline. They read project_store for branch lists, agent lists, and issue discovery caches.
What to do
For each modal:
- Define an immutable
FooModalSnapshot capturing the project_store data it needs (branch list, agent list, issue cache, etc.).
- Lift the
Option<FooModalState> fields into a struct FooModal implementing Render, holding the snapshot plus local draft state (text inputs, selections, validation errors).
- Store as
Entity<FooModal> on app (present when open, replaced when closed, or kept and shown/hidden via a flag).
- Compute and push a fresh snapshot only when the modal is open and its backing data changes.
Why
Modals are shown infrequently but have complex render trees (branch dropdowns, agent lists, issue pickers). As inline helpers they re-render on every tick while open. As isolated View<T> entities they only re-render when their own state (user input, snapshot update) changes.
The Option<State> pattern already exists — this migration adds the Entity<T> wrapper and snapshot boundary without changing modal logic.
Context
Render architecture audit from #203. The four modal factories (new task, add agent, create branch, custom action) are currently stored as
Option<ModalState>fields onAnotherOneAppand rendered inline. They readproject_storefor branch lists, agent lists, and issue discovery caches.What to do
For each modal:
FooModalSnapshotcapturing theproject_storedata it needs (branch list, agent list, issue cache, etc.).Option<FooModalState>fields into astruct FooModalimplementingRender, holding the snapshot plus local draft state (text inputs, selections, validation errors).Entity<FooModal>on app (present when open, replaced when closed, or kept and shown/hidden via a flag).Why
Modals are shown infrequently but have complex render trees (branch dropdowns, agent lists, issue pickers). As inline helpers they re-render on every tick while open. As isolated
View<T>entities they only re-render when their own state (user input, snapshot update) changes.The
Option<State>pattern already exists — this migration adds theEntity<T>wrapper and snapshot boundary without changing modal logic.