@adecore/agents-react 0.54.11 → 0.54.12
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/dist/chat/ui/ChatEmptyScene.d.ts +3 -0
- package/dist/chat/ui/ChatEmptyScene.js +118 -0
- package/dist/chat/ui/Timeline.js +42 -54
- package/dist/locales/en/agent-chat.d.ts +1 -1
- package/dist/locales/en/agent-chat.js +3 -3
- package/dist/locales/nl/agent-chat.d.ts +1 -1
- package/dist/locales/nl/agent-chat.js +3 -3
- package/dist/theme.css +15 -0
- package/package.json +9 -9
- package/src/chat/ui/ChatEmptyScene.tsx +31 -0
- package/src/chat/ui/Timeline.tsx +9 -15
- package/src/locales/en/agent-chat.ts +3 -3
- package/src/locales/nl/agent-chat.ts +3 -3
- package/src/theme.css +15 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
|
+
import { EmptyScene } from '@adecore/ui';
|
|
3
|
+
import { AgentIcon } from '../../agents/AgentIcon.js';
|
|
4
|
+
/* A question goes out and the model answers. Its mark is the one accent here, so the typing dots stay neutral. */
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export function ChatEmptyScene(t0) {
|
|
7
|
+
const $ = _c(9);
|
|
8
|
+
const {
|
|
9
|
+
provider
|
|
10
|
+
} = t0;
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
13
|
+
t1 = /*#__PURE__*/_jsxs("g", {
|
|
14
|
+
className: "chat-scene-send",
|
|
15
|
+
children: [/*#__PURE__*/_jsx("g", {
|
|
16
|
+
className: "scene-lift",
|
|
17
|
+
children: /*#__PURE__*/_jsx("rect", {
|
|
18
|
+
className: "scene-shape",
|
|
19
|
+
x: "70",
|
|
20
|
+
y: "10",
|
|
21
|
+
width: "78",
|
|
22
|
+
height: "24",
|
|
23
|
+
rx: "12"
|
|
24
|
+
})
|
|
25
|
+
}), /*#__PURE__*/_jsx("path", {
|
|
26
|
+
className: "scene-text",
|
|
27
|
+
d: "M82 22h52"
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
30
|
+
$[0] = t1;
|
|
31
|
+
} else {
|
|
32
|
+
t1 = $[0];
|
|
33
|
+
}
|
|
34
|
+
let t2;
|
|
35
|
+
if ($[1] !== provider) {
|
|
36
|
+
t2 = /*#__PURE__*/_jsx("g", {
|
|
37
|
+
className: "scene-reveal-2",
|
|
38
|
+
children: /*#__PURE__*/_jsx("svg", {
|
|
39
|
+
x: "11",
|
|
40
|
+
y: "43",
|
|
41
|
+
width: "20",
|
|
42
|
+
height: "20",
|
|
43
|
+
overflow: "visible",
|
|
44
|
+
children: /*#__PURE__*/_jsx(AgentIcon, {
|
|
45
|
+
kind: provider,
|
|
46
|
+
size: 20
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
$[1] = provider;
|
|
51
|
+
$[2] = t2;
|
|
52
|
+
} else {
|
|
53
|
+
t2 = $[2];
|
|
54
|
+
}
|
|
55
|
+
let t3;
|
|
56
|
+
let t4;
|
|
57
|
+
let t5;
|
|
58
|
+
let t6;
|
|
59
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
60
|
+
t3 = /*#__PURE__*/_jsxs("g", {
|
|
61
|
+
className: "chat-scene-typing",
|
|
62
|
+
children: [/*#__PURE__*/_jsx("circle", {
|
|
63
|
+
className: "scene-dot chat-scene-bounce",
|
|
64
|
+
cx: "42",
|
|
65
|
+
cy: "53",
|
|
66
|
+
r: "2.5"
|
|
67
|
+
}), /*#__PURE__*/_jsx("circle", {
|
|
68
|
+
className: "scene-dot chat-scene-bounce",
|
|
69
|
+
cx: "52",
|
|
70
|
+
cy: "53",
|
|
71
|
+
r: "2.5"
|
|
72
|
+
}), /*#__PURE__*/_jsx("circle", {
|
|
73
|
+
className: "scene-dot chat-scene-bounce",
|
|
74
|
+
cx: "62",
|
|
75
|
+
cy: "53",
|
|
76
|
+
r: "2.5"
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
79
|
+
t4 = /*#__PURE__*/_jsx("path", {
|
|
80
|
+
className: "scene-text scene-type-5",
|
|
81
|
+
pathLength: 1,
|
|
82
|
+
d: "M40 53h98"
|
|
83
|
+
});
|
|
84
|
+
t5 = /*#__PURE__*/_jsx("path", {
|
|
85
|
+
className: "scene-text scene-type-7",
|
|
86
|
+
pathLength: 1,
|
|
87
|
+
d: "M40 66h84"
|
|
88
|
+
});
|
|
89
|
+
t6 = /*#__PURE__*/_jsx("path", {
|
|
90
|
+
className: "scene-text scene-type-9",
|
|
91
|
+
pathLength: 1,
|
|
92
|
+
d: "M40 79h56"
|
|
93
|
+
});
|
|
94
|
+
$[3] = t3;
|
|
95
|
+
$[4] = t4;
|
|
96
|
+
$[5] = t5;
|
|
97
|
+
$[6] = t6;
|
|
98
|
+
} else {
|
|
99
|
+
t3 = $[3];
|
|
100
|
+
t4 = $[4];
|
|
101
|
+
t5 = $[5];
|
|
102
|
+
t6 = $[6];
|
|
103
|
+
}
|
|
104
|
+
let t7;
|
|
105
|
+
if ($[7] !== t2) {
|
|
106
|
+
t7 = /*#__PURE__*/_jsx(EmptyScene, {
|
|
107
|
+
children: /*#__PURE__*/_jsxs("g", {
|
|
108
|
+
className: "scene-loop",
|
|
109
|
+
children: [t1, t2, t3, t4, t5, t6]
|
|
110
|
+
})
|
|
111
|
+
});
|
|
112
|
+
$[7] = t2;
|
|
113
|
+
$[8] = t7;
|
|
114
|
+
} else {
|
|
115
|
+
t7 = $[8];
|
|
116
|
+
}
|
|
117
|
+
return t7;
|
|
118
|
+
}
|
package/dist/chat/ui/Timeline.js
CHANGED
|
@@ -5,10 +5,9 @@ import clsx from 'clsx';
|
|
|
5
5
|
import { LoaderCircle } from 'lucide-react';
|
|
6
6
|
import { memo, useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
|
-
import { AgentIcon } from '../../agents/AgentIcon.js';
|
|
9
8
|
import { useModelName } from '../../agents/model-name.js';
|
|
10
9
|
import { useChatHost } from '../../host.js';
|
|
11
|
-
import { useHostContextSources,
|
|
10
|
+
import { useHostContextSources, useHostHidesToolCalls, useHostThreadCards, useHostTimelineFind, useHostWelcome } from '../../host-hooks.js';
|
|
12
11
|
import { useChatScope } from '../../scope.js';
|
|
13
12
|
import { useChatRow, useChats } from '../../state/chats.js';
|
|
14
13
|
import { useForkedTurns } from '../forks.js';
|
|
@@ -24,6 +23,7 @@ import { openFromMain, useSubagentTrail } from '../subagent-view.js';
|
|
|
24
23
|
import { useTimelineFlash } from '../timeline-flash.js';
|
|
25
24
|
import { registerItemJumper, registerMessageStepper, registerTimeline, registerTurnJumper, setTimelineAtEnd, wantsEarlier } from '../timeline-scroll.js';
|
|
26
25
|
import { BookmarkMarker } from './BookmarkMarker.js';
|
|
26
|
+
import { ChatEmptyScene } from './ChatEmptyScene.js';
|
|
27
27
|
import { FileLinkContext } from './file-links.js';
|
|
28
28
|
import { FindRevealContext } from './find-reveal.js';
|
|
29
29
|
import { MessageActions } from './MessageActions.js';
|
|
@@ -77,12 +77,9 @@ function scrollsWithin(target, boundary, deltaX, deltaY) {
|
|
|
77
77
|
}
|
|
78
78
|
return false;
|
|
79
79
|
}
|
|
80
|
-
/*
|
|
81
|
-
* A thread before its first message: which model answers, what the lines into this node let it read,
|
|
82
|
-
* and the folder it works in, so a first question can lean on all three.
|
|
83
|
-
*/
|
|
80
|
+
/* A thread before its first message: which model answers, and what the lines into this node let it read. */
|
|
84
81
|
function EmptyThread(t0) {
|
|
85
|
-
const $ = _c(
|
|
82
|
+
const $ = _c(23);
|
|
86
83
|
const {
|
|
87
84
|
chatId
|
|
88
85
|
} = t0;
|
|
@@ -95,11 +92,10 @@ function EmptyThread(t0) {
|
|
|
95
92
|
const info = useChatRow(chatId, _temp);
|
|
96
93
|
const model = useModelName(info?.provider, info?.selection.model ?? "");
|
|
97
94
|
const sources = useHostContextSources(chatId);
|
|
98
|
-
const hidesFolder = useHostHidesFolder(chatId);
|
|
99
95
|
let t1;
|
|
100
96
|
if ($[0] !== info) {
|
|
101
|
-
t1 = info ? /*#__PURE__*/_jsx(
|
|
102
|
-
|
|
97
|
+
t1 = info ? /*#__PURE__*/_jsx(ChatEmptyScene, {
|
|
98
|
+
provider: info.provider
|
|
103
99
|
}) : undefined;
|
|
104
100
|
$[0] = info;
|
|
105
101
|
$[1] = t1;
|
|
@@ -110,7 +106,7 @@ function EmptyThread(t0) {
|
|
|
110
106
|
if ($[2] !== info || $[3] !== model || $[4] !== t) {
|
|
111
107
|
t2 = info ? t("timeline.empty.ready", {
|
|
112
108
|
model
|
|
113
|
-
}) :
|
|
109
|
+
}) : undefined;
|
|
114
110
|
$[2] = info;
|
|
115
111
|
$[3] = model;
|
|
116
112
|
$[4] = t;
|
|
@@ -119,78 +115,70 @@ function EmptyThread(t0) {
|
|
|
119
115
|
t2 = $[5];
|
|
120
116
|
}
|
|
121
117
|
let t3;
|
|
122
|
-
if ($[6] !==
|
|
123
|
-
t3 =
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
children: t2
|
|
127
|
-
});
|
|
128
|
-
$[6] = t1;
|
|
129
|
-
$[7] = t2;
|
|
118
|
+
if ($[6] !== info || $[7] !== t) {
|
|
119
|
+
t3 = info ? t("timeline.empty.task") : t("timeline.empty.ask");
|
|
120
|
+
$[6] = info;
|
|
121
|
+
$[7] = t;
|
|
130
122
|
$[8] = t3;
|
|
131
123
|
} else {
|
|
132
124
|
t3 = $[8];
|
|
133
125
|
}
|
|
134
126
|
let t4;
|
|
135
|
-
if ($[9] !==
|
|
136
|
-
t4 =
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
127
|
+
if ($[9] !== t1 || $[10] !== t2 || $[11] !== t3) {
|
|
128
|
+
t4 = /*#__PURE__*/_jsx(EmptyState, {
|
|
129
|
+
scene: t1,
|
|
130
|
+
title: t2,
|
|
131
|
+
className: "p-0",
|
|
132
|
+
children: t3
|
|
133
|
+
});
|
|
134
|
+
$[9] = t1;
|
|
135
|
+
$[10] = t2;
|
|
136
|
+
$[11] = t3;
|
|
137
|
+
$[12] = t4;
|
|
140
138
|
} else {
|
|
141
|
-
t4 = $[
|
|
139
|
+
t4 = $[12];
|
|
142
140
|
}
|
|
143
141
|
let t5;
|
|
144
|
-
if ($[
|
|
145
|
-
t5 =
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
150
|
-
className: "max-w-full text-xs text-text-muted",
|
|
151
|
-
children: sources.map(_temp2).join(", ")
|
|
152
|
-
})]
|
|
153
|
-
});
|
|
154
|
-
$[12] = sources;
|
|
155
|
-
$[13] = t;
|
|
156
|
-
$[14] = t5;
|
|
142
|
+
if ($[13] !== chatId || $[14] !== renderEmptyThread) {
|
|
143
|
+
t5 = renderEmptyThread?.(chatId);
|
|
144
|
+
$[13] = chatId;
|
|
145
|
+
$[14] = renderEmptyThread;
|
|
146
|
+
$[15] = t5;
|
|
157
147
|
} else {
|
|
158
|
-
t5 = $[
|
|
148
|
+
t5 = $[15];
|
|
159
149
|
}
|
|
160
150
|
let t6;
|
|
161
|
-
if ($[
|
|
162
|
-
t6 =
|
|
151
|
+
if ($[16] !== sources || $[17] !== t) {
|
|
152
|
+
t6 = sources.length > 0 && /*#__PURE__*/_jsxs("div", {
|
|
163
153
|
className: "flex max-w-full flex-col items-center gap-1",
|
|
164
154
|
children: [/*#__PURE__*/_jsx(SectionLabel, {
|
|
165
|
-
children: t("timeline.empty.
|
|
155
|
+
children: t("timeline.empty.canRead")
|
|
166
156
|
}), /*#__PURE__*/_jsx("span", {
|
|
167
|
-
className: "max-w-full
|
|
168
|
-
children:
|
|
157
|
+
className: "max-w-full text-xs text-text-muted",
|
|
158
|
+
children: sources.map(_temp2).join(", ")
|
|
169
159
|
})]
|
|
170
160
|
});
|
|
171
|
-
$[
|
|
172
|
-
$[16] = info;
|
|
161
|
+
$[16] = sources;
|
|
173
162
|
$[17] = t;
|
|
174
163
|
$[18] = t6;
|
|
175
164
|
} else {
|
|
176
165
|
t6 = $[18];
|
|
177
166
|
}
|
|
178
167
|
let t7;
|
|
179
|
-
if ($[19] !==
|
|
168
|
+
if ($[19] !== t4 || $[20] !== t5 || $[21] !== t6) {
|
|
180
169
|
t7 = /*#__PURE__*/_jsx("div", {
|
|
181
170
|
className: "flex grow items-center justify-center",
|
|
182
171
|
children: /*#__PURE__*/_jsxs("div", {
|
|
183
172
|
className: "flex max-w-sm flex-col items-center gap-3 px-6 py-8 text-center",
|
|
184
|
-
children: [
|
|
173
|
+
children: [t4, t5, t6]
|
|
185
174
|
})
|
|
186
175
|
});
|
|
187
|
-
$[19] =
|
|
188
|
-
$[20] =
|
|
189
|
-
$[21] =
|
|
190
|
-
$[22] =
|
|
191
|
-
$[23] = t7;
|
|
176
|
+
$[19] = t4;
|
|
177
|
+
$[20] = t5;
|
|
178
|
+
$[21] = t6;
|
|
179
|
+
$[22] = t7;
|
|
192
180
|
} else {
|
|
193
|
-
t7 = $[
|
|
181
|
+
t7 = $[22];
|
|
194
182
|
}
|
|
195
183
|
return t7;
|
|
196
184
|
}
|
|
@@ -254,10 +254,10 @@ export default {
|
|
|
254
254
|
night: 'Still up?'
|
|
255
255
|
},
|
|
256
256
|
empty: {
|
|
257
|
-
ready: '{{model}} is ready
|
|
257
|
+
ready: '{{model}} is ready',
|
|
258
|
+
task: 'Ask a question or give it a task.',
|
|
258
259
|
ask: 'Ask anything.',
|
|
259
|
-
canRead: 'It can read'
|
|
260
|
-
worksIn: 'It works in'
|
|
260
|
+
canRead: 'It can read'
|
|
261
261
|
},
|
|
262
262
|
loading: 'Loading conversation',
|
|
263
263
|
loadingEarlier: 'Loading earlier messages',
|
|
@@ -254,10 +254,10 @@ export default {
|
|
|
254
254
|
night: 'Nog wakker?'
|
|
255
255
|
},
|
|
256
256
|
empty: {
|
|
257
|
-
ready: '{{model}} staat klaar
|
|
257
|
+
ready: '{{model}} staat klaar',
|
|
258
|
+
task: 'Stel een vraag of geef een opdracht.',
|
|
258
259
|
ask: 'Vraag maar raak.',
|
|
259
|
-
canRead: 'Kan lezen'
|
|
260
|
-
worksIn: 'Werkt in'
|
|
260
|
+
canRead: 'Kan lezen'
|
|
261
261
|
},
|
|
262
262
|
loading: 'Gesprek laden',
|
|
263
263
|
loadingEarlier: 'Eerdere berichten laden',
|
package/dist/theme.css
CHANGED
|
@@ -315,3 +315,18 @@
|
|
|
315
315
|
.composer-input .cm-content .cm-line.cm-md-fence { padding: 0 8px; background: var(--surface-sunken); font-family: var(--font-mono); font-size: var(--text-code); }
|
|
316
316
|
.composer-input .cm-content .cm-line.cm-md-fence-start { padding-top: 4px; border-top-left-radius: 6px; border-top-right-radius: 6px; }
|
|
317
317
|
.composer-input .cm-content .cm-line.cm-md-fence-end { padding-bottom: 4px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; }
|
|
318
|
+
|
|
319
|
+
/* The empty thread's scene: a question that goes out, and the model typing before its answer stands. */
|
|
320
|
+
@keyframes chat-scene-send { 0%, 3% { transform: translateY(16px); opacity: 0; } 12%, 100% { transform: none; opacity: 1; } }
|
|
321
|
+
@keyframes chat-scene-typing { 0%, 18% { opacity: 0; } 20%, 32% { opacity: 1; } 34%, 100% { opacity: 0; } }
|
|
322
|
+
@keyframes chat-scene-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-3px); } }
|
|
323
|
+
.chat-scene-send { transform-box: view-box; }
|
|
324
|
+
.chat-scene-typing { opacity: 0; }
|
|
325
|
+
.chat-scene-bounce { transform-box: fill-box; }
|
|
326
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
327
|
+
.chat-scene-send { animation: chat-scene-send 8s var(--scene-arrive) infinite; }
|
|
328
|
+
.chat-scene-typing { animation: chat-scene-typing 8s infinite; }
|
|
329
|
+
.chat-scene-bounce { animation: chat-scene-bounce 0.9s ease-in-out infinite; }
|
|
330
|
+
.chat-scene-bounce:nth-child(2) { animation-delay: 0.15s; }
|
|
331
|
+
.chat-scene-bounce:nth-child(3) { animation-delay: 0.3s; }
|
|
332
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adecore/agents-react",
|
|
3
|
-
"version": "0.54.
|
|
3
|
+
"version": "0.54.12",
|
|
4
4
|
"description": "React agent chat threads, composers, approvals, provider accounts and usage views.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -72,12 +72,12 @@
|
|
|
72
72
|
"test:visuals": "bun --config=integration.bunfig.toml --conditions=source test ./src/chat/visual-viewport.integration.test.ts"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@adecore/agent-contracts": "0.54.
|
|
76
|
-
"@adecore/editor": "0.54.
|
|
77
|
-
"@adecore/editor-react": "0.54.
|
|
78
|
-
"@adecore/intelligent-ui": "0.54.
|
|
79
|
-
"@adecore/merge": "0.54.
|
|
80
|
-
"@adecore/utils": "0.54.
|
|
75
|
+
"@adecore/agent-contracts": "0.54.12",
|
|
76
|
+
"@adecore/editor": "0.54.12",
|
|
77
|
+
"@adecore/editor-react": "0.54.12",
|
|
78
|
+
"@adecore/intelligent-ui": "0.54.12",
|
|
79
|
+
"@adecore/merge": "0.54.12",
|
|
80
|
+
"@adecore/utils": "0.54.12",
|
|
81
81
|
"@codemirror/commands": "^6.11.1",
|
|
82
82
|
"@codemirror/language": "^6.13.1",
|
|
83
83
|
"@codemirror/state": "^6.7.6",
|
|
@@ -101,14 +101,14 @@
|
|
|
101
101
|
"zustand": "^5.0.16"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
|
-
"@adecore/ui": "^0.54.
|
|
104
|
+
"@adecore/ui": "^0.54.12",
|
|
105
105
|
"i18next": "^26.4.2",
|
|
106
106
|
"react": "^19.3.0",
|
|
107
107
|
"react-dom": "^19.3.0",
|
|
108
108
|
"react-i18next": "^17.0.15"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
|
-
"@adecore/ui": "0.54.
|
|
111
|
+
"@adecore/ui": "0.54.12",
|
|
112
112
|
"@types/bun": "^1.4.4",
|
|
113
113
|
"@types/react": "^19.3.0",
|
|
114
114
|
"@types/react-dom": "^19.3.0",
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EmptyScene } from '@adecore/ui';
|
|
2
|
+
import { AgentIcon } from '../../agents/AgentIcon';
|
|
3
|
+
|
|
4
|
+
/* A question goes out and the model answers. Its mark is the one accent here, so the typing dots stay neutral. */
|
|
5
|
+
export function ChatEmptyScene({ provider }: { provider: string }) {
|
|
6
|
+
return (
|
|
7
|
+
<EmptyScene>
|
|
8
|
+
<g className="scene-loop">
|
|
9
|
+
<g className="chat-scene-send">
|
|
10
|
+
<g className="scene-lift">
|
|
11
|
+
<rect className="scene-shape" x="70" y="10" width="78" height="24" rx="12" />
|
|
12
|
+
</g>
|
|
13
|
+
<path className="scene-text" d="M82 22h52" />
|
|
14
|
+
</g>
|
|
15
|
+
<g className="scene-reveal-2">
|
|
16
|
+
<svg x="11" y="43" width="20" height="20" overflow="visible">
|
|
17
|
+
<AgentIcon kind={provider} size={20} />
|
|
18
|
+
</svg>
|
|
19
|
+
</g>
|
|
20
|
+
<g className="chat-scene-typing">
|
|
21
|
+
<circle className="scene-dot chat-scene-bounce" cx="42" cy="53" r="2.5" />
|
|
22
|
+
<circle className="scene-dot chat-scene-bounce" cx="52" cy="53" r="2.5" />
|
|
23
|
+
<circle className="scene-dot chat-scene-bounce" cx="62" cy="53" r="2.5" />
|
|
24
|
+
</g>
|
|
25
|
+
<path className="scene-text scene-type-5" pathLength={1} d="M40 53h98" />
|
|
26
|
+
<path className="scene-text scene-type-7" pathLength={1} d="M40 66h84" />
|
|
27
|
+
<path className="scene-text scene-type-9" pathLength={1} d="M40 79h56" />
|
|
28
|
+
</g>
|
|
29
|
+
</EmptyScene>
|
|
30
|
+
);
|
|
31
|
+
}
|
package/src/chat/ui/Timeline.tsx
CHANGED
|
@@ -17,10 +17,9 @@ import {
|
|
|
17
17
|
type ReactNode
|
|
18
18
|
} from 'react';
|
|
19
19
|
import { useTranslation } from 'react-i18next';
|
|
20
|
-
import { AgentIcon } from '../../agents/AgentIcon';
|
|
21
20
|
import { useModelName } from '../../agents/model-name';
|
|
22
21
|
import { useChatHost, type TimelineFindOptions } from '../../host';
|
|
23
|
-
import { useHostContextSources,
|
|
22
|
+
import { useHostContextSources, useHostHidesToolCalls, useHostThreadCards, useHostTimelineFind, useHostWelcome } from '../../host-hooks';
|
|
24
23
|
import { useChatScope } from '../../scope';
|
|
25
24
|
import { useChatRow, useChats } from '../../state/chats';
|
|
26
25
|
import { useForkedTurns } from '../forks';
|
|
@@ -66,6 +65,7 @@ import {
|
|
|
66
65
|
type TurnTarget
|
|
67
66
|
} from '../timeline-scroll';
|
|
68
67
|
import { BookmarkMarker } from './BookmarkMarker';
|
|
68
|
+
import { ChatEmptyScene } from './ChatEmptyScene';
|
|
69
69
|
import { FileLinkContext } from './file-links';
|
|
70
70
|
import { FindRevealContext } from './find-reveal';
|
|
71
71
|
import { MessageActions } from './MessageActions';
|
|
@@ -122,23 +122,23 @@ function scrollsWithin(target: Element, boundary: Element, deltaX: number, delta
|
|
|
122
122
|
return false;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
/*
|
|
126
|
-
* A thread before its first message: which model answers, what the lines into this node let it read,
|
|
127
|
-
* and the folder it works in, so a first question can lean on all three.
|
|
128
|
-
*/
|
|
125
|
+
/* A thread before its first message: which model answers, and what the lines into this node let it read. */
|
|
129
126
|
function EmptyThread({ chatId }: { chatId: string }) {
|
|
130
127
|
const { renderEmptyThread } = useChatHost();
|
|
131
128
|
const { t } = useTranslation('agent-chat');
|
|
132
129
|
const info = useChatRow(chatId, (row) => row?.info ?? null);
|
|
133
130
|
const model = useModelName(info?.provider, info?.selection.model ?? '');
|
|
134
131
|
const sources = useHostContextSources(chatId);
|
|
135
|
-
const hidesFolder = useHostHidesFolder(chatId);
|
|
136
132
|
|
|
137
133
|
return (
|
|
138
134
|
<div className="flex grow items-center justify-center">
|
|
139
135
|
<div className="flex max-w-sm flex-col items-center gap-3 px-6 py-8 text-center">
|
|
140
|
-
<EmptyState
|
|
141
|
-
{info ?
|
|
136
|
+
<EmptyState
|
|
137
|
+
scene={info ? <ChatEmptyScene provider={info.provider} /> : undefined}
|
|
138
|
+
title={info ? t('timeline.empty.ready', { model }) : undefined}
|
|
139
|
+
className="p-0"
|
|
140
|
+
>
|
|
141
|
+
{info ? t('timeline.empty.task') : t('timeline.empty.ask')}
|
|
142
142
|
</EmptyState>
|
|
143
143
|
{renderEmptyThread?.(chatId)}
|
|
144
144
|
{sources.length > 0 && (
|
|
@@ -147,12 +147,6 @@ function EmptyThread({ chatId }: { chatId: string }) {
|
|
|
147
147
|
<span className="max-w-full text-xs text-text-muted">{sources.map((source) => source.title).join(', ')}</span>
|
|
148
148
|
</div>
|
|
149
149
|
)}
|
|
150
|
-
{info?.cwd && !hidesFolder && (
|
|
151
|
-
<div className="flex max-w-full flex-col items-center gap-1">
|
|
152
|
-
<SectionLabel>{t('timeline.empty.worksIn')}</SectionLabel>
|
|
153
|
-
<span className="max-w-full font-mono text-xs break-all text-text-muted">{info.cwd}</span>
|
|
154
|
-
</div>
|
|
155
|
-
)}
|
|
156
150
|
</div>
|
|
157
151
|
</div>
|
|
158
152
|
);
|
|
@@ -254,10 +254,10 @@ export default {
|
|
|
254
254
|
night: 'Still up?'
|
|
255
255
|
},
|
|
256
256
|
empty: {
|
|
257
|
-
ready: '{{model}} is ready
|
|
257
|
+
ready: '{{model}} is ready',
|
|
258
|
+
task: 'Ask a question or give it a task.',
|
|
258
259
|
ask: 'Ask anything.',
|
|
259
|
-
canRead: 'It can read'
|
|
260
|
-
worksIn: 'It works in'
|
|
260
|
+
canRead: 'It can read'
|
|
261
261
|
},
|
|
262
262
|
loading: 'Loading conversation',
|
|
263
263
|
loadingEarlier: 'Loading earlier messages',
|
|
@@ -254,10 +254,10 @@ export default {
|
|
|
254
254
|
night: 'Nog wakker?'
|
|
255
255
|
},
|
|
256
256
|
empty: {
|
|
257
|
-
ready: '{{model}} staat klaar
|
|
257
|
+
ready: '{{model}} staat klaar',
|
|
258
|
+
task: 'Stel een vraag of geef een opdracht.',
|
|
258
259
|
ask: 'Vraag maar raak.',
|
|
259
|
-
canRead: 'Kan lezen'
|
|
260
|
-
worksIn: 'Werkt in'
|
|
260
|
+
canRead: 'Kan lezen'
|
|
261
261
|
},
|
|
262
262
|
loading: 'Gesprek laden',
|
|
263
263
|
loadingEarlier: 'Eerdere berichten laden',
|
package/src/theme.css
CHANGED
|
@@ -315,3 +315,18 @@
|
|
|
315
315
|
.composer-input .cm-content .cm-line.cm-md-fence { padding: 0 8px; background: var(--surface-sunken); font-family: var(--font-mono); font-size: var(--text-code); }
|
|
316
316
|
.composer-input .cm-content .cm-line.cm-md-fence-start { padding-top: 4px; border-top-left-radius: 6px; border-top-right-radius: 6px; }
|
|
317
317
|
.composer-input .cm-content .cm-line.cm-md-fence-end { padding-bottom: 4px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; }
|
|
318
|
+
|
|
319
|
+
/* The empty thread's scene: a question that goes out, and the model typing before its answer stands. */
|
|
320
|
+
@keyframes chat-scene-send { 0%, 3% { transform: translateY(16px); opacity: 0; } 12%, 100% { transform: none; opacity: 1; } }
|
|
321
|
+
@keyframes chat-scene-typing { 0%, 18% { opacity: 0; } 20%, 32% { opacity: 1; } 34%, 100% { opacity: 0; } }
|
|
322
|
+
@keyframes chat-scene-bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-3px); } }
|
|
323
|
+
.chat-scene-send { transform-box: view-box; }
|
|
324
|
+
.chat-scene-typing { opacity: 0; }
|
|
325
|
+
.chat-scene-bounce { transform-box: fill-box; }
|
|
326
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
327
|
+
.chat-scene-send { animation: chat-scene-send 8s var(--scene-arrive) infinite; }
|
|
328
|
+
.chat-scene-typing { animation: chat-scene-typing 8s infinite; }
|
|
329
|
+
.chat-scene-bounce { animation: chat-scene-bounce 0.9s ease-in-out infinite; }
|
|
330
|
+
.chat-scene-bounce:nth-child(2) { animation-delay: 0.15s; }
|
|
331
|
+
.chat-scene-bounce:nth-child(3) { animation-delay: 0.3s; }
|
|
332
|
+
}
|