fix: save to local for the mvp 0.1

This commit is contained in:
Julien Calixte
2026-05-16 00:28:53 +02:00
parent c702ba83d8
commit c716bdb379

View File

@@ -52,11 +52,11 @@ at build time:
a `.env` file gitignored locally) and embedded as `const &'static str`s in
the binary.
- The dev clones the git working copy onto the SD card from their laptop
(`git clone` directly onto the mounted SD), so `/sd/repo/notes.md` is
(`git clone` directly onto the mounted SD), so `/sd/local/notes.md` is
present at first boot.
- Re-configuring = re-build + re-flash. For a single-dev MVP, that's fine.
If the firmware boots and finds no `/sd/repo` or no `/sd/repo/notes.md`, it
If the firmware boots and finds no `/sd/local` or no `/sd/local/notes.md`, it
shows a one-line error on the splash and stops. No recovery flow ships in
v0.1 — the dev re-mounts the SD and reboots.
@@ -75,7 +75,7 @@ Auth model rationale: [ADR-005](adr.md#adr-005-auth--https--github-personal-acce
Boot (~3 s): Wi-Fi reconnect in background
Open /sd/repo/notes.md, place cursor at end of file
Open /sd/local/notes.md, place cursor at end of file
[EDITING] ← keypresses, partial refresh per edit
@@ -147,15 +147,15 @@ a save.
## Error UX
| Failure | What the user sees |
| ----------------------------------------------------- | ------------------------------------------------------------------------ |
| No SD card on boot | "no SD card — insert one and reboot" |
| SD card mounted but `/sd/repo` missing | "missing /sd/repo — re-provision and reboot" (dev re-clones onto SD) |
| Wi-Fi credentials wrong (build-time env vars) | status shows `Wi-Fi ✗`; dev rebuilds with correct env vars and re-flashes |
| Wi-Fi won't connect | status shows `Wi-Fi ✗`; editing still works; `Ctrl-G` shows "no network" |
| `Ctrl-G` publish fails (auth, network, merge conflict)| status shows reason; local commit is preserved; user can retry — non-fast-forward auto-recovers via pull-then-push and is not surfaced as a failure unless the pull itself conflicts |
| File write fails | status flashes "save failed"; buffer stays dirty |
| Keyboard disconnects | header shows `⌨ ✗`; editing pauses; reconnects automatically |
| Failure | What the user sees |
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| No SD card on boot | "no SD card — insert one and reboot" |
| SD card mounted but `/sd/local` missing | "missing /sd/local — re-provision and reboot" (dev re-clones onto SD) |
| Wi-Fi credentials wrong (build-time env vars) | status shows `Wi-Fi ✗`; dev rebuilds with correct env vars and re-flashes |
| Wi-Fi won't connect | status shows `Wi-Fi ✗`; editing still works; `Ctrl-G` shows "no network" |
| `Ctrl-G` publish fails (auth, network, merge conflict) | status shows reason; local commit is preserved; user can retry — non-fast-forward auto-recovers via pull-then-push and is not surfaced as a failure unless the pull itself conflicts |
| File write fails | status flashes "save failed"; buffer stays dirty |
| Keyboard disconnects | header shows `⌨ ✗`; editing pauses; reconnects automatically |
No modal dialogs. Errors live in the status line. The editor is never blocked
from accepting keystrokes (except during the partial-refresh frame itself).