@deepseek-ai/dsh-client-ui-chat 0.2.3-alpha.3 → 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 +6 -6
- package/README.md +4 -4
- package/README.zh.md +4 -4
- package/lib/client.js +6 -6
- 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/AssistantMarkdown.d.ts.map +1 -1
- package/lib/types/client/chat/AssistantMarkdown.js.map +1 -1
- package/lib/types/client/chat/AssistantNodeView.d.ts +2 -2
- package/lib/types/client/chat/AssistantNodeView.d.ts.map +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.map +1 -1
- package/lib/types/client/chat/ChatView.js.map +1 -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/MessageItem.d.ts +3 -1
- 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/SystemPromptRow.d.ts.map +1 -1
- package/lib/types/client/chat/SystemPromptRow.js.map +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/UserContent.js.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/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/contract/slots.d.ts +18 -7
- 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/tool.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/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 +0 -1
- 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.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.map +1 -1
- package/lib/types/client/settings/TranscriptViewRow.js.map +1 -1
- package/package.json +44 -44
- package/src/client/apply.ts +2 -1
- package/src/client/chat/AssistantMarkdown.tsx +3 -2
- package/src/client/chat/AssistantNodeView.tsx +2 -2
- package/src/client/chat/ChatGroupSeat.module.css +4 -2
- package/src/client/chat/ChatNodeSeat.tsx +4 -2
- package/src/client/chat/ChatView.module.css +37 -5
- package/src/client/chat/ChatView.tsx +13 -6
- package/src/client/chat/ContextBody.tsx +5 -2
- package/src/client/chat/ContextInjectionRow.tsx +3 -2
- package/src/client/chat/MessageItem.tsx +39 -28
- package/src/client/chat/SystemPromptRow.tsx +3 -2
- package/src/client/chat/TurnNavigator.module.css +9 -0
- package/src/client/chat/TurnTailNodeView.tsx +3 -2
- package/src/client/chat/UserContent.tsx +2 -2
- package/src/client/chat/register-node-renderers.ts +5 -8
- package/src/client/chat/text-interaction.ts +1 -2
- package/src/client/chat/text-selection.ts +20 -4
- package/src/client/contract/slots.ts +15 -8
- package/src/client/conversation-nodes/README.i18n.yaml +4 -4
- package/src/client/conversation-nodes/README.md +2 -1
- package/src/client/conversation-nodes/README.zh.md +2 -1
- 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/tool.ts +1 -1
- package/src/client/index.ts +2 -2
- package/src/client/presentation-policy.ts +6 -0
- package/src/client/settings/LinkOpeningRow.tsx +3 -1
- package/src/client/settings/PerformanceUsageRow.tsx +4 -1
- package/src/client/settings/PreferenceRow.tsx +4 -4
- package/src/client/settings/TranscriptViewRow.tsx +10 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-chat",
|
|
3
3
|
"description": "Chat Conversation target, node definitions, renderers, and details surface",
|
|
4
|
-
"version": "0.2.3-alpha.
|
|
4
|
+
"version": "0.2.3-alpha.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -50,56 +50,56 @@
|
|
|
50
50
|
},
|
|
51
51
|
"license": "MIT",
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@deepseek-ai/cordis": "~4.2.0-alpha.
|
|
53
|
+
"@deepseek-ai/cordis": "~4.2.0-alpha.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@deepseek-ai/cordis": "~4.2.0-alpha.
|
|
57
|
-
"@deepseek-ai/dsh-agent": "0.2.3-alpha.
|
|
58
|
-
"@deepseek-ai/dsh-api-remotes": "0.2.3-alpha.
|
|
59
|
-
"@deepseek-ai/dsh-api-session-controller": "0.2.3-alpha.
|
|
60
|
-
"@deepseek-ai/dsh-api-workspace-controller": "0.2.3-alpha.
|
|
61
|
-
"@deepseek-ai/dsh-api-workspace-files": "0.2.3-alpha.
|
|
62
|
-
"@deepseek-ai/dsh-attachment": "0.2.3-alpha.
|
|
63
|
-
"@deepseek-ai/dsh-brand": "0.2.3-alpha.
|
|
64
|
-
"@deepseek-ai/dsh-client-connection": "0.2.3-alpha.
|
|
65
|
-
"@deepseek-ai/dsh-client-locale": "0.2.3-alpha.
|
|
66
|
-
"@deepseek-ai/dsh-client-store": "0.2.3-alpha.
|
|
67
|
-
"@deepseek-ai/dsh-client-ui-approval": "0.2.3-alpha.
|
|
68
|
-
"@deepseek-ai/dsh-client-ui-conversation": "0.2.3-alpha.
|
|
69
|
-
"@deepseek-ai/dsh-client-ui-input-trigger": "0.2.3-alpha.
|
|
70
|
-
"@deepseek-ai/dsh-client-ui-layout": "0.2.3-alpha.
|
|
71
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.2.3-alpha.
|
|
72
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.2.3-alpha.
|
|
73
|
-
"@deepseek-ai/dsh-client-ui-session": "0.2.3-alpha.
|
|
74
|
-
"@deepseek-ai/dsh-client-ui-session-status": "0.2.3-alpha.
|
|
75
|
-
"@deepseek-ai/dsh-client-ui-settings": "0.2.3-alpha.
|
|
76
|
-
"@deepseek-ai/dsh-client-ui-sidebar-browser": "0.2.3-alpha.
|
|
77
|
-
"@deepseek-ai/dsh-client-ui-sidebar-documentpreview": "0.2.3-alpha.
|
|
78
|
-
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.3-alpha.
|
|
79
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.3-alpha.
|
|
80
|
-
"@deepseek-ai/dsh-client-ui-workspace": "0.2.3-alpha.
|
|
81
|
-
"@deepseek-ai/dsh-commands": "0.2.3-alpha.
|
|
82
|
-
"@deepseek-ai/dsh-compaction": "0.2.3-alpha.
|
|
83
|
-
"@deepseek-ai/dsh-llm": "0.2.3-alpha.
|
|
84
|
-
"@deepseek-ai/dsh-llm-retry": "0.2.3-alpha.
|
|
85
|
-
"@deepseek-ai/dsh-session": "0.2.3-alpha.
|
|
86
|
-
"@deepseek-ai/dsh-session-stats": "0.2.3-alpha.
|
|
87
|
-
"@deepseek-ai/dsh-session-turn-outline": "0.2.3-alpha.
|
|
88
|
-
"@deepseek-ai/dsh-subagent": "0.2.3-alpha.
|
|
89
|
-
"@deepseek-ai/dsh-token-meter": "0.2.3-alpha.
|
|
90
|
-
"@deepseek-ai/dsh-util-workspace-path": "0.2.3-alpha.
|
|
91
|
-
"@deepseek-ai/dsh-tool-registry-ptc": "0.2.3-alpha.
|
|
92
|
-
"@deepseek-ai/dsh-util-values": "0.2.3-alpha.
|
|
56
|
+
"@deepseek-ai/cordis": "~4.2.0-alpha.3",
|
|
57
|
+
"@deepseek-ai/dsh-agent": "0.2.3-alpha.4",
|
|
58
|
+
"@deepseek-ai/dsh-api-remotes": "0.2.3-alpha.4",
|
|
59
|
+
"@deepseek-ai/dsh-api-session-controller": "0.2.3-alpha.4",
|
|
60
|
+
"@deepseek-ai/dsh-api-workspace-controller": "0.2.3-alpha.4",
|
|
61
|
+
"@deepseek-ai/dsh-api-workspace-files": "0.2.3-alpha.4",
|
|
62
|
+
"@deepseek-ai/dsh-attachment": "0.2.3-alpha.4",
|
|
63
|
+
"@deepseek-ai/dsh-brand": "0.2.3-alpha.4",
|
|
64
|
+
"@deepseek-ai/dsh-client-connection": "0.2.3-alpha.4",
|
|
65
|
+
"@deepseek-ai/dsh-client-locale": "0.2.3-alpha.4",
|
|
66
|
+
"@deepseek-ai/dsh-client-store": "0.2.3-alpha.4",
|
|
67
|
+
"@deepseek-ai/dsh-client-ui-approval": "0.2.3-alpha.4",
|
|
68
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.2.3-alpha.4",
|
|
69
|
+
"@deepseek-ai/dsh-client-ui-input-trigger": "0.2.3-alpha.4",
|
|
70
|
+
"@deepseek-ai/dsh-client-ui-layout": "0.2.3-alpha.4",
|
|
71
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.3-alpha.4",
|
|
72
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.3-alpha.4",
|
|
73
|
+
"@deepseek-ai/dsh-client-ui-session": "0.2.3-alpha.4",
|
|
74
|
+
"@deepseek-ai/dsh-client-ui-session-status": "0.2.3-alpha.4",
|
|
75
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.2.3-alpha.4",
|
|
76
|
+
"@deepseek-ai/dsh-client-ui-sidebar-browser": "0.2.3-alpha.4",
|
|
77
|
+
"@deepseek-ai/dsh-client-ui-sidebar-documentpreview": "0.2.3-alpha.4",
|
|
78
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.3-alpha.4",
|
|
79
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.3-alpha.4",
|
|
80
|
+
"@deepseek-ai/dsh-client-ui-workspace": "0.2.3-alpha.4",
|
|
81
|
+
"@deepseek-ai/dsh-commands": "0.2.3-alpha.4",
|
|
82
|
+
"@deepseek-ai/dsh-compaction": "0.2.3-alpha.4",
|
|
83
|
+
"@deepseek-ai/dsh-llm": "0.2.3-alpha.4",
|
|
84
|
+
"@deepseek-ai/dsh-llm-retry": "0.2.3-alpha.4",
|
|
85
|
+
"@deepseek-ai/dsh-session": "0.2.3-alpha.4",
|
|
86
|
+
"@deepseek-ai/dsh-session-stats": "0.2.3-alpha.4",
|
|
87
|
+
"@deepseek-ai/dsh-session-turn-outline": "0.2.3-alpha.4",
|
|
88
|
+
"@deepseek-ai/dsh-subagent": "0.2.3-alpha.4",
|
|
89
|
+
"@deepseek-ai/dsh-token-meter": "0.2.3-alpha.4",
|
|
90
|
+
"@deepseek-ai/dsh-util-workspace-path": "0.2.3-alpha.4",
|
|
91
|
+
"@deepseek-ai/dsh-tool-registry-ptc": "0.2.3-alpha.4",
|
|
92
|
+
"@deepseek-ai/dsh-util-values": "0.2.3-alpha.4",
|
|
93
93
|
"@tanstack/react-virtual": "3.14.10",
|
|
94
94
|
"react": "^19.3.1",
|
|
95
95
|
"react-dom": "^19.3.1",
|
|
96
|
-
"@deepseek-ai/dsh-settings": "0.2.3-alpha.
|
|
97
|
-
"@deepseek-ai/dsh-client-product-analytics": "0.2.3-alpha.
|
|
98
|
-
"@deepseek-ai/dsh-client-ui-file-drag": "0.2.3-alpha.
|
|
99
|
-
"@deepseek-ai/dsh-client-ui-context-menu": "0.2.3-alpha.
|
|
96
|
+
"@deepseek-ai/dsh-settings": "0.2.3-alpha.4",
|
|
97
|
+
"@deepseek-ai/dsh-client-product-analytics": "0.2.3-alpha.4",
|
|
98
|
+
"@deepseek-ai/dsh-client-ui-file-drag": "0.2.3-alpha.4",
|
|
99
|
+
"@deepseek-ai/dsh-client-ui-context-menu": "0.2.3-alpha.4"
|
|
100
100
|
},
|
|
101
101
|
"dependencies": {
|
|
102
|
-
"@deepseek-ai/schemastery": "~3.20.0-alpha.
|
|
102
|
+
"@deepseek-ai/schemastery": "~3.20.0-alpha.3"
|
|
103
103
|
},
|
|
104
104
|
"files": [
|
|
105
105
|
"locale/*.json",
|
package/src/client/apply.ts
CHANGED
|
@@ -74,6 +74,7 @@ export const CHAT_NODE_INJECT: ChatNodeInjected = {
|
|
|
74
74
|
},
|
|
75
75
|
disclosure: (_standard, { disclosureReset }) => bindDisclosure(disclosureReset),
|
|
76
76
|
groupAction: (_standard, { useGroupAction }) => useGroupAction,
|
|
77
|
+
presentation: (_standard, { usePresentation }) => usePresentation,
|
|
77
78
|
},
|
|
78
79
|
}
|
|
79
80
|
|
|
@@ -192,7 +193,7 @@ export function apply(ctx: Context): void {
|
|
|
192
193
|
const performancePolicy = new PerformanceUsagePolicy(chatSettings)
|
|
193
194
|
ctx.effect(() => () => { transcriptView.dispose(); performancePolicy.dispose() })
|
|
194
195
|
const performanceUsage = performancePolicy.mode
|
|
195
|
-
registerChatNodeRenderers(ctx, performanceUsage
|
|
196
|
+
registerChatNodeRenderers(ctx, performanceUsage)
|
|
196
197
|
ctx.slots.registerFactory({
|
|
197
198
|
name: 'conversation.chat.user.content', scope: 'session', locale: NS,
|
|
198
199
|
children: { 'conversation.chat.user.images': { kind: 'single', scope: 'session' } },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fragment, memo, useMemo } from 'react'
|
|
1
|
+
import { Fragment, memo, useCallback, useMemo } from 'react'
|
|
2
2
|
import { fileMediaUrl } from '@deepseek-ai/dsh-util-workspace-path'
|
|
3
3
|
import type { PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots/client'
|
|
4
4
|
import type { ReactNode } from 'react'
|
|
@@ -66,6 +66,7 @@ export const AssistantMarkdown = memo(function AssistantMarkdown({
|
|
|
66
66
|
const pathImages = useMemo<MarkdownPathImages>(() => {
|
|
67
67
|
return { resolve: value => localPathMediaUrl(document.baseURI, value) }
|
|
68
68
|
}, [])
|
|
69
|
+
const truncatedLabel = useCallback((total: number) => t('json.truncated', { total }), [t])
|
|
69
70
|
const last = blocks.length - 1
|
|
70
71
|
// Tool-call heads render as tool rows in the chat view's grouping pass, so
|
|
71
72
|
// a node that is only those heads (or empty) would paint an empty root
|
|
@@ -140,7 +141,7 @@ export const AssistantMarkdown = memo(function AssistantMarkdown({
|
|
|
140
141
|
key={i}
|
|
141
142
|
label={t('message.unknownBlock')}
|
|
142
143
|
payload={block.block}
|
|
143
|
-
truncatedLabel={
|
|
144
|
+
truncatedLabel={truncatedLabel}
|
|
144
145
|
/>,
|
|
145
146
|
)
|
|
146
147
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { memo, useCallback, useMemo } from 'react'
|
|
2
2
|
import type { InjectFace, PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots/client'
|
|
3
|
-
import type { ChatFileMentions, ChatNodeViewProps,
|
|
3
|
+
import type { ChatFileMentions, ChatNodeViewProps, TurnTailOwnerProps } from '../contract/slots.ts'
|
|
4
4
|
import { AssistantMarkdown } from './AssistantMarkdown.tsx'
|
|
5
5
|
|
|
6
6
|
/** Business readers owned by the assistant renderer's existing Slot registration. */
|
|
7
|
-
export interface AssistantNodeInjected
|
|
7
|
+
export interface AssistantNodeInjected {
|
|
8
8
|
/** Resolve against the live Session directory. @param path - Recorded path. @returns Host path. */
|
|
9
9
|
resolveFilePath: (path: string) => string
|
|
10
10
|
/** Resolve closing-Turn mentions with the supplied ordinary file gesture callback. */
|
|
@@ -100,7 +100,6 @@
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
.body {
|
|
103
|
-
--dsh-chat-flow-gap: 4px;
|
|
104
103
|
max-height: min(400px, 50vh);
|
|
105
104
|
overflow-y: auto;
|
|
106
105
|
overscroll-behavior-y: auto;
|
|
@@ -145,8 +144,11 @@
|
|
|
145
144
|
flex-direction: column;
|
|
146
145
|
}
|
|
147
146
|
.content > * { flex-shrink: 0; }
|
|
147
|
+
/* Members of a group take the process-row gap, the same 4px a flow row takes
|
|
148
|
+
by default. Rows here sit below the flow row's own registered gap property,
|
|
149
|
+
which does not inherit, so the gap is stated where it applies. */
|
|
148
150
|
.content > :not([hidden]):not(:empty) ~ [data-chat-flow-key]:not([hidden]):not(:empty) {
|
|
149
|
-
margin-top:
|
|
151
|
+
margin-top: 4px;
|
|
150
152
|
}
|
|
151
153
|
.expandedBody {
|
|
152
154
|
max-height: none;
|
|
@@ -119,11 +119,13 @@ export const ChatNodeSeat = memo(function ChatNodeSeat({
|
|
|
119
119
|
const revealProcess = useCallback(() => {
|
|
120
120
|
if (processMember) setOpen(true)
|
|
121
121
|
}, [processMember, setOpen])
|
|
122
|
+
const truncatedLabel = useCallback((total: number) => t('json.truncated', { total }), [t])
|
|
122
123
|
const wrapperRef = useGroupAction(processHidden, revealProcess)
|
|
123
124
|
const [disclosureReset] = useState(() => createSnapshotStore(0))
|
|
124
125
|
const turnData = turnDataOf(routedNode)
|
|
125
126
|
const hookContext = useMemo<ChatNodeHookContext>(
|
|
126
|
-
() => ({ turnData, disclosureReset, useGroupAction }),
|
|
127
|
+
() => ({ turnData, disclosureReset, useGroupAction, usePresentation }),
|
|
128
|
+
[turnData, disclosureReset, useGroupAction, usePresentation],
|
|
127
129
|
)
|
|
128
130
|
useEffect(() => {
|
|
129
131
|
if (processMember && processHidden && wrapperRef.current !== null && hiddenOrCollapsing(wrapperRef.current)) {
|
|
@@ -178,7 +180,7 @@ export const ChatNodeSeat = memo(function ChatNodeSeat({
|
|
|
178
180
|
<JsonBlock
|
|
179
181
|
label={t('message.unknownSurface', { type: routedNode.kind })}
|
|
180
182
|
payload={routedNode.data}
|
|
181
|
-
truncatedLabel={
|
|
183
|
+
truncatedLabel={truncatedLabel}
|
|
182
184
|
/>
|
|
183
185
|
),
|
|
184
186
|
})}
|
|
@@ -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 {
|
|
@@ -76,6 +85,16 @@
|
|
|
76
85
|
flex-direction: column;
|
|
77
86
|
}
|
|
78
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
|
+
|
|
79
98
|
/* The flow slot's display:contents anchor preserves layout but not selector ancestry.
|
|
80
99
|
`hidden="until-found"` retains a searchable zero-height box; hidden and empty
|
|
81
100
|
Seats do not contribute spacing. The older-history control precedes the anchor;
|
|
@@ -246,6 +265,8 @@
|
|
|
246
265
|
color: var(--dsw-alias-label-deep-diving);
|
|
247
266
|
font-size: calc(var(--dsh-content-font-size, 14px) - 2px);
|
|
248
267
|
line-height: calc(22px + var(--dsh-content-font-delta, 0px));
|
|
268
|
+
-webkit-user-select: none;
|
|
269
|
+
user-select: none;
|
|
249
270
|
}
|
|
250
271
|
|
|
251
272
|
/* After the Session stops running and before the Turn's actions row arrives, the status keeps its slot
|
|
@@ -387,10 +408,17 @@
|
|
|
387
408
|
element whose containing block is the layer, as it does in the
|
|
388
409
|
back-to-bottom control's padding below. The Conversation body's end
|
|
389
410
|
reserve narrows the frame by --dsh-chat-end-inset; the layer reaches back
|
|
390
|
-
across it to the scrollport's end edge, and the gutter counts it.
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
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. */
|
|
394
422
|
.asideSlot {
|
|
395
423
|
position: absolute;
|
|
396
424
|
top: 0;
|
|
@@ -399,14 +427,18 @@
|
|
|
399
427
|
z-index: 9;
|
|
400
428
|
height: 0;
|
|
401
429
|
margin-inline-end: calc(-1 * var(--dsh-chat-end-inset, 0px));
|
|
402
|
-
transition: margin-inline-end var(--dsh-chat-end-reserve-transition, 0s);
|
|
403
430
|
pointer-events: none;
|
|
431
|
+
container-type: inline-size;
|
|
404
432
|
--dsh-chat-aside-gutter: calc(
|
|
405
433
|
var(--dsh-chat-end-inset, 0px)
|
|
406
434
|
+ max(0px, (100% - var(--dsh-chat-end-inset, 0px) - var(--dsh-chat-content-width, 100%)) / 2)
|
|
407
435
|
);
|
|
408
436
|
}
|
|
409
437
|
|
|
438
|
+
.asideSlot:has([data-session-panel-moving]) {
|
|
439
|
+
transition: margin-inline-end 160ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
440
|
+
}
|
|
441
|
+
|
|
410
442
|
.asideSlot:is(:global([data-conversation-scroll]) *) {
|
|
411
443
|
position: sticky;
|
|
412
444
|
}
|
|
@@ -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],
|
|
@@ -256,7 +263,7 @@ export function ChatView({
|
|
|
256
263
|
{t('chat.loadError', { message: openError.message, code: openError.code })}
|
|
257
264
|
</div>
|
|
258
265
|
)}
|
|
259
|
-
{(hasMore || historyWasPartial) && (
|
|
266
|
+
{!inheritedFolded && (hasMore || historyWasPartial) && (
|
|
260
267
|
<div className={css.older} ref={scroll.historyEdgeRef} data-chat-history={historyLoadStatus}>
|
|
261
268
|
<button type="button" disabled={!hasMore}
|
|
262
269
|
onClick={scroll.loadEarlier}>
|
|
@@ -321,7 +328,7 @@ export function ChatView({
|
|
|
321
328
|
message={fileOpenError.message}
|
|
322
329
|
busy={fileOpenBusy}
|
|
323
330
|
onClose={closeFileOpenError}
|
|
324
|
-
onRetry={
|
|
331
|
+
onRetry={retryFileOpen}
|
|
325
332
|
t={t}
|
|
326
333
|
/>
|
|
327
334
|
)}
|
|
@@ -4,6 +4,7 @@
|
|
|
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
9
|
import { JsonBlock } from '@deepseek-ai/dsh-client-ui-primitives/client'
|
|
9
10
|
import type { ChatViewSlotProps } from '../contract/slots.ts'
|
|
@@ -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
|
</>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState } from 'react'
|
|
1
|
+
import { useCallback, useState } from 'react'
|
|
2
2
|
import type { ChatViewSlotProps } from '../contract/slots.ts'
|
|
3
3
|
import { DisclosureRow, IconBrowseOutlineRegular, IconContextInjectionOutlineRegular, ReferenceIconRegular } from '@deepseek-ai/dsh-client-ui-primitives/client'
|
|
4
4
|
import type { ContextMessageNode } from '../contract/snapshot.ts'
|
|
@@ -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 : (
|
|
@@ -276,6 +276,14 @@ export function PendingSteeringBubble({ content, loadImage, renderFactorySlot, t
|
|
|
276
276
|
renderFactorySlot: PropsRenderFactories['renderFactorySlot']
|
|
277
277
|
t: ChatViewSlotProps['t']
|
|
278
278
|
} & Pick<ChatNodeOwnerProps, 'loadImage'>): ReactNode {
|
|
279
|
+
const renderActions = useCallback((text: string) => (
|
|
280
|
+
<MessageIconActions
|
|
281
|
+
text={text}
|
|
282
|
+
clock="start"
|
|
283
|
+
className={css.actions}
|
|
284
|
+
t={t}
|
|
285
|
+
/>
|
|
286
|
+
), [t])
|
|
279
287
|
return (
|
|
280
288
|
<UserStyleBubble
|
|
281
289
|
node={UNDECORATED_ROW}
|
|
@@ -284,14 +292,7 @@ export function PendingSteeringBubble({ content, loadImage, renderFactorySlot, t
|
|
|
284
292
|
renderFactorySlot={renderFactorySlot}
|
|
285
293
|
loadImage={loadImage}
|
|
286
294
|
pending
|
|
287
|
-
actions={
|
|
288
|
-
<MessageIconActions
|
|
289
|
-
text={text}
|
|
290
|
-
clock="start"
|
|
291
|
-
className={css.actions}
|
|
292
|
-
t={t}
|
|
293
|
-
/>
|
|
294
|
-
)}
|
|
295
|
+
actions={renderActions}
|
|
295
296
|
/>
|
|
296
297
|
)
|
|
297
298
|
}
|
|
@@ -329,6 +330,15 @@ export function PendingSubmissionBubble({ submission, loadImage, renderFactorySl
|
|
|
329
330
|
: { type: 'file', file: attachment.value }),
|
|
330
331
|
[submission.attachments],
|
|
331
332
|
)
|
|
333
|
+
const renderActions = useCallback((text: string) => (
|
|
334
|
+
<MessageIconActions
|
|
335
|
+
text={text}
|
|
336
|
+
time={submission.time}
|
|
337
|
+
clock="start"
|
|
338
|
+
className={css.actions}
|
|
339
|
+
t={t}
|
|
340
|
+
/>
|
|
341
|
+
), [submission.time, t])
|
|
332
342
|
return (
|
|
333
343
|
<UserStyleBubble
|
|
334
344
|
node={UNDECORATED_ROW}
|
|
@@ -339,15 +349,7 @@ export function PendingSubmissionBubble({ submission, loadImage, renderFactorySl
|
|
|
339
349
|
loadImage={loadImage}
|
|
340
350
|
pending={submission.placement === 'steering'}
|
|
341
351
|
echo
|
|
342
|
-
actions={
|
|
343
|
-
<MessageIconActions
|
|
344
|
-
text={text}
|
|
345
|
-
time={submission.time}
|
|
346
|
-
clock="start"
|
|
347
|
-
className={css.actions}
|
|
348
|
-
t={t}
|
|
349
|
-
/>
|
|
350
|
-
)}
|
|
352
|
+
actions={renderActions}
|
|
351
353
|
/>
|
|
352
354
|
)
|
|
353
355
|
}
|
|
@@ -360,12 +362,28 @@ export function PendingSubmissionBubble({ submission, loadImage, renderFactorySl
|
|
|
360
362
|
* bubble without asking for it.
|
|
361
363
|
*/
|
|
362
364
|
export const UserMessageNodeView = memo(function UserMessageNodeView({
|
|
363
|
-
node, renderFactorySlot, loadImage, renderSlotChain, t,
|
|
365
|
+
node, renderFactorySlot, loadImage, renderSlotChain, renderSlot, t,
|
|
364
366
|
}: ChatNodeViewProps<'user' | 'steering'> & {
|
|
365
367
|
/** Bound by the `user` keyed registration, the only entry that declares the seat. */
|
|
366
368
|
renderSlotChain: PropsRenderSlots<'conversation.chat.user.before'>['renderSlotChain']
|
|
369
|
+
/** Bound by the `user` keyed registration, the only entry that declares the action list. */
|
|
370
|
+
renderSlot: PropsRenderSlots<'conversation.chat.user-actions'>['renderSlot']
|
|
367
371
|
}) {
|
|
368
372
|
const data = node.data
|
|
373
|
+
// A steering row shares the renderer without the action list; a synthetic projection names no durable message.
|
|
374
|
+
const userActions = node.kind === 'user' && data.messageId !== undefined
|
|
375
|
+
? renderSlot('conversation.chat.user-actions', { messageId: data.messageId })
|
|
376
|
+
: null
|
|
377
|
+
const renderActions = useCallback((text: string) => (
|
|
378
|
+
<MessageIconActions
|
|
379
|
+
text={text}
|
|
380
|
+
time={data.time}
|
|
381
|
+
clock="start"
|
|
382
|
+
className={css.actions}
|
|
383
|
+
extraActions={userActions}
|
|
384
|
+
t={t}
|
|
385
|
+
/>
|
|
386
|
+
), [data.time, t, userActions])
|
|
369
387
|
return (
|
|
370
388
|
<UserStyleBubble
|
|
371
389
|
node={node}
|
|
@@ -377,15 +395,7 @@ export const UserMessageNodeView = memo(function UserMessageNodeView({
|
|
|
377
395
|
batchStart={node.kind === 'steering' && node.data.batchStart === true}
|
|
378
396
|
{...data.referenceLabels === undefined ? {} : { referenceLabels: data.referenceLabels }}
|
|
379
397
|
{...data.skillNames === undefined ? {} : { skillNames: data.skillNames }}
|
|
380
|
-
actions={
|
|
381
|
-
<MessageIconActions
|
|
382
|
-
text={text}
|
|
383
|
-
time={data.time}
|
|
384
|
-
clock="start"
|
|
385
|
-
className={css.actions}
|
|
386
|
-
t={t}
|
|
387
|
-
/>
|
|
388
|
-
)}
|
|
398
|
+
actions={renderActions}
|
|
389
399
|
/>
|
|
390
400
|
)
|
|
391
401
|
})
|
|
@@ -456,12 +466,13 @@ export const TurnMaxTokensNodeView = memo(function TurnMaxTokensNodeView({ t }:
|
|
|
456
466
|
/** Explicit unknown-surface keyed Chat renderer. */
|
|
457
467
|
export const UnknownNodeView = memo(function UnknownNodeView({ node, t }: ChatNodeViewProps<'unknown'>) {
|
|
458
468
|
const data = node.data
|
|
469
|
+
const truncatedLabel = useCallback((total: number) => t('json.truncated', { total }), [t])
|
|
459
470
|
return (
|
|
460
471
|
<div className={css.contextRow}>
|
|
461
472
|
<JsonBlock
|
|
462
473
|
label={t('message.unknownSurface', { type: data.type })}
|
|
463
474
|
payload={data.data}
|
|
464
|
-
truncatedLabel={
|
|
475
|
+
truncatedLabel={truncatedLabel}
|
|
465
476
|
/>
|
|
466
477
|
</div>
|
|
467
478
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { memo, useState } from 'react'
|
|
1
|
+
import { memo, useCallback, useState } from 'react'
|
|
2
2
|
import type { ChatNodeViewProps, ChatViewSlotProps } from '../contract/slots.ts'
|
|
3
3
|
import { DisclosureRow, IconBrowseOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives/client'
|
|
4
4
|
import type { SystemMessageSections } from '@deepseek-ai/dsh-client-ui-conversation/client'
|
|
@@ -28,6 +28,7 @@ export interface SystemPromptRowProps {
|
|
|
28
28
|
*/
|
|
29
29
|
export function SystemPromptRow({ text, update = false, message, t }: SystemPromptRowProps) {
|
|
30
30
|
const [open, setOpen] = useState(false)
|
|
31
|
+
const toggleOpen = useCallback(() => { setOpen(value => !value) }, [])
|
|
31
32
|
const names = message?.changes.map(change => change.name) ?? []
|
|
32
33
|
// Up to two sources are named in the row; more are counted.
|
|
33
34
|
const summary = names.length > 2 ? t('message.systemPromptSections', { count: names.length }) : names.join(', ')
|
|
@@ -47,7 +48,7 @@ export function SystemPromptRow({ text, update = false, message, t }: SystemProm
|
|
|
47
48
|
open={open}
|
|
48
49
|
expandable
|
|
49
50
|
expandOnRowClick
|
|
50
|
-
onToggle={
|
|
51
|
+
onToggle={toggleOpen}
|
|
51
52
|
>
|
|
52
53
|
<div className={css.body} data-system-prompt-body>
|
|
53
54
|
{message === undefined
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/* The rail is a sibling of the clipped transcript, not its descendant. */
|
|
2
2
|
.slot {
|
|
3
|
+
/* The rail reads the composer and viewport heights below, never the end
|
|
4
|
+
inset, so a docking request stops at this layer. */
|
|
5
|
+
--dsh-chat-end-inset: initial;
|
|
3
6
|
position: absolute;
|
|
4
7
|
top: 0;
|
|
5
8
|
right: 0;
|
|
@@ -49,6 +52,12 @@
|
|
|
49
52
|
/* The frame's inner scroller: no visible scrollbar, no scroll chaining into
|
|
50
53
|
the transcript, and gradient fades over the ends that can still scroll. */
|
|
51
54
|
.scroller {
|
|
55
|
+
/* The marks read none of the lengths the frame measures its band with, so
|
|
56
|
+
a composer or scrollport height change restyles the frame, not every
|
|
57
|
+
mark. */
|
|
58
|
+
--dsh-composer-height: initial;
|
|
59
|
+
--dsh-conversation-viewport-height: initial;
|
|
60
|
+
--turn-rail-band: initial;
|
|
52
61
|
position: relative;
|
|
53
62
|
max-height: inherit;
|
|
54
63
|
overflow-y: auto;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { memo } from 'react'
|
|
1
|
+
import { memo, useCallback } from 'react'
|
|
2
2
|
import type { InjectFace, PropsRenderSlots } from '@deepseek-ai/dsh-client-ui-slots/client'
|
|
3
3
|
import type { ChatNodeViewProps, PerformanceUsageInjected, TurnTailOwnerProps } from '../contract/slots.ts'
|
|
4
4
|
import { MessageIconActions } from './MessageIconActions.tsx'
|
|
@@ -40,6 +40,7 @@ export const TurnTailNodeView = memo(function TurnTailNodeView({
|
|
|
40
40
|
(candidate.kind !== 'text' && candidate.kind !== 'reasoning') || candidate.text.trim() !== '') : undefined
|
|
41
41
|
return block !== undefined && hasAssistantReplyContent([block])
|
|
42
42
|
})
|
|
43
|
+
const branchAction = useCallback(() => { forkAt(data.seq) }, [data.seq, forkAt])
|
|
43
44
|
const turn = node.location.kind === 'turn' || node.location.kind === 'step'
|
|
44
45
|
? node.location.turn
|
|
45
46
|
: undefined
|
|
@@ -67,7 +68,7 @@ export const TurnTailNodeView = memo(function TurnTailNodeView({
|
|
|
67
68
|
clock="end"
|
|
68
69
|
// The branch action owns boundary resolution: it sends the real
|
|
69
70
|
// turn/end seq it already has, and the Host cuts exactly there.
|
|
70
|
-
onBranch={forkAllowed ?
|
|
71
|
+
onBranch={forkAllowed ? branchAction : undefined}
|
|
71
72
|
branchUnavailable={data.branchUnavailable || hasLaterChatNode}
|
|
72
73
|
className={css.actions}
|
|
73
74
|
extraActions={assistantActions}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Reusable user contents inside a caller-owned message row. */
|
|
2
|
-
import { Fragment } from 'react'
|
|
2
|
+
import { Fragment, useCallback } from 'react'
|
|
3
3
|
import type { FactoryComponentPropsOf } from '@deepseek-ai/dsh-client-ui-slots/client'
|
|
4
4
|
import { fileExtension, FileTypeIcon, fileSizeText, JsonBlock, UserMessageBubble } from '@deepseek-ai/dsh-client-ui-primitives/client'
|
|
5
5
|
import css from './MessageItem.module.css'
|
|
@@ -16,7 +16,7 @@ export function UserContent({ content, loadImage, facts, interactive = false, el
|
|
|
16
16
|
FactoryComponentPropsOf<'conversation.chat.user.content'>) {
|
|
17
17
|
const { text, attachments, extraBlocks, referenceLabels = EMPTY_LABELS } = content
|
|
18
18
|
const compactImages = attachments.length > 1
|
|
19
|
-
const truncated = (total: number): string => t('json.truncated', { total })
|
|
19
|
+
const truncated = useCallback((total: number): string => t('json.truncated', { total }), [t])
|
|
20
20
|
const showBubble = text !== '' || extraBlocks.length > 0
|
|
21
21
|
return (
|
|
22
22
|
<div className={css.userStack}>
|