Repository navigation
fix(gpui): show project folders before the first session exists - #232
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
With no sessions at all (a fresh install, or a new data directory), the sidebar's Projects view stays empty, even when
projects.jsonlists projects.MainScreenpasses 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, andrelayout_foldersreturns early, so the saved projects never get folders.Change
Gpuirecords when the first session listing arrived (chat_sessions_loaded). Both places that store the listing go through the newset_chat_sessions.MainScreenpasses 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).