强度区也抬成共享样式面:首页带同一份思维强度,滑块点色变浅、点与轨道同高
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m7s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m46s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m27s
Project CI / Frontend tests (pull_request) Successful in 3m27s
Project CI / Backend tests (pull_request) Successful in 8m4s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m5s
Project CI / Repository checks (pull_request) Successful in 6m48s
Project CI / Native shell tests (pull_request) Successful in 9m12s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 7m7s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 4m46s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m27s
Project CI / Frontend tests (pull_request) Successful in 3m27s
Project CI / Backend tests (pull_request) Successful in 8m4s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m5s
Project CI / Repository checks (pull_request) Successful in 6m48s
Project CI / Native shell tests (pull_request) Successful in 9m12s
- 用户口径:①「把思维强度也加进去,保持所有地方的样式一致,不需要做区分」;②「点的颜色做浅一点,进度条的高度和滑块高度一致」 - ① 首页:`view/home/index.tsx` 给那颗 `ConversationModelSelect` 传**同一个** `ComposerReasoningEffortSelect`(`presentation=section`),读写仍是组件自己的 `read_game_creator_app_config` / `select_game_creator_reasoning_effort`,首页不新写 state;强度区(`.project-chat-reasoning-effort.is-section` / `.project-chat-composer-strength-*`)与外壳锚点(`position: absolute; right: 0; bottom: calc(100% + 8px)`)一并抬到共享样式面,宿主作用域只剩工具栏几何 - ① 实测(无头 Chromium,同一夹具同一裁剪框):首页 1200/447 两档都是外壳 260×262.5、强度区 234×60.5、列表 234×170、滑块 222×26,与工作台逐项一致;工作台回归后外壳/强度区/列表/滑块逐值不变(抬升过程中必须删掉两条给旧独立「推理档」控件排版的死重规则,否则它们以更高特异性盖掉共享面的 `display: grid`,把强度区算宽 24px) - ② 点色:`--platform-text-strong` → `color-mix(in srgb, var(--platform-text-strong) 60%, var(--platform-subpanel-border))`;实测点 rgb(126,100,85) / 相邻轨道 rgb(230,213,198) ⇒ 对比度 3.83:1(上一版 10.5:1,仍守住 ≥3:1)。边界:点落在橙色已选段上时只有 1.54:1——「变浅」与「已选段也 ≥3:1」不可兼得,按「不抢戏」优先,取值可由这条 color-mix 的百分比统一调 - ② 变体 A(落地,默认):填充段=轨道高度 6px(本来就是轨道渐变的一段),档位点也收到 6px(不再上下各露 0.5px);实测轨道 6.0 / 填充 6.0 / 点 6.0 / 圆钮 20(range 盒 26)。变体 B(只出图、未提交):填充段与点都做成 20px=圆钮高度;实测 20/20/20/20(range 盒 34)。447 下圆钮中心到最近可见点中心 37.5px(A) / 30.5px(B),不重叠、不溢出 - 测试:`home.suite.ts` 的首页用例补断言(首页菜单里确实有 `input[type=range]`,`aria-label=思维强度`、`aria-valuetext=默认`);`chatDialogFrameLayout.test.ts` 的强度区选择器改到共享面、并断言点 6px == 轨道高度、点色来自 color-mix、无描边 - 校验:相关 vitest 221 passed / 9 skipped、typecheck、eslint、prettier、encoding 5268 files、spacetime-schema 91 tables、diff-check;对照图与变体图见 PR #607 Refs #600, PR #607
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -16,6 +16,7 @@ import type { ProjectStartMode } from '../../app/types';
|
||||
import { resolveHomeCreationFailureMessage } from '../../features/app-shell/homeCreationFailure';
|
||||
import { ConversationModelSelect } from '../../features/project-workspace/ConversationModelSelect';
|
||||
import type { GameTemplateEntry } from '../../features/template-library/templateLibraryModel';
|
||||
import { ComposerReasoningEffortSelect } from '../project-development/chat/components/DirectProjectComposer/ComposerControls';
|
||||
import RichInputArea, { UploadButton } from './components/RichInputArea';
|
||||
import {
|
||||
richTextToAttachments,
|
||||
@@ -297,6 +298,14 @@ export default function HomeView({
|
||||
<ConversationModelSelect
|
||||
className="home-input-model-select"
|
||||
disabled={homeCreationBusy || creationBusy}
|
||||
/* 与工作台同一形态:思维强度区在模型菜单顶部(同一个组件、同一份配置通道)。
|
||||
首页没有浮层宿主,所以状态文案沿用控件内的 `inline`(Direct 那边是 toast)。 */
|
||||
strengthSection={
|
||||
<ComposerReasoningEffortSelect
|
||||
disabled={homeCreationBusy || creationBusy}
|
||||
presentation="section"
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<button
|
||||
className="grid size-7 cursor-pointer place-items-center rounded-full border-0 bg-(image:--platform-button-primary-fill) p-0 text-(--platform-button-primary-text) shadow-(--platform-profile-action-shadow) transition-transform hover:scale-105 disabled:cursor-not-allowed disabled:opacity-55"
|
||||
|
||||
@@ -212,6 +212,19 @@ export function registerClientHomeTests() {
|
||||
expect(menu.classList.contains('conversation-model-menu')).toBe(true);
|
||||
expect(menu.closest('.conversation-model-select')).not.toBeNull();
|
||||
expect(menu.closest('.game-workbench-chat')).toBeNull();
|
||||
// 首页这颗也有「思维强度」区(同一个组件、同一份配置通道),且菜单里有原生滑块。
|
||||
const group = document.querySelector(
|
||||
'.home-input-model-select [role="group"]',
|
||||
);
|
||||
expect(group?.getAttribute('aria-label')).toBe('思维强度');
|
||||
const slider = document.querySelector<HTMLInputElement>(
|
||||
'.home-input-model-select input[type="range"]',
|
||||
);
|
||||
expect(slider).not.toBeNull();
|
||||
expect(slider?.getAttribute('aria-label')).toBe('思维强度');
|
||||
await waitFor(() =>
|
||||
expect(slider?.getAttribute('aria-valuetext')).toBe('默认'),
|
||||
);
|
||||
|
||||
const rules = parseStyleSheet(
|
||||
readFileSync(
|
||||
|
||||
@@ -164,10 +164,12 @@ const SHARED_CARD = '.conversation-model-select .conversation-model-menu';
|
||||
const SHARED_SHELL =
|
||||
'.conversation-model-select .conversation-model-menu-shell';
|
||||
const SHARED_CARD_IN_SHELL = `${SHARED_SHELL} .conversation-model-menu`;
|
||||
/** 强度滑块与它那排装饰档位点(issue #600 的复核点:点被轨道压住、横向与圆钮错位)。 */
|
||||
const STRENGTH_RANGE = `${COMPOSER} .project-chat-composer-strength-range`;
|
||||
/** 强度区与它那排装饰档位点(issue #600 的复核点:点被轨道压住、横向与圆钮错位)。
|
||||
这些规则与卡片一样已经抬到共享样式面(组件自带类名,不带宿主祖先链)。 */
|
||||
const STRENGTH_SECTION = '.project-chat-reasoning-effort.is-section';
|
||||
const STRENGTH_RANGE = '.project-chat-composer-strength-range';
|
||||
const STRENGTH_THUMB = `${STRENGTH_RANGE}::-webkit-slider-thumb`;
|
||||
const STRENGTH_STOPS = `${COMPOSER} .project-chat-composer-strength-stops`;
|
||||
const STRENGTH_STOPS = '.project-chat-composer-strength-stops';
|
||||
const STRENGTH_STOPS_DOT = `${STRENGTH_STOPS} span`;
|
||||
const STRENGTH_STOPS_DOT_ACTIVE = `${STRENGTH_STOPS} span.is-active`;
|
||||
const TOPBAR = `${CHAT} .project-chat-topbar`;
|
||||
@@ -361,12 +363,8 @@ describe('陶泥儿对话区:Codex 三段式(顶栏 / 唯一滚动区 / 文
|
||||
SHARED_CARD,
|
||||
SHARED_CARD_IN_SHELL,
|
||||
);
|
||||
const section = desktopDeclarations(
|
||||
`${COMPOSER} .project-chat-reasoning-effort.is-section`,
|
||||
);
|
||||
const range = desktopDeclarations(
|
||||
`${COMPOSER} .project-chat-composer-strength-range`,
|
||||
);
|
||||
const section = desktopDeclarations(STRENGTH_SECTION);
|
||||
const range = desktopDeclarations(STRENGTH_RANGE);
|
||||
/**
|
||||
* 共享样式面为了压过基础规则里那几条 `!important`,自己也是按 `!important` 声明的;
|
||||
* 断言时只看最终值,去掉后缀。
|
||||
@@ -425,13 +423,14 @@ describe('陶泥儿对话区:Codex 三段式(顶栏 / 唯一滚动区 / 文
|
||||
|
||||
// 当前档位那一点不画:圆钮已经压在那儿,再画出来就是"靶心"。
|
||||
expect(pixelValue(activeDot, 'opacity')).toBe(0);
|
||||
// 点的填充与描边都来自暖色 token(对比度数值在真机夹具里量,见 PR 正文)。
|
||||
// 点:直径 == 轨道高度(6px,不再上下各露 0.5px),浅暖色从既有 token 派生(对比度实测见 PR)。
|
||||
expect(pixelValue(dot, 'width')).toBe(6);
|
||||
expect(pixelValue(dot, 'height')).toBe(pixelValue(stops, 'height'));
|
||||
expect(declaration(dot, 'background')).toContain('color-mix');
|
||||
expect(declaration(dot, 'background')).toContain(
|
||||
'var(--platform-text-strong)',
|
||||
);
|
||||
expect(declaration(dot, 'border')).toContain(
|
||||
'var(--platform-input-highlight)',
|
||||
'var(--platform-subpanel-border)',
|
||||
);
|
||||
expect(dot.has('border')).toBe(false);
|
||||
});
|
||||
|
||||
it('窄屏(390px)输入盒仍在文档流、四周有边距,列表底部没有留白', () => {
|
||||
|
||||
Reference in New Issue
Block a user