Severity: Medium
Labels: bug, data-integrity, frontend, P2
Location: frontend/src/components/flashcards/tabs/PasteTab.tsx:57-62 (live-reparse effect); conditional tab mounting in frontend/src/components/flashcards/FlashcardImportModal.tsx:131-135
Description
All import tabs share one cards array via setCards, and tabs are conditionally mounted. PasteTab's live re-parse effect runs on mount; with empty local text it hits if (!text...) { onCards([]); return; }, clearing the shared deck.
Steps to reproduce
- Open Import; on Upload/URL/AI/Photo build a parsed-cards table.
- Click the "Paste" tab.
- The table empties — all parsed/edited cards are lost with no warning.
Expected vs actual
- Expected: switching tabs preserves the working deck.
- Actual: re-entering Paste unconditionally clears it.
Suggested fix
Don't emit onCards([]) from the empty/mount path (gate on a "user has typed" flag), or keep tabs mounted (hidden) so the effect doesn't re-fire on switch.
Acceptance criteria
- Navigating between import tabs never clears already-parsed cards.
Severity: Medium
Labels: bug, data-integrity, frontend, P2
Location:
frontend/src/components/flashcards/tabs/PasteTab.tsx:57-62(live-reparse effect); conditional tab mounting infrontend/src/components/flashcards/FlashcardImportModal.tsx:131-135Description
All import tabs share one
cardsarray viasetCards, and tabs are conditionally mounted. PasteTab's live re-parse effect runs on mount; with empty localtextit hitsif (!text...) { onCards([]); return; }, clearing the shared deck.Steps to reproduce
Expected vs actual
Suggested fix
Don't emit
onCards([])from the empty/mount path (gate on a "user has typed" flag), or keep tabs mounted (hidden) so the effect doesn't re-fire on switch.Acceptance criteria