-
Notifications
You must be signed in to change notification settings - Fork 734
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
Menubar & Tabs visibility logic fixes #7664
Menubar & Tabs visibility logic fixes #7664
Conversation
Previously, when using the Collapse_Notebookbar postmessage or equivalent ui_defaults (SpreadsheetToolbar=false, etc.), particularly in compact mode, it was possible to additionally hide the menu bar. As the button to show the menu bar is on the notebookbar, this meant that you couldn't reactivate either notebookbar or menubar until you refreshed the page. This is particularly annoying in integrators that may not provide an easy way to reload the page This commit makes it so that hiding the menu bar automatically uncollapses the notebookbar and won't let it be collapsed again. Whether the notebook bar should be collapsed (the last thing done to it was a collapse) is remembered and restored after the menu bar is shown again, so if you send a postmessage that will affect the state of the notebookbar after the menu is shown (even though it will not affect the notebookbar's state immediately) Caveats: - If you are hiding the notebookbar to limit the control the user has, that's broken by this commit as it makes it impossible to hide both the menu and notebook bars at the same time. - The notebook bar will be hidden again when re-showing the menu bar, however there still isn't a way to hide the notebook bar in normal use (i.e. without using either postmessage or ui_defaults) while in compact mode (although there is a workaround to show it- switching into tabbed mode and then back!). It might be nice to have one. Other considered solutions: - We could add a new button that allowed you to reopen the menu if both menu and notebookbar were hidden - Not sure there's much benefit to this over just doing what we're doing here, and it's harder to implement - We could disable the button to hide the menu bar when the notebookbar is collapsed - As far as I know, there's no button in the UI to show the notebook bar. This would make it impossible to hide the menu bar if the notebookbar was hidden via postmessage or ui_defaults Signed-off-by: Skyler Grey <[email protected]> Change-Id: Ieab6d72a6be181aba88e9a5b21dda16a369b9e54
This seems reasonable. Somehow I'm getting a weird behaviour where hiding the menubar still hides the tabs: Peek.2023-11-14.12-51.mp4I would prefer if Note: Collapse and expand tabs are already possible via post message or by pressing the active tab or by pressing the collapse tabs (view tab) |
|
Tabbed mode doesn't have a menu bar, instead it has tabs. These can't be hidden. Unfortunately, the post messages to hide the menu bar have the side effect of hiding the tabs. This commit prevents the tabs being hidden when in tabbed mode, and shows the tabs again when switching from compact mode into tabbed mode. When switching back from tabbed into compact mode, the state that you would like the menu bar to be in (hidden/shown) will be remembered and restored. This includes any postmessages that were not acted on while in tabbed mode. Signed-off-by: Skyler Grey <[email protected]> Change-Id: I1177903fe965e354538e6e7bbc3c83af3177938e
de0410e
to
7380bf2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Now the hide menu bar doesn't affect tabbed view 👍
Still something looks out of place in the compact view
Peek.2023-11-14.16-02.mp4
Hide menu bar can now trigger Extend Tabbed Toolbar
I would prefer to have both Extend Tabbed Toolbar
and Collapse Tabbed Toolbar
not affecting compact view at all.
Are you sure? The commands are used elsewhere (e.g. #7627) in order to hide the compact view toolbar. I could make it so that there were various different states that were restored when switching back, but as I am aware of at least 1 instance of people using stuff around here to affect compact mode in the wild so I don't know that we should stop these functions affecting it. @hfiguiere @pedropintosilva what do you think? |
Both use the same code path, ie The discrepency in functionality is caused by the fact that in the ui_defaults case the notebook bar isn't in a state where this does anything. Also the notebookbar is expanded when clicking on any tab. |
looking again, maybe we could change this so that the ui_defaults added in #7627 don't affect notebookbar and the postmessages to collapse/expand don't affect the compact view (and then maybe add some more postmessages to collapse and expand for compact view)... would this be a good solution? I notice the collapse/expand postmessages for tabbed toolbar were only added 2 weeks ago so maybe it's not too late to change what they do (see #7556)? |
I think we can merge these improvements as is (unless @pedropintosilva disagrees) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can merge these improvements as is (unless @pedropintosilva disagrees)
We can still followup
sure
Commit 9115d9d
Previously, when using the Collapse_Notebookbar postmessage or equivalent ui_defaults (SpreadsheetToolbar=false, etc.), particularly in compact mode, it was possible to additionally hide the menu bar. As the button to show the menu bar is on the notebookbar, this meant that you couldn't reactivate either notebookbar or menubar until you refreshed the page. This is particularly annoying in integrators that may not provide an easy way to reload the page
This commit makes it so that hiding the menu bar automatically uncollapses the notebookbar and won't let it be collapsed again. Whether the notebook bar should be collapsed (the last thing done to it was a collapse) is remembered and restored after the menu bar is shown again, so if you send a postmessage that will affect the state of the notebookbar after the menu is shown (even though it will not affect the notebookbar's state immediately)
Caveats:
Other considered solutions:
Change-Id: Ieab6d72a6be181aba88e9a5b21dda16a369b9e54
Commit de0410e
Prevent hiding the menu bar in tabbed mode
Tabbed mode doesn't have a menu bar, instead it has tabs. These can't be
hidden. Unfortunately, the post messages to hide the menu bar have the
side effect of hiding the tabs. This commit prevents the tabs being
hidden when in tabbed mode, and shows the tabs again when switching from
compact mode into tabbed mode.
When switching back from tabbed into compact mode, the state that you
would like the menu bar to be in (hidden/shown) will be remembered and
restored. This includes any postmessages that were not acted on while in
tabbed mode.
Change-Id: I1177903fe965e354538e6e7bbc3c83af3177938e
Summary
TODO
Checklist
make check
make run
and manually verified that everything looks okay