Skip to content

refactor(desktop): make AppShell a renderer composition root #3439

Description

@chihumyum

Problem

The previous AppShell governance work improved file-level separation, but
AppShell remains the default owner of renderer state, environment IO,
subscriptions, feature lifecycles, and prop assembly.

After the Workbar extraction, app-shell.tsx is still 3,230 lines with
105 imports and 21 direct window.maka references. The wider
app-shell* / use-app-shell* family contains 30 files and 8,942 lines.

This is not a line-count target. The problem is ownership and dependency
direction.

Desired boundary

AppShell may own:

  • root providers and error boundaries;
  • top-level location and frame composition;
  • composition of feature public APIs;
  • explicit cross-feature intent wiring.

AppShell must not own:

  • feature reducers or persistence;
  • feature-specific subscriptions or environment IO;
  • transcript, submission, Goal, Workbar, or dynamic-resource lifecycles;
  • tool-specific view-model construction.

Proposed direction

Use the Workbar model / controller / ui / ports / desktop adapter / testing boundary as the reference for the remaining renderer slices.

Invariants

No product, visual, IPC, storage-schema, copy, or shortcut changes.
Composer mount semantics, bootstrap behavior, streaming isolation,
Session-switch races, and Workbar resource lifecycles must remain compatible.

Non-goals

  • No new global state library or service locator
  • No IPC redesign
  • No packages/ui extraction
  • No mechanical movement of every large renderer file into features/

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions