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

The right-pane keeps re-opening itself on window resize #8772

Closed
pacien opened this issue Feb 18, 2019 · 4 comments · Fixed by matrix-org/matrix-react-sdk#3703
Closed

The right-pane keeps re-opening itself on window resize #8772

pacien opened this issue Feb 18, 2019 · 4 comments · Fixed by matrix-org/matrix-react-sdk#3703
Assignees
Labels
A-Right-Panel P2 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect

Comments

@pacien
Copy link
Contributor

pacien commented Feb 18, 2019

Description

The right pane (listing members, files and notifications for a given room) keeps re-opening itself after being closed when the window is resized, when it should instead keep its last user-decided state.

Something similar is happening to the left pane (listing rooms), which is made narrow instead of keeping its width.

Steps to reproduce

  • Open a room.
  • Hide the right pane.
  • Resize the window to a smaller width.
  • Resize the window to a bigger width.
  • The right pane is now shown again.

Version information

  • Platform: desktop
  • OS: Debian
  • Version: 1.0.1
@jryans
Copy link
Collaborator

jryans commented Feb 19, 2019

Hmm, so far I can't seem to reproduce this. Do I need to first open a specific right pane, does it happen with any of them?

@jryans jryans added the X-Needs-Info This issue is blocked awaiting information from the reporter label Feb 19, 2019
@pacien
Copy link
Contributor Author

pacien commented Feb 19, 2019

This works with all panes.
Here's a recording of the bug: the panel re-opens itself when the window is re-sized.

simplescreenrecorder-2019-02-19_12 19 55

@lampholder lampholder added A-Right-Panel T-Defect P2 S-Minor Impairs non-critical functionality or suitable workarounds exist and removed X-Needs-Info This issue is blocked awaiting information from the reporter labels Mar 14, 2019
@joepie91
Copy link

joepie91 commented Nov 22, 2019

Can only reproduce it when making the window so small that the right-hand pane gets auto-hidden.

Did some triaging, and the problem lies in matrix-react-sdk, which doesn't distinguish in its state model between "user hid the panel" and "panel was auto-hidden", which means that upon restoration of the original window size, it just blindly re-shows the panel as it has no way to know whether it was open or closed before the first resize.

In MatrixChat.js, the action to re-show the panel is dispatched from the handleResize method:

Selection_396

In the same file, that action results in the collapsedRhs state being set:

Selection_397

This then propagates down, eventually showing the panel again. However, there's no check at either of these points about whether the panel was originally open or closed. Because when the panel is explicitly closed by the user, it just dispatches a generic hide_right_panel action, which doesn't track the reason for the panel close:

Selection_399

If the panel were to be auto-closed, then it would dispatch the exact same action (in MatrixChat.js again), which means there's no way to distinguish the two cases:

Selection_400

The solution would be to:

  1. Track the user intent (explicit panel close) in a separate state property
  2. Check this state property upon un-resizing, to only re-show the panel if there was no explicit close before
  3. Clear the user intent property upon explicit panel open

I don't know whether there are any other parts of the codebase being touched by this that I'm not aware of. That should probably be checked by someone more familiar with the code than me :)

@colemickens
Copy link

possibly related: #10149. dupe: #10156

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Right-Panel P2 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants