Merge pull request #8337 from deepseek-harness/turtle/add-fork-divider-icon-00480ee14df2
feat(web): lead the inherited-history divider with a fork icon
This commit is contained in:
commit
3b0e25bc4b
8 files changed
+43
-11
No files matched your search
@@ -24,8 +24,8 @@
|
||||
en: 30878be703edac57
|
||||
zh: 16b84188c8660850
|
||||
/deepseek-ai-dsh-client-ui-chat/inherited-history-divider:
|
||||
en: b8b735733697ffdf
|
||||
zh: 9c735d3798b89d4d
|
||||
en: a191f90e9a64f6fe
|
||||
zh: 8e91b8660f9baa18
|
||||
/deepseek-ai-dsh-client-ui-chat/turn-token-usage:
|
||||
en: d363057b5c0b2571
|
||||
zh: 0f6fe864d9673576
|
||||
|
||||
@@ -79,7 +79,7 @@ Chat adapts Markdown targets at `MarkdownDelegateProvider.getTriggerProps`. The
|
||||
<a id="inherited-history-divider"></a>
|
||||
## 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 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.
|
||||
|
||||
-----
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ Chat 在 `MarkdownDelegateProvider.getTriggerProps` 接入处适配 Markdown 目
|
||||
<a id="inherited-history-divider"></a>
|
||||
## 继承历史分隔线
|
||||
|
||||
分叉产生的会话(例如 fork 子智能体或分支出的对话)在最后一个继承的 `session/end-seed` 标记处显示一条标注“以上为继承的历史消息”的分隔线,把复制来的历史与该会话自己的消息分开。切点位于某个 Turn 内部时,分隔线留在该 Turn 的过程折叠之外。分隔线在包含标记的历史页加载后才出现,因此继承历史较长时,可能要向上滚动才能看到。没有继承历史的会话不显示分隔线。
|
||||
分叉产生的会话(例如 fork 子智能体或分支出的对话)在最后一个继承的 `session/end-seed` 标记处显示一条标注“以上为继承的历史消息”的分隔线,把复制来的历史与该会话自己的消息分开。标注以“在新对话中分支”操作所用的分支图标开头。切点位于某个 Turn 内部时,分隔线留在该 Turn 的过程折叠之外。分隔线在包含标记的历史页加载后才出现,因此继承历史较长时,可能要向上滚动才能看到。没有继承历史的会话不显示分隔线。
|
||||
|
||||
-----
|
||||
|
||||
|
||||
@@ -44,11 +44,31 @@
|
||||
border-top: 0.5px solid var(--dsw-alias-border-l2);
|
||||
}
|
||||
|
||||
/* 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;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
color: var(--dsw-alias-label-tertiary);
|
||||
}
|
||||
|
||||
/* 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));
|
||||
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;
|
||||
|
||||
@@ -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 (
|
||||
<div className={css.inheritedHistoryRow} role="separator" aria-label={t('message.inheritedHistory')}>
|
||||
<span className={css.inheritedHistoryLine} aria-hidden />
|
||||
<span className={css.inheritedHistoryLabel} aria-hidden>{t('message.inheritedHistory')}</span>
|
||||
<span className={css.inheritedHistoryCaption} aria-hidden>
|
||||
<IconBranchOutlineRegular className={css.inheritedHistoryIcon} />
|
||||
<span className={css.inheritedHistoryLabel}>{t('message.inheritedHistory')}</span>
|
||||
</span>
|
||||
<span className={css.inheritedHistoryLine} aria-hidden />
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -3723,6 +3723,7 @@ 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()
|
||||
expect(separator.querySelector('[data-icon="dsw-icon-branch-outline-regular"]')).not.toBeNull()
|
||||
})
|
||||
|
||||
it('disables fork when the indexed Turn has a later steering Node', () => {
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user