From ff9b86464176c718d41c03c1ee4f830af76325b9 Mon Sep 17 00:00:00 2001 From: Turtle Date: Thu, 12 Nov 2026 03:36:22 +0800 Subject: [PATCH 1/2] feat(web): mark the inherited-history divider with the fork glyph The divider that separates a forked Session's inherited history from its own messages was a bare hairline and caption, so it read as an unlabelled rule rather than a boundary with a meaning. Lead the caption with the shared fork glyph, the same artwork the branch action uses, and keep both inside one caption group so they share the tertiary ink. The glyph takes the 14px flow-row edge and follows the content font delta like the other chat row leading icons. Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com> --- packages/client/ui-chat/README.i18n.yaml | 4 ++-- packages/client/ui-chat/README.md | 2 +- packages/client/ui-chat/README.zh.md | 2 +- .../src/client/chat/MessageItem.module.css | 21 ++++++++++++++++++- .../ui-chat/src/client/chat/MessageItem.tsx | 7 +++++-- .../ui-chat/tests/chat-view.client.spec.tsx | 3 +++ 6 files changed, 32 insertions(+), 7 deletions(-) diff --git a/packages/client/ui-chat/README.i18n.yaml b/packages/client/ui-chat/README.i18n.yaml index 28af833f22..dc3ee52ae1 100644 --- a/packages/client/ui-chat/README.i18n.yaml +++ b/packages/client/ui-chat/README.i18n.yaml @@ -24,8 +24,8 @@ en: 30878be703edac57 zh: 16b84188c8660850 /deepseek-ai-dsh-client-ui-chat/inherited-history-divider: - en: b8b735733697ffdf - zh: 9c735d3798b89d4d + en: 4e8e6e7e1dd5fc57 + zh: 96ad94c2782dd641 /deepseek-ai-dsh-client-ui-chat/turn-token-usage: en: d363057b5c0b2571 zh: 0f6fe864d9673576 diff --git a/packages/client/ui-chat/README.md b/packages/client/ui-chat/README.md index 8d6a921724..3aefae4daa 100644 --- a/packages/client/ui-chat/README.md +++ b/packages/client/ui-chat/README.md @@ -79,7 +79,7 @@ Chat adapts Markdown targets at `MarkdownDelegateProvider.getTriggerProps`. The ## Inherited history divider -A forked Session, such as a fork subagent or a branched conversation, shows a divider labelled “Inherited history above” at its latest inherited `session/end-seed` marker, between the copied history and the Session's own messages. A cut inside a Turn keeps the divider outside that Turn's process folding. The divider appears once the history page that holds the marker is loaded, so a long inherited history may show it only after scrolling up. Sessions without inherited history show no divider. +A forked Session, such as a fork subagent or a branched conversation, shows a divider labelled “Inherited history above” at its latest inherited `session/end-seed` marker, between the copied history and the Session's own messages. The caption leads with the shared fork glyph, the same one the branch action uses, so the line names the relationship it marks. A cut inside a Turn keeps the divider outside that Turn's process folding. The divider appears once the history page that holds the marker is loaded, so a long inherited history may show it only after scrolling up. Sessions without inherited history show no divider. ----- diff --git a/packages/client/ui-chat/README.zh.md b/packages/client/ui-chat/README.zh.md index bd57e895a5..6bda04bb5a 100644 --- a/packages/client/ui-chat/README.zh.md +++ b/packages/client/ui-chat/README.zh.md @@ -79,7 +79,7 @@ Chat 在 `MarkdownDelegateProvider.getTriggerProps` 接入处适配 Markdown 目 ## 继承历史分隔线 -分叉产生的会话(例如 fork 子智能体或分支出的对话)在最后一个继承的 `session/end-seed` 标记处显示一条标注“以上为继承的历史消息”的分隔线,把复制来的历史与该会话自己的消息分开。切点位于某个 Turn 内部时,分隔线留在该 Turn 的过程折叠之外。分隔线在包含标记的历史页加载后才出现,因此继承历史较长时,可能要向上滚动才能看到。没有继承历史的会话不显示分隔线。 +分叉产生的会话(例如 fork 子智能体或分支出的对话)在最后一个继承的 `session/end-seed` 标记处显示一条标注“以上为继承的历史消息”的分隔线,把复制来的历史与该会话自己的消息分开。标注以共享的 fork 图标开头,与“在新对话中分支”操作使用的是同一个图标,让这条线点明它所标记的关系。切点位于某个 Turn 内部时,分隔线留在该 Turn 的过程折叠之外。分隔线在包含标记的历史页加载后才出现,因此继承历史较长时,可能要向上滚动才能看到。没有继承历史的会话不显示分隔线。 ----- diff --git a/packages/client/ui-chat/src/client/chat/MessageItem.module.css b/packages/client/ui-chat/src/client/chat/MessageItem.module.css index 7bb1349e59..11a7b2f2bc 100644 --- a/packages/client/ui-chat/src/client/chat/MessageItem.module.css +++ b/packages/client/ui-chat/src/client/chat/MessageItem.module.css @@ -44,11 +44,30 @@ border-top: 0.5px solid var(--dsw-alias-border-l2); } +/* The caption is one group: the fork glyph names what the line separates, and + it shares the label's tertiary ink. Its 6px inset from the label matches the + flow-row leading glyph; the row's own 12px gap keeps both off the hairlines. */ +.inheritedHistoryCaption { + flex: 0 1 auto; + display: flex; + align-items: center; + gap: 6px; + min-width: 0; + color: var(--dsw-alias-label-tertiary); +} + +/* Same 14px flow-row glyph edge as DisclosureRow's leading icon: the CSS edge + overrides the svg's own width/height so the glyph follows the font delta. */ +.inheritedHistoryIcon { + flex: none; + width: calc(14px + var(--dsh-content-font-delta, 0px)); + height: calc(14px + var(--dsh-content-font-delta, 0px)); +} + .inheritedHistoryLabel { flex: 0 1 auto; min-width: 0; overflow: hidden; - color: var(--dsw-alias-label-tertiary); font-size: var(--dsh-content-font-size-secondary, 13px); line-height: calc(24px + var(--dsh-content-font-delta, 0px)); text-overflow: ellipsis; diff --git a/packages/client/ui-chat/src/client/chat/MessageItem.tsx b/packages/client/ui-chat/src/client/chat/MessageItem.tsx index 8c637e6e6c..d946cc620b 100644 --- a/packages/client/ui-chat/src/client/chat/MessageItem.tsx +++ b/packages/client/ui-chat/src/client/chat/MessageItem.tsx @@ -3,7 +3,7 @@ import type { ReactNode } from 'react' import type { PendingSubmission } from '@deepseek-ai/dsh-api-session-controller/client' import type { PropsRenderFactories, PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots' import type { UserTextFacts } from '@deepseek-ai/dsh-client-ui-conversation/client' -import { JsonBlock, StateDot, TextShimmer } from '@deepseek-ai/dsh-client-ui-primitives' +import { IconBranchOutlineRegular, JsonBlock, StateDot, TextShimmer } from '@deepseek-ai/dsh-client-ui-primitives' import type { ChatNodeOwnerProps, ChatNodeViewProps, ChatViewSlotProps, UserContentAttachment, UserContentData, UserContentInput, } from '../contract/slots.ts' @@ -384,7 +384,10 @@ export const InheritedHistoryNodeView = memo(function InheritedHistoryNodeView({ return (
- {t('message.inheritedHistory')} + + + {t('message.inheritedHistory')} +
) diff --git a/packages/client/ui-chat/tests/chat-view.client.spec.tsx b/packages/client/ui-chat/tests/chat-view.client.spec.tsx index c7cee3bded..29760c3971 100644 --- a/packages/client/ui-chat/tests/chat-view.client.spec.tsx +++ b/packages/client/ui-chat/tests/chat-view.client.spec.tsx @@ -3723,6 +3723,9 @@ describe('ChatView', () => { const own = view.getByText('own question') expect(inherited.compareDocumentPosition(separator) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() expect(separator.compareDocumentPosition(own) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() + // The caption carries the fork glyph, so the divider names the relationship + // it marks rather than reading as an unlabelled hairline. + expect(separator.querySelector('[data-icon="dsw-icon-branch-outline-regular"]')).not.toBeNull() }) it('disables fork when the indexed Turn has a later steering Node', () => { From 3528d66356fa78580ce804f2943d2c89b99a3edf Mon Sep 17 00:00:00 2001 From: Turtle Date: Fri, 13 Nov 2026 13:27:26 +0800 Subject: [PATCH 2/2] docs(web): state the divider glyph contract without rationale prose Trim the divider caption comment, test comment, and README sentence to current behavior, record the new glyph rule copy in the bash-sample inventory, and pin the glyph's font-delta edge in the font-axis spec. Co-authored-by: imccyu <276526105+imccyu@users.noreply.github.com> --- packages/client/ui-chat/README.i18n.yaml | 4 ++-- packages/client/ui-chat/README.md | 2 +- packages/client/ui-chat/README.zh.md | 2 +- .../ui-chat/src/client/chat/MessageItem.module.css | 11 ++++++----- .../tests/chat-font-axis-styles.client.spec.ts | 7 +++++++ .../client/ui-chat/tests/chat-view.client.spec.tsx | 2 -- .../src/client/tool/toolviews/bash-sample.module.css | 9 +++++---- 7 files changed, 22 insertions(+), 15 deletions(-) diff --git a/packages/client/ui-chat/README.i18n.yaml b/packages/client/ui-chat/README.i18n.yaml index dc3ee52ae1..a986f761c4 100644 --- a/packages/client/ui-chat/README.i18n.yaml +++ b/packages/client/ui-chat/README.i18n.yaml @@ -24,8 +24,8 @@ en: 30878be703edac57 zh: 16b84188c8660850 /deepseek-ai-dsh-client-ui-chat/inherited-history-divider: - en: 4e8e6e7e1dd5fc57 - zh: 96ad94c2782dd641 + en: a191f90e9a64f6fe + zh: 8e91b8660f9baa18 /deepseek-ai-dsh-client-ui-chat/turn-token-usage: en: d363057b5c0b2571 zh: 0f6fe864d9673576 diff --git a/packages/client/ui-chat/README.md b/packages/client/ui-chat/README.md index 3aefae4daa..70921859ae 100644 --- a/packages/client/ui-chat/README.md +++ b/packages/client/ui-chat/README.md @@ -79,7 +79,7 @@ Chat adapts Markdown targets at `MarkdownDelegateProvider.getTriggerProps`. The ## Inherited history divider -A forked Session, such as a fork subagent or a branched conversation, shows a divider labelled “Inherited history above” at its latest inherited `session/end-seed` marker, between the copied history and the Session's own messages. The caption leads with the shared fork glyph, the same one the branch action uses, so the line names the relationship it marks. A cut inside a Turn keeps the divider outside that Turn's process folding. The divider appears once the history page that holds the marker is loaded, so a long inherited history may show it only after scrolling up. Sessions without inherited history show no divider. +A forked Session, such as a fork subagent or a branched conversation, shows a divider labelled “Inherited history above” at its latest inherited `session/end-seed` marker, between the copied history and the Session's own messages. The caption starts with the branch glyph that the branch action uses. A cut inside a Turn keeps the divider outside that Turn's process folding. The divider appears once the history page that holds the marker is loaded, so a long inherited history may show it only after scrolling up. Sessions without inherited history show no divider. ----- diff --git a/packages/client/ui-chat/README.zh.md b/packages/client/ui-chat/README.zh.md index 6bda04bb5a..d50ba90f91 100644 --- a/packages/client/ui-chat/README.zh.md +++ b/packages/client/ui-chat/README.zh.md @@ -79,7 +79,7 @@ Chat 在 `MarkdownDelegateProvider.getTriggerProps` 接入处适配 Markdown 目 ## 继承历史分隔线 -分叉产生的会话(例如 fork 子智能体或分支出的对话)在最后一个继承的 `session/end-seed` 标记处显示一条标注“以上为继承的历史消息”的分隔线,把复制来的历史与该会话自己的消息分开。标注以共享的 fork 图标开头,与“在新对话中分支”操作使用的是同一个图标,让这条线点明它所标记的关系。切点位于某个 Turn 内部时,分隔线留在该 Turn 的过程折叠之外。分隔线在包含标记的历史页加载后才出现,因此继承历史较长时,可能要向上滚动才能看到。没有继承历史的会话不显示分隔线。 +分叉产生的会话(例如 fork 子智能体或分支出的对话)在最后一个继承的 `session/end-seed` 标记处显示一条标注“以上为继承的历史消息”的分隔线,把复制来的历史与该会话自己的消息分开。标注以“在新对话中分支”操作所用的分支图标开头。切点位于某个 Turn 内部时,分隔线留在该 Turn 的过程折叠之外。分隔线在包含标记的历史页加载后才出现,因此继承历史较长时,可能要向上滚动才能看到。没有继承历史的会话不显示分隔线。 ----- diff --git a/packages/client/ui-chat/src/client/chat/MessageItem.module.css b/packages/client/ui-chat/src/client/chat/MessageItem.module.css index 11a7b2f2bc..02a83126a7 100644 --- a/packages/client/ui-chat/src/client/chat/MessageItem.module.css +++ b/packages/client/ui-chat/src/client/chat/MessageItem.module.css @@ -44,9 +44,9 @@ border-top: 0.5px solid var(--dsw-alias-border-l2); } -/* The caption is one group: the fork glyph names what the line separates, and - it shares the label's tertiary ink. Its 6px inset from the label matches the - flow-row leading glyph; the row's own 12px gap keeps both off the hairlines. */ +/* Glyph and label share one caption and its tertiary ink. The 6px gap matches + a flow row's glyph-to-label gap; without the flow row's 16px leading box the + label starts 20px in rather than 22px. */ .inheritedHistoryCaption { flex: 0 1 auto; display: flex; @@ -56,8 +56,9 @@ color: var(--dsw-alias-label-tertiary); } -/* Same 14px flow-row glyph edge as DisclosureRow's leading icon: the CSS edge - overrides the svg's own width/height so the glyph follows the font delta. */ +/* The 14px flow-row glyph edge shared with DisclosureRow's leading icon: the + CSS edge overrides the svg's own width/height so the glyph follows the font + delta. */ .inheritedHistoryIcon { flex: none; width: calc(14px + var(--dsh-content-font-delta, 0px)); diff --git a/packages/client/ui-chat/tests/chat-font-axis-styles.client.spec.ts b/packages/client/ui-chat/tests/chat-font-axis-styles.client.spec.ts index aeba01b380..b2cb704e53 100644 --- a/packages/client/ui-chat/tests/chat-font-axis-styles.client.spec.ts +++ b/packages/client/ui-chat/tests/chat-font-axis-styles.client.spec.ts @@ -76,6 +76,13 @@ describe('chat flow font-size axis', () => { ])) }) + it('the inherited-history caption glyph scales with its label', () => { + expect(declarationsFrom(read('MessageItem.module.css'), '.inheritedHistoryIcon')).toEqual(expect.arrayContaining([ + 'width: calc(14px + var(--dsh-content-font-delta, 0px))', + 'height: calc(14px + var(--dsh-content-font-delta, 0px))', + ])) + }) + it('expanded bodies indent by 22px + delta so content stays under the shifted title start', () => { // The DisclosureRow title starts at leading (16 + delta) + gap 6; a fixed // 22px indent would misalign at every non-default size. diff --git a/packages/client/ui-chat/tests/chat-view.client.spec.tsx b/packages/client/ui-chat/tests/chat-view.client.spec.tsx index 29760c3971..311679176c 100644 --- a/packages/client/ui-chat/tests/chat-view.client.spec.tsx +++ b/packages/client/ui-chat/tests/chat-view.client.spec.tsx @@ -3723,8 +3723,6 @@ describe('ChatView', () => { const own = view.getByText('own question') expect(inherited.compareDocumentPosition(separator) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() expect(separator.compareDocumentPosition(own) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy() - // The caption carries the fork glyph, so the divider names the relationship - // it marks rather than reading as an unlabelled hairline. expect(separator.querySelector('[data-icon="dsw-icon-branch-outline-regular"]')).not.toBeNull() }) diff --git a/packages/client/ui-tool/src/client/tool/toolviews/bash-sample.module.css b/packages/client/ui-tool/src/client/tool/toolviews/bash-sample.module.css index 6f521dc8b3..38da2a3869 100644 --- a/packages/client/ui-tool/src/client/tool/toolviews/bash-sample.module.css +++ b/packages/client/ui-tool/src/client/tool/toolviews/bash-sample.module.css @@ -125,10 +125,11 @@ /* Same glyph-scaling rule as DisclosureRow's leading: the CSS edge overrides the svg attributes so the 14px business glyph follows the font-size delta. - TODO: this bash header duplicates the DisclosureRow structure (and this is - the fourth copy of the glyph rule, with DisclosureRow, MessageItem - .compactionLeading, and MessageIconActions); migrating the bash row onto - the shared DisclosureRow would collapse them to one. */ + TODO: this bash header duplicates the DisclosureRow structure, and the glyph + rule is also copied in DisclosureRow, MessageItem .compactionLeading and + .inheritedHistoryIcon, ChatGroupSeat, SkillRow, and MessageIconActions (at + 15px); migrating the bash row onto the shared DisclosureRow removes this + copy. */ .leading svg:not([data-state]) { width: calc(14px + var(--dsh-content-font-delta, 0px)); height: calc(14px + var(--dsh-content-font-delta, 0px));