Repository navigation
feat(web): Schedule and General become ES-module pages (stage 3) - #767
Merged
Merged
Conversation
Schedule and General follow stage 2 (#727): no inline scripts or inline handlers in either partial. Their code moves to static/v3/js/pages/schedule.js and pages/general.js, started per swap-in by the page registry. - Schedule: both pickers are drawn from the saved config carried as JSON in data-* attributes. The forms' hx-on save handlers become one htmx:afterRequest listener on the page; the forms are marked data-reports-result, which app.js now treats like an hx-on after-request handler, so a save still shows one notification. - General: the timezone picker reads data-timezone. The Security section's forms and buttons are delegated data-actions; requests go through core/api.js, so the login redirect is quiet, and a change made just before a swap is still reported. - handleScheduleResponse, handleDimScheduleResponse and webLogin stay as deprecated aliases through window.LEDMatrix. - New DOM suites test_schedule_page.js and test_general_page.js; the web login unit suite imports the module; test_es_modules.py pins the pages, the aliases, and the schedule config's round trip through its attribute. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (15)
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 |
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 2 high |
🟢 Metrics 168 complexity · 9 duplication
Metric Results Complexity 168 Duplication 9
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
…ge 3 modules Codacy flagged two unused catch variables and dynamic-key writes in pages/schedule.js and boot.js. The schedule config is read with getAttribute, and the default days and the webLogin alias object are built with Object.fromEntries. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 5, 2026
Merged
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.
Stage 3 of the web UI's move to ES modules (
docs/WEB_FRONTEND_ARCHITECTURE.md, migration steps 6 and 7). Follows #703 and #727.What changes
Schedule (
partials/schedule.html→static/v3/js/pages/schedule.js, 193 inline lines → 0)data-schedule-config/data-dim-schedule-configinstead of templating it into a script.hx-on:htmx:after-requesthandlers become onehtmx:afterRequestlistener on the page root. The forms are markeddata-reports-result, andapp.jstreats that like anhx-onafter-request handler, so a save still shows exactly one notification.oninputmoves into the module.General (
partials/general.html→static/v3/js/pages/general.js, 153 inline lines → 0)data-timezone.data-actionand use one delegated submit and one delegated click listener. A token row added after a create needs no listener of its own.core/api.js. The optional login's "sign in again" answer no longer flashes an error while the page navigates away. A change made just before a swap is still reported, but nothing is drawn into the page that has gone.hx-oncall to the sharedshowSaveResult, as the Rotation form does.Old globals stay as deprecated aliases through
window.LEDMatrix(one console warning each):handleScheduleResponse,handleDimScheduleResponse, andwebLogin(an object with its five methods).boot.jsgainsaliasObject()for that last one.Behaviour is otherwise unchanged. Two small differences on error paths: a
nullJSON answer to a schedule save now reports an error instead of throwing, and a picker widget that loads late is retried for a few seconds instead of once.Tests
test/js/dom/test_schedule_page.js(28 checks) andtest/js/dom/test_general_page.js(49 checks), built like the cache suite: the real partial, the real widget and the real API shape, then five swaps followed by one action that must make exactly one request. They also cover cancel-on-swap, late widgets, hostile token names and the old entry points. Both suites were mutation-checked.unit/test_general_web_login_token.jsnow imports the module instead of slicing the template's script.unit/test_restart_banner.jscovers thedata-reports-resultmarker.test/web_interface/test_es_modules.pyregisters both pages and aliases, and checks that no template still names a moved global. It also rendersschedule.htmlwith a hostile config (quotes,</div>) and checks the attribute parses back to the same value.Local runs (Windows):
REQUIRE_DOM=1 node test/js/run_all.jsagainstweb_interface.appin emulator mode: all 33 suites pass.python scripts/build_css.py --check: up to date.test/web_interfaceplus the web smoke, auth, partial-save, legacy-flags and JS-unit tests, on this branch and on anorigin/mainworktree:test_starlark_pixlet_routes.py).data-dirty; Revoke removes it; Save General shows one toast. A section reload re-mounts once..catch).🤖 Generated with Claude Code