Skip to content

[dev] [carhartlewis] lewis/comp-sidebar-opportunistic-ui#855

Merged
claudfuen merged 2 commits into
mainfrom
lewis/comp-sidebar-opportunistic-ui
Jun 10, 2025
Merged

[dev] [carhartlewis] lewis/comp-sidebar-opportunistic-ui#855
claudfuen merged 2 commits into
mainfrom
lewis/comp-sidebar-opportunistic-ui

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Jun 9, 2025

This is an automated pull request to merge lewis/comp-sidebar-opportunistic-ui into dev.
It was created by the [Auto Pull Request] action.

- Revert sidebar collapse state if the server action fails
- Update comments for clarity on background state updates
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 5:10pm
comp-framework-editor ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 5:10pm
comp-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 5:10pm
comp-trust ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 5:10pm

@claudfuen claudfuen merged commit c394fce into main Jun 10, 2025
5 of 9 checks passed
@claudfuen claudfuen deleted the lewis/comp-sidebar-opportunistic-ui branch June 10, 2025 17:08
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

const { execute } = useAction(updateSidebarState, {
onError: () => {
// Revert the optimistic update if the server action fails
setIsCollapsed(isCollapsed);

Fix in Cursor


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 👎

@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.40.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants