[dev] [carhartlewis] lewis/comp-sidebar-opportunistic-ui#855
Conversation
- Revert sidebar collapse state if the server action fails - Update comments for clarity on background state updates
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…omp-sidebar-opportunistic-ui
There was a problem hiding this comment.
Bug: Optimistic State Update Reversion Fails
The onError callback in SidebarCollapseButton fails to revert the optimistic sidebar state update. It attempts to revert using setIsCollapsed(isCollapsed), but the isCollapsed prop has already been updated by the optimistic setIsCollapsed(!isCollapsed) call and subsequent re-render. This results in the state being set to the new, optimistically updated value instead of reverting to the original state.
apps/app/src/components/sidebar-collapse-button.tsx#L19-L22
comp/apps/app/src/components/sidebar-collapse-button.tsx
Lines 19 to 22 in 0bed3a4
BugBot free trial expires on June 12, 2025
You have used $0.00 of your $60.00 spend limit so far. Manage your spend limit in the Cursor dashboard.
Was this report helpful? Give feedback by reacting with 👍 or 👎
|
🎉 This PR is included in version 1.40.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This is an automated pull request to merge lewis/comp-sidebar-opportunistic-ui into dev.
It was created by the [Auto Pull Request] action.