Skip to content

bug(platform): an archived chat opens with the message box, then the archived bar replaces it and every message moves #5403

Open

Description

@yannickmonney

Summary

When an archived chat opens, it first looks like an active chat: it has the message box and every message has its Edit and Fork buttons. It only switches to the archived layout when the chat's own summary read answers. That switch moves every message on screen:

  • the 130 px message box becomes the 61 px archived bar;
  • every message the reader wrote loses its Edit button and gets 12 px shorter;
  • the visible messages move down by 81 to 105 px.

It was reported on 2026-11-06 as "a layout shift when opening archived chats in chat". It is reproduced below on main d886f4e05 (v0.5.101). The same gate works the other way too: an active chat opened from an archived one shows the archived bar until its own summary answers.

What happens

The measurements below use a local production build in Chromium at 1440×900. An archived chat with 12 messages was opened from Home › Archived while another chat was open, with 100 ms added to every request. Figures without the added latency are in brackets. Each step is a painted frame (screencast) plus a per-frame geometry log.

After the click On screen
+32 ms (+27) The previous chat with its message box, faded, under the archived chat's address
+145 ms (+50) The archived chat's messages, with the message box and every message's Edit, Fork and More buttons
+157 ms (+61) The archived bar replaces the message box. The conversation grows by 69 px (725 → 794), every user message shrinks by 12 px (124 → 112), the visible messages move down by 81 to 105 px, and the scroll position settles (in the next frame without latency)
  • Timing of the two reads. The messages read and the summary read both start at the click (+24 and +26 ms). They answered about 8 ms apart here, so the active-looking state of the archived chat lasted one or two frames. In general it lasts from the messages' answer to the summary's answer.
  • Direct open. Opening the archived chat's address directly (a reload or a bookmark) shows the message box under the loading conversation until both reads answer. That took about 300 ms with the added latency (+730 → +1031 ms) and 43 ms without. Then the archived bar replaces the box.
  • The other direction. An active chat opened from an archived one keeps the archived bar until its own summary answers. At +26 ms the archived chat's messages and bar are still on screen under the active chat's address. At +141 ms (100 ms latency) the message box comes back while the archived chat's messages are still shown. The active chat's messages replace them at +153 ms.
  • Layout-shift entries. The browser scored the swap from the list at 0.018–0.022, but it falls within 500 ms of the click. The entries therefore carry hadRecentInput, and CLS does not count them. The frames above are what a reader sees.

What the code does today (main d886f4e05)

  • The archived state comes only from the chat's own summary. threadArchived needs openThread.status === 'ready' (services/platform/app/features/chat/components/chat-surface.tsx:492-498).
    • Until then, the footer renders the composer branch rather than ArchivedBanner (services/platform/app/features/chat/components/chat-surface.tsx:2465-2595).
    • The message actions also stay on until then (services/platform/app/features/chat/components/chat-surface.tsx:2374-2392).
    • A user message gets its Edit button only when onEditSubmit is set (services/platform/app/features/chat/components/message-item.tsx:405-422).
  • The surface has no other source for the fact. An archived chat is not in the caller's chat list (services/platform/app/features/chat/components/chat-surface.tsx:459-466).
    • The archived row the reader clicked already holds the chat's summary, archived included (services/platform/app/features/chat/components/archived-section.tsx:118-147). Nothing hands it on.
    • The summary is cached under a key of its own per thread (services/platform/app/lib/backend/chat.ts:135-153).
  • The previous chat's answers stand in while the new ones load. Every chat read sets placeholderData: keepPreviousData (services/platform/app/features/chat/data/chat-backend.ts:256-265). The surface stays mounted when the reader moves to another chat (services/platform/app/routes/dashboard/$id/chat.tsx:13-21).
    • So between the click and the answers, the screen shows the previous chat.
    • The previous chat's summary decides the footer meanwhile. The reverse case above shows this.
  • The route's warm-up does not run. services/platform/app/routes/dashboard/$id/chat/$threadId.tsx:11-20 prefetches chat/messages:listMessages through prefetchAdaptedQuery.
    • That helper looks the name up in the app-wide READ_ADAPTERS (services/platform/app/lib/backend/prefetch.ts:24-54).
    • The chat reads live only in the chat seam's own table (services/platform/app/features/chat/data/chat-backend.ts:139-199, and the note at services/platform/app/lib/backend/adapters.ts:8-9).
    • So the prefetch logs [prefetch] no 0.5 row for chat/messages:listMessages — skipping prefetch and returns. The same happens for chat/threads:listThreads from services/platform/app/routes/dashboard/$id/chat.tsx:35-37.
    • Hovering a row therefore warms nothing, although the router preloads on intent (services/platform/app/router.tsx:71-74). Observed: after a 600 ms hover, the messages were still requested at the click.
    • The summary is not part of the warm-up either way.
  • Bar and box sizes. The archived bar is one row with py-3 and a button (services/platform/app/features/chat/components/archived-banner.tsx:22-40); it measured 61 px. The composer block (chat-surface.tsx:2472-2594) measured 130 px.

#2658 reported the same flash on the earlier chat screen. #2674 closed it on 2026-07-12. The current surface (chat-surface.tsx) was added later, by #2857 on 2026-07-29.

Not covered

  • Phone width; Firefox and Safari.
  • Opening an archived chat from ⌘K search, from a project, or from a notification.
  • Archive and Unarchive in place. The header menu's Archive swaps to the bar without navigating (services/platform/app/features/chat/components/chat-surface.tsx:733-738).
  • A deployment over HTTP/2 with real latency. The numbers here are local, with latency added by the browser.

Two other shifts appeared in the same recordings but are not part of this report:

  • The Home panel on a cold load. It replaces its placeholder rows with the real ones: the search field moves up 34 px, and Archived goes from six placeholder rows to one row.
  • The "Knowledge search is off" notice. An organization without an embedding model gets this notice 0.5–3 s after load. It pushes the whole app down 45 px.

Constraints

#2658's acceptance list still applies:

  • a switch from one chat to another must not bring back a full conversation skeleton;
  • Unarchive must bring the composer back without a reverse flicker;
  • a direct link to an archived chat must not show the active composer either.

Also, for 2 s after a chat opens, the scroll hold re-pins through content changes (services/platform/app/features/chat/hooks/use-chat-scroll.ts:122-129).

Options (no preference)

  1. Seed the surface with what the clicked row knows. Pass the row's summary (or only archived) with the navigation, or write it into the summary's cache key before navigating. This covers opens from the panel, not direct links.
  2. Hold the footer while the chat's state is unknown. Show neither composer nor bar (a placeholder of fixed height) until openThread answers for this chat, and decide whether the message actions wait too.
  3. Give the two footers the same height. The swap would then move nothing, though its content still changes.
  4. Answer archived (and viewerIsOwner) with the messages read, so that one answer decides the transcript and the footer together.
  5. Make the route warm-up work for chat reads, and add the summary to it. This could be a READ_ADAPTERS row under the same key, or a chat-aware prefetch. It shortens every chat open, but on its own it does not remove the swap when the click comes before the warm-up answers.
  6. Stop the previous chat's answers from standing in across chats for the reads that decide the layout. The open would then show the skeleton instead of the previous chat.

Questions

  • What should the footer show while a chat's state is unknown: the composer (as today), nothing, or a placeholder?
  • Should the skipped warm-up get an issue of its own? It slows every chat open, not only archived ones.

How to reproduce

  1. Archive a chat that has a few messages.
  2. Open another chat, expand Archived in the Home panel, and click the archived chat. Network throttling in the browser's developer tools (for example "Fast 4G") keeps each step on screen longer.
  3. Or reload the archived chat's address. The message box shows under the loading conversation, then the archived bar replaces it.

Related

Activity

  1. added
    priority: low
    bug
    service: platform
    on Nov 6, 2026
  2. added
    agent-ready
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybugpriority: lowservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions