Files icon indicating copy to clipboard operation
Files copied to clipboard

Fix: Fixed an issue where sometimes the `SideBar` did not display correctly according to the user preset

Open XTorLukas opened this issue 1 year ago • 13 comments
trafficstars

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.

  1. Set Collapsed sidebar as default and close
  2. Reopen Files and sometimes not correct sidebar showing

image

XTorLukas avatar May 29 '24 12:05 XTorLukas

Need testing

XTorLukas avatar May 29 '24 13:05 XTorLukas

What are the steps to repro this issue?

yaira2 avatar May 29 '24 14:05 yaira2

Set SidebarDisplayMode.Minimal on initial load and update display mode before loading. This will cause the display to be set correctly.

XTorLukas avatar May 29 '24 14:05 XTorLukas

I set it to minimal but how can I change the display mode before loading?

yaira2 avatar May 29 '24 14:05 yaira2

What are the steps to repro this issue?

  1. Set as collapsed image
  2. Close
  3. Open a new instances of the Files app
  4. Sometimes there are problems image

However, the problems become apparent when loading more items in the background, although sometimes even the basic Home panel

XTorLukas avatar May 29 '24 15:05 XTorLukas

@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.

0x5bfa avatar Jun 05 '24 11:06 0x5bfa

@XTorLukas How about?

0x5bfa avatar Jun 12 '24 05:06 0x5bfa

@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.

XTorLukas avatar Jun 12 '24 11:06 XTorLukas

I think we can merge as long as this seems to fix.

0x5bfa avatar Jun 13 '24 05:06 0x5bfa

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.

marcelwgn avatar Jun 16 '24 10:06 marcelwgn

@yaira2 I've apparently managed to detect a bug. After much debugging I found the following:

  1. Initialization is done before calling loaded
  2. After Loaded, the state is set and the animation is executed if needed, here the width is set to the desired size
  3. This introduces the OnPropertyChanged call.
  4. 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.

XTorLukas avatar Jun 16 '24 12:06 XTorLukas

Initialization is done before calling loaded

@marcelwgn this can cause unexpected behaviors, what do you think?

yaira2 avatar Jun 16 '24 14:06 yaira2

@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.

marcelwgn avatar Jun 18 '24 17:06 marcelwgn

@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.

0x5bfa avatar Jul 17 '24 03:07 0x5bfa

I will close this PR for now, the problem will be resolved in another PR.

XTorLukas avatar Jul 17 '24 15:07 XTorLukas