Repository navigation
Offline geschriebene Texte bleiben auf dem Gerät und landen beim nächsten Start in Convex (LRN-30) - #21
Open
hernstev97 wants to merge 4 commits into
Open
Offline geschriebene Texte bleiben auf dem Gerät und landen beim nächsten Start in Convex (LRN-30)#21hernstev97 wants to merge 4 commits into
hernstev97 wants to merge 4 commits into
Conversation
Offline reading mode now stores exercise drafts in LocalStorage, one key per
area, exercise and fingerprint (60 KB limit as online). The next authorized
start hands them to the new adoptDraft mutation, which saves a draft only
where none exists; a different saved draft stays and the exercise offers the
offline one ("Offline geschriebener Entwurf verfügbar · Laden"/"Verwerfen").
Signing out deletes the local drafts and asks first if some are not adopted.
Updates the offline notice, docs/CONVEX.md and the callout in the narrative
course. Notes stay unavailable offline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Offline drafts carry the reset generation of their offline copy; after a reset they are offered instead of coming back on their own. - Drafts whose fingerprint no longer matches the exercise stay on the device instead of being saved where no exercise shows them. - "Laden" asks first and forgets the local copy only once the server has confirmed the draft; a held draft no longer overwrites it. - A local copy is removed only while it still holds the adopted text. - The start waits up to three seconds for adoption, so an exercise opened right away already shows the adopted text. - Shorter offline notice; it took half a phone screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Some 300 dev-server navigations in one tab ran the CI browser out of resources (net::ERR_INSUFFICIENT_RESOURCES, then a page module failed to load); the nightly run on main failed the same way. Each width now gets a fresh tab, and a page that did not load is tried once more. The test checks layout, not loading. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fresh tab and retry did not help on CI: the runner was short of resources for the PostgreSQL, pytest and VM tests in the same run too, and the retries only used up the test's time budget. The flakiness exists on main as well and gets its own issue instead of riding along with LRN-30. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 22, 2026
Open
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Für LRN-30: Wer die App ohne Netz startet („Offline weiterlesen“), konnte Übungen bearbeiten, aber beim Neuladen war der Text weg. Für den Erzählkurs ist das ein echtes Hindernis: Du schreibst im Bus kurze Texte, und gerade dort fehlt oft das Netz.
Jetzt legt der Offline-Lesemodus jede Eingabe in einer Übung auf dem Gerät ab. Beim nächsten Start mit Anmeldung landet sie als Entwurf in Convex. Liegt dort schon ein anderer Entwurf, wird nichts überschrieben: Die Übung bietet den offline geschriebenen mit „Offline geschriebener Entwurf verfügbar · Laden“ an, daneben „Verwerfen“.
So funktioniert es
saveAnswerschreibt jeden Entwurf zusätzlich nach LocalStorage. Je Bereich, Übung und Fingerprint gibt es einen Schlüssel (learn-offline:draft:v1:<bereich>:<übung>:<fingerprint>), mit der Grenze von 60 KB wie online.prepareDraftlädt ihn nach einem Neuladen ohne Netz wieder.adoptDraftspeichert einen Entwurf nur, wenn auf dem Server keiner liegt, und antwortet mitsaved,sameoderdifferent. Die Entscheidung fällt in einer Transaktion, eine eigene Sync-Engine gibt es nicht (LRN-7). Beisavedundsamewird die lokale Kopie gelöscht, beidifferentangeboten. Der Start wartet bis zu 3 s auf diese Übernahme. So zeigt eine sofort geöffnete Übung den Text schon an.docs/CONVEX.mdaktualisiert, Callout „So ist dieser Kurs gebaut“ infiguren-motivationangepasst.Entscheidungen (Steven hat geschlafen, ich habe selbst entschieden)
practice/explain/gap. Der Mechanismus hängt am gemeinsamensaveAnswer, deshalb kostet es nichts extra. Ausnahme ist wie bisherscenario, das keinen Entwurf hat.adoptDraftprüft den Eigentümer wie jeder Endpunkt.Prüfungen
pnpm lint,pnpm typecheck,pnpm test(339 Tests, neu: LocalStorage-Funktionen,adoptDraftsamt Autorisierung)pnpm test:pwa:e2e6/6, neuer Fall: offline starten, Prosa-Text schreiben, offline neu laden, Text noch da; wieder online „Erneut verbinden“ bei nicht erreichbarer Anmeldung, Text bleibt auf dem Gerätpnpm test:convex:e2e15/15, neuer Fall: fehlender Entwurf wird übernommen, ein anderer gespeicherter bleibt und wird angeboten, „Laden“ speichert, Entwurf von vor einem Reset wird nur angeboten, „Verwerfen“ löschtpnpm test:e2e59/59CI: Alle Jobs außer e2e sind grün (check, verify, convex). e2e scheitert an einem einzigen Test, „real content fits phone, tablet and desktop viewports“, und zwar auch auf unverändertem
main: Lauf 39690603895 scheitert genauso (net::ERR_INSUFFICIENT_RESOURCESnach einigen hundert Seitenaufrufen). Am 20.10. war derselbe Stand vonmaingrün. Lokal istpnpm test:e2egrün (59/59). Ein Versuch, den Test robuster zu machen, half nicht und ist wieder zurückgenommen (7a87626, e72f331). Der Inhalt des Branches entspricht damit dem geprüften Stand. Weiter geht es in LRN-31.Nicht geprüft: Auf dem echten Handy im Flugmodus mit echter Clerk-Sitzung. Das geht nur mit Stevens Konto. Vorschlag: Offline starten, im Erzählkurs Übung 6 etwas schreiben, neu laden, dann online starten und auf einem zweiten Gerät nachsehen.
Closes LRN-30
🤖 Generated with Claude Code