Wire flashcard CSV/JSON import/export and fix theme/responsive gaps

Import and export were stubbed with status-text placeholders; wire them
to the existing backend endpoints with a real file picker (web JS
bridge or native FileDialog) and browser/desktop download, plus an
import preview with create/update/skip/error counts before commit.

Also fix the library and study screens' theme-refresh handlers, which
were no-op stubs so cards never restyled on a theme toggle, and add
responsive layout handling for narrow viewports.
This commit is contained in:
hz
2026-07-21 16:41:26 -05:00
parent 48a8c8361d
commit 4dfbd811b9
5 changed files with 515 additions and 17 deletions
+8
View File
@@ -75,6 +75,14 @@ create/update/skip/error preview (`FlashcardImportPreviews`, TTL-expired after a
skipped as an exact-content duplicate, or reported as a row-level error. Limits: 25 MB and
10,000 notes per import.
The Godot client (`scripts/autoload/flashcard_service.gd`) picks a file, uploads it to the
matching preview endpoint as `multipart/form-data`, and shows the create/update/skip/error counts
before letting the user commit or cancel. Export streams the response body and saves it client
side. File selection and download both branch on `OS.has_feature("web")`: on web, a hidden
`<input type="file">`/`FileReader` pair (bridged back into GDScript via
`JavaScriptBridge.create_callback`) and an anchor-click data-URL download stand in for a native
picker/save dialog; on desktop, a `FileDialog` and the OS downloads folder are used instead.
## Deployment
No new secrets. `FlashcardsController`/stores register the same way as the rest of the API