Repository navigation
dashboard: modularize dashboard.py and dashboard.html with zero bundler - #414
Merged
Merged
Conversation
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.
Why
runtime/host/dashboard.py(2,487 LOC) andruntime/host/dashboard.html(1,700 LOC) had grown into single-file monoliths mixing HTTP server logic, data collection, parsers, quiet-mode management, inline CSS, and 1,200+ lines of inline JS, while retaining a leftoversparkring_sircl.cpusimport. Modularizing them makes the built-in Web + TUI dashboard maintainable without dropping any feature or introducing a JS bundler.What Changed
runtime/host/dashboard.py: 2,487 → 199 LOC facade):dashboard_client.py(131 LOC),dashboard_parsers.py(353 LOC),dashboard_sources.py(501 LOC),dashboard_collector.py(1,029 LOC),dashboard_quiet.py(156 LOC), anddashboard_server.py(313 LOC), while preserving all public entrypoints and symbols ondashboard.py.parse_cpu_list/format_cpu_listintoruntime/host/host_load.py, severing the dashboard's lastsparkring_sirclimport.runtime/host/dashboard.html: 1,700 → 78 LOC shell):runtime/host/dashboard_assets/(dashboard.css,charts.js,ring.js,cards.js,app.js), assembled server-side viadashboard.page_bytes()with identical SHA-256 CSP hashes and zero external build tooling.runtime/host/test_dashboard_actions.pyto inspectdashboard.page_bytes()[0]instead of the raw HTML shell.runtime/host/test_dashboard_modular.pycovering facade exports, zerosparkring_sirclcoupling, and assembled page/CSP invariants.Verification
pytestacross dashboard, Playwright UI,host_load, andbuild_debsuites: 510 passed, 5 skipped.ruff check,check_repository_layout.py, andcheck_release_safety.py(0 findings) all passed cleanly.origin/main(c41caea3).Risks / Follow-Ups
.debpackaging paths are preserved.