@deepseek-ai/dsh-client-ui-chat 0.2.3-alpha.2 → 0.2.3-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +12 -12
- package/README.md +11 -9
- package/README.zh.md +11 -9
- package/lib/client.js +9 -9
- package/lib/client.js.map +1 -1
- package/lib/types/client/apply.d.ts.map +1 -1
- package/lib/types/client/apply.js.map +1 -1
- package/lib/types/client/chat/ApprovalCommand.d.ts +1 -1
- package/lib/types/client/chat/ApprovalCommand.d.ts.map +1 -1
- package/lib/types/client/chat/AssistantMarkdown.d.ts +2 -2
- package/lib/types/client/chat/AssistantMarkdown.d.ts.map +1 -1
- package/lib/types/client/chat/AssistantMarkdown.js.map +1 -1
- package/lib/types/client/chat/AssistantNodeView.d.ts +3 -3
- package/lib/types/client/chat/AssistantNodeView.d.ts.map +1 -1
- package/lib/types/client/chat/ChatAside.d.ts +1 -1
- package/lib/types/client/chat/ChatAside.d.ts.map +1 -1
- package/lib/types/client/chat/ChatFlow.d.ts +1 -1
- package/lib/types/client/chat/ChatFlow.d.ts.map +1 -1
- package/lib/types/client/chat/ChatFlow.js.map +1 -1
- package/lib/types/client/chat/ChatGroupSeat.d.ts.map +1 -1
- package/lib/types/client/chat/ChatGroupSeat.js.map +1 -1
- package/lib/types/client/chat/ChatNodeSeat.d.ts +1 -1
- package/lib/types/client/chat/ChatNodeSeat.d.ts.map +1 -1
- package/lib/types/client/chat/ChatNodeSeat.js.map +1 -1
- package/lib/types/client/chat/ChatView.d.ts +1 -1
- package/lib/types/client/chat/ChatView.d.ts.map +1 -1
- package/lib/types/client/chat/ChatView.js.map +1 -1
- package/lib/types/client/chat/CommandNodeView.d.ts +1 -1
- package/lib/types/client/chat/CommandNodeView.d.ts.map +1 -1
- package/lib/types/client/chat/CommandStatusRow.js.map +1 -1
- package/lib/types/client/chat/CompactionItem.js.map +1 -1
- package/lib/types/client/chat/ContextBody.d.ts +11 -1
- package/lib/types/client/chat/ContextBody.d.ts.map +1 -1
- package/lib/types/client/chat/ContextBody.js.map +1 -1
- package/lib/types/client/chat/ContextInjectionRow.d.ts.map +1 -1
- package/lib/types/client/chat/ContextInjectionRow.js.map +1 -1
- package/lib/types/client/chat/MessageIconActions.js.map +1 -1
- package/lib/types/client/chat/MessageItem.d.ts +5 -3
- package/lib/types/client/chat/MessageItem.d.ts.map +1 -1
- package/lib/types/client/chat/MessageItem.js.map +1 -1
- package/lib/types/client/chat/QuotaNoticeHost.js.map +1 -1
- package/lib/types/client/chat/ReasoningContent.d.ts +1 -1
- package/lib/types/client/chat/ReasoningContent.d.ts.map +1 -1
- package/lib/types/client/chat/ReasoningContent.js.map +1 -1
- package/lib/types/client/chat/ReasoningRow.d.ts +1 -1
- package/lib/types/client/chat/ReasoningRow.d.ts.map +1 -1
- package/lib/types/client/chat/ReasoningRow.js.map +1 -1
- package/lib/types/client/chat/RunningStatus.js.map +1 -1
- package/lib/types/client/chat/StatsPills.d.ts +1 -1
- package/lib/types/client/chat/StatsPills.d.ts.map +1 -1
- package/lib/types/client/chat/StatsPills.js.map +1 -1
- package/lib/types/client/chat/SystemPromptRow.d.ts +7 -3
- package/lib/types/client/chat/SystemPromptRow.d.ts.map +1 -1
- package/lib/types/client/chat/SystemPromptRow.js.map +1 -1
- package/lib/types/client/chat/TurnNavigator.d.ts +1 -1
- package/lib/types/client/chat/TurnNavigator.d.ts.map +1 -1
- package/lib/types/client/chat/TurnProcessNodeView.js.map +1 -1
- package/lib/types/client/chat/TurnTailNodeView.d.ts +1 -1
- package/lib/types/client/chat/TurnTailNodeView.d.ts.map +1 -1
- package/lib/types/client/chat/TurnTailNodeView.js.map +1 -1
- package/lib/types/client/chat/TurnTriggerNodeView.js.map +1 -1
- package/lib/types/client/chat/TurnUsagePanel.js.map +1 -1
- package/lib/types/client/chat/UserContent.d.ts +1 -1
- package/lib/types/client/chat/UserContent.d.ts.map +1 -1
- package/lib/types/client/chat/UserContent.js.map +1 -1
- package/lib/types/client/chat/flow-motion.d.ts +1 -1
- package/lib/types/client/chat/flow-motion.d.ts.map +1 -1
- package/lib/types/client/chat/flow-motion.js.map +1 -1
- package/lib/types/client/chat/message-chrome.d.ts +1 -1
- package/lib/types/client/chat/message-chrome.d.ts.map +1 -1
- package/lib/types/client/chat/register-node-renderers.d.ts +1 -5
- package/lib/types/client/chat/register-node-renderers.d.ts.map +1 -1
- package/lib/types/client/chat/register-node-renderers.js.map +1 -1
- package/lib/types/client/chat/searchable-hidden.d.ts +1 -1
- package/lib/types/client/chat/searchable-hidden.d.ts.map +1 -1
- package/lib/types/client/chat/stat-dialog.d.ts +3 -3
- package/lib/types/client/chat/stat-dialog.d.ts.map +1 -1
- package/lib/types/client/chat/stat-dialog.js.map +1 -1
- package/lib/types/client/chat/step-process.d.ts +18 -1
- package/lib/types/client/chat/step-process.d.ts.map +1 -1
- package/lib/types/client/chat/step-process.js.map +1 -1
- package/lib/types/client/chat/text-interaction.d.ts +1 -1
- package/lib/types/client/chat/text-interaction.d.ts.map +1 -1
- package/lib/types/client/chat/text-interaction.js.map +1 -1
- package/lib/types/client/chat/text-selection.d.ts +1 -0
- package/lib/types/client/chat/text-selection.d.ts.map +1 -1
- package/lib/types/client/chat/text-selection.js.map +1 -1
- package/lib/types/client/chat/use-chat-scroll.d.ts +2 -2
- package/lib/types/client/chat/use-chat-scroll.d.ts.map +1 -1
- package/lib/types/client/chat/use-chat-viewport.d.ts +2 -2
- package/lib/types/client/chat/use-chat-viewport.d.ts.map +1 -1
- package/lib/types/client/chat/use-chat-viewport.js.map +1 -1
- package/lib/types/client/chat/use-process-scroll.d.ts +1 -1
- package/lib/types/client/chat/use-process-scroll.d.ts.map +1 -1
- package/lib/types/client/chat/use-process-scroll.js.map +1 -1
- package/lib/types/client/contract/chat-nodes.d.ts +4 -0
- package/lib/types/client/contract/chat-nodes.d.ts.map +1 -1
- package/lib/types/client/contract/chat-nodes.js.map +1 -1
- package/lib/types/client/contract/chat-visibility.d.ts +2 -2
- package/lib/types/client/contract/chat-visibility.js.map +1 -1
- package/lib/types/client/contract/slots.d.ts +33 -12
- package/lib/types/client/contract/slots.d.ts.map +1 -1
- package/lib/types/client/conversation-nodes/command.js.map +1 -1
- package/lib/types/client/conversation-nodes/fallback.js.map +1 -1
- package/lib/types/client/conversation-nodes/message.js.map +1 -1
- package/lib/types/client/conversation-nodes/request-prompt.d.ts +8 -3
- package/lib/types/client/conversation-nodes/request-prompt.d.ts.map +1 -1
- package/lib/types/client/conversation-nodes/request-prompt.js.map +1 -1
- package/lib/types/client/conversation-nodes/retry.d.ts.map +1 -1
- package/lib/types/client/conversation-nodes/retry.js.map +1 -1
- package/lib/types/client/conversation-nodes/tool.d.ts +18 -3
- package/lib/types/client/conversation-nodes/tool.d.ts.map +1 -1
- package/lib/types/client/conversation-nodes/tool.js.map +1 -1
- package/lib/types/client/fence/FenceLayers.d.ts +1 -1
- package/lib/types/client/fence/FenceLayers.d.ts.map +1 -1
- package/lib/types/client/fence/FenceLayers.js.map +1 -1
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/locale.d.ts +96 -0
- package/lib/types/client/locale.d.ts.map +1 -1
- package/lib/types/client/locale.js.map +1 -1
- package/lib/types/client/markdown-labels.d.ts +1 -1
- package/lib/types/client/markdown-labels.d.ts.map +1 -1
- package/lib/types/client/presentation-policy.d.ts +2 -0
- package/lib/types/client/presentation-policy.d.ts.map +1 -1
- package/lib/types/client/presentation-policy.js.map +1 -1
- package/lib/types/client/settings/LinkOpeningRow.d.ts +2 -3
- package/lib/types/client/settings/LinkOpeningRow.d.ts.map +1 -1
- package/lib/types/client/settings/LinkOpeningRow.js.map +1 -1
- package/lib/types/client/settings/PerformanceUsageRow.d.ts +2 -2
- package/lib/types/client/settings/PerformanceUsageRow.d.ts.map +1 -1
- package/lib/types/client/settings/PerformanceUsageRow.js.map +1 -1
- package/lib/types/client/settings/PreferenceRow.js.map +1 -1
- package/lib/types/client/settings/TranscriptViewRow.d.ts +2 -2
- package/lib/types/client/settings/TranscriptViewRow.d.ts.map +1 -1
- package/lib/types/client/settings/TranscriptViewRow.js.map +1 -1
- package/package.json +46 -46
- package/src/client/apply.ts +11 -10
- package/src/client/chat/ApprovalCommand.tsx +1 -1
- package/src/client/chat/AssistantMarkdown.module.css +10 -16
- package/src/client/chat/AssistantMarkdown.tsx +6 -5
- package/src/client/chat/AssistantNodeView.tsx +3 -3
- package/src/client/chat/ChatAside.tsx +1 -1
- package/src/client/chat/ChatFlow.tsx +2 -2
- package/src/client/chat/ChatGroupSeat.module.css +4 -2
- package/src/client/chat/ChatGroupSeat.tsx +10 -6
- package/src/client/chat/ChatNodeSeat.tsx +16 -6
- package/src/client/chat/ChatView.module.css +67 -14
- package/src/client/chat/ChatView.tsx +18 -10
- package/src/client/chat/CommandNodeView.tsx +1 -1
- package/src/client/chat/CommandStatusRow.tsx +1 -1
- package/src/client/chat/CompactionItem.tsx +1 -1
- package/src/client/chat/ContextBody.module.css +8 -0
- package/src/client/chat/ContextBody.tsx +37 -4
- package/src/client/chat/ContextInjectionRow.tsx +4 -3
- package/src/client/chat/MessageIconActions.module.css +7 -0
- package/src/client/chat/MessageIconActions.tsx +1 -1
- package/src/client/chat/MessageItem.module.css +40 -48
- package/src/client/chat/MessageItem.tsx +97 -54
- package/src/client/chat/QuotaNoticeHost.tsx +1 -1
- package/src/client/chat/ReasoningContent.tsx +2 -2
- package/src/client/chat/ReasoningRow.tsx +2 -2
- package/src/client/chat/RunningStatus.tsx +1 -1
- package/src/client/chat/StatsPills.tsx +2 -2
- package/src/client/chat/SystemPromptRow.tsx +26 -9
- package/src/client/chat/TurnNavigator.module.css +10 -1
- package/src/client/chat/TurnProcessNodeView.tsx +1 -1
- package/src/client/chat/TurnTailNodeView.tsx +4 -3
- package/src/client/chat/TurnTriggerNodeView.tsx +1 -1
- package/src/client/chat/TurnUsagePanel.tsx +1 -1
- package/src/client/chat/UserContent.tsx +4 -4
- package/src/client/chat/flow-motion.ts +3 -1
- package/src/client/chat/message-chrome.ts +1 -1
- package/src/client/chat/register-node-renderers.ts +5 -8
- package/src/client/chat/searchable-hidden.ts +1 -1
- package/src/client/chat/stat-dialog.module.css +8 -6
- package/src/client/chat/stat-dialog.ts +5 -5
- package/src/client/chat/step-process.ts +33 -1
- package/src/client/chat/text-interaction.ts +7 -8
- package/src/client/chat/text-selection.ts +33 -14
- package/src/client/chat/use-chat-scroll.ts +2 -2
- package/src/client/chat/use-chat-viewport.ts +12 -11
- package/src/client/chat/use-process-scroll.ts +1 -1
- package/src/client/contract/chat-nodes.ts +4 -0
- package/src/client/contract/chat-visibility.ts +3 -3
- package/src/client/contract/slots.ts +30 -13
- package/src/client/conversation-nodes/README.i18n.yaml +4 -4
- package/src/client/conversation-nodes/README.md +5 -4
- package/src/client/conversation-nodes/README.zh.md +5 -4
- package/src/client/conversation-nodes/command.ts +1 -1
- package/src/client/conversation-nodes/fallback.ts +1 -1
- package/src/client/conversation-nodes/message.ts +1 -1
- package/src/client/conversation-nodes/request-prompt.ts +16 -6
- package/src/client/conversation-nodes/retry.ts +19 -1
- package/src/client/conversation-nodes/tool.ts +50 -29
- package/src/client/conversation-nodes/turn-process.ts +1 -1
- package/src/client/fence/FenceLayers.tsx +2 -2
- package/src/client/index.ts +2 -2
- package/src/client/locale.ts +96 -0
- package/src/client/markdown-labels.ts +1 -1
- package/src/client/model/tool-call-tree.ts +1 -1
- package/src/client/presentation-policy.ts +6 -0
- package/src/client/settings/LinkOpeningRow.tsx +5 -3
- package/src/client/settings/PerformanceUsageRow.tsx +6 -3
- package/src/client/settings/PreferenceRow.tsx +5 -5
- package/src/client/settings/TranscriptViewRow.tsx +12 -5
|
@@ -17,6 +17,15 @@
|
|
|
17
17
|
|
|
18
18
|
overflow-x: visible;
|
|
19
19
|
overflow-y: clip;
|
|
20
|
+
/* The transcript reads none of the live lengths the Conversation publishes
|
|
21
|
+
for floating chrome: the composer and viewport heights and the end
|
|
22
|
+
inset. The turn rail, the aside layer and the back-to-bottom control are
|
|
23
|
+
siblings of this box and are handled where they are styled. Resetting
|
|
24
|
+
them here keeps a measurement or a docking request from restyling the
|
|
25
|
+
transcript. */
|
|
26
|
+
--dsh-composer-height: initial;
|
|
27
|
+
--dsh-conversation-viewport-height: initial;
|
|
28
|
+
--dsh-chat-end-inset: initial;
|
|
20
29
|
}
|
|
21
30
|
|
|
22
31
|
.scroll {
|
|
@@ -37,24 +46,25 @@
|
|
|
37
46
|
container-type: inline-size;
|
|
38
47
|
}
|
|
39
48
|
|
|
40
|
-
.scroll
|
|
41
|
-
:global([data-conversation-scroll]):has(.root) {
|
|
49
|
+
.scroll {
|
|
42
50
|
overscroll-behavior-y: none;
|
|
43
51
|
}
|
|
44
52
|
|
|
45
|
-
.root[data-chat-following-tail] .scroll
|
|
46
|
-
:global([data-conversation-scroll]):has(.root[data-chat-following-tail]) {
|
|
53
|
+
.root[data-chat-following-tail] .scroll {
|
|
47
54
|
overflow-anchor: none;
|
|
48
55
|
}
|
|
49
56
|
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
/* Inside a Conversation scrollport the root asks that scrollport for the same
|
|
58
|
+
two behaviors with ui-conversation's data-conversation-overscroll and
|
|
59
|
+
data-conversation-scroll-anchor marks, and the transcript grows with it. */
|
|
60
|
+
.frame:is(:global([data-conversation-scroll]) *),
|
|
61
|
+
.root:is(:global([data-conversation-scroll]) *) {
|
|
52
62
|
flex: 0 0 auto;
|
|
53
63
|
min-height: auto;
|
|
54
64
|
height: auto;
|
|
55
65
|
}
|
|
56
66
|
|
|
57
|
-
:global([data-conversation-scroll])
|
|
67
|
+
.scroll:is(:global([data-conversation-scroll]) *) {
|
|
58
68
|
/* A host scrollport still owns vertical overflow; horizontal overflow is
|
|
59
69
|
clipped for the same reason as the self-scrolled case above. */
|
|
60
70
|
overflow-x: clip;
|
|
@@ -75,6 +85,16 @@
|
|
|
75
85
|
flex-direction: column;
|
|
76
86
|
}
|
|
77
87
|
|
|
88
|
+
/* The spacing a flow row takes above itself. Every rule that sets it and the
|
|
89
|
+
margin-top that reads it apply to the same row, so it is registered without
|
|
90
|
+
inheritance: when a neighbour's state changes the gap, only that row is
|
|
91
|
+
restyled, never its subtree. */
|
|
92
|
+
@property --dsh-chat-flow-gap {
|
|
93
|
+
syntax: '<length>';
|
|
94
|
+
inherits: false;
|
|
95
|
+
initial-value: 4px;
|
|
96
|
+
}
|
|
97
|
+
|
|
78
98
|
/* The flow slot's display:contents anchor preserves layout but not selector ancestry.
|
|
79
99
|
`hidden="until-found"` retains a searchable zero-height box; hidden and empty
|
|
80
100
|
Seats do not contribute spacing. The older-history control precedes the anchor;
|
|
@@ -97,6 +117,26 @@
|
|
|
97
117
|
--dsh-chat-flow-gap: 12px;
|
|
98
118
|
}
|
|
99
119
|
|
|
120
|
+
/* A message bubble below a process row takes the 12px response gap. The
|
|
121
|
+
listed process rows always render content, so none of them is an empty
|
|
122
|
+
Seat. */
|
|
123
|
+
.flowItem[data-chat-flow-kind="question-reply"],
|
|
124
|
+
:is(.column, :global([data-slot="conversation.chat.flow"])) > :is([data-chat-group-key], .flowItem:is([data-chat-flow-kind="compaction"], [data-chat-flow-kind="manual-compaction"], [data-chat-flow-kind="command"], [data-chat-flow-kind="context"], [data-chat-flow-kind="model-retry"], [data-chat-flow-kind="turn-error"], [data-chat-flow-kind="turn-max-tokens"])):not([hidden])
|
|
125
|
+
+ .flowItem[data-chat-flow-kind="user"] {
|
|
126
|
+
--dsh-chat-flow-gap: 12px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* Below a message's actions row, whose 28px height separates the two, the
|
|
130
|
+
next question reply or response takes the 4px process gap. These rules
|
|
131
|
+
override the 12px set above and by the response rule; in a folded Turn a
|
|
132
|
+
hidden process group sits between the two rows. */
|
|
133
|
+
:is(.column, :global([data-slot="conversation.chat.flow"])) > :is([data-chat-flow-kind="user"], [data-chat-flow-kind="steering"], [data-chat-flow-kind="question-reply"]) + .flowItem[data-chat-flow-kind="question-reply"],
|
|
134
|
+
:is(.column, :global([data-slot="conversation.chat.flow"])) > :is([data-chat-flow-kind="user"], [data-chat-flow-kind="steering"], [data-chat-flow-kind="question-reply"]) + [hidden] + .flowItem[data-chat-flow-kind="question-reply"],
|
|
135
|
+
:is(.column, :global([data-slot="conversation.chat.flow"])) > [data-chat-flow-kind="question-reply"] + .flowItem[data-chat-group-part="response"],
|
|
136
|
+
:is(.column, :global([data-slot="conversation.chat.flow"])) > [data-chat-flow-kind="question-reply"] + [hidden] + .flowItem[data-chat-group-part="response"] {
|
|
137
|
+
--dsh-chat-flow-gap: 4px;
|
|
138
|
+
}
|
|
139
|
+
|
|
100
140
|
/* Settled-flow identity boundary. It is neutral until it becomes the natural
|
|
101
141
|
measurement/mount unit for a virtualizer without changing the column gap. */
|
|
102
142
|
.flowItem {
|
|
@@ -225,6 +265,8 @@
|
|
|
225
265
|
color: var(--dsw-alias-label-deep-diving);
|
|
226
266
|
font-size: calc(var(--dsh-content-font-size, 14px) - 2px);
|
|
227
267
|
line-height: calc(22px + var(--dsh-content-font-delta, 0px));
|
|
268
|
+
-webkit-user-select: none;
|
|
269
|
+
user-select: none;
|
|
228
270
|
}
|
|
229
271
|
|
|
230
272
|
/* After the Session stops running and before the Turn's actions row arrives, the status keeps its slot
|
|
@@ -366,10 +408,17 @@
|
|
|
366
408
|
element whose containing block is the layer, as it does in the
|
|
367
409
|
back-to-bottom control's padding below. The Conversation body's end
|
|
368
410
|
reserve narrows the frame by --dsh-chat-end-inset; the layer reaches back
|
|
369
|
-
across it to the scrollport's end edge, and the gutter counts it.
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
411
|
+
across it to the scrollport's end edge, and the gutter counts it. While
|
|
412
|
+
the Session panel's entrance or exit plays, the probe inside this layer
|
|
413
|
+
carries the moving mark and the margin follows it, as the scrollport's
|
|
414
|
+
padding does, so the layer's end edge stays put while the inset
|
|
415
|
+
animates. The layer is also the inline-size query container of that probe:
|
|
416
|
+
its width is the frame's content width plus the end inset its negative
|
|
417
|
+
margin reaches across. At rest that is the scrollport's clientWidth before
|
|
418
|
+
DOM rounds it to a whole pixel (its padding box less the vertical
|
|
419
|
+
scrollbar); while the frame and the margin animate they change by equal and
|
|
420
|
+
opposite amounts, so it stays that width throughout. The probe reads it as
|
|
421
|
+
100cqw. */
|
|
373
422
|
.asideSlot {
|
|
374
423
|
position: absolute;
|
|
375
424
|
top: 0;
|
|
@@ -378,15 +427,19 @@
|
|
|
378
427
|
z-index: 9;
|
|
379
428
|
height: 0;
|
|
380
429
|
margin-inline-end: calc(-1 * var(--dsh-chat-end-inset, 0px));
|
|
381
|
-
transition: margin-inline-end var(--dsh-chat-end-reserve-transition, 0s);
|
|
382
430
|
pointer-events: none;
|
|
431
|
+
container-type: inline-size;
|
|
383
432
|
--dsh-chat-aside-gutter: calc(
|
|
384
433
|
var(--dsh-chat-end-inset, 0px)
|
|
385
434
|
+ max(0px, (100% - var(--dsh-chat-end-inset, 0px) - var(--dsh-chat-content-width, 100%)) / 2)
|
|
386
435
|
);
|
|
387
436
|
}
|
|
388
437
|
|
|
389
|
-
:
|
|
438
|
+
.asideSlot:has([data-session-panel-moving]) {
|
|
439
|
+
transition: margin-inline-end 160ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
.asideSlot:is(:global([data-conversation-scroll]) *) {
|
|
390
443
|
position: sticky;
|
|
391
444
|
}
|
|
392
445
|
|
|
@@ -410,7 +463,7 @@
|
|
|
410
463
|
pointer-events: none;
|
|
411
464
|
}
|
|
412
465
|
|
|
413
|
-
:global([data-conversation-scroll])
|
|
466
|
+
.toBottomSlot:is(:global([data-conversation-scroll]) *) {
|
|
414
467
|
position: sticky;
|
|
415
468
|
/* Clears the sticky composer stack (docks + input card + stats): the live
|
|
416
469
|
height rides --dsh-composer-height (ConversationRoot's seat observer) so
|
|
@@ -10,7 +10,7 @@ import type { PendingSubmission } from '@deepseek-ai/dsh-api-session-controller/
|
|
|
10
10
|
import {
|
|
11
11
|
Button, FenceCodeBlock, IconChevronDownOutlineRegular, MarkdownDelegateProvider, Modal,
|
|
12
12
|
type MarkdownDelegateFenceInfo, type MarkdownMenuTarget,
|
|
13
|
-
} from '@deepseek-ai/dsh-client-ui-primitives'
|
|
13
|
+
} from '@deepseek-ai/dsh-client-ui-primitives/client'
|
|
14
14
|
import { isAtOrOutside } from '../contract/group-tree.ts'
|
|
15
15
|
import type { ChatFlowHookContext, ChatViewSlotProps, OpenFileOptions } from '../contract/slots.ts'
|
|
16
16
|
import type { ChatSnapshot } from '../contract/snapshot.ts'
|
|
@@ -65,7 +65,7 @@ const MOTION_TAIL_MS = 800
|
|
|
65
65
|
export function ChatView({
|
|
66
66
|
useSession, useChat, useConversation, useSessions, renderSlot,
|
|
67
67
|
sessionId, openFile, openExternalLink, resolveFilePath, useContextMenu,
|
|
68
|
-
loadOlder, consumeOlder, loadThrough, loadImage, inspectCall, chatScroll, forkAt,
|
|
68
|
+
loadOlder, consumeOlder, loadThrough, loadImage, inspectCall, inspectRequest, chatScroll, forkAt,
|
|
69
69
|
usePresentation, useProjection, useInteractionIds, dispatchInteraction, t, fileDrag,
|
|
70
70
|
}: ChatViewSlotProps) {
|
|
71
71
|
const { getTriggerProps } = useContextMenu()
|
|
@@ -85,6 +85,9 @@ export function ChatView({
|
|
|
85
85
|
const entries = useMemo<readonly RenderEntry[]>(() => groupedEntries
|
|
86
86
|
?? order.map(key => ({ kind: 'node', key: key as NodeKey })), [groupedEntries, order])
|
|
87
87
|
const nodeStore = useChat(s => s.nodes)
|
|
88
|
+
// A folded Conversation withholds inherited history: the Chat requests no older pages and shows no history control.
|
|
89
|
+
const inheritedFolded = useConversation(snapshot => snapshot.inheritedHistoryFolded === true)
|
|
90
|
+
const hasMore = useSession(s => s.hasMore) && !inheritedFolded
|
|
88
91
|
const deferCompletedTurns = usePresentation(policy => policy.collapseTiming === 'next-input')
|
|
89
92
|
const transcriptView = usePresentation(policy => policy.mode)
|
|
90
93
|
// The rail's items are accumulated in the Chat snapshot, so this selector is
|
|
@@ -92,11 +95,12 @@ export function ChatView({
|
|
|
92
95
|
// Turn enters, leaves, or changes its preview.
|
|
93
96
|
const turnNavigationItems = useChat(s => s.navigation.items())
|
|
94
97
|
// Host-computed whole-log outline; the merge is view-layer only (the
|
|
95
|
-
// conversation snapshot never carries projection values).
|
|
98
|
+
// conversation snapshot never carries projection values). A folded
|
|
99
|
+
// Conversation keeps the whole-log outline out: it points into the withheld history.
|
|
96
100
|
const turnOutline = useProjection('turnOutline')
|
|
97
101
|
const railItems = useMemo(
|
|
98
|
-
() => mergeTurnRailItems(turnNavigationItems, turnOutline),
|
|
99
|
-
[turnNavigationItems, turnOutline],
|
|
102
|
+
() => mergeTurnRailItems(turnNavigationItems, inheritedFolded ? undefined : turnOutline),
|
|
103
|
+
[turnNavigationItems, turnOutline, inheritedFolded],
|
|
100
104
|
)
|
|
101
105
|
const inbox = useProjection('inbox') as InboxState | undefined
|
|
102
106
|
// Workspace root off the session list row: path summaries display relative to it.
|
|
@@ -138,7 +142,6 @@ export function ChatView({
|
|
|
138
142
|
}, [running, deferCompletedTurns])
|
|
139
143
|
const openState = useSession(s => s.openState)
|
|
140
144
|
const openError = useSession(s => s.openError)
|
|
141
|
-
const hasMore = useSession(s => s.hasMore)
|
|
142
145
|
const loadingOlder = useSession(s => s.loadingOlder)
|
|
143
146
|
const historyLoadStatus = useSession(s => s.historyLoadStatus)
|
|
144
147
|
const historyWasPartial = useSession(s => s.historyWasPartial)
|
|
@@ -177,6 +180,10 @@ export function ChatView({
|
|
|
177
180
|
setFileOpenBusy(false)
|
|
178
181
|
}, [])
|
|
179
182
|
|
|
183
|
+
const retryFileOpen = useCallback(() => {
|
|
184
|
+
if (fileOpenError !== null) requestOpenFile(fileOpenError.path)
|
|
185
|
+
}, [fileOpenError, requestOpenFile])
|
|
186
|
+
|
|
180
187
|
const inboxSteering = useMemo(
|
|
181
188
|
() => inbox?.['next-step'].filter(message => message.source.kind === 'user') ?? [],
|
|
182
189
|
[inbox],
|
|
@@ -244,7 +251,8 @@ export function ChatView({
|
|
|
244
251
|
/>
|
|
245
252
|
)}
|
|
246
253
|
<ChatAside renderSlot={renderSlot} />
|
|
247
|
-
<div className={css.root} data-chat-following-tail={scroll.followingTail ? '' : undefined}
|
|
254
|
+
<div className={css.root} data-chat-following-tail={scroll.followingTail ? '' : undefined}
|
|
255
|
+
data-conversation-overscroll="none" data-conversation-scroll-anchor={scroll.followingTail ? 'none' : undefined}>
|
|
248
256
|
<div ref={scroll.listRef} className={css.scroll}>
|
|
249
257
|
<div ref={scroll.columnRef} className={css.column} data-chat-flow=""
|
|
250
258
|
data-chat-motion={deferCompletedTurns && scroll.initialized
|
|
@@ -255,7 +263,7 @@ export function ChatView({
|
|
|
255
263
|
{t('chat.loadError', { message: openError.message, code: openError.code })}
|
|
256
264
|
</div>
|
|
257
265
|
)}
|
|
258
|
-
{(hasMore || historyWasPartial) && (
|
|
266
|
+
{!inheritedFolded && (hasMore || historyWasPartial) && (
|
|
259
267
|
<div className={css.older} ref={scroll.historyEdgeRef} data-chat-history={historyLoadStatus}>
|
|
260
268
|
<button type="button" disabled={!hasMore}
|
|
261
269
|
onClick={scroll.loadEarlier}>
|
|
@@ -285,7 +293,7 @@ export function ChatView({
|
|
|
285
293
|
>
|
|
286
294
|
{renderSlot('conversation.chat.flow', {
|
|
287
295
|
entries, pendingInputs, lastInputTurn, deferCollapse,
|
|
288
|
-
cwd, openFile: requestOpenFile, inspectCall, forkAt, loadImage,
|
|
296
|
+
cwd, openFile: requestOpenFile, inspectCall, inspectRequest, forkAt, loadImage,
|
|
289
297
|
}, { hookContext: flowContext })}
|
|
290
298
|
</MarkdownDelegateProvider>
|
|
291
299
|
<div ref={interactionSurfaceRef} className={css.textInteraction} data-text-interaction-surface=""
|
|
@@ -320,7 +328,7 @@ export function ChatView({
|
|
|
320
328
|
message={fileOpenError.message}
|
|
321
329
|
busy={fileOpenBusy}
|
|
322
330
|
onClose={closeFileOpenError}
|
|
323
|
-
onRetry={
|
|
331
|
+
onRetry={retryFileOpen}
|
|
324
332
|
t={t}
|
|
325
333
|
/>
|
|
326
334
|
)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CompactionRowInjected } from './CompactionItem.tsx'
|
|
2
2
|
import { memo, useMemo } from 'react'
|
|
3
|
-
import type { InjectFace, PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots'
|
|
3
|
+
import type { InjectFace, PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots/client'
|
|
4
4
|
import type {
|
|
5
5
|
ChatNodeViewProps, CommandRowOwnerProps,
|
|
6
6
|
} from '../contract/slots.ts'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { memo, useCallback, useMemo, useState } from 'react'
|
|
2
2
|
import type { ChatViewSlotProps } from '../contract/slots.ts'
|
|
3
|
-
import { DisclosureRow, IconApiOutlineRegular, TextShimmer } from '@deepseek-ai/dsh-client-ui-primitives'
|
|
3
|
+
import { DisclosureRow, IconApiOutlineRegular, TextShimmer } from '@deepseek-ai/dsh-client-ui-primitives/client'
|
|
4
4
|
import a11yCss from './accessibility.module.css'
|
|
5
5
|
import css from './CommandStatusRow.module.css'
|
|
6
6
|
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
IconApiOutlineRegular,
|
|
6
6
|
IconChevronRightOutlineRegular,
|
|
7
7
|
Tooltip,
|
|
8
|
-
} from '@deepseek-ai/dsh-client-ui-primitives'
|
|
8
|
+
} from '@deepseek-ai/dsh-client-ui-primitives/client'
|
|
9
9
|
import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'
|
|
10
10
|
import type { ChatViewSlotProps } from '../contract/slots.ts'
|
|
11
11
|
import type { CompactionSummaryNode } from '../contract/snapshot.ts'
|
|
@@ -127,6 +127,14 @@
|
|
|
127
127
|
overflow-wrap: anywhere;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
+
/* system update: a notice the message attaches to one source, above that source's text. */
|
|
131
|
+
.sectionNotice {
|
|
132
|
+
margin: 0;
|
|
133
|
+
color: var(--dsw-alias-label-caption);
|
|
134
|
+
white-space: pre-wrap;
|
|
135
|
+
overflow-wrap: anywhere;
|
|
136
|
+
}
|
|
137
|
+
|
|
130
138
|
/* relay: who sent this, above what they said. */
|
|
131
139
|
.relaySender {
|
|
132
140
|
margin: 0 0 6px;
|
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
// an absent, unknown, or malformed form — a resumed or foreign log must render
|
|
5
5
|
// even when this UI version has never seen its producer.
|
|
6
6
|
|
|
7
|
+
import { useCallback } from 'react'
|
|
7
8
|
import type { ReactNode } from 'react'
|
|
8
|
-
import { JsonBlock } from '@deepseek-ai/dsh-client-ui-primitives'
|
|
9
|
+
import { JsonBlock } from '@deepseek-ai/dsh-client-ui-primitives/client'
|
|
9
10
|
import type { ChatViewSlotProps } from '../contract/slots.ts'
|
|
10
11
|
import type { ContextMessageNode } from '../contract/snapshot.ts'
|
|
11
|
-
import type { KnownContextForm } from '@deepseek-ai/dsh-client-ui-conversation/client'
|
|
12
|
+
import type { KnownContextForm, SystemMessageSections } from '@deepseek-ai/dsh-client-ui-conversation/client'
|
|
12
13
|
import css from './ContextBody.module.css'
|
|
13
14
|
|
|
14
15
|
/** Model-facing text stays bounded at the disclosure, not at the producer. */
|
|
@@ -115,6 +116,7 @@ function SourceFields({ source, formRendered, t }: {
|
|
|
115
116
|
* @returns One generic JSON block per unknown entry.
|
|
116
117
|
*/
|
|
117
118
|
function UnknownBlocks({ blocks, t }: { blocks: readonly unknown[]; t: Translate }): ReactNode {
|
|
119
|
+
const truncatedLabel = useCallback((total: number) => t('json.truncated', { total }), [t])
|
|
118
120
|
return (
|
|
119
121
|
<>
|
|
120
122
|
{blocks.map((block, index) => (
|
|
@@ -122,7 +124,7 @@ function UnknownBlocks({ blocks, t }: { blocks: readonly unknown[]; t: Translate
|
|
|
122
124
|
key={index}
|
|
123
125
|
label={t('message.unknownBlock')}
|
|
124
126
|
payload={block}
|
|
125
|
-
truncatedLabel={
|
|
127
|
+
truncatedLabel={truncatedLabel}
|
|
126
128
|
/>
|
|
127
129
|
))}
|
|
128
130
|
</>
|
|
@@ -140,6 +142,7 @@ function ModelFacingContent({ content, t }: {
|
|
|
140
142
|
content: ContextMessageNode['content']
|
|
141
143
|
t: Translate
|
|
142
144
|
}): ReactNode {
|
|
145
|
+
const truncatedLabel = useCallback((total: number) => t('json.truncated', { total }), [t])
|
|
143
146
|
return (
|
|
144
147
|
<>
|
|
145
148
|
{contentRuns(content).map((run, index) => ('text' in run
|
|
@@ -151,7 +154,7 @@ function ModelFacingContent({ content, t }: {
|
|
|
151
154
|
key={index}
|
|
152
155
|
label={t('message.unknownBlock')}
|
|
153
156
|
payload={run.block}
|
|
154
|
-
truncatedLabel={
|
|
157
|
+
truncatedLabel={truncatedLabel}
|
|
155
158
|
/>
|
|
156
159
|
)))}
|
|
157
160
|
</>
|
|
@@ -410,6 +413,36 @@ export function SnapshotBody({ content, source, t }: {
|
|
|
410
413
|
)
|
|
411
414
|
}
|
|
412
415
|
|
|
416
|
+
/**
|
|
417
|
+
* One incremental system message split by the sources it names, in the order the model read them:
|
|
418
|
+
* what each source did, the notices attached to it, then the text the message carries for it.
|
|
419
|
+
* @param props - Section-attributed reading of the message and the locale seat.
|
|
420
|
+
* @returns The system update body.
|
|
421
|
+
*/
|
|
422
|
+
export function SystemSectionsBody({ message, t }: { message: SystemMessageSections; t: Translate }): ReactNode {
|
|
423
|
+
return (
|
|
424
|
+
<>
|
|
425
|
+
{message.reset && (
|
|
426
|
+
<p className={css.catalogNotice} data-system-reset>{t('message.systemPromptReset')}</p>
|
|
427
|
+
)}
|
|
428
|
+
{message.notices.map((notice, index) => (
|
|
429
|
+
<p key={index} className={css.catalogNotice} data-system-notice>{boundedText(notice, t)}</p>
|
|
430
|
+
))}
|
|
431
|
+
<dl className={css.sections} data-system-sections>
|
|
432
|
+
{message.changes.map(change => (
|
|
433
|
+
<div key={change.name} className={css.section} data-system-section={change.change}>
|
|
434
|
+
<dt className={css.sectionName}>{t(`message.systemSection.${change.change}`, { name: change.name })}</dt>
|
|
435
|
+
{change.notices.map((notice, index) => (
|
|
436
|
+
<dd key={index} className={css.sectionNotice} data-system-notice>{boundedText(notice, t)}</dd>
|
|
437
|
+
))}
|
|
438
|
+
{change.text !== '' && <dd className={css.sectionText}>{boundedText(change.text, t)}</dd>}
|
|
439
|
+
</div>
|
|
440
|
+
))}
|
|
441
|
+
</dl>
|
|
442
|
+
</>
|
|
443
|
+
)
|
|
444
|
+
}
|
|
445
|
+
|
|
413
446
|
/**
|
|
414
447
|
* `notice` form: what just happened, with the model-facing text beneath it.
|
|
415
448
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useState } from 'react'
|
|
1
|
+
import { useCallback, useState } from 'react'
|
|
2
2
|
import type { ChatViewSlotProps } from '../contract/slots.ts'
|
|
3
|
-
import { DisclosureRow, IconBrowseOutlineRegular, IconContextInjectionOutlineRegular, ReferenceIconRegular } from '@deepseek-ai/dsh-client-ui-primitives'
|
|
3
|
+
import { DisclosureRow, IconBrowseOutlineRegular, IconContextInjectionOutlineRegular, ReferenceIconRegular } from '@deepseek-ai/dsh-client-ui-primitives/client'
|
|
4
4
|
import type { ContextMessageNode } from '../contract/snapshot.ts'
|
|
5
5
|
import { contextBody } from './ContextBody.tsx'
|
|
6
6
|
import css from './ContextInjectionRow.module.css'
|
|
@@ -30,6 +30,7 @@ export interface ContextInjectionRowProps {
|
|
|
30
30
|
*/
|
|
31
31
|
export function ContextInjectionRow({ content, source, producer, form, t }: ContextInjectionRowProps) {
|
|
32
32
|
const [open, setOpen] = useState(false)
|
|
33
|
+
const toggleOpen = useCallback(() => { setOpen(value => !value) }, [])
|
|
33
34
|
// Resolved rather than declared: a form whose fields are unreadable renders
|
|
34
35
|
// the opaque body, and the marker must say what the row actually shows.
|
|
35
36
|
const { rendered, summary, body } = contextBody(form, { content, source, t })
|
|
@@ -79,7 +80,7 @@ export function ContextInjectionRow({ content, source, producer, form, t }: Cont
|
|
|
79
80
|
open={open && single === undefined}
|
|
80
81
|
expandable={single === undefined}
|
|
81
82
|
expandOnRowClick
|
|
82
|
-
onToggle={
|
|
83
|
+
onToggle={toggleOpen}
|
|
83
84
|
>
|
|
84
85
|
<div className={css.body} data-context-injection-body data-context-form={rendered ?? undefined}>
|
|
85
86
|
{toolBlocks === undefined ? body : (
|
|
@@ -58,6 +58,13 @@
|
|
|
58
58
|
):focus-within .actions {
|
|
59
59
|
opacity: 1;
|
|
60
60
|
}
|
|
61
|
+
|
|
62
|
+
/* A slot entry marks an action in progress with data-action-ongoing, such as
|
|
63
|
+
a reply being read aloud. Its row stays revealed so the action can be
|
|
64
|
+
stopped without hovering the row first. */
|
|
65
|
+
[data-actions-reveal='hover'] .actions:has([data-action-ongoing]) {
|
|
66
|
+
opacity: 1;
|
|
67
|
+
}
|
|
61
68
|
}
|
|
62
69
|
|
|
63
70
|
.action {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { useId, type ReactNode } from 'react'
|
|
5
5
|
import {
|
|
6
6
|
IconBranchOutlineRegular, IconCheckOutlineRegular, IconCopyOutlineRegular, Tooltip, useClipboardCopy,
|
|
7
|
-
} from '@deepseek-ai/dsh-client-ui-primitives'
|
|
7
|
+
} from '@deepseek-ai/dsh-client-ui-primitives/client'
|
|
8
8
|
import type { ChatViewSlotProps } from '../contract/slots.ts'
|
|
9
9
|
import { formatMessageClock } from './message-chrome.ts'
|
|
10
10
|
import { useCalendarDay } from './use-calendar-day.ts'
|
|
@@ -187,73 +187,65 @@
|
|
|
187
187
|
white-space: nowrap;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.retrySummary {
|
|
197
|
-
display: inline-flex;
|
|
198
|
-
align-items: center;
|
|
199
|
-
width: fit-content;
|
|
200
|
-
max-width: 100%;
|
|
201
|
-
padding: 2px 0;
|
|
202
|
-
gap: 7px;
|
|
203
|
-
border-radius: var(--dsw-radius-sm);
|
|
204
|
-
color: inherit;
|
|
205
|
-
cursor: pointer;
|
|
206
|
-
list-style: none;
|
|
207
|
-
user-select: none;
|
|
190
|
+
@media (prefers-reduced-motion: reduce) {
|
|
191
|
+
.compactionButton {
|
|
192
|
+
transition: none;
|
|
193
|
+
}
|
|
208
194
|
}
|
|
209
195
|
|
|
210
|
-
|
|
211
|
-
|
|
196
|
+
/* The retry row matches its neighbours: step rows (secondary size) when the
|
|
197
|
+
Turn shows its step runs flat, and group headers (body size) when it shows
|
|
198
|
+
them grouped. It keeps the 24px line, but its status wraps in a narrow column
|
|
199
|
+
instead of clipping: the row grows from its single-line height and the glyph
|
|
200
|
+
stays on the first line. */
|
|
201
|
+
[data-disclosure-row].retryRow {
|
|
202
|
+
height: auto;
|
|
203
|
+
min-height: calc(24px + var(--dsh-content-font-delta, 0px));
|
|
204
|
+
align-items: flex-start;
|
|
212
205
|
}
|
|
213
206
|
|
|
214
|
-
.
|
|
215
|
-
|
|
216
|
-
width: 6px;
|
|
217
|
-
height: 6px;
|
|
218
|
-
margin-right: 2px;
|
|
219
|
-
border-right: 1.5px solid currentcolor;
|
|
220
|
-
border-bottom: 1.5px solid currentcolor;
|
|
221
|
-
content: '';
|
|
222
|
-
transform: rotate(-45deg);
|
|
223
|
-
transition: transform 120ms ease;
|
|
207
|
+
[data-disclosure-row] .retryLeading {
|
|
208
|
+
margin-top: 4px;
|
|
224
209
|
}
|
|
225
210
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
@media (prefers-reduced-motion: reduce) {
|
|
233
|
-
.compactionButton {
|
|
234
|
-
transition: none;
|
|
235
|
-
}
|
|
211
|
+
[data-disclosure-row] .retryTitle {
|
|
212
|
+
flex: 0 1 auto;
|
|
213
|
+
font-size: var(--dsh-content-font-size-secondary, 13px);
|
|
214
|
+
min-width: 0;
|
|
215
|
+
white-space: normal;
|
|
216
|
+
overflow-wrap: anywhere;
|
|
236
217
|
}
|
|
237
218
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
219
|
+
/* Title (attempt/maximum) · countdown, with the tool-row separator dot and summary type. */
|
|
220
|
+
.retrySeparator {
|
|
221
|
+
flex: none;
|
|
222
|
+
align-self: center;
|
|
223
|
+
width: 2px;
|
|
224
|
+
height: 2px;
|
|
225
|
+
margin: 0 8px;
|
|
226
|
+
border-radius: 1px;
|
|
227
|
+
background: var(--dsw-alias-label-caption);
|
|
241
228
|
}
|
|
242
229
|
|
|
243
|
-
.
|
|
230
|
+
.retryProgress {
|
|
244
231
|
min-width: 0;
|
|
245
232
|
overflow-wrap: anywhere;
|
|
233
|
+
font-size: var(--dsh-content-font-size-secondary, 13px);
|
|
234
|
+
line-height: calc(24px + var(--dsh-content-font-delta, 0px));
|
|
246
235
|
}
|
|
247
236
|
|
|
248
|
-
.
|
|
249
|
-
|
|
237
|
+
.retryBesideGroups [data-disclosure-row] .retryTitle,
|
|
238
|
+
.retryBesideGroups .retryProgress {
|
|
239
|
+
font-size: var(--dsh-content-font-size, 14px);
|
|
250
240
|
}
|
|
251
241
|
|
|
242
|
+
/* Retry delay and failure under the expanded retry row, aligned with its title text. */
|
|
252
243
|
.retryDetails {
|
|
253
244
|
display: grid;
|
|
254
245
|
gap: 2px;
|
|
255
|
-
margin-top:
|
|
256
|
-
padding-left:
|
|
246
|
+
margin-top: 2px;
|
|
247
|
+
padding-left: calc(22px + var(--dsh-content-font-delta, 0px));
|
|
248
|
+
color: var(--dsw-alias-label-tertiary);
|
|
257
249
|
overflow-wrap: anywhere;
|
|
258
250
|
font-size: var(--dsh-content-font-size-secondary, 13px);
|
|
259
251
|
line-height: calc(18px + var(--dsh-content-font-delta-secondary, 0px));
|