Repository navigation
Conversation
| func sidebarFolderItem(_ item: WorkspaceClient.FileItem) -> some View { | ||
| DisclosureGroup(isExpanded: $isExpanded) { | ||
| if isExpanded { // Only load when expanded -> Improves performance massively | ||
| ForEach(item.children!.sortItems(foldersOnTop: workspace.sortFoldersOnTop)) { child in |
There was a problem hiding this comment.
This is actually required since in a very large project folder this will load all children all the time which leads to very long file opening times.
There was a problem hiding this comment.
Screen.Recording.2022-03-18.at.15.59.15.mov
There was a problem hiding this comment.
It breaks the animation.
Maybe it's an idea to only place the labels, and then update them?
There was a problem hiding this comment.
If you can figure something out that doesn't break performance that'd be awesome. So far this if clause was the best option I found
There was a problem hiding this comment.
So instead of
SideBarItem(item: child,
workspace: workspace,
windowController: windowController)We should use?
SideBarItem(item: child,
workspace: workspace,
windowController: windowController,
loadSubitems: isExpanded)Or (maybe the worst solution)
Text(child.name) // Don't know is child.name exists. its pseudo code
There was a problem hiding this comment.
Ah, I see, the issue is, when you open a file, it's rendering the whole file tree again.
This should
- be done on the background
- or not at all when opening a file
There was a problem hiding this comment.
That's what I suspected as well
There was a problem hiding this comment.
ok I just tested the latest commit and it seems to run very nice. Couldn't see performance losses to before.
There was a problem hiding this comment.
Ok, after some research, opening/closing doesn't trigger an update.
selecting a file does.
There seems to be a delay again when opening files from that video
This has been fixed with commit
6dfa149
6dfa149 (for refrerence, clickable)
This commit increases the speed, but this is not the solution, the problem is that this bar is getting re-rendered when you open/select a file.
if you disable this if, and only open and close the disclosure groups, then it works as expected.
There was a problem hiding this comment.
SwiftUI acts strangely sometimes…
|
Something you might want to have a look at: |
|
There seems to be a delay again when opening files from that video |
This has been fixed with commit |
|
I'm closing this pull request. |
No description provided.