Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure folder items in sidebar always expandable #1252

Merged
merged 12 commits into from
May 12, 2023

Conversation

jeremypw
Copy link
Collaborator

@jeremypw jeremypw commented Jan 22, 2023

Fixes #739

Needed to relation to issues with expanding and closing folders in the sidebar as well as accomodating files being added removed and renamed while correctly handling presence/absence of dummy item. The behaviour of the sidebar is now similar to that of Files in relation to empty folders.

  • Ensure that empty folders AND folders with no visible children have a dummy entry and therefore expandable
  • Simplify handling of created/deleted/renamed files
  • Only load all children once; thereafter keep tree in sync with changes
  • Prevent stray output stream files being handled or showing.
  • Put single use functions inline
  • Prevent terminal warning due to attempted updating git status of non-git folders

Test by creating a project with a mixture of subfolders - empty, only non-text files, text files. Add, remove, rename files in each case to check correct behaviour.

@jeremypw jeremypw changed the title Ensure folders always expandable Ensure folder items in sidebar always expandable Mar 21, 2023
@jeremypw jeremypw marked this pull request as ready for review March 21, 2023 12:17
@jeremypw jeremypw requested a review from a team March 21, 2023 12:17
@zeebok
Copy link
Contributor

zeebok commented May 11, 2023

Finally getting to look at this. Code looks good, I just gotta test it.

@zeebok
Copy link
Contributor

zeebok commented May 12, 2023

When I loaded a folder with a mix of file and folders (the source folder for Code), I noticed non-text files in the build/src directory weren't visible and when I removed what was there, the dummy was not created and thus would not let you expand it. If I restored the deleted files it immediately detected and was expandable.

In my test with fresh new folders, adding and removing things would properly keep the expand functionality. Not sure what is different.

@zeebok
Copy link
Contributor

zeebok commented May 12, 2023

Just looked at it again after realizing I was running it from the build directory instead of installing it. If I Install it works correctly!

@jeremypw
Copy link
Collaborator Author

It should not matter whether running installed or not (as long there isnt a pre-existing master version running) as no plugins are involved. You can verify which version is running by using meson configure -Ddevelopment=true before building and then checking the window title in multitasking view. Development builds show the branch name in the window title. I am always getting confused about which version of Code is running when developing Code with Code!

@jeremypw jeremypw merged commit 64b5a90 into master May 12, 2023
@jeremypw jeremypw deleted the fix-expand-no-children branch May 12, 2023 08:48
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.

No expander on folders that contain no text files but expander on empty folders
3 participants