Issue: Refactor ModalContext to Support Multiple Simultaneous Modals
Priority
Low - Future enhancement, not required for MVP
Current State
- ModalContext manages a single modal at a time
currentModal state is ModalType | null
- Works well for current use cases (login, register, save design)
Problem Statement
We have one specific use case where multiple modals would be beneficial: showing a delete confirmation modal on top of another modal (e.g., confirming deletion of a design while a design details modal is open).
Currently, opening a confirmation modal would close the underlying modal, requiring the user to re-open it if they cancel the deletion.
Proposed Solution
Refactor ModalContext to support a modal stack instead of a single modal.
Implementation Steps
1. Analysis Phase (30 min)
2. Type System Updates (15 min)
3. Context Provider Refactoring (45 min)
4. Rendering Logic Updates (1 hour)
5. Styling & UX Polish (30 min)
6. Testing & Validation (2 hours)
7. Documentation (30 min)
Alternative Approaches to Consider
Before implementing, evaluate if simpler solutions exist:
-
Inline Confirmations: Could delete confirmation be an inline UI state change within the parent modal rather than a separate modal?
-
Modal Modes: Could the existing modal support different "modes" (view/edit/confirm-delete) without needing a stack?
-
Dedicated Confirmation Modal: Could we have a special confirmation modal that temporarily hides (not closes) the underlying modal?
Estimated Time
Total: 5-6 hours of focused development + testing
Success Criteria
Notes
- This is not essential for launch - only implement if time allows
- Consider if the UX benefit justifies the implementation complexity
- Could be replaced with simpler confirmation patterns (inline buttons, toast notifications)
Before starting this work, ask: "Does this problem really require modal stacking, or could we solve it more simply?" Often the best refactoring is the one you don't have to do.
Issue: Refactor ModalContext to Support Multiple Simultaneous Modals
Priority
Low - Future enhancement, not required for MVP
Current State
currentModalstate isModalType | nullProblem Statement
We have one specific use case where multiple modals would be beneficial: showing a delete confirmation modal on top of another modal (e.g., confirming deletion of a design while a design details modal is open).
Currently, opening a confirmation modal would close the underlying modal, requiring the user to re-open it if they cancel the deletion.
Proposed Solution
Refactor ModalContext to support a modal stack instead of a single modal.
Implementation Steps
1. Analysis Phase (30 min)
2. Type System Updates (15 min)
currentModalfrom single value to array/stack structureModalTypeif new modal types are needed3. Context Provider Refactoring (45 min)
currentModalstate with modal stack stateopenModalto push onto stack (not replace)closeModalto handle:4. Rendering Logic Updates (1 hour)
5. Styling & UX Polish (30 min)
6. Testing & Validation (2 hours)
7. Documentation (30 min)
Alternative Approaches to Consider
Before implementing, evaluate if simpler solutions exist:
Inline Confirmations: Could delete confirmation be an inline UI state change within the parent modal rather than a separate modal?
Modal Modes: Could the existing modal support different "modes" (view/edit/confirm-delete) without needing a stack?
Dedicated Confirmation Modal: Could we have a special confirmation modal that temporarily hides (not closes) the underlying modal?
Estimated Time
Total: 5-6 hours of focused development + testing
Success Criteria
Notes
Before starting this work, ask: "Does this problem really require modal stacking, or could we solve it more simply?" Often the best refactoring is the one you don't have to do.