Files
Files copied to clipboard
Fix: Fixed an issue where sometimes the `SideBar` did not display correctly according to the user preset
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.
https://discord.com/channels/725513575971684472/1231311318498410648
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.
- Set Collapsed sidebar as default and close
- Reopen Files and sometimes not correct sidebar showing
Need testing
What are the steps to repro this issue?
Set SidebarDisplayMode.Minimal on initial load and update display mode before loading. This will cause the display to be set correctly.
I set it to minimal but how can I change the display mode before loading?
What are the steps to repro this issue?
- Set as collapsed
- Close
- Open a new instances of the Files app
- Sometimes there are problems
However, the problems become apparent when loading more items in the background, although sometimes even the basic Home panel
@yaira2 @XTorLukas I’m planning to overhaul Sidebar control. If you @XTorLukas can confirm this fixed, we could merge. And later I can make it better overall.
@XTorLukas How about?
@XTorLukas How about?
For me the problem is no longer manifested, for me this is resolved, if you are going to rework this there is an option to close this. I think the problem will be somewhere within the panel work, but I don't have time to look for another solution right now. In summary it is possible to do the merge.
I think we can merge as long as this seems to fix.
I can only reiterate what @yaira2 and I said earlier. Hesitant to accept this given it's hard to repro and I also think the changes might not actually fix the underlying issues.
@yaira2 I've apparently managed to detect a bug. After much debugging I found the following:
- Initialization is done before calling loaded
- After Loaded, the state is set and the animation is executed if needed, here the width is set to the desired size
- This introduces the OnPropertyChanged call.
- The event must be called immediately, however if there was a delay and interrupted by another action before Loaded this event was pushed back to later, but the UpdateOpenPaneLengthColumn call remained in Loaded which set the width to 200 by default, this overwrote the correct value for Collapsed.
I tested this solution with 50x open/close Application and the problem was fixed.
Initialization is done before calling loaded
@marcelwgn this can cause unexpected behaviors, what do you think?
@marcelwgn this can cause unexpected behaviors, what do you think?
Does it really? If initialization means the constructor, then obviously the constructor needs to called before loaded. After all, loaded is the event that gets triggered once the control has been initialized and the UI components are available.
@XTorLukas Thank you for the contribution including recent localization enhancements.
Regarding this PR, given that
- This is reproducible by no one in the team
- I'll refactor majority of code base around Sidebar control soon
We seem to be at the dead end and we might as well ask to close this and ask you to review my PRs for it, seeing if this issue is still present or not, to move forward.
I will close this PR for now, the problem will be resolved in another PR.