Skip to content

Bug: Sidebar collapse preference does not persist after reload #2473

Description

@cleanjunc

Collapsing the left or right sidebar works visually, but the state is lost after a page reload. The sidebar always reopens.

The app-layout Stimulus controller reads this.userIdValue when saving the preference, but the controller never declares a static values block. Because userId is not registered, Stimulus does not bind the data-app-layout-user-id-value attribute set in the layout, and this.userIdValue is undefined.

As a result every toggle sends a request to /users/undefined, which cannot update show_sidebar or show_ai_sidebar. The preference is never stored, so the layout resets on the next load.

Steps to reproduce

  1. Collapse the left or right sidebar.
  2. Reload the page.
  3. The sidebar is expanded again.

Expected

The collapsed or expanded state is remembered across reloads.

Notes

UsersController#update already permits show_sidebar and show_ai_sidebar, and the layout already renders data-app-layout-user-id-value. The only missing piece is the value declaration on the controller.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions