Skip to content

Fix: Prevent filter textbox from being cleared when folder is loaded - #18809

Open
Rana-Shumail wants to merge 1 commit into
files-community:mainfrom
Rana-Shumail:main
Open

Fix: Prevent filter textbox from being cleared when folder is loaded#18809
Rana-Shumail wants to merge 1 commit into
files-community:mainfrom
Rana-Shumail:main

Conversation

@Rana-Shumail

Copy link
Copy Markdown

…load

This PR fixes an issue where the filter textbox is cleared 1-2 seconds after a folder loads if the user starts typing immediately.

Root cause: The desktopIniUpdateTask runs with Low priority and clears the filter box after the UI thread goes idle. Any text typed by the user before this task executes is overwritten.
Fix: Removed the delayed clearing. Instead, the filter is now cleared synchronously inside SetWorkingDirectoryAsync when the path actually changes (value != WorkingDirectory).
Note: I wasn't able to compile the app locally due to a local toolchain issue, so this fix is based on code analysis. I'm happy to iterate if any feedback or issues arise during testing!

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 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. Performed code analysis on ShellViewModel.cs to trace the filter text binding.
  2. Verified that the desktopIniUpdateTask was asynchronously clearing FilesAndFoldersFilter on a low-priority thread, which conflicted with immediate user typing.
  3. Verified that SetWorkingDirectoryAsync correctly resets the filter synchronously when navigating between folders.

…load

This PR fixes an issue where the filter textbox is cleared 1-2 seconds after a folder loads if the user starts typing immediately.

Root cause: The desktopIniUpdateTask runs with Low priority and clears the filter box after the UI thread goes idle. Any text typed by the user before this task executes is overwritten.
Fix: Removed the delayed clearing. Instead, the filter is now cleared synchronously inside SetWorkingDirectoryAsync when the path actually changes (value != WorkingDirectory).
Note: I wasn't able to compile the app locally due to a local toolchain issue, so this fix is based on code analysis. I'm happy to iterate if any feedback or issues arise during testing!
@CLAassistant

CLAassistant commented Aug 11, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Josh65-2201 Josh65-2201 changed the title Fix: Prevent filter textbox from being cleared during delayed folder … Fix: Prevent filter textbox from being cleared when folder is loaded Aug 11, 2026
@Josh65-2201 Josh65-2201 added the ready for review Pull requests that are ready for review label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Pull requests that are ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Filter textbox is cleared when typing right after opening a folder

3 participants