From 401416d131514659cf6ea1ef12d16fb44bbeb401 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Nov 2026 02:24:24 +0000 Subject: [PATCH] perf(site): stop loading jQuery, Slick and the theme script; record license evidence The homepage loaded jQuery, jQuery Migrate, the Bootstrap JS bundle, Slick (JS and CSS) and the WordPress theme script. No markup used Slick or any Bootstrap JS component; the theme script's two live behaviours (mobile menu toggle, compact header past 50 px) now live in scripts/browser/menu.js. About 225 KB of deferred JavaScript and one stylesheet request fewer. The files keep their public paths; the parity test re-inserts the exact removed markup before comparing with the baseline. License register: a file-by-file review of the served third-party files, and the Inter OFL text served beside the Inter fonts. The current state snapshot is brought up to 2026-11-22. Checked: site tests 77/77, lint, verify, docs verify; headless Chromium at 390 and 1280 px (menu, aria-expanded, scrolled header, no console errors, no request to the removed files). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012ta9C814jorgtP53iJYMQP --- apps/site/docs/migration-manifest.json | 8 +- apps/site/docs/refactor-progress.md | 9 ++ apps/site/docs/spds/current_state_snapshot.md | 15 ++- apps/site/docs/spds/license_register.md | 24 ++++- apps/site/scripts/browser/menu.js | 13 +++ apps/site/source/index.html | 10 -- .../static/assets/theme/fonts/Inter-OFL.txt | 92 +++++++++++++++++++ apps/site/tests/output-parity.test.mjs | 22 ++++- apps/site/tests/performance-budget.test.mjs | 6 +- 9 files changed, 178 insertions(+), 21 deletions(-) create mode 100644 apps/site/static/assets/theme/fonts/Inter-OFL.txt diff --git a/apps/site/docs/migration-manifest.json b/apps/site/docs/migration-manifest.json index 2f62cf5..373c9e6 100644 --- a/apps/site/docs/migration-manifest.json +++ b/apps/site/docs/migration-manifest.json @@ -292,7 +292,7 @@ }, { "path": "source/index.html", - "sha256": "2698e042002ad42167fa8760273bec52a659806b531807bcb163c9096695a489" + "sha256": "f1fc3013ba93c537c5868723e5afce1dc1d61cb8b49330f058717c30a5975499" }, { "path": "assets/system-anatomy.css", @@ -496,7 +496,7 @@ }, { "path": "scripts/browser/menu.js", - "sha256": "15e7ba1e5e1894c5cb7d7f70fd4a472905225d04c2ecde4bcba5b9b6df56a918" + "sha256": "29a79a8f170347c22811c3936132ef2106cf971d87ed6e8b76dc35dd1d9f777d" }, { "path": "scripts/browser/reveal.js", @@ -549,6 +549,10 @@ { "path": "assets/sentrapedia-solusi-poster.webp", "sha256": "cd8e833e4d26f6ea3b0bf4b3a0c33282405650d60fadaf46bde48612187d4a62" + }, + { + "path": "static/assets/theme/fonts/Inter-OFL.txt", + "sha256": "262481e844521b326f5ecd053e59b98c8b2da78c8ee1bdbb6e8174305e54935a" } ] } diff --git a/apps/site/docs/refactor-progress.md b/apps/site/docs/refactor-progress.md index c0166bc..5e5e6f6 100644 --- a/apps/site/docs/refactor-progress.md +++ b/apps/site/docs/refactor-progress.md @@ -84,3 +84,12 @@ The reviewed foundation from `c773e692` is preserved. Desktop/mobile navigation - **Not verified:** the live site (nothing is deployed), a real phone, Safari and Firefox, a screen reader. The PageSpeed score itself will differ from the local one; rerun PageSpeed after deployment. - **Open from the review, not changed:** while a choice is pending the panel's link and two buttons come before the skip link in Tab order on the six inner pages; the declared subset range names about 40 code points Inter lacks (a soft hyphen in future copy would fetch the full font and the copy test would not notice); several tests match the controllers' text and not their behaviour; the product film's early observer gains only the scroll distance between its first pixel and 30% in view. - **Left as found:** the five workflow posters (410 KiB) and the 943x735 mark used at 120 px (72 KiB) still load with the page; 664 KB of homepage HTML is mostly four inline SVG illustrations; Bootstrap's CSS is almost entirely unused; `Cache-Control` is `max-age=0` for every file (a Vercel setting); twelve `.clinical-note-ink` spans carry `aria-label`; `label-content-name-mismatch` is reported for the language link and the five workflow card controls. + +## Theme script removal - 2026-11-22 + +- **Asked:** Gaffer asked to close the launch-readiness gaps on third-party weight and licensing. +- **Changed:** the homepage no longer loads `jquery.min.js`, `jquery-migrate.min.js`, `bootstrap.bundle.min.js`, `slick.min.js`, `slick.min.css` or `custom55e2.js`, nor the inline `ajaxurl` script only that theme script read. No page markup used Slick, Bootstrap's JavaScript components (no `data-bs-*`), the WordPress post or project loaders, or the sub-menu toggle. The theme script's two live behaviours (mobile menu toggle, `#header.scrolled` past 50 px) are in `scripts/browser/menu.js`, bundled into `media/design-audit.js`. The files stay at their paths; `tests/output-parity.test.mjs` re-inserts the exact removed markup before comparing with the baseline. `assets/theme/fonts/Inter-OFL.txt` is the one added path. +- **Effect:** about 225 KB of deferred JavaScript and one stylesheet request fewer on the homepage. +- **Checked:** site tests 77/77, lint, verify and docs verify with no errors; in headless Chromium at 390 px the menu button opens and closes the menu and updates `aria-expanded`, at 1280 px the header gains and loses `scrolled`, no console errors and no request to the removed files. +- **Not verified:** a new PageSpeed run, a real phone, Safari and Firefox. + diff --git a/apps/site/docs/spds/current_state_snapshot.md b/apps/site/docs/spds/current_state_snapshot.md index 3978bb5..a4102ec 100644 --- a/apps/site/docs/spds/current_state_snapshot.md +++ b/apps/site/docs/spds/current_state_snapshot.md @@ -4,9 +4,9 @@ title: "Current State Snapshot" status: active authority: Gaffer owner: "dr. Ferdi Iskandar" -version: "1.1.0" +version: "1.2.0" created: "2026-10-14" -last_verified: "2026-10-15" +last_verified: "2026-11-22" applies_to: "projects/healthcare/sentrapedia/apps/site" source_of_truth: true supersedes: [] @@ -25,4 +25,13 @@ review_trigger: "material change to purpose, architecture, runtime, data handlin ## Function Preserve a dated implementation snapshot. -As of 2026-10-15, the site subsystem contains authored source/assets, generated `site/`, Node build/preview/contact tooling, a Vercel contact function (`api/contact.mjs`), 15 automated tests, a verifier, migration manifest/report, and SPDS documentation. It is public on Vercel at `https://sentrapedia.vercel.app` as a work-in-progress pre-beta site, deployed by CLI. Contact delivery returns 503 until the Resend secrets are set. Committed-checkout tests passed in the standalone split. Monitoring, legal basis/retention, licensing, and Git-connected deploys remain open. +As of 2026-11-22, the site subsystem contains authored source/assets, generated `site/`, Node build/preview/contact tooling, a Vercel contact function (`api/contact.mjs`), 77 automated tests (`node --test`), a verifier, migration manifest/report, and SPDS documentation. It is public at `https://sentrapedia.com` as a work-in-progress pre-beta site. Since the previous snapshot (2026-10-15): + +- **Beta entry:** "Masuk" and "Daftar" link to `https://beta.sentrapedia.com/sign-in` and `/sign-up`; the beta application's `/apply` renders Clerk's waitlist (root repository, pull request 19). +- **Contact form:** accepts the site's HTTPS origin without a pinned `CONTACT_PUBLIC_ORIGIN` and logs each delivery failure as one line naming only the reason (pull request 17). The per-address attempt limit is held in memory per function instance, so it is weak on serverless hosting. +- **Measurement and search:** consent-based Google Analytics, Search Console verification, `robots.txt` and `sitemap.xml` (pull requests 11, 12, 16). +- **Performance and accessibility:** the PageSpeed plan of 2026-11-21 (pull request 14; record in `docs/refactor-progress.md`). On 2026-11-22 the homepage stopped loading jQuery, jQuery Migrate, the Bootstrap JS bundle, Slick and the WordPress theme script; the mobile menu toggle and the compact header moved to `scripts/browser/menu.js`. +- **Monitoring:** `.github/workflows/uptime.yml` probes the site, the contact function and the beta sign-up every 15 minutes and opens an `outage` issue on failure (pull request 18). +- **Licensing:** file review in `license_register.md`; the theme, Slick and owner-supplied media remain open. + +Still open: legal basis and retention for contact messages, the license items above, Bootstrap CSS that is almost entirely unused, and `Cache-Control: max-age=0` on every file (a Vercel setting). diff --git a/apps/site/docs/spds/license_register.md b/apps/site/docs/spds/license_register.md index d1652b4..3d99413 100644 --- a/apps/site/docs/spds/license_register.md +++ b/apps/site/docs/spds/license_register.md @@ -4,9 +4,9 @@ title: "License Register" status: active authority: Gaffer owner: "dr. Ferdi Iskandar" -version: "1.0.0" +version: "1.1.0" created: "2026-10-14" -last_verified: "2026-10-14" +last_verified: "2026-11-22" applies_to: "projects/healthcare/sentrapedia/apps/site" source_of_truth: true supersedes: [] @@ -26,3 +26,23 @@ review_trigger: "material change to purpose, architecture, runtime, data handlin Preserve known license evidence and gaps. Caveat includes an OFL text file. Local GSAP and jQuery bundles retain embedded notices. Bootstrap, Bootstrap Icons, Slick, Inter, original theme assets, brand artwork, and video/media redistribution rights require a file-by-file review before public release. This register records evidence status and does not grant rights. + +## File review, 2026-11-22 + +Read from the first bytes of each served file (`static/` and `assets/`). Evidence of a notice, not a legal opinion. + +| Component | Served at | Loaded by a page | Notice in the file | Status | +| --- | --- | --- | --- | --- | +| Bootstrap 5.3.8 CSS | `/vendor/cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/` | yes | MIT, "Copyright 2011-2025 The Bootstrap Authors" | notice present | +| Bootstrap 5.3.8 JS bundle | same package, `dist/js/` | no, since 2026-11-22 | MIT, same header | notice present; unused | +| Bootstrap Icons 1.11.3 | `/vendor/cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/` and `bootstrap-icons-subset.woff2` | yes | MIT in the CSS header | notice present | +| jQuery 3.7.1, jQuery Migrate 3.4.1 | `/assets/vendor/` | no, since 2026-11-22 | "(c) OpenJS Foundation", jquery.org/license | notice present; unused | +| Slick 1.8.1 JS and CSS | `/vendor/cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/` | no, since 2026-11-22 | none | open: no notice in the files; no longer loaded | +| GSAP, ScrollTrigger, SplitText, DrawSVGPlugin | `/media/` | yes | "@license Copyright 2026, GreenSock", terms at gsap.com/standard-license | notice present; terms are GreenSock's standard license, for Gaffer to accept | +| Inter (TTF, WOFF2 subsets) | `/assets/theme/fonts/` | yes | none in the font folder before 2026-11-22 | OFL 1.1 text added as `Inter-OFL.txt`, copied from github.com/rsms/inter LICENSE.txt | +| Caveat | `/media/fonts/` | yes | `Caveat-OFL.txt` | notice present | +| Theme CSS and `custom55e2.js` from the original WordPress theme | `/assets/theme/` | CSS yes, script no since 2026-11-22 | none | open: origin and rights of the theme need Gaffer's confirmation | +| Brand artwork, films, posters, screenshots | `/assets/`, `/media/` | yes | none | open: owner-supplied; redistribution rights need Gaffer's confirmation | + +The four unused script files stay at their public paths because the output-parity contract preserves every path; removing them is a separate decision. + diff --git a/apps/site/scripts/browser/menu.js b/apps/site/scripts/browser/menu.js index 9d99fe2..fd14adc 100644 --- a/apps/site/scripts/browser/menu.js +++ b/apps/site/scripts/browser/menu.js @@ -4,6 +4,12 @@ function initMenu() { if (menuToggle && mobileMenu) { const syncMenu = () => menuToggle.setAttribute('aria-expanded', String(document.body.classList.contains('menu-open'))); new MutationObserver(syncMenu).observe(document.body, { attributes: true, attributeFilter: ['class'] }); + // Formerly the jQuery theme script (assets/theme/js/custom55e2.js), the only reason the page loaded jQuery. + menuToggle.addEventListener('click', event => { + event.preventDefault(); + menuToggle.classList.toggle('active'); + document.body.classList.toggle('menu-open'); + }); mobileMenu.addEventListener('click', event => { if (!event.target.closest('a[href^="#"]')) return; document.body.classList.remove('menu-open'); @@ -18,4 +24,11 @@ function initMenu() { }); } + // The desktop header compacts once the page has scrolled past 50 px (main1509.css .header-desk.scrolled). + const header = document.querySelector('#header'); + if (header) { + const syncHeader = () => header.classList.toggle('scrolled', window.scrollY > 50); + window.addEventListener('scroll', syncHeader, { passive: true }); + syncHeader(); + } } diff --git a/apps/site/source/index.html b/apps/site/source/index.html index 6842d2c..e89ec2b 100644 --- a/apps/site/source/index.html +++ b/apps/site/source/index.html @@ -10,7 +10,6 @@ - @@ -58,20 +57,11 @@ - - - - - - diff --git a/apps/site/static/assets/theme/fonts/Inter-OFL.txt b/apps/site/static/assets/theme/fonts/Inter-OFL.txt new file mode 100644 index 0000000..9b2ca37 --- /dev/null +++ b/apps/site/static/assets/theme/fonts/Inter-OFL.txt @@ -0,0 +1,92 @@ +Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION AND CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/apps/site/tests/output-parity.test.mjs b/apps/site/tests/output-parity.test.mjs index ac94c74..f8045a0 100644 --- a/apps/site/tests/output-parity.test.mjs +++ b/apps/site/tests/output-parity.test.mjs @@ -41,6 +41,20 @@ const reversals20261121 = { 'media/product-film.js': script => script.replace(filmWarmUp, ''), }; +// Theme script removal, 2026-11-22: jQuery, jQuery Migrate, the Bootstrap bundle, Slick and the WordPress theme script +// are no longer loaded (their two live behaviours moved to scripts/browser/menu.js); their files stay at their paths. +const themeScripts = ['', + '', + '', + '', + ''].join('\n'); +const restoreThemeScripts = html => html + .replace('crossorigin="anonymous">\n\n\n\n \n\n \n\n\n \n\n\n${themeScripts}\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n { const expected = JSON.parse(await readFile(new URL('refactor-evidence/baseline-output.json', root), 'utf8')); const actual = await inventory(new URL('site/', root)); @@ -49,7 +63,9 @@ test('every public path is preserved and only reviewed runtime bundles change by 'assets/theme/fonts/Inter_28pt-Regular.woff2', 'assets/theme/fonts/Inter_28pt-SemiBold.woff2', 'assets/theme/fonts/Inter_28pt-Bold.woff2', 'assets/theme/fonts/bootstrap-icons-subset.woff2', 'media/fonts/Caveat-Variable.woff2', // PageSpeed plan 2026-11-21: frame 0 of each film, shown until the film itself is fetched. - 'media/promo-vid-poster.webp', 'media/sentrapedia-solusi-poster.webp']); + 'media/promo-vid-poster.webp', 'media/sentrapedia-solusi-poster.webp', + // License evidence 2026-11-22: the Inter font's OFL text, served beside the Inter files it covers. + 'assets/theme/fonts/Inter-OFL.txt']); for (let i = actual.length - 1; i >= 0; i--) if (additions.has(actual[i].path)) actual.splice(i, 1); // Strip only the reviewed shared metadata; preserve byte comparisons for the remaining HTML. for (const entry of actual.filter(entry => entry.path.endsWith('.html') && entry.path !== 'index.html' && entry.path !== 'privasi/index.html')) { @@ -66,7 +82,9 @@ test('every public path is preserved and only reviewed runtime bundles change by // Reinsert only the audited unused WordPress emoji rule to prove the rest of the homepage is byte-identical. const html = await readFile(new URL('site/index.html', root), 'utf8'); const removed = await readFile(new URL('refactor-evidence/removed-emoji-style.txt', root), 'utf8'); - const restored = html.replace(/[\s\S]*?\n/, '').replace(/\n[\s\S]*?/, '').replace('https://sentrapedia.com/\" />', 'index.html\" />').replace('