Bug 477050 - Auto-reload Projects sidebar
Summary: Auto-reload Projects sidebar
Status: RESOLVED INTENTIONAL
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 23.04.3
Platform: NixOS Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-15 15:26 UTC by Adam Beer
Modified: 2024-10-31 16:27 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Beer 2023-11-15 15:26:31 UTC
SUMMARY
It's very annoying to have to manually click the reload button in the Projects sidebar whenever the folder layout changes.

STEPS TO REPRODUCE
1. Enable the Projects plugin.
2. Show the Projects sidebar.
3. Open a Git project.
3. Open a file in that project.
4.a) Right-click on the file's tab and rename it.
b) Rename the file outside of Kate.

OBSERVED RESULT
The Projects sidebar still shows the file under its old name.

EXPECTED RESULT
If there's a filesystem event listener system that would allow the Projects sidebar to immediately know whenever a directory tree changes without just polling the filesystem, then it should use that to immediately reload the view of the current project whenever its contents change. If there is no such system, then:
a) The Projects sidebar should automatically reload the view of the current project whenever a file within it gets created/renamed/deleted in Kate.
b) The Projects sidebar should automatically reload the view of the current project every so often, in order to catch changes from outside of Kate. If you're concerned about performance, then set the period to something huge like 10 seconds, pause the feature while the window isn't focused, and immediately reload whenever the window gains focus.

And either way, whenever the user switches the current project, it should reload the newly selected one.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
I'm experimenting with replacing some uses of VSCodium with Kate, and this lack of functionality struck me as downright bizarre. KDevelop has it, and with a period that appears to be about 1 second, including when the window isn't focused. Is there a specific benefit to having the reload be only manual?
Comment 1 Waqar Ahmed 2023-11-30 12:26:08 UTC
We haven't done this intentionally so far and I am not sure if we will do it. Efficiency is one reason, another reason is that it has limited use as its not often does one adds/removes files in a project.

Hitting the reload button/shortcut is pretty easy when/if you would like to reload and allows kate to stay lightweight.
Comment 2 Waqar Ahmed 2024-10-19 21:19:19 UTC
After implementing a basic watcher I have realized this will just be a source of bugs and problems so I am closing this.

We support multiple projects open at once, many people using kate often open upto 4 or 5 projects easily. If we start watching these projects, the watches will exhaust quickly. And this is just linux, the cross platform issues such as macos having hard limits on number of watches is another problem. Almost all editors that are doing this have constant problems with such a feature.

I'd prefer that kate remains lightweight instead.
Comment 3 Grósz Dániel 2024-10-31 16:27:38 UTC
Where it gets confusing is when the Quick Open feature doesn't see new files added outside Kate. It took me a while to figure out that it's the Projects sidebar where I have to reload files, especially since I rarely use the Projects sidebar (I mostly use the Filesystem and the Git ones to deal with files).

I'm not sure what the less confusing solution would be. Putting a Reload button in the Quick Open panel could also be confusing (what does it reload?). Perhaps reload project(s) if you type something in the Quick Open panel that doesn't match any existing file, or just reload project(s) in the background whenever the Quick Open panel is opened?

Also, the Git sidebar does check for changes whenever it's opened (though it doesn't continuously listen for changes either), while the Projects sidebar doesn't. So, even though they both essentially handle the files belonging to the project, they sometimes see different sets of files.