Skip to content

[Bug] Switching sessions briefly blanks the conversation timeline #311

@Astro-Han

Description

@Astro-Han

Summary

Switching between sessions in the left sidebar briefly blanks or flashes the conversation timeline before the target session messages appear.

Reproduction

  1. Open the desktop app.
  2. Open a project with multiple existing sessions.
  3. Click one session name in the left sidebar.
  4. Click another session name, especially a longer session.
  5. Observe the main conversation timeline area during the switch.

Expected Behavior

The session header, selected sidebar item, and conversation timeline should switch together without showing an empty timeline frame.

Actual Behavior

The route and selected sidebar item switch first, while the main conversation timeline briefly appears blank or incomplete, then re-populates with the target session messages.

This looks like the conversation stream is being fully reloaded or momentarily lost.

Impact

P1. Session switching is a high-frequency interaction. The blank timeline frame is visually jarring and can make users worry that conversation data disappeared or the app navigated incorrectly.

Initial Diagnosis

Observed in the desktop app with Computer Use. This appears to be a frontend render-state issue, not a route or data-loss issue.

Current code path:

  • packages/app/src/pages/session.tsx computes messagesReady() from sync.data.message[id] !== undefined.
  • The session panel renders MessageTimeline inside <Show when={messagesReady()}>.
  • When params.id changes and the target session messages are not ready yet, messagesReady() becomes false.
  • That unmounts the entire MessageTimeline, creating a transient 0-message blank frame.
  • Once sync.data.message[id] arrives, MessageTimeline mounts again and the target messages appear.

Related note: PR #286 added session timeline scroll stabilization coverage, but its session-switch test only excludes partial counts between 1 and the initial window size. It does not catch a 0-message blank frame after the URL has switched.

Suggested Verification

Add an E2E regression test for session switching that samples the timeline after navigation reaches the target session URL and asserts there is no 0-message blank frame.

The fix should keep this scoped to session switching and not mix it with the separate send-scroll issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High priorityappApplication behavior and product flowsbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions