feat: implement unsaved changes handling in editor and sidebar

- Introduced global state management for unsaved changes and pending navigation using Jotai atoms.
- Updated the editor component to sync local unsaved changes with global state and handle navigation prompts.
- Enhanced sidebar functionality to check for unsaved changes before navigating to a new note.
- Added cleanup logic for global state on component unmount to prevent stale data.
This commit is contained in:
Anish Sarkar 2025-12-19 22:59:42 +05:30
parent ee46a43afc
commit b53b19170e
4 changed files with 108 additions and 7 deletions

View file

@ -14,7 +14,7 @@ export const chatSummary = z.object({
});
export const chatDetails = chatSummary.extend({
initial_connectors: z.array(z.string()),
initial_connectors: z.array(z.string()).nullable().optional(),
messages: z.array(z.any()),
});