Skip to content

Bug: Opening an archived chat flickers between active and archived layout #2658

Closed

Description

@yannickmonney

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

  1. Expand Archived in the chat history sidebar and click an archived thread.
  2. The main pane first renders as a normal (active) chat — composer visible, archived affordances absent.
  3. After getThreadStatus resolves, 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: when threadStatus === undefined, calls renderInterface() without a status
  • services/platform/app/features/chat/components/chat-interface.tsx — isArchived = threadStatus === 'archived'; footer branches composer vs ArchivedBanner
  • services/platform/app/features/chat/components/chat-interface/archived-banner.tsx — archived footer
  • Sidebar already knows archive status when the click happens (chat-history-sidebar.tsx passes isArchived into ChatActions)

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 threadStatus from the sidebar / threads list when navigating from an archived row, or
  • Hold the previous footer / a neutral placeholder until getThreadStatus resolves when the open target is archived, without reintroducing the full-interface skeleton flicker that ThreadGate'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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions