@adecore/agents-react 0.54.10 → 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.
@@ -0,0 +1,3 @@
1
+ export declare function ChatEmptyScene({ provider }: {
2
+ provider: string;
3
+ }): import("react").JSX.Element;
@@ -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
+ }
@@ -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, useHostHidesFolder, useHostHidesToolCalls, useHostThreadCards, useHostTimelineFind, useHostWelcome } from '../../host-hooks.js';
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(24);
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(AgentIcon, {
102
- kind: info.provider
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
- }) : t("timeline.empty.ask");
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] !== t1 || $[7] !== t2) {
123
- t3 = /*#__PURE__*/_jsx(EmptyState, {
124
- icon: t1,
125
- className: "p-0",
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] !== chatId || $[10] !== renderEmptyThread) {
136
- t4 = renderEmptyThread?.(chatId);
137
- $[9] = chatId;
138
- $[10] = renderEmptyThread;
139
- $[11] = t4;
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 = $[11];
139
+ t4 = $[12];
142
140
  }
143
141
  let t5;
144
- if ($[12] !== sources || $[13] !== t) {
145
- t5 = sources.length > 0 && /*#__PURE__*/_jsxs("div", {
146
- className: "flex max-w-full flex-col items-center gap-1",
147
- children: [/*#__PURE__*/_jsx(SectionLabel, {
148
- children: t("timeline.empty.canRead")
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 = $[14];
148
+ t5 = $[15];
159
149
  }
160
150
  let t6;
161
- if ($[15] !== hidesFolder || $[16] !== info || $[17] !== t) {
162
- t6 = info?.cwd && !hidesFolder && /*#__PURE__*/_jsxs("div", {
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.worksIn")
155
+ children: t("timeline.empty.canRead")
166
156
  }), /*#__PURE__*/_jsx("span", {
167
- className: "max-w-full font-mono text-xs break-all text-text-muted",
168
- children: info.cwd
157
+ className: "max-w-full text-xs text-text-muted",
158
+ children: sources.map(_temp2).join(", ")
169
159
  })]
170
160
  });
171
- $[15] = hidesFolder;
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] !== t3 || $[20] !== t4 || $[21] !== t5 || $[22] !== t6) {
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: [t3, t4, t5, t6]
173
+ children: [t4, t5, t6]
185
174
  })
186
175
  });
187
- $[19] = t3;
188
- $[20] = t4;
189
- $[21] = t5;
190
- $[22] = t6;
191
- $[23] = t7;
176
+ $[19] = t4;
177
+ $[20] = t5;
178
+ $[21] = t6;
179
+ $[22] = t7;
192
180
  } else {
193
- t7 = $[23];
181
+ t7 = $[22];
194
182
  }
195
183
  return t7;
196
184
  }
@@ -255,9 +255,9 @@ declare const _default: {
255
255
  };
256
256
  empty: {
257
257
  ready: string;
258
+ task: string;
258
259
  ask: string;
259
260
  canRead: string;
260
- worksIn: string;
261
261
  };
262
262
  loading: string;
263
263
  loadingEarlier: string;
@@ -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',
@@ -255,9 +255,9 @@ declare const _default: {
255
255
  };
256
256
  empty: {
257
257
  ready: string;
258
+ task: string;
258
259
  ask: string;
259
260
  canRead: string;
260
- worksIn: string;
261
261
  };
262
262
  loading: string;
263
263
  loadingEarlier: string;
@@ -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
+ }
@@ -1,5 +1,6 @@
1
1
  import { type ReactElement } from 'react';
2
- export declare function UsageLimitsCard({ side, children }: {
2
+ export declare function UsageLimitsCard({ side, open, children }: {
3
3
  side?: 'top' | 'left';
4
+ open?: boolean;
4
5
  children: ReactElement<Record<string, unknown>>;
5
6
  }): import("react").JSX.Element;
@@ -68,68 +68,70 @@ export function UsageLimitsCard(t0) {
68
68
  const $ = _c(13);
69
69
  const {
70
70
  side: t1,
71
+ open: t2,
71
72
  children
72
73
  } = t0;
73
74
  const side = t1 === undefined ? "top" : t1;
75
+ const open = t2 === undefined ? false : t2;
76
+ const [hovered, setHovered] = useState(false);
74
77
  const [opened, setOpened] = useState(false);
75
- let t2;
78
+ let t3;
76
79
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
77
- t2 = new Set();
78
- $[0] = t2;
80
+ t3 = new Set();
81
+ $[0] = t3;
79
82
  } else {
80
- t2 = $[0];
83
+ t3 = $[0];
81
84
  }
82
- const [folded, setFolded] = useState(t2);
83
- let t3;
84
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
85
- t3 = open => open && setOpened(true);
86
- $[1] = t3;
87
- } else {
88
- t3 = $[1];
85
+ const [folded, setFolded] = useState(t3);
86
+ const shown = hovered || open;
87
+ if (shown && !opened) {
88
+ setOpened(true);
89
89
  }
90
90
  let t4;
91
- if ($[2] !== children) {
91
+ if ($[1] !== children) {
92
92
  t4 = /*#__PURE__*/_jsx(PreviewCard.Trigger, {
93
93
  render: children,
94
94
  delay: 500
95
95
  });
96
- $[2] = children;
97
- $[3] = t4;
96
+ $[1] = children;
97
+ $[2] = t4;
98
98
  } else {
99
- t4 = $[3];
99
+ t4 = $[2];
100
100
  }
101
101
  let t5;
102
- if ($[4] !== folded || $[5] !== opened) {
102
+ if ($[3] !== folded || $[4] !== opened) {
103
103
  t5 = opened && /*#__PURE__*/_jsx(CardBody, {
104
104
  folded: folded,
105
105
  onFoldedChange: setFolded
106
106
  });
107
- $[4] = folded;
108
- $[5] = opened;
109
- $[6] = t5;
107
+ $[3] = folded;
108
+ $[4] = opened;
109
+ $[5] = t5;
110
110
  } else {
111
- t5 = $[6];
111
+ t5 = $[5];
112
112
  }
113
113
  let t6;
114
- if ($[7] !== side || $[8] !== t5) {
114
+ if ($[6] !== side || $[7] !== t5) {
115
115
  t6 = /*#__PURE__*/_jsx(PreviewCard.Popup, {
116
116
  side: side,
117
117
  align: "end",
118
118
  className: "w-85 p-2",
119
119
  children: t5
120
120
  });
121
- $[7] = side;
122
- $[8] = t5;
123
- $[9] = t6;
121
+ $[6] = side;
122
+ $[7] = t5;
123
+ $[8] = t6;
124
124
  } else {
125
- t6 = $[9];
125
+ t6 = $[8];
126
126
  }
127
127
  let t7;
128
- if ($[10] !== t4 || $[11] !== t6) {
128
+ if ($[9] !== shown || $[10] !== t4 || $[11] !== t6) {
129
129
  t7 = /*#__PURE__*/_jsxs(PreviewCard.Root, {
130
- onOpenChange: t3,
130
+ open: shown,
131
+ onOpenChange: setHovered,
131
132
  children: [t4, t6]
132
133
  });
134
+ $[9] = shown;
133
135
  $[10] = t4;
134
136
  $[11] = t6;
135
137
  $[12] = t7;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adecore/agents-react",
3
- "version": "0.54.10",
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.10",
76
- "@adecore/editor": "0.54.10",
77
- "@adecore/editor-react": "0.54.10",
78
- "@adecore/intelligent-ui": "0.54.10",
79
- "@adecore/merge": "0.54.10",
80
- "@adecore/utils": "0.54.10",
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.10",
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.10",
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
+ }
@@ -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, useHostHidesFolder, useHostHidesToolCalls, useHostThreadCards, useHostTimelineFind, useHostWelcome } from '../../host-hooks';
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 icon={info ? <AgentIcon kind={info.provider} /> : undefined} className="p-0">
141
- {info ? t('timeline.empty.ready', { model }) : t('timeline.empty.ask')}
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
+ }
@@ -29,17 +29,26 @@ function CardBody({ folded, onFoldedChange }: { folded: ReadonlySet<string>; onF
29
29
  */
30
30
  export function UsageLimitsCard({
31
31
  side = 'top',
32
+ open = false,
32
33
  children
33
34
  }: {
34
35
  /* Where the card opens: above a button in a footer, or `left` beside one in a column at the window's right edge. */
35
36
  side?: 'top' | 'left';
37
+ /* Holds the card open beside the hover, such as while the app's own key is down. */
38
+ open?: boolean;
36
39
  children: ReactElement<Record<string, unknown>>;
37
40
  }) {
41
+ const [hovered, setHovered] = useState(false);
38
42
  const [opened, setOpened] = useState(false);
39
43
  const [folded, setFolded] = useState<ReadonlySet<string>>(new Set());
44
+ const shown = hovered || open;
45
+
46
+ if (shown && !opened) {
47
+ setOpened(true);
48
+ }
40
49
 
41
50
  return (
42
- <PreviewCard.Root onOpenChange={(open) => open && setOpened(true)}>
51
+ <PreviewCard.Root open={shown} onOpenChange={setHovered}>
43
52
  <PreviewCard.Trigger render={children} delay={500} />
44
53
  <PreviewCard.Popup side={side} align="end" className="w-85 p-2">
45
54
  {opened && <CardBody folded={folded} onFoldedChange={setFolded} />}