-
Couldn't load subscription status.
- Fork 818
Improved reactivity in Fragments #189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Morph API Data Validation Regression
The shouldUseMorph condition was simplified, no longer validating for fragment.code and fragment.file_path. This could cause the morph API to receive incomplete fragment data, potentially leading to API errors or unexpected behavior.
app/page.tsx#L100-L104
Lines 100 to 104 in a66a4ff
| // Determine which API to use based on morph toggle and existing fragment | |
| const shouldUseMorph = useMemo( | |
| () => useMorphApply && fragment, | |
| [useMorphApply, fragment], | |
| ) |
Bug: Undo Operation Triggers Unwanted Sidebar Display
The handleUndo function clears the displayed fragment and result by calling setCurrentPreview. However, setCurrentPreview now always opens the sidebar, which results in an empty sidebar being visible after an undo operation, creating a confusing user experience.
app/page.tsx#L293-L297
Lines 293 to 297 in a66a4ff
| function handleUndo() { | |
| setMessages((previousMessages) => [...previousMessages.slice(0, -2)]) | |
| setCurrentPreview({ fragment: undefined, result: undefined }) | |
| } |
Note
Memoizes key selectors and introduces an independently toggleable preview sidebar, updating API selection, message updates, and layout accordingly.
isSideBarOpen; open on submit/preview, close via button; layout switches betweenmd:grid-cols-1andmd:grid-cols-2.Previewnow renders based onisSideBarOpen(notfragment), replacingonClosewithisSideBarOpenandsetIsSideBarOpen.filteredModels,currentModel,lastMessage,currentTemplate,shouldUseMorph, andapiEndpointusinguseMemo.setLastMessage(useCallback) and removedsetMessage, updating assistant message/result updates accordingly.shouldUseMorphnow checks onlyfragment; conditional payload spread updated to...(shouldUseMorph ? { currentFragment: fragment } : {}).Written by Cursor Bugbot for commit a66a4ff. This will update automatically on new commits. Configure here.