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

Sidebar and Navigator menu entries not checked when the features are activated #10083

Open
cosminh11 opened this issue Sep 20, 2024 · 2 comments
Labels
bug Something isn't working unconfirmed

Comments

@cosminh11
Copy link
Contributor

Describe the Bug

When you activate or deactivate the sidebar or the navigator, either from the menu or from the notebook bar, neither do the menu entries get checked or unchecked, nor do the buttons get selected or deselected.

Other features, such as "formatting marks" do show the current state, so for consistency I would expect the sidebar and the navigator to do the same.

Steps to Reproduce

With the compact view

  1. Go to 'View'
  2. See that the 'Sidebar' entry has no check mark
  3. Click on 'Sidebar'
  4. Open the 'View' menu again
  5. See that the 'Sidebar' still has no check mark

With the tabbed view

  1. Go to 'View'
  2. See that 'Sidebar' is not selected
  3. Click on 'Sidebar'
  4. See that 'Sidebar' is still not selected

Expected Behavior

The 'Sidebar' and 'Navigator' menu entries and notebook bar buttons appear as checked and selected, respectively, depending on whether their corresponding feature is shown or hidden.

Actual Behavior

The 'Sidebar' and 'Navigator' menu entries and notebook bar buttons never appear as checked / selected.

Screenshots

sidebar_open_not_selected

Desktop

  • Collabora version: 24.04.7.2
  • OS and version: Ubuntu 22.04.5 LTS
  • Browser and version: Firefox 130.0.1

Additional Context

The status of these buttons and menu entries seems to be determined by the UNO commands that are sent and received.

The difference between these two and 'Formatting Marks' (which works as expected) is that in the case of 'Formatting Marks' the command name is the same both for the request and the response ('.uno:ControlCodes'), while for Sidebar and Navigator they are different:

  • Formatting Marks:
    • request: uno .uno:ControlCodes
    • response: statechanged: .uno:ControlCodes=true
  • Sidebar:
    • request: uno .uno:SidebarDeck.PropertyDeck
    • response: statechanged: { "locale": "en-US", "commandName": ".uno:Sidebar", "state": "true" }
  • Navigator:
    • request: uno .uno:Navigator
    • response: statechanged: { "locale": "en-US", "commandName": ".uno:SidebarDeck.NavigatorDeck", "state": "true" }
@cosminh11 cosminh11 added bug Something isn't working unconfirmed labels Sep 20, 2024
@cosminh11
Copy link
Contributor Author

cosminh11 commented Sep 20, 2024

I tried to fix this in the frontend by mapping those different request and response values. I have a patch that mostly works.
I would open a pull-request (should I?) but there's a problem: sometimes when you open the navigator, the sidebar button gets selected too. That's because we also get a "statechanged" event for it as well (steps to reproduce, below).
So I'm not sure: do we want to do this in the frontend (and try to find a solution for this "both-are-selected" issue)? Or should we use different commands, maybe try to send the commands we're receiving (i.e. send .uno:Sidebar instead of .uno:SidebarDeck.PropertyDeck).
I would need some advice.

Steps to reproduce the remaining "both-are-selected" issue:

  • both sidebar and navigator are off
  • click sidebar
    • the following are received:
      • statechanged: .uno:Sidebar=true
      • statechanged: { "locale": "en-US", "commandName": ".uno:SidebarDeck.NavigatorDeck", "state": "true" }
      • statechanged: { "locale": "en-US", "commandName": ".uno:SidebarDeck.NavigatorDeck", "state": "false" }
      • statechanged: { "locale": "en-US", "commandName": ".uno:Sidebar", "state": "true" }
    • sidebar becomes visible
    • sidebar button is selected
    • navigator button is not selected
  • click navigator
    • the following are received:
      • statechanged: { "locale": "en-US", "commandName": ".uno:Sidebar", "state": "false" }
      • statechanged: { "locale": "en-US", "commandName": ".uno:SidebarDeck.NavigatorDeck", "state": "true" }
    • navigator becomes visible
    • sidebar button is not selected
    • navigator button is selected
  • click navigator
    • the following are received:
      • statechanged: { "commandName": ".uno:SidebarDeck.NavigatorDeck", "state": "false" }
      • statechanged: .uno:Sidebar=false
    • neither sidebar nor navigator are visible
    • neither button is selected
  • click navigator
    • the following are received:
      • statechanged: .uno:Sidebar=true
      • statechanged: { "locale": "en-US", "commandName": ".uno:SidebarDeck.NavigatorDeck", "state": "true" }
    • navigator becomes visible
    • both buttons are selected (expected: only the navigator button should be)
      • at this point, if you switch to compact view, then only "navigator" is checked, as expected; switching back to tabbed view shows only "navigator" as selected; however all this is done while 8 more "statechanged" messages are received

@sebastiaanveld
Copy link
Contributor

sebastiaanveld commented Oct 1, 2024

Same issue somne of the other buttons on the View tab/menu:

  • Invert Background

These following buttons have are check in the menu in Compact view but not in Tabbed view

  • Dark Mode

    Open a document in Compact view, this will show Dark Mode checked in the menu. When switching to Tabbed view the button will be checked
    Open a document in Tabbed view and Dark mode does not show the button checked. Switch to light mode and back to Dark mode will toggle the button checked.

  • Full Screen

    This one will be checked in the Compact view, but never in Tabbed view

COOLWSD version: 24.04.7.2(git hash: d5ebff5 (E))
LOKit version: Collabora Office 24.04.7.2(git hash: 8c74383)
Served by: Debian GNU/Linux 12 (bookworm)
Server ID: ae20e376

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed
Projects
Status: No status
Development

No branches or pull requests

2 participants