diff --git a/.trellis/tasks/07-17-gilded-wasteland-theme/research/plan-progress-icon-audit.md b/.trellis/tasks/07-17-gilded-wasteland-theme/research/plan-progress-icon-audit.md index fbd17b9..adbafde 100644 --- a/.trellis/tasks/07-17-gilded-wasteland-theme/research/plan-progress-icon-audit.md +++ b/.trellis/tasks/07-17-gilded-wasteland-theme/research/plan-progress-icon-audit.md @@ -48,3 +48,9 @@ - Firefox `ui.prefersReducedMotion=1` 时:`animation-name: none`、`opacity: 1`、`transform: none`,图标仍正常显示且无描边。 - 1672×941、1440×900、500×844、390×844 均检查短计划与 12 图标长计划;标题、长计划和页面横向溢出量均为 0。 - 两枚 PNG、manifest、CSS、JS 均返回 HTTP 200;专项、暗金主题、旧 Warframe 主题与全量回归均通过。 + +## 最终完成态同步修复 + +- 问题:展开列表使用最新 `result`,标题原先优先读取旧 `meta.progress`,会出现列表全部勾选但最后一个图标仍未点亮。 +- 修复:标题进度来源调整为 `result → input → meta`;无法解析最新结果时仍保留兼容回退。 +- Firefox 复现数据:`meta/input=7/8`、`result=8/8`;最终解析为 `8/8`,DOM 生成 8 个 `.is-complete`、0 个 `.is-remaining`,横向溢出为 0。 diff --git a/dist-exe/cc-web-bun-linux-x64-baseline.tar.gz b/dist-exe/cc-web-bun-linux-x64-baseline.tar.gz index f11d40e..35ee2ac 100644 Binary files a/dist-exe/cc-web-bun-linux-x64-baseline.tar.gz and b/dist-exe/cc-web-bun-linux-x64-baseline.tar.gz differ diff --git a/public/app.js b/public/app.js index 9037444..bded2d0 100644 --- a/public/app.js +++ b/public/app.js @@ -6519,7 +6519,8 @@ function resolveToolPlanProgress(tool) { if (toolKind(tool) !== 'todo_list') return null; - const candidates = [tool?.meta?.progress, tool?.input, tool?.result]; + // result 是展开列表实际使用的最新快照;meta/input 可能仍停留在上一轮更新。 + const candidates = [tool?.result, tool?.input, tool?.meta?.progress]; for (const candidate of candidates) { const progress = planProgressFromPayload(candidate); if (progress) return progress; diff --git a/public/index.html b/public/index.html index b5f7d35..c6e6514 100644 --- a/public/index.html +++ b/public/index.html @@ -24,7 +24,7 @@ document.documentElement.dataset.dividerTime = dividerTime; })(); - + @@ -183,6 +183,6 @@ - + diff --git a/scripts/regression.js b/scripts/regression.js index 3e43d21..9ca7aff 100644 --- a/scripts/regression.js +++ b/scripts/regression.js @@ -618,8 +618,8 @@ function assertFrontendSidebarCollapseContract() { 'Rich themes should provide isolated rail treatments on top of the shared semantic fallback' ); assert( - indexSource.includes('style.css?v=20260720-plan-progress-icons') - && indexSource.includes('app.js?v=20260720-plan-progress-icons'), + indexSource.includes('style.css?v=20260720-plan-progress-final-state') + && indexSource.includes('app.js?v=20260720-plan-progress-final-state'), 'Sidebar interaction assets should share the reviewed cache-busting version' ); } @@ -839,6 +839,18 @@ function assertPlanListProgressContract() { })) === JSON.stringify({ completed: 3, total: 5 }), 'Todo tool summaries should resolve progress from runtime metadata' ); + assert( + JSON.stringify(progressApi.resolveToolPlanProgress({ + kind: 'todo_list', + meta: { progress: { completed: 7, total: 8 } }, + input: { progress: { completed: 7, total: 8 } }, + result: JSON.stringify({ + type: 'todo_list', + items: Array.from({ length: 8 }, () => ({ completed: true })), + }), + })) === JSON.stringify({ completed: 8, total: 8 }), + 'Latest todo result should override stale meta and input progress so the final icon lights up' + ); assert(progressApi.resolveToolPlanProgress({ kind: 'command_execution' }) === null, 'Non-plan tools should not render plan progress'); const sent = []; @@ -930,8 +942,8 @@ function assertPlanListProgressContract() { assert(extractorSource.includes('references/source-assets/wasteland-icon-sheet.webp'), 'Plan progress extractor should read the archived source sheet'); assert(!extractorSource.includes('sessions/_attachments'), 'Plan progress extractor should not depend on temporary session attachments'); - assert(indexSource.includes('style.css?v=20260720-plan-progress-icons'), 'Plan progress CSS should use the current cache-busted URL'); - assert(indexSource.includes('app.js?v=20260720-plan-progress-icons'), 'Plan progress frontend logic should use the current cache-busted URL'); + assert(indexSource.includes('style.css?v=20260720-plan-progress-final-state'), 'Plan progress CSS should use the current cache-busted URL'); + assert(indexSource.includes('app.js?v=20260720-plan-progress-final-state'), 'Plan progress frontend logic should use the current cache-busted URL'); } function assertFrontendGildedThemeContract() { @@ -1046,8 +1058,8 @@ function assertFrontendGildedThemeContract() { assert(contrast('#655446', '#fff7ea') >= 4.5, 'Gilded muted text should remain readable on ivory panels'); assert(contrast('#fff7ea', '#7a3f20') >= 7, 'Gilded primary action text should reach AAA contrast on copper'); assert(themeStyle.includes('@media (prefers-reduced-motion: reduce)'), 'Gilded theme motion should respect reduced-motion preferences'); - assert(indexSource.includes('style.css?v=20260720-plan-progress-icons'), 'Theme bundle stylesheet should use the current cache-busted asset URL'); - assert(indexSource.includes('app.js?v=20260720-plan-progress-icons'), 'Theme bundle app script should use the current cache-busted asset URL'); + assert(indexSource.includes('style.css?v=20260720-plan-progress-final-state'), 'Theme bundle stylesheet should use the current cache-busted asset URL'); + assert(indexSource.includes('app.js?v=20260720-plan-progress-final-state'), 'Theme bundle app script should use the current cache-busted asset URL'); } function assertFrontendWastelandThemeContract() { @@ -1300,8 +1312,8 @@ function assertFrontendWastelandThemeContract() { assert(contrast('#c9bda6', backgroundColor) >= 4.5, `Wasteland muted text should reach AA contrast on ${backgroundColor}`); }); - assert(indexSource.includes('style.css?v=20260720-plan-progress-icons'), 'Wasteland stylesheet should share the cache-busted theme bundle URL'); - assert(indexSource.includes('app.js?v=20260720-plan-progress-icons'), 'Wasteland registration should share the cache-busted theme bundle URL'); + assert(indexSource.includes('style.css?v=20260720-plan-progress-final-state'), 'Wasteland stylesheet should share the cache-busted theme bundle URL'); + assert(indexSource.includes('app.js?v=20260720-plan-progress-final-state'), 'Wasteland registration should share the cache-busted theme bundle URL'); } function assertFrontendCcwebPromptContract() {