-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Feature]: Harden Control UI Lit lifecycle boundaries #102423
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.enhancementNew feature or requestNew feature or requestimpact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.User-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maintainerMaintainer-authored PRMaintainer-authored PR
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.enhancementNew feature or requestNew feature or requestimpact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.User-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.maintainerMaintainer-authored PRMaintainer-authored PR
Type
Fields
Priority
None yet
Summary
Harden the Control UI's Lit lifecycle boundaries around external subscriptions, post-render work, routing, localization, and chat persistence.
Problem to solve
The Control UI already uses Lit 3, but many elements still manage store subscriptions with paired fields and
connectedCallback/updated/disconnectedCallbackbookkeeping. The repeated lifecycle code has produced concrete ordering gaps: late context requires retrying subscription setup fromupdated(), locale changes do not invalidate every mounted element, router pending/not-found work can survive a disconnect, and chat commit/scroll/persistence effects can run after their owning pane is gone or before state is actually rendered.Proposed solution
ReactiveControllerfor lazy external-source subscriptions, including late source arrival and source replacement.Alternatives considered
Impact
Affected: Control UI users and maintainers.
Severity: medium. Most failures are edge cases around reconnects, route changes, locale changes, final chat updates, or immediate navigation after typing.
Frequency: lifecycle-dependent and intermittent.
Consequence: stale UI, missed post-render updates, incorrect pending navigation behavior, or a draft not being flushed when a chat pane disconnects. The shared controller boundaries also remove substantial repeated cleanup code and make future UI changes safer.
Evidence/examples
ui/src/app/app-host.tsretries an eight-subscription setup fromupdated()because context/runtime may arrive late.ui/src/components/app-sidebar.ts,ui/src/pages/sessions/sessions-page.ts, andui/src/pages/workboard/workboard-page.tsrepeat the same pattern.ui/src/app/router-outlet.tsretains pending state across AsyncDirective disconnect/reconnect and queues an unguarded not-found microtask.ui/src/pages/chat/chat-state.tsregisters composer persistence after the outer controller but clears the shared state first during disconnect.ui/src/pages/chat/scroll.tsmutates rendered indicator state after commit without invalidating and does not cancel every frame/retry on teardown.Additional information
This is a maintainer-requested modernization slice. It intentionally preserves public behavior, the current ApplicationContext capability contracts, and the existing Lit decorator mode.