Skip to content

Decompose render: toasts and resource indicator as isolated View<T> #205

Description

@MasonRhodesDev

Context

Render architecture audit from #203. Both the toast layer and the resource indicator are high-frequency but completely self-contained UI sections that currently live as inline helpers on AnotherOneApp. Because they share the parent's render lifecycle, any unrelated state change causes them to re-render unnecessarily.

Toast layer

Fields today on AnotherOneApp: toasts, next_toast_id, toast_drag, copied_toast, pasted_image_preview.

Zero dependencies on any other app state. During toast animations the render tick runs at 16ms — this currently re-renders the entire app. As View<ToastController> only the toast layer repaints during animations.

Resource indicator

Fields today on AnotherOneApp: resource_indicator_open, last_resource_usage_refresh, resource_collapsed_nodes. Reads registry_state for usage data.

3 fields, all specific to this panel. Updates at 1–5s cadence.

What to do

  1. Extract toast fields into struct ToastController implementing Render. Store as Entity<ToastController> on app. Pass toast mutations via the existing app-action pattern or a small dedicated channel.
  2. Extract resource indicator fields into struct ResourcePanel implementing Render. Store as Entity<ResourcePanel> on app. Push a ResourceSnapshot from the drain tick when usage data changes.
  3. Neither requires a snapshot design — both have fully local state with no project_store dependency.

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