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

Unable to persist fullscreen / maximized mode #494

Open
garyvh2 opened this issue Feb 7, 2024 · 3 comments
Open

Unable to persist fullscreen / maximized mode #494

garyvh2 opened this issue Feb 7, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@garyvh2
Copy link

garyvh2 commented Feb 7, 2024

Describe the bug
Fullscreen (or maximized) state, is not persisted when calling api.toJSON. Instead this.exitMaximizedView(); is called modifying the end users state.

To Reproduce
Codesandbox example

Screen.Recording.2024-02-07.at.15.44.43.mov

Whenever there's a call to onDidLayoutChange we persist the user's layout state, with toJSON() so we store the layout structure on our end.

When we added the Maximize feature we noticed that the when the user maximizes the group, and changes the active tab, the call to toJSON() executed on onDidLayoutChange causes the maximize state to be lost.

Upon closer inspection on the library we noticed that

dockviewComponent.ts ln.1010 -> this.gridview.serialize() // When the gridview is serialized
   |__ gridview.ts ln.439 -> this.exitMaximizedView() // The library exits the maximized view purposely

Additionally we noticed the comment on

gridview.ts ln.435
/**
 * do not persist maximized view state
 * firstly exit any maximized views to ensure the correct dimensions are persisted
 */

And were wondering if there was a reason for such, we on our end wanted to persist the maximized state, as it's originated from a user interaction, so forcefully removing state is thought as a non expected behavior, but not sure if there was a deeper reason as to not persist such state on your end.

Expected behavior
When the layout is persisted through toJSON method, the maximized state is persisted along the other components.

Screenshots
N/A

Desktop (please complete the following information):

  • Browser all
  • Version all
@gggonzalo
Copy link

This issue is even more evident when the group is maximized but the visible panel is not active. If you click anywhere in the maximized panel (inactive), onDidLayoutChange gets triggered and the maximized state is exited.

Screen.Recording.2024-02-08.at.16.00.42.mov

@mathuo mathuo added the enhancement New feature or request label Feb 29, 2024
@mathuo
Copy link
Owner

mathuo commented Feb 29, 2024

This issue is even more evident when the group is maximized but the visible panel is not active. If you click anywhere in the maximized panel (inactive), onDidLayoutChange gets triggered and the maximized state is exited.

Screen.Recording.2024-02-08.at.16.00.42.mov

This particular issue has been fixed in v1.10.0 - when a group is maximized it's automatically set as the active group

@mathuo
Copy link
Owner

mathuo commented Feb 29, 2024

As for the fullscreen state not being persisted - it would require some non-trival code changes to get to work due the fact of having to store extra metadata in the persisted state.

I agree it's a feature that should exist and will look into it at some point in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants