Skip to content

refactor: externalize dashboard CSS and JS into static/ - #18

Merged
martinctc merged 2 commits into
mainfrom
refactor/externalize-static-assets
Nov 26, 2026
Merged

martinctc merged 2 commits into
mainfrom
refactor/externalize-static-assets

Conversation

@martinctc

Copy link
Copy Markdown
Owner

Summary

Implements #4.

  • Moved PAGE_CSS and CLIENT_JS out of dashboard.py into static/dashboard.css and static/dashboard.js.
  • They are loaded and inlined at build time, so the generated HTML is still self-contained and offline.
  • Formatted the assets with Prettier and added a CI lint check (npx prettier --check).
  • Added a test that the static assets are inlined verbatim, plus CONTRIBUTING/parity docs.
  • dashboard.py drops ~1,700 lines.

Test plan

  • python -m pytest tests -q → 48 passed (including browser tests)
  • npx prettier@3 --check static/dashboard.js static/dashboard.css → clean
  • Verified the extracted files match the original strings before formatting
  • Validated ci.yml and _config.yml YAML

Note

This touches ci.yml and dashboard.py, so it may need a rebase after #17 (mypy annotations + CI rework) merges.

Closes #4

Move the page stylesheet and client render layer out of dashboard.py and into static/dashboard.css and static/dashboard.js. They are inlined at build time, so the generated HTML stays self-contained and offline. The assets are formatted with Prettier and checked in CI.

dashboard.py drops ~1,700 lines; no generated output changes.
@martinctc martinctc self-assigned this Nov 26, 2026
…static-assets

# Conflicts:
#	.github/workflows/ci.yml
#	dashboard.py
#	tests/test_dashboard.py
@martinctc
martinctc merged commit 66c5b2f into main Nov 26, 2026
8 checks passed
@martinctc
martinctc deleted the refactor/externalize-static-assets branch November 26, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor dashboard.py to externalize the inlined JS/CSS

1 participant