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

Menubar & Tabs visibility logic fixes #7664

Merged
merged 2 commits into from
Nov 16, 2023

Conversation

Minion3665
Copy link
Member

@Minion3665 Minion3665 commented Nov 14, 2023

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:

  • 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

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

  • Resolves: #
  • Target version: master

Summary

TODO

  • ...

Checklist

  • Code is properly formatted
  • All commits have Change-Id
  • I have run tests with make check
  • I have issued make run and manually verified that everything looks okay
  • Documentation (manuals or wiki) has been updated or is not required

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
@pedropintosilva
Copy link
Contributor

pedropintosilva commented Nov 14, 2023

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

This seems reasonable. Somehow I'm getting a weird behaviour where hiding the menubar still hides the tabs:

Peek.2023-11-14.12-51.mp4

I would prefer if Hide Menubar would act solely on comapct view. Since there is no menu bar in the tabbed view, it shouldn't affect tabbed view at all.

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)

@Minion3665
Copy link
Member Author

Minion3665 commented Nov 14, 2023

I would prefer if Hide Menubar would act solely on comapct view. Since there is no menu bar in the tabbed view, it shouldn't affect tabbed view at all.

sure, that makes sense. Would you like me to do that here or in a followup PR as it's a separate thing, @pedropintosilva? I'll do it here

@Minion3665 Minion3665 changed the title Stop hiding both menu and notebookbar softlocking Menubar & Tabs visibility logic fixes Nov 14, 2023
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
@Minion3665 Minion3665 force-pushed the private/skyler/prevent-menu-notebookbar-softlock branch from de0410e to 7380bf2 Compare November 14, 2023 13:17
Copy link
Contributor

@pedropintosilva pedropintosilva left a 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.

@Minion3665
Copy link
Member Author

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?

@hfiguiere
Copy link
Contributor

Both use the same code path, ie UIManager.collapseNotebookbar()

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.

@Minion3665
Copy link
Member Author

Minion3665 commented Nov 14, 2023

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)?

@hfiguiere
Copy link
Contributor

I think we can merge these improvements as is (unless @pedropintosilva disagrees)
We can still followup

Copy link
Contributor

@pedropintosilva pedropintosilva left a 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

@Minion3665 Minion3665 merged commit 02d64f1 into master Nov 16, 2023
7 checks passed
@Minion3665 Minion3665 deleted the private/skyler/prevent-menu-notebookbar-softlock branch November 16, 2023 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants