Skip to content

[frontend] P2: composer busy-state cutover incomplete — dead legacy computation every render + non-reactive getState() read #219

Description

@Interstellar-code

Problem

The Phase 2.2 composer-busy cutover (chat-store.ts:206-234 comments) was never finished:

  1. chat-screen.tsx:1646isComposerLoadingLegacy = isChatRuntimeBusy({...}) computes the legacy 6-signal composition on every render and is never read (grep: declaration only). Dead CPU + reader confusion.
  2. chat-screen.tsx:1654isComposerLoading = useChatStore.getState().selectIsComposerBusy(...) reads through .getState(), which does not subscribe. When runPhase/waiting state changes without another render trigger, the composer's enabled/disabled state can go stale — correctness currently depends on incidental re-renders.
  3. chat-screen.tsx:585 — stale comment "Feature flag (default OFF): swap in the drop-in shadcn composer" — ChatComposerShadcn is rendered unconditionally (:3261), old composer no longer imported. Remove comment; delete old composer file if fully unreferenced.

Fix

Delete isComposerLoadingLegacy (and the isChatRuntimeBusy import if unused elsewhere); convert the busy read into a reactive selector useChatStore(s => s.selectIsComposerBusy(...)) or subscribe to the underlying slices. Clean up the stale flag comment + dead composer file.

Found in chat-area audit 2026-06-11.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions