fix(agent): match studio controls, thumbnail ratio and sample digits

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
2026-10-22 18:53:44 +08:00
co-authored by multica-agent
parent ab48895b99
commit afbf50447a
4 changed files with 39 additions and 14 deletions
@@ -551,7 +551,7 @@ let {
onpaste={onPaste}
></div>
<div class="actions">
{#if studio}<button type="button" class="attach workflow-shortcut" disabled={busy} onclick={()=>{editorEl?.focus();mentionQuery='';mentionIndex=0;mentionAnchor=caretAnchor();mentionLocked=false;mentionOpen=true;}}>@ 工作流</button>{/if}
{#if studio}<button type="button" class="b4-chip workflow-shortcut" disabled={busy} onclick={()=>{editorEl?.focus();mentionQuery='';mentionIndex=0;mentionAnchor=caretAnchor();mentionLocked=false;mentionOpen=true;}}>@ 工作流</button>{/if}
<input
bind:this={fileInput}
type="file"
@@ -562,29 +562,31 @@ let {
/>
<button
type="button"
class="attach"
class={studio ? "b4-chip" : "attach"}
title={t('agentComposer.attach')}
disabled={busy}
onclick={() => fileInput?.click()}
>
<Icon name="paperclip" size={16} />{#if studio}<span>参考材料</span>{/if}
{#if studio}+ 参考材料{:else}<Icon name="paperclip" size={16} />{/if}
</button>
{#if studio}<span class="b4-grow"></span>{/if}
{#if running}
<button type="button" class="send stop" onclick={onCancel} title={t('agentComposer.stopTitle')}>
<Icon name="stop" size={14} />
<button type="button" class={studio ? "a-btn sm ghost stop" : "send stop"} onclick={onCancel} title={t('agentComposer.stopTitle')}>
{#if !studio}<Icon name="stop" size={14} />{/if}
{t('common.stop')}
</button>
{/if}
<button
type="button"
class="send"
class={studio ? "a-btn sm primary" : "send"}
class:steer={running}
onclick={submit}
disabled={!sendable}
title={running ? t('agentComposer.steerTitle') : t('agentComposer.sendTitle')}
>
{#if studio}<Icon name="agent-send" size={14} />{/if}
{running ? t('agentComposer.steer') : t('common.send')}
<Icon name="chevron-right" size={14} />
{#if !studio}<Icon name="chevron-right" size={14} />{/if}
</button>
</div>
</div>
@@ -747,7 +749,7 @@ let {
display: flex;
justify-content:var(--composer-actions-justify,normal);
align-items: center;
gap: 6px;
gap: var(--composer-actions-gap, 6px);
flex-shrink: 0;
}
.attach {
@@ -188,6 +188,8 @@
flex: none;
}
.b4 .shot .th :is(img, video) {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: contain;
@@ -591,7 +593,7 @@
position: absolute;
right: 12px;
top: 6px;
font: 800 36px/1 var(--mono);
font: 800 36px/1 var(--agent-number-font);
color: transparent;
-webkit-text-stroke: 1px rgb(var(--ink) / 0.22);
}
+9 -5
View File
@@ -14,6 +14,8 @@
--agent-seg-bg: var(--well);
--agent-seg-selected-bg: var(--bg-3);
--agent-seg-shadow: var(--sh-1);
/* Match the sample's local fallback glyphs even while webfonts are loaded. */
--agent-number-font: "Cascadia Mono", Consolas, monospace;
--agent-hero-shrink: 0;
--agent-input-select-max: none;
--agent-radius-22: 22px;
@@ -874,11 +876,13 @@ html.theme-anim *::after {
--composer-editor-height: 44px;
--composer-send-height: 26px;
--composer-send-bg: var(--grad-gold);
--composer-actions-justify: space-between;
--composer-attach-width: auto;
--composer-attach-height: 26px;
--composer-attach-padding: 0 6px;
--composer-attach-margin: auto;
--composer-actions-gap: 8px;
}
.b4 .composer {
--button-primary-height: var(--button-sm-height);
--button-primary-padding: var(--button-sm-padding);
--button-primary-radius: var(--button-sm-radius);
}
[data-theme="day"] {
@@ -0,0 +1,17 @@
HEL-787:B4 Agent 局部视觉修正(待独立复验)
基底为原 PR #11 的 `feat/hel-732-agent-results@ab48895b99b463bd8151da204d5a87eb3a526963`,目标保持 `leefer/hel-731-studio-project@8d7e58645c9e63bb9b9e6a4ae8dfb031bf5960fb`。
- `workspace.css`:只将镜头 img/video 绝对定位于既有 16:9 媒体盒,保留 contain、控件与手动播放。短文案首行从 104 恢复 66.375 高;盒从 86×86 恢复 86×48.375。长文案自然换行时行高可增加,媒体仍保持 16:9。
- `AgentComposer.svelte`:Studio 入口复用已有 b4-chip 与 a-btn sm/primary/ghost;参考材料恢复“+ 参考材料”,左侧相邻;发送复用 agent-send 图标并前置。旧聊天保留原类名与表现。逻辑、上传、提及、键盘/中文输入、停止/引导及错误处理未改。
- `static/themes.css`:沿用统一按钮/胶囊 token,composer 只消费 sm 尺寸;动作间距 8px。编号局部 token 采用样本在本系统实际使用的本地回退栈,不全局改字体、不加字体请求。正常网络加载 JetBrains Mono 时和字体不可用时,01–05 均实测为 DejaVuSansMono-Bold(原样本相同),800 请求解析为本地 Bold;原应用为仅加载 500 的 JetBrains Mono 合成粗体。字形宽 43.2→43.34375,与样本相等。
验证:干净 npm ci,npm run lint,npm run check(0 errors / 0 warnings),npm test,npm run build,git diff --check 均通过。构建器保留原有第三方未使用导入/大 chunk 提示,没有新增诊断。
四主题×1440×900/1366×768/1280×720:24 组首页/任务原样本同内容截图;12 组 Studio 按钮位置、宽高、圆角、字号字重、颜色背景/渐变一致(几何容差 <0.2px),真实 fill 进入双方空闲可发送态;missing=[]。原 HTML SHA256 仍为 0473d80d22b90194375f3566c1b8ca30dbd7433581b18f60956eabca252242a4。参考保留原 CSS/结构,只映射真实内容、媒体及状态;JSON 回复使用 API 原文并按原文换行。首页保留先前已批准的 flex-shrink:0。应用媒体按本卡明确要求 contain,样本背景图 cover 保留原样,不借改样本掩盖差异。其他真实控件/工具卡与样本的既有结构差异仍交独立目检,不宣称整页像素完全相同。
CDP 实际渲染字体:5 编号×4 主题×正常网络/字体不可用,共 40 对,平台字体、字形宽高均一致;附局部图。媒体验证包含 100×100、100×180、240×100 图片和 240×400 视频,等待真实 load/metadata,盒均为 86×48.375,长文案行高由文字决定,无横向溢出,视频元数据后 paused=true、autoplay=false,手动播放/暂停成功。空镜状态保留。
真实 UI 操作:上传入口与上传、工作流/技能选择、方向键/Enter、Shift+Enter、中文组合 Enter 不误发、点击和键盘发送、运行中引导与停止、错误反馈、工具展开收起、主题切换保留编辑、保存刷新、上一版本及带回原项目待确认通过。运行态/错误测试使用隔离网络夹具;消息发送、上传和保存/带回走隔离应用。原有 e2e/hel732-layout.cjs 的 12 组输入、开始任务、滚动、选择器、焦点和无溢出测试通过。
证据脚本、完整日志、局部图与数据随 HEL-787 附件交付;不把本次局部验证冒充后端/API/迁移复审。contracts.json 原修复保留。无依赖、后端协议、数据库或原样本变更,无真实 GPU/收费生成、部署、合并或强推。测试站仍是 B3。隔离服务均由 foreground runner finally 回收,交付前再次核验端口与子进程。