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

Feature: Update the Drives Widget & Tags Widget when refreshing the Home Page #16732

Merged

Conversation

ferrariofilippo
Copy link
Contributor

@ferrariofilippo ferrariofilippo commented Jan 24, 2025

Resolved / Related Issues

To prevent extra work, all changes to the Files codebase must link to an approved issue marked as Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.

Steps

  • Make the Refresh button actually refresh the home page
  • Refresh Tags when changes are detected
  • Refresh Tags when files are tagged
  • Refresh drives when files are added/removed

Steps used to test these changes

Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.

  1. Open the home page
  2. Play with tags/drives and recent files
  3. See the home page widgets are refreshed

@ferrariofilippo ferrariofilippo marked this pull request as draft January 24, 2025 12:31
@ferrariofilippo
Copy link
Contributor Author

@yaira2 I'm not sure we should use the filewatcher to update drives. If a user is copying many items this would slow down the process

@yaira2
Copy link
Member

yaira2 commented Jan 24, 2025

That could be a concern, we might be better off reloading the details only when the user refreshes the page.

@Josh65-2201
Copy link
Member

Couldn't it refresh when the home page is opened, that way it auto refreshes without the performance issue

@ferrariofilippo
Copy link
Contributor Author

Couldn't it refresh when the home page is opened, that way it auto refreshes without the performance issue

This seems a good workaround, I'll look into it

@ferrariofilippo ferrariofilippo marked this pull request as ready for review January 26, 2025 19:12
@yaira2
Copy link
Member

yaira2 commented Jan 26, 2025

Refresh Tags when changes are detected

Is this automatic, or does it require refreshing the page?

@ferrariofilippo
Copy link
Contributor Author

Refresh Tags when changes are detected

Is this automatic, or does it require refreshing the page?

It was automatic but I reverted it in the last commit. I can re-revert it if it's needed
(It still works automatically when their name/colors are updated from settings)

@yaira2
Copy link
Member

yaira2 commented Jan 26, 2025

So just to confirm, aside from when the settings change, the only live updating is when manually refreshing & when navigating to the home page?

@ferrariofilippo
Copy link
Contributor Author

So just to confirm, aside from when the settings change, the only live updating is when manually refreshing & when navigating to the home page?

Currently the behaviour is as follows:

  • When a drive is (un)mounted it is added to the Drives widget [even for network drives]
  • When files are opened they are added to the Recent files widget
  • When pinned folders are changed the Quick Access widget is updated

Introduced in this PR:

  • Update the Tags widget when tags are changed from settings
  • When manually refreshing the Home page or navigating to it, update all the widgets

I can add back the code to update the Tags widget when items are tagged.
As mentioned above I don't think we should update the drives widget whenever items are moved

@yaira2 yaira2 self-requested a review January 28, 2025 15:33
@yaira2 yaira2 self-requested a review January 29, 2025 21:32
Copy link
Member

@yaira2 yaira2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yaira2 yaira2 changed the title Feature: Auto refresh drive widget & tags widget when changes are detected Feature: Update the Drives Widget & Tags Widget when refreshing the Home Page Jan 29, 2025
@yaira2 yaira2 added ready to merge Pull requests that are approved and ready to merge and removed needs - code review labels Jan 29, 2025
@yaira2 yaira2 merged commit d079525 into files-community:main Jan 29, 2025
6 checks passed
@ferrariofilippo ferrariofilippo deleted the allow-refreshing-home-page branch January 30, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Auto refresh drive widget & tags widget when changes are detected
3 participants