diff --git a/TODO.md b/TODO.md index e09dd2a..f656f06 100644 --- a/TODO.md +++ b/TODO.md @@ -1,9 +1,11 @@ # TODO -> Last updated: 2026-06-22 -> Context: Add mobile-responsive accordion + chip bar to repertoire filter index (column headings restored) +> Last updated: 2026-06-24 +> Context: Inline JS/CSS + gzip analysis (see docs/ANALYSIS_INLINE_JS_CSS_MINIFY.md) ## Pending +- [ ] #gzip-nginx Enable gzip compression in nginx config `(nginx/xamxam.conf)` +- [ ] #extract-inline-js Move inline JS to external files across 17 templates `(app/templates/**/*.php)` - [ ] #rep-student-touch Replace hover student popover with tap-to-open drawer for mobile `(repertoire.php, repertoire.css)` - [ ] #rep-polish Polish: scroll-position memory on HTMX swap, animation tuning `(repertoire.css)` - [ ] #icon-color-verify Verify icon colors render correctly across all pages (header, admin tables, forms, dialogs, cleanup modal) @@ -61,3 +63,7 @@ - [x] #extra-css-admin Update `head.php` to support `$extraCssAdmin` for admin-only stylesheets `(head.php)` ✓ ## Deferred / Blocked +- [ ] #minify-js Minify custom JS files (post-extraction, ~1,763 lines across 9 files) +- [ ] #bundle-css Bundle CSS to eliminate @import waterfall (18 files, ~6,200 lines) +- [ ] #build-step Add build step (justfile commands) for JS minification + CSS bundling +- [ ] #tighten-csp Tighten CSP to remove 'unsafe-inline' after inline JS extraction diff --git a/docs/ANALYSIS_INLINE_JS_CSS_MINIFY.md b/docs/ANALYSIS_INLINE_JS_CSS_MINIFY.md new file mode 100644 index 0000000..d4ffba6 --- /dev/null +++ b/docs/ANALYSIS_INLINE_JS_CSS_MINIFY.md @@ -0,0 +1,276 @@ +# Analysis: Inline JS/CSS, Minification & Compression + +**Date:** 2026-06-24 +**Scope:** Entire project (excluding `/vendor`, `/.jj`, `/.git`, `/coverage`, `/storage`) + +--- + +## 1. Inline JavaScript + +### 1.1 Summary + +**~797 lines of inline JavaScript** spread across **17 PHP template files**. Every admin page loads multiple inline blocks. The public-facing pages also contain inline JS. + +### 1.2 Detailed Inventory + +| File | Lines | Can Be Externalized? | Notes | +|---|---|---|---| +| `app/templates/admin/contenus.php` | 232 | ✅ Yes | Bulk lang/tag operations: delete, merge, rename, inline rename via HTMX, dialog handlers. Two large independent blocks (langues + mots-clés) that mirror each other almost identically. | +| `app/templates/public/repertoire.php` | 101 | ✅ Yes | Student popover: positioning logic, HTML fetch/prefill. Self-contained component. | +| `app/templates/admin/tags.php` | 76 | ✅ Yes | Bulk merge, inline rename, delete confirm. Mirrors the mots-clés block in `contenus.php` — same logic duplicated. | +| `app/templates/admin/apropos-groups-form.php` | 68 | ✅ Yes | Dynamic form fields: add/remove contact groups and entries, reindex. Reads template from `