Skip to content

Decompose render: modal views with snapshot-based project_store reads #206

Description

@MasonRhodesDev

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:

  1. Define an immutable FooModalSnapshot capturing the project_store data it needs (branch list, agent list, issue cache, etc.).
  2. Lift the Option<FooModalState> fields into a struct FooModal implementing Render, holding the snapshot plus local draft state (text inputs, selections, validation errors).
  3. Store as Entity<FooModal> on app (present when open, replaced when closed, or kept and shown/hidden via a flag).
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions