1
0

WIP: working patcher?

This commit is contained in:
2026-03-15 22:27:59 +01:00
parent 2ce1772611
commit d7622e5e05
15 changed files with 1363 additions and 337 deletions

View File

@@ -4,51 +4,46 @@
- [x] Device detection proof of concept (File System Access API)
- [x] Serial prefix → model mapping (verified against official Kobo help page)
- [x] Architecture planning (updated: fully client-side, no PHP backend)
- [x] Architecture planning (fully client-side WASM, no backend)
- [x] Installed Go via Homebrew (v1.26.1)
- [x] Verified all kobopatch tests pass natively
- [x] Verified all kobopatch tests pass under `GOOS=js GOARCH=wasm` (via Node.js)
- [x] Updated device identification doc with correct model list
- [x] Removed obsolete backend-api.md
- [x] Verified all kobopatch tests pass natively + WASM
- [x] Created `kobopatch-wasm/` with setup.sh, build.sh, go.mod, main.go
- [x] WASM wrapper compiles successfully (9.9MB)
- [x] All kobopatch tests still pass with our module's replace directives
- [x] Cleaned up .gitignore
- [x] GitHub/Gitea CI workflow (build + test)
- [x] Patch UI: loads patches from zip, parses YAML, renders toggles
- [x] PatchGroup mutual exclusion (radio buttons)
- [x] Full app flow: connect → detect → configure patches → upload firmware → build → write/download
- [x] Patches served from `src/public/patches/` with `index.json` for version discovery
- [x] JSZip for client-side zip extraction
- [x] Renamed `src/frontend``src/public` (webroot)
- [x] Moved `patches/` into `src/public/patches/`
## In Progress
## To Test
### Integration Testing
- [ ] End-to-end test in browser with real Kobo device + firmware zip
- [ ] Verify WASM loads and `patchFirmware()` works in browser (not just Node.js)
- [ ] Verify patch YAML parser handles all 6 patch files correctly
- [ ] Verify File System Access API write to `.kobo/KoboRoot.tgz`
- [ ] Verify download fallback works
- [ ] Test WASM binary in actual browser (load wasm_exec.js + kobopatch.wasm)
- [ ] Test `patchFirmware()` JS function end-to-end with real firmware zip + patches
## Remaining Work
### Frontend - Patch UI
- [ ] YAML parsing in JS (extract patch names, descriptions, enabled, PatchGroup)
- [ ] `patch-ui.js` — render grouped toggles per target file
- [ ] PatchGroup mutual exclusion (radio buttons)
- [ ] Generate kobopatch.yaml config string from UI state
### Frontend - Build Flow
- [ ] User provides firmware zip (file input / drag-and-drop)
- [ ] Load WASM, call `patchFirmware()` with config + firmware + patch files
- [ ] Receive KoboRoot.tgz blob, write to `.kobo/` via File System Access API
- [ ] Fallback: download KoboRoot.tgz manually
- [ ] Bundle patch YAML files as static assets
- [ ] Copy `kobopatch.wasm` + `wasm_exec.js` to `src/public/` as part of build
- [ ] Run WASM patching in a Web Worker (avoid blocking UI during build)
- [ ] Loading/progress feedback during WASM load + build
- [ ] Better error messages for common failures
- [ ] Test with multiple firmware versions / patch zips
## Future / Polish
- [ ] Run WASM patching in a Web Worker (avoid blocking UI)
- [ ] Browser compatibility warning with detail
- [ ] Loading/progress states during build
- [ ] Error handling for common failure modes
- [ ] Host as static site (GitHub Pages / Netlify)
- [ ] NickelMenu install/uninstall support (bonus feature)
- [ ] NickelMenu install/uninstall support
- [ ] Dark mode support
## Architecture Change Log
- **Switched from PHP backend to fully client-side WASM.**
Reason: avoid storing Kobo firmware files on a server (legal risk).
The user provides their own firmware zip. kobopatch runs as WASM in the browser.
No server needed — can be a static site.
- **Patches served from zip files in `src/public/patches/`.**
App scans `patches/index.json` to find compatible patch zips for the detected firmware.
User provides their own firmware zip. kobopatch runs as WASM in the browser.