fix(web): pin preset before subagent header action

This commit is contained in:
Yichen Jiang
2026-08-10 19:53:58 +08:00
parent cec716717f
commit 9ce8340dd9
8 changed files with 77 additions and 8 deletions

View File

@@ -2,5 +2,5 @@
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write packages/client/ui-agent-preset/README.md
README.md: c4c7df4e6fbe0479cac4767247c1b10fd65aad77
README.zh.md: 84c02977ec18f89c06311b570428f92c2b459fb3
README.md: 008066114e9c49e5c74299979e24c27a4c9621c9
README.zh.md: e07d5994ae196cd03be7818fe4ade1aafda9aa55

View File

@@ -18,7 +18,7 @@ A session that has started is refused rather than queued: the host answers `agen
## The session-header label
A third surface, beside the session title: the preset THIS session runs, as static chrome. It precedes the subagent catalog in the header action row. A control there would promise a switch the host refuses outright. It reads the preset from the session's own summary — a resumed session runs what it was created with, not today's default — and resolves the display name against the same roster the General row reads.
A third surface, beside the session title: the preset THIS session runs, as static chrome. A control there would promise a switch the host refuses outright. It reads the preset from the session's own summary — a resumed session runs what it was created with, not today's default — and resolves the display name against the same roster the General row reads.
## What it reads and writes

View File

@@ -18,7 +18,7 @@ chip 以部署默认值打开,其选择是**暂存**的——该界面先于
## 会话标题旁的标签
第三个表层,位于会话标题旁:**本会话**所运行的 preset作为静态装饰呈现。它在头部操作行中排在 subagent 列表之前。在那里放一个控件,等于承诺一次宿主会断然拒绝的切换。它从会话自身的摘要读取 preset——被恢复的会话运行的是它创建时的那一份而非今天的默认值——并在 General 行所读的同一份名单上解析显示名称。
第三个表层,位于会话标题旁:**本会话**所运行的 preset作为静态装饰呈现。在那里放一个控件等于承诺一次宿主会断然拒绝的切换。它从会话自身的摘要读取 preset——被恢复的会话运行的是它创建时的那一份而非今天的默认值——并在 General 行所读的同一份名单上解析显示名称。
## 它读什么、写什么

View File

@@ -157,7 +157,8 @@ export function apply(ctx: ClientContext): void {
const label = scope.slots.register({
name: 'conversation.session.header.actions',
id: 'agent-preset',
order: 0,
// Static session context occupies the header's leading negative-order band.
order: -10,
locale: 'settings.agentPreset',
inject: labelInjected,
}, AgentPresetLabel)

View File

@@ -304,7 +304,7 @@ describe('ui-agent-preset apply', () => {
expect(chip.component).toBe(AgentPresetSeat)
const label = slots.entries('conversation.session.header.actions')[0]!
expect(label.component).toBe(AgentPresetLabel)
expect(label.options).toMatchObject({ id: 'agent-preset', order: 0 })
expect(label.options).toMatchObject({ id: 'agent-preset', order: -10 })
await fiber.dispose()
expect(slots.entries('conversation.hero.agentPreset')).toHaveLength(0)
expect(slots.entries('conversation.session.header.actions')).toHaveLength(0)

View File

@@ -38,7 +38,11 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
'conversation.session': { kind: 'single'; scope: 'session' }
/** Strict-session header above the resident conversation scrollport. */
'conversation.session.header': { kind: 'single'; scope: 'session' }
/** Session-header actions contributed by feature plugins. */
/**
* Session-header actions contributed by feature plugins. Entries render
* by ascending `order`; negative values are reserved for static session
* context that precedes interactive actions.
*/
'conversation.session.header.actions': { kind: 'list'; scope: 'session'; owner: ConversationHeaderActionOwnerProps }
/**
* The conversation view ring: one list entry per view tab (chat here;