Repository navigation
Web UI: data/ as the single source of truth (2/7) - #43
Merged
Merged
Conversation
…I source of truth The /euclid/ plate skin is dropped to reclaim tight LittleFS flash (~20 KB gzipped). With one skin left, the ui-concepts/ source tree + sync_web.py copy step were pure overhead and are dissolved entirely: - delete ui-concepts/ (euclid-live, console-euclid-live, _engine) and the deployed data/euclid/; data/ is now the single committed source you edit - delete scripts/sync_web.py; its one real remaining job — stamping ?v=<content-hash> cache-busters on asset URLs — moves into scripts/gzip_web_files.py (the buildfs/uploadfs pre-action), which also runs standalone: python3 scripts/gzip_web_files.py - .github/workflows/release.yml: drop the manual sync step (the buildfs hook now guarantees a consistent image) - scripts/dev_server.js: serve data/ only, engine loaded from data/assets/ - docs: ENGINE_API.md moves to docs/; new docs/WEB_UI.md replaces the stale ui-concepts README (it advertised two skins + mockup dirs that no longer exist); HARDENING_LOG/ROADMAP/TECH_DEBT updated; de-euclid the comments in server.cpp/storage.cpp Verified: node --check on app.js/engine.js; dev_server serves / and 404s /euclid/; stamp+gzip hook is idempotent on a clean tree. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Follow-up to the euclid-removal commit earlier in this PR, guided by an exhaustive residue audit (which found zero functional leftovers — no dead routes, endpoints, files, or build steps; only comment/doc text): - data/assets/app.css: three comments cited the deleted console/ and euclid/ mockup dirs as design references — rewritten as self-contained design notes - src/api/status.cpp, docs/TECH_DEBT.md: "both skins" / "the skins" → the one web UI - docs/DEVELOPMENT.md: data/ tree now lists engine.js (it was missing) and the Web UI section defers to docs/WEB_UI.md instead of keeping a second, drifting account of the workflow - .github/copilot-instructions.md: same fix, plus the load-bearing rule an agent must not rediscover the hard way — the view never calls fetch; all device-API logic belongs in engine.js Intentionally kept: historical euclid mentions in HARDENING_LOG/ROADMAP (they record real events), the "Byrne (Euclid) material language" design-language description, and ENGINE_API.md's skin-agnostic framing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two defects in the asset pipeline, both of which could ship a broken
filesystem image to users.
1. Hook ordering (release-integrity bug). The pre-action was registered on
the "buildfs"/"uploadfs" ALIASES, but an alias's pre-actions run after
the alias's dependency — the image — is already built. Reproduced by
deleting data/*.gz (the state of a fresh CI checkout, since .gz are
gitignored) and running `pio run -t buildfs`: the log printed
"Building FS image" BEFORE the stamp+gzip output, so the published
littlefs.bin contained uncompressed, unstamped assets. It only looked
correct locally because stale .gz files from earlier runs were present.
Fixed by registering on the real image target,
$BUILD_DIR/${ESP32_FS_IMAGE_NAME}.bin, which uploadfs/uploadfsota also
depend on — so one registration now covers every path. Re-verified with
no .gz present: gzip output now precedes "Building FS image", for both
buildfs and uploadfs.
This is what the ui-concepts dissolution commit assumed when it deleted the release
workflow's explicit sync step; that assumption is only true now.
2. The stamp regex required an EXISTING ?v=<hex>, so a newly added
reference like <script src="/assets/new.js"> was silently never
stamped — and /assets/ is served with a week-long max-age, pinning
users to a stale copy. The stamp is now optional in the pattern and
anchored on the closing quote so only whole attribute values match.
Verified against stamped, unstamped, and single-quoted refs, and the
emitted stamps re-checked against the files' real sha1[:8].
…k deferral
Two follow-ups from review of the build-hook ordering fix.
- The stamp regex was anchored only on the closing quote, so it also
matched an external URL that merely contains /assets/
("https://cdn.example.com/assets/app.js": stamped with a local file's
hash, or aborting the build) and a directory ("/assets/icons/":
aborting the build). It now requires an opening quote directly before
/assets/ and a file extension. Tested against stamped, unstamped,
single-quoted, dotted-name, external-URL and directory references; the
real data/index.html restamps idempotently. A reference inside an HTML
comment still matches; if its file is gone the build fails loudly
instead of shipping it (documented).
- The image-target registration works only because PlatformIO defers
pre: script actions: at pre-time ESP32_FS_IMAGE_NAME is undefined and
the target string is re-expanded later. Documented in place, including
what to do if that ever changes (move it to a post: script) — a
regression there would silently bring back the unstamped-image bug.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 12, 2026
bring42
changed the base branch from
claude/pr1-premium-render-modes
to
main
September 12, 2026 18:03
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.
What
data/becomes the single source of truth for the web UI./euclid/skin and dissolvesui-concepts/+scripts/sync_web.py. With one skin left, the copy step was pure overhead. Frees ~110 KB of filesystem content (the files plus their gzipped copies).?v=<hash>cache-busting stamps move intoscripts/gzip_web_files.py, the build pre-action. The release workflow's manual sync step is removed.buildfsalias, which fires after the filesystem image is packed. Reproduced by deletingdata/*.gz(a fresh CI checkout) and runningpio run -t buildfs: the image was built before the gzip ran. It is now hooked on the image target itself. The stamp regex also now catches newly added, unstamped asset references./assets/and a directory path. The hook's reliance on PlatformIO deferringpre:actions is now documented where it's registered.docs/WEB_UI.md;ENGINE_API.mdmoved todocs/.Review notes
Verification
Built and tested on this branch alone. This stacked state is new, so it was verified independently rather than assumed: 80/80 native tests pass, the firmware builds for
seeed_xiao_esp32c3(90.9% of the app partition), and the web UI JS passesnode --check.🤖 Generated with Claude Code
The stack (merge top to bottom):