mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 12:25:05 +03:00
## What kind of change does this PR introduce? Bug fix. Resolves FE-2802. Fixes #43882. ## What is the current behavior? Second-level foreign key side panels in Table Editor can be dismissed while dirty without a discard confirmation. That makes accidental dismissal easy and is inconsistent with the shared dirty-form dismissal pattern from FE-2802. ## What is the new behavior? - Adds `DiscardChangesConfirmationDialog` handling to `ForeignKeySelector` - Guards all selector close paths behind a local dirty-state check - Normalizes foreign key state so derived type metadata does not create false dirty prompts - Clarifies in `modality.mdx` that route-driven/page-unload flows should use a navigation guard rather than the dialog/sheet close guard | Dirty State | Dialog | | --- | --- | | <img width="1502" height="899" alt="test Table Editor AWS Healthy Toolshed Supabase-D1EA9D5F-46EB-4DB5-830D-7CEF36A55B7E" src="https://github.com/user-attachments/assets/3d866850-d062-4fb7-9949-2fd713e6088f" /> | <img width="1502" height="899" alt="test Table Editor AWS Healthy Toolshed Supabase" src="https://github.com/user-attachments/assets/1396361d-1d44-4206-862f-3379ea22be30" /> | ## Additional context Includes a focused unit test for foreign key dirty-state normalization.