- Dedup via deep field query auf Object (1 GET statt 2 Junction-GETs)
- Wörter batch-linked via PATCH objects/{id}.linked_words create
- Fragen batch-linked via PATCH objects/{id}.linked_questions create
- related_words + distractor_words via PATCH questions/{id} create
- Keine direkten Junction-Table-POSTs mehr
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove per-call _ensure_junction (junction tables already exist)
- Load existing word/question links upfront (2 GET requests instead of N)
- Batch POST all new words_objects links in a single request
- Batch POST related_words and distractor_words per new question
- Eliminates O(N) serial GET+POST pattern in favour of O(1) upfront dedup + batch writes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- GET: Deep-Query über pictures.linked_words statt manuelle Junction-Abfrage
- POST: PATCH /items/pictures/{id} mit linked_words.create statt _ensure_link
- _ensure_junction/_ensure_link für words_pictures entfernt
- Setup-Logik in _setup_words_pictures() ausgelagert (idempotent)
- Batch-Insert aller neuen Links in einem einzigen PATCH-Call
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
words_pictures M2M-Relationen werden idempotent beim POST eingerichtet –
kein manueller Setup-Call nötig.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Einmaliger Setup-Endpoint: setzt special=m2m auf Alias-Felder,
erstellt Relations für words_pictures Junction in Directus.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
_find_or_create_word gibt is_new zurück; bei is_new=False wird das Level
via PATCH aktualisiert. _ensure_link läuft immer → Picture-Junction wird
auch für bereits existierende Wörter angelegt.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rechte Sidebar in zwei Frames aufgeteilt: Objects (bisherig) + Words (neu)
- Words-Frame: Wörter + Level (1–100) per Bild anlegen, dedupliziert via words_pictures Junction
- Pending-Words in Primary-Farbe mit inline Level-Edit, gespeicherte Words in neutralem Grau
- Save-Button speichert alle pending Words nach Directus (status=draft, title_de, level, picture-Link)
- Automatisches Laden der Bild-Words bei Bildwechsel
- Backend: GET/POST /api/directus/pictures/<pic_id>/words (words_pictures Junction, _find_or_create_word)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Backend: DELETE question/word räumt alle Junction-Zeilen mit auf
- Backend: /purge-orphans bereinigt verwaiste Junctions per Objekt
- Frontend: reloadQW ruft purgeOrphans vor dem Neu-Laden auf
- Frontend: ↺-Button in Wörter- und Fragen-Sidebar
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Neue Endpoints: GET /api/object/<id>/questions+words, DELETE /api/question/<id>, DELETE /api/word/<id>
- GenerateIt: Wörter-Sidebar mit ×-Chips, Fragen-Sidebar mit Level-Badge und ×
- Laden beim Objekt-Wechsel und nach Generate it
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Cache all words globally across levels (avoids 500+ Directus calls)
- Add Procfile with --timeout 300 to prevent gunicorn killing long requests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- DrawIt: Button "Fertigstellen" unter Objektliste setzt Picture-Status auf drawing_created
- Bild verschwindet danach aus der Annotieren-Ansicht
- GenerateIt: lädt jetzt Directus-Bilder mit status=drawing_created
- GenerateIt: zeigt Bild-Vorschau + Directus-Objekte
- app.py: PATCH-Endpunkt für Pictures + Status-Parameter im GET
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- bbox und polygon Felder in Directus versteckt (Daten bleiben)
- Alle Auswahlen laufen nur noch über das selections-Feld
- CanvasObject, DirectusObject, API und Zeichenlogik umgestellt
- Objekte mit mehreren Auswahlen werden korrekt auf Canvas gezeichnet
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Neues JSON-Feld 'selections' in Directus objects-Collection
- Alle Auswahlen (bbox/polygon) landen in einem einzigen Objekt
- Erste Auswahl bleibt weiterhin in bbox/polygon für Kompatibilität
- GET-Proxy liefert selections-Feld mit aus
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Polygon kann nun mit ≥2 Punkten über den Button geschlossen werden
- Button zeigt "Polygon schließen & hinzufügen" solange Polygon offen ist
- Automatisches Schließen (Verbindung zum Startpunkt) beim Klick
- Einmalige Setup-Route /api/directus/setup-m2m entfernt (nicht mehr benötigt)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Login und Bildliste laufen jetzt über /api/directus/* statt direkt
zu db.hejyou.com – kein CORS-Problem mehr im Browser.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>