openhab / openhab-webui

Web UIs of openHAB
Eclipse Public License 2.0
212 stars 232 forks source link

Sticky Developer Sidebar #2206

Closed jlaur closed 5 months ago

jlaur commented 5 months ago

The problem

The Developer Sidebar is shown initially and it keeps reappearing on page refresh.

Expected behavior

Is it intentionally shown initially (i.e. after installation)? Is it intentionally shown after being hidden when refreshing the page?

I would hope that it is possible to hide it so that it won't be shown again until requested using the (Shift+Alt+D) shortcut.

Steps to reproduce

Hide the Developer Sidebar. Refresh the page.

Your environment

runtimeInfo:
  version: 4.1.0
  buildString: "Build #3760"
locale: da-DK
systemInfo:
  configFolder: C:\PROGRA~1\OPENHA~1\conf
  userdataFolder: C:\PROGRA~1\OPENHA~1\userdata
  logFolder: C:\PROGRA~1\OPENHA~1\userdata\logs
  javaVersion: 17.0.8
  javaVendor: Oracle Corporation
  osName: Windows 10
  osVersion: "10.0"
  osArchitecture: amd64
  availableProcessors: 4
  freeMemory: 120730968
  totalMemory: 394264576
  uptime: 844
  startLevel: 100
addons: []
clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: false
    macos: false
    windows: true
    cordova: false
    phonegap: false
    electron: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    os: windows
    pixelRatio: 1
    prefersColorScheme: light
  isSecureContext: true
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: 8
    hardwareConcurrency: 4
    language: da
    languages:
      - da
      - en-US
      - da-DK
      - en-DK
      - en
    onLine: true
    platform: Win32
  screen:
    width: 3840
    height: 1600
    colorDepth: 24
  support:
    touch: false
    pointerEvents: true
    observer: true
    passiveListener: true
    gestures: false
    intersectionObserver: true
  themeOptions:
    dark: light
    filled: true
    pageTransitionAnimation: default
    bars: filled
    homeNavbar: default
    homeBackground: default
    expandableCardAnimation: default
  userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/120.0.0.0 Safari/537.36
timestamp: 2023-12-08T14:59:00.120Z

Browser console

Browser network traffic

Additional information

lolodomo commented 5 months ago

I agree

rkoshak commented 5 months ago

Is it intentionally shown initially (i.e. after installation)?

I believe so.

Is it intentionally shown after being hidden when refreshing the page?

This doesn't sound right and suspect it's unintentional.

I would hope that it is possible to hide it so that it won't be shown again until requested using the (Shift+Alt+D) shortcut.

I agree. It should be hide able and that choice should persist across refreshes.

JustinGeorgi commented 5 months ago

It should only appear automatically if you have an empty overview page. Have you added any widgets to the MainUI overview page?

sihui62 commented 5 months ago

I would hope that it is possible to hide it so that it won't be shown again until requested using the (Shift+Alt+D) shortcut.

Yes, please! This "feature" is very annoying if you are using a Page on a wall tablet in full size or kiosk mode and don't have access to a keyboard to hide the sidebar.

ghys commented 5 months ago

I have encountered this behavior too while spinning up a new instance to review some PRs and found it (sorry) annoying as well.

The 'offending' code is here, I believe: https://github.com/openhab/openhab-webui/blob/0c199ec1022fedc1caa45ed9e05fd9a9f2c95b5b/bundles/org.openhab.ui/web/src/components/app.vue#L508-L512

I think it would be better to have a button in the "empty state" of the overview page to open the developer pane instead, in this case.

sihui62 commented 5 months ago

have a button

I realized today that there is already a switch to turn the Developer Sidebar on and off, but it is always re-enabled after a page refresh.

ds

So if this switch state would persist, everything should be fine ...

JustinGeorgi commented 5 months ago

I have encountered this behavior too while spinning up a new instance to review some PRs and found it (sorry) annoying as well.

No apologies necessary, I would find it annoying too. I just can't replicate it on either of my test systems.

The 'offending' code is here, I believe:

Yeah, that's it. It just works as expected on my system, so I'm flummoxed.

I think it would be better to have a button in the "empty state" of the overview page to open the developer pane instead, in this case.

This is a perfectly satisfactory compromise. I'll try and get a PR out today or tomorrow.

jlaur commented 5 months ago

Thank you @florian-h05. 👍