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
- Collapse the left or right sidebar.
- Reload the page.
- 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.
Collapsing the left or right sidebar works visually, but the state is lost after a page reload. The sidebar always reopens.
The
app-layoutStimulus controller readsthis.userIdValuewhen saving the preference, but the controller never declares astatic valuesblock. BecauseuserIdis not registered, Stimulus does not bind thedata-app-layout-user-id-valueattribute set in the layout, andthis.userIdValueisundefined.As a result every toggle sends a request to
/users/undefined, which cannot updateshow_sidebarorshow_ai_sidebar. The preference is never stored, so the layout resets on the next load.Steps to reproduce
Expected
The collapsed or expanded state is remembered across reloads.
Notes
UsersController#updatealready permitsshow_sidebarandshow_ai_sidebar, and the layout already rendersdata-app-layout-user-id-value. The only missing piece is the value declaration on the controller.