删除对话输入盒内的项目信息标签行

- ProjectSupervisorView:移除输入盒内「项目名 · 本地」信息标签行,删除随之无用的 projectDisplayName 辅助函数
- styles.css:输入盒网格从三行改回两行(文本区 / 控制排),删除信息标签行及其胶囊样式规则
- chatDialogFrameLayout.test.ts:把「表单子树含信息标签行」的断言反转成不再包含,并删除相关 CSS 常量与取值
- project-development.suite.ts:输入盒断言从「含项目名/本地标签」改为「不再渲染该标签行」,网格行数断言同步为两行
This commit is contained in:
2026-09-14 14:17:20 +08:00
parent 8410426d12
commit bc796c1db4
4 changed files with 18 additions and 68 deletions
@@ -84,12 +84,6 @@ function directStatusTitle(status: string | null | undefined) {
}
}
/** Codex 顶栏只显示项目名:取路径最后一段,拿不到时退回占位文案。 */
function projectDisplayName(projectPath: string) {
const name = projectPath.split(/[\\/]/u).filter(Boolean).pop();
return name ?? '未选择项目';
}
type ProjectSupervisorViewProps = RuntimePanelProps & {
activeVersionId?: string | null;
chatInput: string;
@@ -508,12 +502,6 @@ export function ProjectSupervisorView({
void validateModel();
}}
>
{directCodex ? (
<div className="project-supervisor-composer-context">
<span title={projectPath}>{projectDisplayName(projectPath)}</span>
<span></span>
</div>
) : null}
<ResourceReferenceInput
ref={composerRef}
ariaLabel={directCodex ? '陶泥儿对话内容' : '项目需求'}
+3 -37
View File
@@ -10483,19 +10483,18 @@ button.design-workspace-tree__entry:hover,
font-size: 12px;
}
/* Direct Codex composer: keep the editor and its actions in one vertical
structure instead of positioning each control independently. */
/* 输入盒是唯一有边框的容器,且**回到文档流**:它在消息列表下方(Codex 桌面客户端的
「整块面板 = 顶栏 + 消息流 + 输入盒」),不再浮在消息列表之上。
旧版那套「输入区绝对定位、消息列表用 196px 底边留白给它让位」已撤掉——两套叠着生效会
让消息被空白顶掉、输入盒盖住消息。
行结构:项目信息标签行 / 文本区 / 控制排(`+` `@` · 模型下拉 · 发送)。 */
行结构:文本区 / 控制排(`+` `@` · 模型下拉 · 发送)。原先那行「项目名 · 本地」信息标签
已按需求删掉,输入盒内不再复述当前项目。 */
.game-workbench-chat
.project-supervisor-surface.is-direct-codex
.project-supervisor-composer.is-direct-codex {
display: grid;
grid-template-columns: minmax(0, 1fr);
grid-template-rows: auto auto auto;
grid-template-rows: auto auto;
gap: 0;
align-items: stretch;
position: relative;
@@ -10512,39 +10511,6 @@ button.design-workspace-tree__entry:hover,
pointer-events: auto;
}
/* 信息标签行:`项目名` · `本地`。只做只读信息,不加取数(不查 git 分支)。 */
.game-workbench-chat
.project-supervisor-surface.is-direct-codex
.project-supervisor-composer
.project-supervisor-composer-context {
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
padding-bottom: 2px;
}
.game-workbench-chat
.project-supervisor-surface.is-direct-codex
.project-supervisor-composer
.project-supervisor-composer-context
> span {
display: inline-flex;
align-items: center;
min-width: 0;
max-width: 60%;
padding: 1px 7px;
overflow: hidden;
border: 1px solid var(--platform-line-soft);
border-radius: 999px;
background: var(--platform-warm-bg);
color: var(--platform-text-soft);
font-size: 11px;
line-height: 1.6;
text-overflow: ellipsis;
white-space: nowrap;
}
.game-workbench-chat
.project-supervisor-surface.is-direct-codex
.project-supervisor-composer.is-direct-codex
@@ -5840,14 +5840,14 @@ export function registerProjectWorkbenchFoundationTests() {
expect(styles).toMatch(
/\.game-workbench-chat \.project-runtime-summary\s*\{[^}]*position:\s*sticky[^}]*top:\s*-10px/s,
);
// 输入盒是行网格(信息标签 / 文本区 / 控制排)的文档流块,不再是贴在列表下边的
// 输入盒是行网格(文本区 / 控制排)的文档流块,不再是贴在列表下边的
// 绝对定位浮层,也不再与 82px 的发送钮列共用网格。
const composerRule = styles.match(
/\.game-workbench-chat\s+\.project-supervisor-surface\.is-direct-codex\s+\.project-supervisor-composer\.is-direct-codex\s*\{([^}]*)\}/s,
);
expect(composerRule?.[1]).not.toBeUndefined();
expect(composerRule?.[1]).toContain('position: relative;');
expect(composerRule?.[1]).toContain('grid-template-rows: auto auto auto;');
expect(composerRule?.[1]).toContain('grid-template-rows: auto auto;');
expect(composerRule?.[1]).toContain('z-index: 1;');
expect(composerRule?.[1]).toContain('padding: 8px 12px 10px;');
expect(composerRule?.[1]).toContain(
@@ -6709,15 +6709,15 @@ export function registerProjectSupervisorSurfaceTests() {
expect(anchor).toMatch(/flex:\s*0 1 auto/u);
expect(anchor).toMatch(/min-width:\s*0/u);
// 输入盒高度变化不得推动同排操作元素:composer 是行网格(信息标签 / 文本区 /
// 控制排),文本区从 96px 长到 140px 只把 composer 顶边抬高,控制排仍在同一行的
// 下面一行(发送钮与模型选择钮不动)。它不再靠 `position: absolute` 底边锚定。
// 输入盒高度变化不得推动同排操作元素:composer 是行网格(文本区 / 控制排),
// 文本区从 96px 长到 140px 只把 composer 顶边抬高,控制排仍在同一行的下面一行
// (发送钮与模型选择钮不动)。它不再靠 `position: absolute` 底边锚定。
const composer = styleRuleBody(
styles,
'\\.game-workbench-chat\\s+\\.project-supervisor-surface\\.is-direct-codex\\s+\\.project-supervisor-composer\\.is-direct-codex',
);
expect(composer).toMatch(/position:\s*relative/u);
expect(composer).toMatch(/grid-template-rows:\s*auto auto auto/u);
expect(composer).toMatch(/grid-template-rows:\s*auto auto;/u);
expect(styleNumber(composer, 'bottom')).toBe(0);
// 控制排是单行 flex、不换行:窄屏下靠可压缩的模型选择钮(flex 0 1 auto + min-width 0
// 收窄,而不是把模型选择钮/发送钮挤到第二行。
@@ -8113,18 +8113,18 @@ export function registerProjectSupervisorSurfaceTests() {
expect(
within(supervisorSurface).queryByRole('button', { name: /审批配置/ }),
).toBeNull();
// 输入盒段式:信息标签行 / 文本区 / 控制排。项目名 + 本地两个标签,`+` 与 `@` 都在。
// 输入盒段式:文本区 / 控制排。原先那行「项目名 · 本地」信息标签已按需求删除,
// 输入盒内不再复述当前项目;`+` 与 `@` 仍在。
const composer = supervisorSurface.querySelector(
'form.project-supervisor-composer',
);
expect(composer).not.toBeNull();
const context = composer?.querySelector(
'.project-supervisor-composer-context',
);
expect(
within(context as HTMLElement).getByText('launcher-codex-panel-game'),
).not.toBeNull();
expect(within(context as HTMLElement).getByText('本地')).not.toBeNull();
composer?.querySelector('.project-supervisor-composer-context'),
).toBeNull();
expect(
within(composer as HTMLElement).queryByText('launcher-codex-panel-game'),
).toBeNull();
expect(
within(composer as HTMLElement).getByRole('button', {
name: '添加素材引用',
@@ -134,7 +134,6 @@ const COMPOSER_INPUT_PLAIN = `${COMPOSER_PLAIN} .resource-reference-input`;
const COMPOSER_EDITOR = `${COMPOSER_PLAIN} .resource-reference-input-editor`;
const COMPOSER_CONTROLS = `${COMPOSER} .project-supervisor-composer-controls`;
const COMPOSER_SUBMIT = `${COMPOSER_CONTROLS} .project-supervisor-submit-button`;
const COMPOSER_CONTEXT = `${COMPOSER_PLAIN} .project-supervisor-composer-context`;
const INPUT_ACTIONS = `${COMPOSER} .resource-reference-input-actions`;
const TOPBAR = `${CHAT} .project-supervisor-topbar`;
// 策划链在会话列里额外挂了一条规划面/窄条时,列表会命中这条 `:has(...)` 规则——
@@ -186,7 +185,6 @@ function composerMaxHeight() {
`${INPUT_ACTIONS} .resource-reference-input-polish`,
'.resource-reference-input-polish',
);
const context = desktopDeclarations(COMPOSER_CONTEXT);
const controls = desktopDeclarations(COMPOSER_CONTROLS);
const submit = desktopDeclarations(COMPOSER_SUBMIT);
@@ -207,9 +205,6 @@ function composerMaxHeight() {
// 一旦设了,网格行高会被顶起来、编辑器的 min-height 也跟着变,算式随之作废。
expect(actions.has('height')).toBe(false);
expect(actions.has('min-height')).toBe(false);
// 信息标签行只在 direct-codex 渲染,也只占一行,不设固定高度。
expect(context.has('height')).toBe(false);
expect(context.has('min-height')).toBe(false);
return {
actionsRowHeight,
@@ -332,7 +327,8 @@ describe('陶泥儿对话区:Codex 三段式(顶栏 / 唯一滚动区 / 文
// 编辑器、`+` / `@` 引用、模型选择、提交按钮全在这棵子树里,位置只由样式挪。
expect(formSource).toContain('ResourceReferenceInput');
expect(formSource).toContain('project-supervisor-composer-context');
// 输入盒里不再有「项目名 · 本地」信息标签行(按需求删除)。
expect(formSource).not.toContain('project-supervisor-composer-context');
expect(formSource).toContain('project-supervisor-composer-controls');
expect(formSource).toContain('project-supervisor-attachment-trigger');
expect(formSource).toContain('project-supervisor-reference-trigger');