Context
Render architecture audit from #203. The titlebar/toolbar is the hardest decomposition target: it reads 4+ cross-cutting fields from different subsystems and has no clean snapshot boundary today.
Current cross-cutting reads
- Active section id — lives in
workspace_pane (already an Entity<T>)
project_store — active project, current branch, PR status
active_git_actions — in-progress git action state (mutated by drain loop)
project_pull_requests — PR metadata map (populated by background lookup)
custom_actions_menu_open, settings_open — local boolean toggles
Why it's hard
Unlike the sidebar (one snapshot source: project_store), the titlebar aggregates live state from at least three independent subsystems. A naive TitlebarSnapshot would need to be recomputed whenever any of them changes, which is frequent.
What to do (design needed first)
- Audit the titlebar render path — map exactly which fields it reads per render and how frequently each changes. Some reads may be cacheable locally.
- Design a
TitlebarSnapshot — determine the minimal set of data needed. Consider whether workspace_pane.read(cx) inside a titlebar View<T> is sufficient to avoid copying active-section state, or whether a true snapshot is required.
- Prototype isolation — the titlebar's local interaction state (
custom_actions_menu_open, drag anchors, dropdowns) can move to the view immediately; the cross-cutting reads are the open question.
- Implement once the snapshot shape is settled.
File this as a follow-up after #204 (sidebar) and #205 (toasts/resource) land — lessons from those migrations will inform the design here.
Context
Render architecture audit from #203. The titlebar/toolbar is the hardest decomposition target: it reads 4+ cross-cutting fields from different subsystems and has no clean snapshot boundary today.
Current cross-cutting reads
workspace_pane(already anEntity<T>)project_store— active project, current branch, PR statusactive_git_actions— in-progress git action state (mutated by drain loop)project_pull_requests— PR metadata map (populated by background lookup)custom_actions_menu_open,settings_open— local boolean togglesWhy it's hard
Unlike the sidebar (one snapshot source:
project_store), the titlebar aggregates live state from at least three independent subsystems. A naiveTitlebarSnapshotwould need to be recomputed whenever any of them changes, which is frequent.What to do (design needed first)
TitlebarSnapshot— determine the minimal set of data needed. Consider whetherworkspace_pane.read(cx)inside a titlebarView<T>is sufficient to avoid copying active-section state, or whether a true snapshot is required.custom_actions_menu_open, drag anchors, dropdowns) can move to the view immediately; the cross-cutting reads are the open question.File this as a follow-up after #204 (sidebar) and #205 (toasts/resource) land — lessons from those migrations will inform the design here.