fix: sidebar collapse preference not persisting after reload#2474
fix: sidebar collapse preference not persisting after reload#2474cleanjunc wants to merge 1 commit into
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA single ChangesAppLayout Controller userId Value
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Collapsing the left or right sidebar did not survive a page reload. The toggle animated correctly, but the preference was never saved.
Why
The
app-layoutStimulus controller saves the preference by callingPATCH /users/${this.userIdValue}, but it never declared astatic valuesblock. WithoutuserIdregistered, Stimulus does not bind thedata-app-layout-user-id-valueattribute that the layout renders, sothis.userIdValueresolves toundefined.Every toggle therefore hit
/users/undefined, which could not updateshow_sidebarorshow_ai_sidebar, and the layout reset on the next load.How
Add the missing value declaration to the controller:
Closes #2473
Summary by CodeRabbit