Fix syntax error and finalize robust note resizing

This commit is contained in:
2026-01-24 20:02:38 +01:00
parent 8e35780717
commit 4a1b60e575
6 changed files with 26 additions and 21 deletions

View File

@@ -237,15 +237,21 @@ export function NoteCard({
}
const handleSizeChange = async (size: 'small' | 'medium' | 'large') => {
// Notify parent of size change so it can update its state
onSizeChange?.(size)
startTransition(async () => {
// Instant visual feedback for the card itself
addOptimisticNote({ size })
// Trigger layout refresh
onResize?.()
setTimeout(() => onResize?.(), 300)
// Notify parent so it can update its local state
onSizeChange?.(size)
// Update server in background
updateSize(note.id, size)
// Trigger layout refresh
onResize?.()
setTimeout(() => onResize?.(), 300)
// Update server in background
await updateSize(note.id, size)
router.refresh()
})
}
const handleCheckItem = async (checkItemId: string) => {