From 32d0297564ffa002aa4989f5767b9a69b318a977 Mon Sep 17 00:00:00 2001 From: leefer <2298888111@qq.com> Date: Fri, 23 Oct 2026 18:49:45 +0800 Subject: [PATCH] fix: resolve canvas viewfinder color in its scene Co-authored-by: multica-agent --- calliope-web/static/themes.css | 13 +++++++++++-- docs/changelogs/2026-10-23-hel818-canvas.md | 4 ++-- e2e/hel818.cjs | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/calliope-web/static/themes.css b/calliope-web/static/themes.css index ca7d65b8..64c4b4b9 100644 --- a/calliope-web/static/themes.css +++ b/calliope-web/static/themes.css @@ -239,7 +239,6 @@ --task-tabs-offset: 12px; --task-search-width: 240px; --task-preview-height: 300px; - --viewfinder-color: color-mix(in srgb, var(--scene) 90%, var(--hi)); --viewfinder-length: 12px; --viewfinder-stroke: 1.5px; --viewfinder-inset: -1px; @@ -433,7 +432,6 @@ } [data-theme="day"] { - --viewfinder-color: color-mix(in srgb, var(--scene) 85%, black); --result-develop: a-develop-day; --result-calm-filter: blur(8px) sepia(0.25); --project-button-disabled-filter: none; @@ -1160,3 +1158,14 @@ html.theme-anim *::after { --stage-loop: none; --viewfinder-inset: var(--viewfinder-selected-inset); } + +/* Resolve the existing corner token against each canvas card's local scene. + * Other consumers retain the original inherited root value. */ +:root, +.canvas-card.a-viewfinder { + --viewfinder-color: color-mix(in srgb, var(--scene) 90%, var(--hi)); +} +[data-theme="day"], +[data-theme="day"] .canvas-card.a-viewfinder { + --viewfinder-color: color-mix(in srgb, var(--scene) 85%, black); +} diff --git a/docs/changelogs/2026-10-23-hel818-canvas.md b/docs/changelogs/2026-10-23-hel818-canvas.md index b1dd4f64..a4d3ffaf 100644 --- a/docs/changelogs/2026-10-23-hel818-canvas.md +++ b/docs/changelogs/2026-10-23-hel818-canvas.md @@ -2,7 +2,7 @@ 继续原草稿 PR #12(远端 `agent/agent/8ec6e532b3ac`),本轮起点 `fe4759b788ea82747e1085f94cfe749756b08fb3`,base `leefer/hel-731-studio-project@2952af42b6232483640f1f27803980367cd62dd0`。HEL-801 的画布线程已明确批准;静态外观以 HEL-814 HTML/规范为依据,动效冲突按总管补充与 HEL-805 v3,不复制演示脚本。 -- `static/themes.css` 仅新增四主题 `--board-bg` 与 `--board-dot` 八行;不改共享主题/三档动效状态机、滤镜和时序。 +- `static/themes.css` 新增四主题 `--board-bg` 与 `--board-dot` 八行;既有 `--viewfinder-color` 的两条取值集中到 root/画布卡片分组规则,在画布卡片局部重新求值,避免继承根节点金色,数值不变,其它消费者仍沿 root 值;不改共享主题/三档动效状态机、滤镜和时序。 - `canvas/[id]/+page.svelte` 合并重复样式,移除固定浅灰和 light 锁定。浮条、项目胶囊、空态、整理按钮、助手头和收展钮消费已有主题 token;默认助手 320px,小窗口 300px,保留手动宽度、视口、真实数据与已有操作。 - `lib/canvas/canvas.css` 是两类卡片与 xyflow 画布控件的共同样式来源。实体 240、产物 220;媒体 132/124;统一玻璃缩放控件与 172×110 小地图;复用 `a-viewfinder`,选中及键盘焦点采用既有 −1→−3px 规则。 - 两类卡片保留真实文件、视频首帧及预览回调,不放演示卡和示例标记。产物只在同一个 job 的 pending/running→done 时使用既有 `a-result-develop`(700/350ms),切档终态、历史不播、重复 done 不重播、点击跳过;运行状态静态显示。 @@ -16,6 +16,6 @@ 同状态画布比较明确采用离线字体条件:浏览器同时阻止应用和映射样本的 Google Fonts 请求,两者使用同机同字体栈的 fallback,数表保留 computed font;这不是产品字体来源调整,也不是联网字体一致性证明。原样图(未映射)单独保留,真实内容/节点位置/视口/视频首帧和会话文本只在测试运行 DOM 映射。 -最终验证:前端 lint/check(0错误0警告)、test/build 通过;浏览器173/173通过、pageerror=0;画布相关后端隔离测试43通过(保留一项依赖弃用提示)。完整/克制四主题显影与三档主题切换共11组动画记录,四主题×三窗口12组比较。标题、实体/产物、缩放控件40×160、小地图172×110的同状态尺寸吻合,助手320/300;顶栏保留既有1px差异。点阵按样图保持屏幕26px网格/1px半径,抵消图形视口缩放;小地图保留10px内衬和按媒体种类的真实色块。 +最终验证:前端 lint/check(0错误0警告)、test/build 通过;浏览器185/185通过、pageerror=0;画布相关后端隔离测试43通过(保留一项依赖弃用提示)。完整/克制四主题显影与三档主题切换共11组动画记录,四主题×三窗口12组比较。标题、实体/产物、缩放控件40×160、小地图172×110的同状态尺寸吻合,助手320/300;顶栏保留既有1px差异。点阵按样图保持屏幕26px网格/1px半径,抵消图形视口缩放;小地图保留10px内衬和按媒体种类的真实色块。 本轮未单独回归计划/推理面板的所有分支、完整档不支持ViewTransition浏览器的回退路径、联网字体及后端全量套件;相关实现保留既有版本,旧证据不冒充新头实测。浏览器操作覆盖框选、多选保护、Backspace删除、命名、项目解绑、缩放持久化、拖动、整理、助手收展/键盘调宽、图片/视频预览、上传保留、工作流/技能菜单、工具参数展开、引导与停止。 diff --git a/e2e/hel818.cjs b/e2e/hel818.cjs index 98ffc098..222f3041 100644 --- a/e2e/hel818.cjs +++ b/e2e/hel818.cjs @@ -41,6 +41,7 @@ const theme=async(p,id)=>{await p.evaluate(id=>{document.documentElement.dataset const actual=await geom(p,{board:'.flow-panel',title:'.titlecard',controls:'.svelte-flow__controls',minimap:'.svelte-flow__minimap',chat:'.chat-panel',head:'.chat-head',entity:'.entity-node',artifact:'.artifact-node',media:'.entity-node .media'}); const reference=await geom(sample,{board:'.board-wrap',title:'.titlecard',controls:'.ctl',minimap:'.minimap',chat:'.chat',head:'.chat-head',entity:'.card.entity',artifact:'.card.artifact',media:'.card.entity .media'}); report.geometry.push({id,width,height,actual,reference}); + const corner=await p.locator('.artifact-node').first().evaluate(e=>({token:getComputedStyle(e).getPropertyValue('--viewfinder-color'),image:getComputedStyle(e).getPropertyValue('--sc-image'),gold:getComputedStyle(e).getPropertyValue('--gold'),inset:getComputedStyle(e,'::after').inset}));report.geometry.at(-1).corner=corner;ok(id+' '+width+' corners use canvas scene',corner.token.includes(corner.image.trim())&&!corner.token.includes(corner.gold.trim())); ok(id+' '+width+' 26px grid and 1px dot radius',await p.locator('.svelte-flow__background').evaluate(e=>Math.abs(parseFloat(e.querySelector('pattern').getAttribute('width'))-26)<.01&&Math.abs(parseFloat(e.querySelector('circle').getAttribute('r'))-1)<.01)); ok(id+' '+width+' no document overflow',await p.evaluate(()=>document.documentElement.scrollWidth<=innerWidth)); for(const sel of ['.titlecard','.tidy-btn','.svelte-flow__controls','.svelte-flow__minimap','.chat-head','.composer button.primary'])ok(id+' '+width+' '+sel+' reachable',await p.locator(sel).evaluate(e=>{const r=e.getBoundingClientRect();return r.x>=0&&r.y>=0&&r.right<=innerWidth&&r.bottom<=innerHeight}));