Repository navigation
Description
Problem
Opening an archived chat briefly paints the active chat layout (composer / editable chrome), then swaps to the archived layout (ArchivedBanner + read-only chrome). The flash is visible on every open from the sidebar's archived section.
Current behaviour
- Expand Archived in the chat history sidebar and click an archived thread.
- The main pane first renders as a normal (active) chat — composer visible, archived affordances absent.
- After
getThreadStatusresolves, the footer swaps to the archived banner and interaction is disabled.
Likely cause: ThreadGate intentionally renders ChatInterface while threadStatus is still undefined (to avoid a skeleton flash on thread→thread switches). ChatInterface treats that loading state as not-archived (isArchived = threadStatus === 'archived'), so the active footer paints first, then flips when status arrives as 'archived'.
Code pointers
services/platform/app/routes/dashboard/$id/chat.tsx—ThreadGate: whenthreadStatus === undefined, callsrenderInterface()without a statusservices/platform/app/features/chat/components/chat-interface.tsx—isArchived = threadStatus === 'archived'; footer branches composer vsArchivedBannerservices/platform/app/features/chat/components/chat-interface/archived-banner.tsx— archived footer- Sidebar already knows archive status when the click happens (
chat-history-sidebar.tsxpassesisArchivedintoChatActions)
Related (not duplicates): closed #2544 (sidebar skeleton layout shift), closed #1290 (archived threads visibility).
Proposed change
Don't paint the active composer for a thread that is known (or about to resolve) as archived. Prefer one of:
- Seed
threadStatusfrom the sidebar / threads list when navigating from an archived row, or - Hold the previous footer / a neutral placeholder until
getThreadStatusresolves when the open target is archived, without reintroducing the full-interface skeleton flicker thatThreadGate's optimistic path was meant to fix.
Acceptance criteria
- Opening an archived chat from the sidebar never briefly shows the active composer
- Active → archived thread switches still avoid a full chat-interface skeleton flash
- Unarchive still restores the composer without a reverse flicker
- Deep-linking directly to an archived thread URL also avoids the active-layout flash
Activity