fix: Resolve stale CSS caching and CI test failure
- Add ?v= cache-bust parameters to CSS references in index.html, home-ai.html, and timeline.html (were missing, causing stale CSS) - Fix version.json: disable forceUpdate (was causing 10s auto-reload loops), fix minVersion paradox (was 0.2.1 > current 0.1.3) - Fix update-cache-version.js: stop always setting forceUpdate=true, add 7 missing HTML files to cache-bust list, add bare CSS/JS reference detection - Fix ClaudeAPI.test.js: generateBlogTopics now takes context object, not positional arguments - Add spacing between honesty note and Koha section Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5e3ae8523a
commit
c80cc29936
6 changed files with 25 additions and 8 deletions
|
|
@ -21,7 +21,7 @@
|
|||
<link rel="icon" type="image/svg+xml" href="/favicon-new.svg">
|
||||
<link rel="stylesheet" href="/css/fonts.css">
|
||||
<link rel="stylesheet" href="/css/tailwind.css">
|
||||
<link rel="stylesheet" href="/css/tractatus-theme.min.css">
|
||||
<link rel="stylesheet" href="/css/tractatus-theme.min.css?v=0.1.3">
|
||||
<style>
|
||||
.skip-link { position: absolute; left: -9999px; top: 0; }
|
||||
.skip-link:focus { left: 0; z-index: 100; background: white; padding: 1rem; border: 2px solid #3b82f6; }
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
<link rel="stylesheet" href="/css/fonts.css">
|
||||
<link rel="stylesheet" href="/css/tailwind.css">
|
||||
<link rel="stylesheet" href="/css/tractatus-theme.min.css">
|
||||
<link rel="stylesheet" href="/css/tractatus-theme.min.css?v=0.1.3">
|
||||
<style>
|
||||
.skip-link { position: absolute; left: -9999px; }
|
||||
.skip-link:focus { left: 0; z-index: 100; background: white; padding: 1rem; }
|
||||
|
|
@ -473,7 +473,7 @@
|
|||
</section>
|
||||
|
||||
<!-- Intellectual Honesty Note -->
|
||||
<section class="max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 pb-12">
|
||||
<section class="max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
|
||||
<div class="bg-amber-50 border-l-4 border-amber-500 p-6 rounded-r-lg">
|
||||
<h2 class="text-lg font-bold text-amber-900 mb-3">A note on claims</h2>
|
||||
<p class="text-amber-800 text-sm leading-relaxed">
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
<link rel="icon" type="image/svg+xml" href="/favicon-new.svg">
|
||||
<link rel="stylesheet" href="/css/fonts.css">
|
||||
<link rel="stylesheet" href="/css/tailwind.css">
|
||||
<link rel="stylesheet" href="/css/tractatus-theme.min.css">
|
||||
<link rel="stylesheet" href="/css/tractatus-theme.min.css?v=0.1.3">
|
||||
<style>
|
||||
.skip-link { position: absolute; left: -9999px; top: 0; }
|
||||
.skip-link:focus { left: 0; z-index: 100; background: white; padding: 1rem; border: 2px solid #3b82f6; }
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@
|
|||
"Added Tino Rangatiratanga (Māori) flag to language selector",
|
||||
"Fixed cross-origin flag loading issue"
|
||||
],
|
||||
"forceUpdate": true,
|
||||
"minVersion": "0.2.1"
|
||||
"forceUpdate": false,
|
||||
"minVersion": "0.1.0"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,13 @@ const HTML_FILES = [
|
|||
'public/case-submission.html',
|
||||
'public/koha.html',
|
||||
'public/check-version.html',
|
||||
'public/home-ai.html',
|
||||
'public/architecture.html',
|
||||
'public/village-case-study.html',
|
||||
'public/architectural-alignment.html',
|
||||
'public/architectural-alignment-community.html',
|
||||
'public/architectural-alignment-policymakers.html',
|
||||
'public/korero-counter-arguments.html',
|
||||
'public/admin/blog-curation.html',
|
||||
'public/admin/dashboard.html'
|
||||
];
|
||||
|
|
@ -77,6 +84,10 @@ function updateCacheVersion(filePath) {
|
|||
// Matches: ?v=1.0.4, ?v=1759833751, ?v=1.0.5.1760123456
|
||||
content = content.replace(/\?v=[0-9a-zA-Z._-]+/g, `?v=${CACHE_VERSION}`);
|
||||
|
||||
// Also catch bare CSS/JS references that are missing ?v= entirely
|
||||
// Adds ?v= to .css and .js hrefs/srcs that don't have one
|
||||
content = content.replace(/(href|src)="([^"]+\.(?:css|js))(?!.*\?v=)"/g, `$1="$2?v=${CACHE_VERSION}"`);
|
||||
|
||||
// Only write if changed
|
||||
if (content !== originalContent) {
|
||||
fs.writeFileSync(fullPath, content, 'utf8');
|
||||
|
|
@ -131,7 +142,7 @@ function updateVersionJson() {
|
|||
|
||||
versionData.version = NEW_SEMVER;
|
||||
versionData.buildDate = new Date().toISOString();
|
||||
versionData.forceUpdate = true;
|
||||
versionData.forceUpdate = false;
|
||||
|
||||
// Preserve existing changelog
|
||||
if (!versionData.changelog) {
|
||||
|
|
|
|||
|
|
@ -279,7 +279,13 @@ describe('ClaudeAPI Service', () => {
|
|||
usage: { input_tokens: 100, output_tokens: 200 }
|
||||
});
|
||||
|
||||
const result = await ClaudeAPI.generateBlogTopics('implementer', 'governance frameworks');
|
||||
const result = await ClaudeAPI.generateBlogTopics({
|
||||
audience: 'implementer',
|
||||
theme: 'governance frameworks',
|
||||
tone: 'standard',
|
||||
culture: 'universal',
|
||||
language: 'en'
|
||||
});
|
||||
|
||||
expect(result).toEqual(mockTopics);
|
||||
const callArgs = ClaudeAPI._makeRequest.mock.calls[0][0];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue