Skip to content

fix(gpui): show project folders before the first session exists - #232

Merged
stippi merged 1 commit into
mainfrom
fix/sidebar-empty-session-list
Oct 8, 2026
Merged

stippi merged 1 commit into
mainfrom
fix/sidebar-empty-session-list

Conversation

@daniel-kurzynski

Copy link
Copy Markdown
Collaborator

Problem

With no sessions at all (a fresh install, or a new data directory), the sidebar's Projects view stays empty, even when projects.json lists projects.

MainScreen passes the session listing to the sidebar only when it differs from the last one it saw. That starts out as an empty list, so an empty listing never reaches the sidebar. The sidebar never marks its sessions as loaded, and relayout_folders returns early, so the saved projects never get folders.

Change

  • Gpui records when the first session listing arrived (chat_sessions_loaded). Both places that store the listing go through the new set_chat_sessions.
  • MainScreen passes that first listing to the sidebar even when it is empty (sidebar_sessions_synced).

Tests

  • main_screen::tests::sidebar::saved_projects_show_before_the_first_session_exists: an empty listing arrives with one saved project, and the sidebar shows that project's folder. It fails without the fix (no folders).

The main screen hands the session listing to the sidebar only when it
differs from the last one it saw. Its initial value is an empty list, so
an empty listing (a fresh install, or a new data directory) never
reached the sidebar. The sidebar then never counted its sessions as
loaded and never laid out the folders of the projects saved in
projects.json: the Projects view stayed empty.

Gpui now records when the first listing arrived, and the main screen
hands that first listing over even when it is empty.
@stippi
stippi merged commit 7ed0d2c into main Oct 8, 2026
5 checks passed
@stippi
stippi deleted the fix/sidebar-empty-session-list branch October 8, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants