Files
vibe-kanban/frontend
Louis Knight-Webb 6fb7b939d9 Don't let user close browser window if they have unsaved changes (vibe-kanban) (#538)
* Perfect! The implementation is complete and passes all checks. 

## Summary

Added browser window close protection to prevent data loss when users have unsaved changes in the task dialog:

- **Added `beforeunload` event listener** in [`TaskFormDialog.tsx`](file:///private/var/folders/m1/9q_ct1913z10v6wbnv54j25r0000gn/T/vibe-kanban/worktrees/vk-f59b-don-t-let/frontend/src/components/tasks/TaskFormDialog.tsx#L95-L111)
- **Integrates with existing `hasUnsavedChanges()` logic** - no duplication
- **Only active when dialog is open AND has unsaved content** 
- **Automatic cleanup** when dialog closes or changes are saved
- **Browser-standard confirmation dialog** appears when user tries to close tab/window

The feature now protects against data loss from both dialog close (existing) and browser window close (new) scenarios.

* Cleanup script changes for task attempt f59bea00-6158-4cdd-ad19-1f30e40c1324

* Perfect! Now the browser window close protection works for both scenarios:

## Updated Implementation

**Create mode:** Warns when user has entered title or description content
**Edit mode:** Warns when user has modified title, description, or status from original values

The `beforeunload` event will now trigger when:
- **Creating a task** and typing content, then trying to close browser
- **Editing a task** and changing any field, then trying to close browser

Both the existing dialog close warning and new browser window close warning now protect against data loss in all editing scenarios.

* Cleanup script changes for task attempt f59bea00-6158-4cdd-ad19-1f30e40c1324
2025-08-20 15:44:38 +01:00
..
2025-07-11 15:57:30 +01:00
2025-06-25 09:36:07 +01:00
2025-06-14 15:14:08 -04:00
2025-07-08 13:41:47 +02:00
2025-06-14 15:14:08 -04:00
2025-06-14 16:26:48 -04:00
2025-06-14 15:14:08 -04:00
2025-07-04 11:11:45 +02:00