Skip to content

Conversation

@DayuanJiang
Copy link
Owner

Summary

  • Add Close Protection toggle to Settings dialog
  • Save setting to localStorage (default: enabled)
  • Make beforeunload confirmation conditional based on user preference
  • Settings button now always visible in header (not just when access code required)
  • Add shadcn Switch and Label UI components

Changes

  • app/page.tsx: Add closeProtection state, make beforeunload effect conditional
  • components/settings-dialog.tsx: Add Close Protection toggle with localStorage persistence
  • components/chat-panel.tsx: Always show Settings button, pass callback to SettingsDialog
  • components/ui/switch.tsx: New shadcn Switch component
  • components/ui/label.tsx: New shadcn Label component

Test plan

  • Open Settings dialog via gear icon in header
  • Verify Close Protection toggle is visible and enabled by default
  • Toggle off, save, and verify no confirmation when leaving page
  • Toggle on, save, and verify confirmation appears when leaving page
  • Refresh page and verify setting persists from localStorage

- Add Close Protection toggle to Settings dialog
- Save setting to localStorage (default: enabled)
- Make beforeunload confirmation conditional
- Settings button now always visible in header
- Add shadcn Switch and Label components
@vercel
Copy link

vercel bot commented Dec 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
next-ai-draw-io Ready Ready Preview Comment Dec 6, 2025 0:42am

@DayuanJiang DayuanJiang merged commit 9f77199 into main Dec 6, 2025
4 checks passed
@DayuanJiang DayuanJiang deleted the feat/configurable-close-protection branch December 6, 2025 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants