[GH-ISSUE #144] [Bug] The page tree disappears when re-showing the side panel #73

Closed
opened 2026-03-23 20:31:28 +00:00 by mirror · 5 comments
Owner

Originally created by @MikeWallaceDev on GitHub (Dec 13, 2021).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/144

Originally assigned to: @lwchkg on GitHub.

Describe the bug
The page tree disappears when clicking on the image button to hide and then reshow the side panel.

To Reproduce
Steps to reproduce the behavior:

  1. Click on the image button to hide the panel
  2. Click on the button again to show the panel
  3. The page tree is gone.
  4. After more tests it has come to my attention that the tree comes back after a while, but the tree branches are collapsed. Obviously, this isn't acceptable.

Expected behavior
The tree should reappear immediately when the panel is shown

Screenshots
image
image
image
After a while the data is shown, but not as it was when the panel was closed.
image

Desktop (please complete the following information):

  • OS: Linux
  • Browser N/A
  • Version 0.0.2

Additional context
None.

Originally created by @MikeWallaceDev on GitHub (Dec 13, 2021). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/144 Originally assigned to: @lwchkg on GitHub. **Describe the bug** The page tree disappears when clicking on the ![image](https://user-images.githubusercontent.com/5375835/145899213-f5f0309b-0bef-472b-bd01-f00f915cc10a.png) button to hide and then reshow the side panel. **To Reproduce** Steps to reproduce the behavior: 1. Click on the ![image](https://user-images.githubusercontent.com/5375835/145899213-f5f0309b-0bef-472b-bd01-f00f915cc10a.png) button to hide the panel 2. Click on the button again to show the panel 3. The page tree is gone. 4. After more tests it has come to my attention that the tree comes back after a while, but the tree branches are collapsed. Obviously, this isn't acceptable. **Expected behavior** The tree should reappear immediately when the panel is shown **Screenshots** ![image](https://user-images.githubusercontent.com/5375835/145899548-3306b658-9ff2-422d-8b68-994089c1c066.png) ![image](https://user-images.githubusercontent.com/5375835/145899616-d7fcf24c-8059-4023-ab4e-80e9c14570ca.png) ![image](https://user-images.githubusercontent.com/5375835/145899677-831b444c-a5b4-42ce-b4a2-a15929db3f6c.png) After a while the data is shown, but not as it was when the panel was closed. ![image](https://user-images.githubusercontent.com/5375835/145899723-a48e9f59-e212-4bc7-b7de-f596a662e8d2.png) **Desktop (please complete the following information):** - OS: Linux - Browser N/A - Version 0.0.2 **Additional context** None.
Author
Owner

@polypixeldev commented on GitHub (Jul 29, 2022):

I have been able to partially reproduce this issue. When I re-show the side panel, the page tree comes back immediately, but only the branch that contains the page that's open is not collapsed, even though I had other branches not collapsed prior to hiding the side panel.

<!-- gh-comment-id:1199652964 --> @polypixeldev commented on GitHub (Jul 29, 2022): I have been able to partially reproduce this issue. When I re-show the side panel, the page tree comes back immediately, but only the branch that contains the page that's open is not collapsed, even though I had other branches not collapsed prior to hiding the side panel.
Author
Owner

@lwchkg commented on GitHub (Oct 21, 2022):

Is anyone actively working on this issue? If no I'd like to have a look and see if I can solve it.

Anyway, this will take some time because the issue appears to be some feature yet to be coded instead of a bug in some existing code. The states whether tree items are expanded appear to be lost when the side panel collapse.

P.S. it would be nice to hear from the original contributor why this trade-off, that appears to be a bug, is made.

<!-- gh-comment-id:1287048149 --> @lwchkg commented on GitHub (Oct 21, 2022): Is anyone actively working on this issue? If no I'd like to have a look and see if I can solve it. Anyway, this will take some time because the issue appears to be some feature yet to be coded instead of a bug in some existing code. The states whether tree items are expanded appear to be lost when the side panel collapse. P.S. it would be nice to hear from the original contributor why this trade-off, that appears to be a bug, is made.
Author
Owner

@lwchkg commented on GitHub (Oct 23, 2022):

Searched the code, confirm that the function _expandIfNeed and the value of initialExpanded, both in app_bloc.dart, creates the behavior described in this issue. This "buggy" behavior looks like a workaround of some underlying issue.

Also, those ExpandablePanel instances appear to be destroyed and recreated in the process, which ideally should not happen at all.

<!-- gh-comment-id:1287965631 --> @lwchkg commented on GitHub (Oct 23, 2022): Searched the code, confirm that the function `_expandIfNeed` and the value of `initialExpanded`, both in `app_bloc.dart`, creates the behavior described in this issue. This "buggy" behavior looks like a workaround of some underlying issue. Also, those ExpandablePanel instances appear to be destroyed and recreated in the process, which ideally should not happen at all.
Author
Owner

@lwchkg commented on GitHub (Oct 27, 2022):

I have come up with 2 approaches. Please help me to decide on which one (or both) to work with.

  1. Add a persistent expanded/collapsed state to each collapsible item, and add two-way link it to ExpandableController with listeners. Ideally these states are saved to the disk, but that can be done in a later stage.

  2. Try to prevent rebuilding of the ExpandablePanels (if they are rebuilt). I have no idea how to accomplish this anyway.

P.S. the is some repair work in my home, so my progress will likely be slow.

<!-- gh-comment-id:1292800148 --> @lwchkg commented on GitHub (Oct 27, 2022): I have come up with 2 approaches. Please help me to decide on which one (or both) to work with. 1. Add a persistent expanded/collapsed state to each collapsible item, and add two-way link it to ExpandableController with listeners. Ideally these states are saved to the disk, but that can be done in a later stage. 2. Try to prevent rebuilding of the ExpandablePanels (if they are rebuilt). I have no idea how to accomplish this anyway. P.S. the is some repair work in my home, so my progress will likely be slow.
Author
Owner

@polypixeldev commented on GitHub (Oct 27, 2022):

I think that the persistent state is probably the best approach, although I want to see @appflowy's opinion on this. Thanks for working on the issue, take your time. 👍

<!-- gh-comment-id:1292814477 --> @polypixeldev commented on GitHub (Oct 27, 2022): I think that the persistent state is probably the best approach, although I want to see @appflowy's opinion on this. Thanks for working on the issue, take your time. :+1:
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#73
No description provided.