Repository navigation
Commit 6177417
Vendor HTMX/Pico/Chart.js so HTMX buttons work in pywebview
HTMX, Pico CSS, Chart.js and chartjs-adapter-date-fns all loaded from
cdn.jsdelivr.net with an SRI hash on the HTMX script. Inside pywebview
(WKWebView on macOS) the HTMX request was failing — offline-tolerant
caching, an SRI mismatch on a re-built CDN file, or strict
content-policy — and dropping silently. Without HTMX every HTMX button
(Test MongoDB connection, Test SolisCloud, Poll SolisCloud now) clicked
to nothing with no console error, which presented as "I can't click on
anything in the app".
Everything is now served from `src/solisdash/static/vendor/`:
- pico.min.css (Pico 2)
- htmx.min.js (HTMX 2.0.4)
- chart.umd.min.js (Chart.js 4.4.7)
- chartjs-adapter-date-fns.bundle.min.js
base.html and history.html load them via `url_for('static', path='vendor/…')`.
No network roundtrip on first render, no CDN dependency at runtime.
Also adds `tests/test_clickability.py`:
- For every authed page, extract every `<a href>`, `<form action>`
and `[hx-{get,post,put,delete}]` URL pointing back at our app, then
assert the endpoint doesn't 5xx (catches "I shipped a button whose
handler doesn't exist" and "the handler 500s on empty input").
- Refuse any future `cdn.jsdelivr.net` / `unpkg.com` /
`cdnjs.cloudflare.com` reference in a template.
- Confirm all four vendored asset files are present on disk.
- Refuse `pointer-events` declarations in style.css without an
explicit `/* allow-pointer-events: … */` justification.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 2de5fb9 commit 6177417
12 files changed
Lines changed: 297 additions & 22 deletions
File tree
- src/solisdash
- static/vendor
- templates
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
7 | 28 | | |
8 | 29 | | |
9 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 7 | + | |
11 | 8 | | |
12 | 9 | | |
13 | 10 | | |
| |||
20 | 17 | | |
21 | 18 | | |
22 | 19 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 20 | + | |
29 | 21 | | |
30 | 22 | | |
31 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 92 | + | |
| 93 | + | |
100 | 94 | | |
101 | 95 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| |||
0 commit comments