Skip to content

Improvement: Chat sidebar skeleton dismisses before projects load, causing layout shift #2544

Closed

Description

@yannickmonney

Problem

The chat history sidebar skeleton can dismiss before project folders finish loading, causing a visible layout shift when project rows appear after the skeleton swaps to real content.

Current behaviour

ChatHistorySidebar sets:

const showSkeleton = !isMounted || isLoadingFirstPage;

(services/platform/app/features/chat/components/chat-history-sidebar.tsx, line ~489)

This gates on thread first-page load only. useProjects() exposes isLoading (services/platform/app/features/projects/hooks/queries.ts, lines ~17–27) but the sidebar destructures only { projects } and does not include project loading in the skeleton condition.

When threads resolve before projects, the skeleton is replaced with real content and project folder rows can appear afterward. The skeleton also uses fixed row counts (2 project rows, 6 chat rows) and does not cover the archived-chats footer block.

A recent pass improved folder-row geometry in the skeleton (chevron + icon placeholders), but the projects-loading gap remains.

Proposed change

Extend showSkeleton to stay visible until both threads and projects have resolved (e.g. include useProjects().isLoading). Optionally adapt skeleton row counts to expected geometry and skeleton the archived section footer.

Acceptance criteria

  • Skeleton remains visible until both chat threads (first page) and projects have finished loading.
  • No layout shift when project folders appear after initial sidebar paint.
  • Skeleton geometry still mirrors loaded sidebar structure (Projects header, folder rows, Chats header, chat rows).
  • Existing hydration guard (!isMounted) behaviour preserved.

Code pointers

  • services/platform/app/features/chat/components/chat-history-sidebar.tsx (showSkeleton, skeleton UI ~525–584)
  • services/platform/app/features/projects/hooks/queries.ts (useProjects isLoading)
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

    improvementservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions