@agent-native/toolkit 0.217.0 → 0.219.0
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/agent-native.eject.json +21 -0
- package/dist/app/agent-page/AgentContextTab.d.ts.map +1 -1
- package/dist/app/agent-page/AgentContextTab.js +1 -0
- package/dist/app/agent-page/AgentContextTab.js.map +1 -1
- package/dist/app/agentkit/react/components.d.ts.map +1 -1
- package/dist/app/agentkit/react/components.js +1 -1
- package/dist/app/agentkit/react/components.js.map +1 -1
- package/dist/app/agentkit/react/context.d.ts +4 -1
- package/dist/app/agentkit/react/context.d.ts.map +1 -1
- package/dist/app/agentkit/react/context.js +3 -1
- package/dist/app/agentkit/react/context.js.map +1 -1
- package/dist/app/agentkit/react/data-chart-layout.d.ts +30 -0
- package/dist/app/agentkit/react/data-chart-layout.d.ts.map +1 -0
- package/dist/app/agentkit/react/data-chart-layout.js +2 -0
- package/dist/app/agentkit/react/data-chart-layout.js.map +1 -0
- package/dist/app/agentkit/react/index.d.ts +1 -0
- package/dist/app/agentkit/react/index.d.ts.map +1 -1
- package/dist/app/agentkit/react/index.js +1 -0
- package/dist/app/agentkit/react/index.js.map +1 -1
- package/dist/app/agentkit/react/root.d.ts +3 -1
- package/dist/app/agentkit/react/root.d.ts.map +1 -1
- package/dist/app/agentkit/react/root.js +2 -2
- package/dist/app/agentkit/react/root.js.map +1 -1
- package/dist/app/agentkit/react/styles.css +31 -6
- package/dist/app/agentkit/react/transcript-layout.d.ts +2 -0
- package/dist/app/agentkit/react/transcript-layout.d.ts.map +1 -1
- package/dist/app/agentkit/react/transcript-layout.js.map +1 -1
- package/dist/app/chat/AgentKitAssistantChat.d.ts.map +1 -1
- package/dist/app/chat/AgentKitAssistantChat.js +2 -2
- package/dist/app/chat/AgentKitAssistantChat.js.map +1 -1
- package/dist/app/chat/AgentPanel.js +6 -6
- package/dist/app/chat/AgentPanel.js.map +1 -1
- package/dist/app/chat/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/app/chat/MultiTabAssistantChat.js +53 -95
- package/dist/app/chat/MultiTabAssistantChat.js.map +1 -1
- package/dist/app/chat/agentkit-chat/action-widget.d.ts.map +1 -1
- package/dist/app/chat/agentkit-chat/action-widget.js +4 -1
- package/dist/app/chat/agentkit-chat/action-widget.js.map +1 -1
- package/dist/app/chat/agentkit-chat/rail.d.ts +1 -1
- package/dist/app/chat/agentkit-chat/rail.d.ts.map +1 -1
- package/dist/app/chat/agentkit-chat/rail.js +1 -1
- package/dist/app/chat/agentkit-chat/rail.js.map +1 -1
- package/dist/app/chat/chat/index.d.ts +2 -1
- package/dist/app/chat/chat/index.d.ts.map +1 -1
- package/dist/app/chat/chat/index.js +1 -1
- package/dist/app/chat/chat/index.js.map +1 -1
- package/dist/app/chat/chat/surface-types.d.ts +3 -0
- package/dist/app/chat/chat/surface-types.d.ts.map +1 -1
- package/dist/app/chat/chat/surface-types.js.map +1 -1
- package/dist/app/chat/chat/tool-call-display.d.ts +5 -1
- package/dist/app/chat/chat/tool-call-display.d.ts.map +1 -1
- package/dist/app/chat/chat/tool-call-display.js +6 -4
- package/dist/app/chat/chat/tool-call-display.js.map +1 -1
- package/dist/app/chat/chat/tool-render-registry.d.ts +4 -0
- package/dist/app/chat/chat/tool-render-registry.d.ts.map +1 -1
- package/dist/app/chat/chat/tool-render-registry.js.map +1 -1
- package/dist/app/chat/chat/widgets/DataChartRenderer.d.ts +3 -1
- package/dist/app/chat/chat/widgets/DataChartRenderer.d.ts.map +1 -1
- package/dist/app/chat/chat/widgets/DataChartRenderer.js +116 -26
- package/dist/app/chat/chat/widgets/DataChartRenderer.js.map +1 -1
- package/dist/app/chat/chat/widgets/DataChartWidget.d.ts +3 -1
- package/dist/app/chat/chat/widgets/DataChartWidget.d.ts.map +1 -1
- package/dist/app/chat/chat/widgets/DataChartWidget.js +21 -2
- package/dist/app/chat/chat/widgets/DataChartWidget.js.map +1 -1
- package/dist/app/chat/chat/widgets/DataInsightsWidget.d.ts +3 -1
- package/dist/app/chat/chat/widgets/DataInsightsWidget.d.ts.map +1 -1
- package/dist/app/chat/chat/widgets/DataInsightsWidget.js +2 -2
- package/dist/app/chat/chat/widgets/DataInsightsWidget.js.map +1 -1
- package/dist/app/chat/chat/widgets/DataWidgetDisplayControls.d.ts +1 -1
- package/dist/app/chat/chat/widgets/DataWidgetDisplayControls.d.ts.map +1 -1
- package/dist/app/chat/chat/widgets/DataWidgetDisplayControls.js +3 -1
- package/dist/app/chat/chat/widgets/DataWidgetDisplayControls.js.map +1 -1
- package/dist/app/chat/chat/widgets/builtin-tool-renderers.d.ts.map +1 -1
- package/dist/app/chat/chat/widgets/builtin-tool-renderers.js +2 -2
- package/dist/app/chat/chat/widgets/builtin-tool-renderers.js.map +1 -1
- package/dist/app/chat/chat-first/chat-history.d.ts +13 -2
- package/dist/app/chat/chat-first/chat-history.d.ts.map +1 -1
- package/dist/app/chat/chat-first/chat-history.js +24 -3
- package/dist/app/chat/chat-first/chat-history.js.map +1 -1
- package/dist/app/chat/conversation/AgentConversation.d.ts.map +1 -1
- package/dist/app/chat/conversation/AgentConversation.js +6 -1
- package/dist/app/chat/conversation/AgentConversation.js.map +1 -1
- package/dist/app/chat/ownership-history/ChatOwnerAvatar.d.ts +6 -0
- package/dist/app/chat/ownership-history/ChatOwnerAvatar.d.ts.map +1 -0
- package/dist/app/chat/ownership-history/ChatOwnerAvatar.js +9 -0
- package/dist/app/chat/ownership-history/ChatOwnerAvatar.js.map +1 -0
- package/dist/app/chat/ownership-history/index.d.ts +11 -0
- package/dist/app/chat/ownership-history/index.d.ts.map +1 -0
- package/dist/app/chat/ownership-history/index.js +22 -0
- package/dist/app/chat/ownership-history/index.js.map +1 -0
- package/dist/app/chat/ownership-history/rows.d.ts +27 -0
- package/dist/app/chat/ownership-history/rows.d.ts.map +1 -0
- package/dist/app/chat/ownership-history/rows.js +101 -0
- package/dist/app/chat/ownership-history/rows.js.map +1 -0
- package/dist/app/chat/ownership-history/useOwnershipChatHistory.d.ts +52 -0
- package/dist/app/chat/ownership-history/useOwnershipChatHistory.d.ts.map +1 -0
- package/dist/app/chat/ownership-history/useOwnershipChatHistory.js +497 -0
- package/dist/app/chat/ownership-history/useOwnershipChatHistory.js.map +1 -0
- package/dist/app/i18n/catalogs/ar-SA.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ar-SA.js +3 -0
- package/dist/app/i18n/catalogs/ar-SA.js.map +1 -1
- package/dist/app/i18n/catalogs/de-DE.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/de-DE.js +3 -0
- package/dist/app/i18n/catalogs/de-DE.js.map +1 -1
- package/dist/app/i18n/catalogs/en-US.d.ts +3 -0
- package/dist/app/i18n/catalogs/en-US.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/en-US.js +3 -0
- package/dist/app/i18n/catalogs/en-US.js.map +1 -1
- package/dist/app/i18n/catalogs/es-ES.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/es-ES.js +3 -0
- package/dist/app/i18n/catalogs/es-ES.js.map +1 -1
- package/dist/app/i18n/catalogs/fr-FR.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/fr-FR.js +3 -0
- package/dist/app/i18n/catalogs/fr-FR.js.map +1 -1
- package/dist/app/i18n/catalogs/hi-IN.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/hi-IN.js +3 -0
- package/dist/app/i18n/catalogs/hi-IN.js.map +1 -1
- package/dist/app/i18n/catalogs/ja-JP.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ja-JP.js +3 -0
- package/dist/app/i18n/catalogs/ja-JP.js.map +1 -1
- package/dist/app/i18n/catalogs/ko-KR.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ko-KR.js +3 -0
- package/dist/app/i18n/catalogs/ko-KR.js.map +1 -1
- package/dist/app/i18n/catalogs/pt-BR.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/pt-BR.js +3 -0
- package/dist/app/i18n/catalogs/pt-BR.js.map +1 -1
- package/dist/app/i18n/catalogs/zh-CN.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/zh-CN.js +3 -0
- package/dist/app/i18n/catalogs/zh-CN.js.map +1 -1
- package/dist/app/i18n/catalogs/zh-TW.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/zh-TW.js +3 -0
- package/dist/app/i18n/catalogs/zh-TW.js.map +1 -1
- package/dist/app/shared/CommandMenu.d.ts +2 -0
- package/dist/app/shared/CommandMenu.d.ts.map +1 -1
- package/dist/app/shared/CommandMenu.js +11 -6
- package/dist/app/shared/CommandMenu.js.map +1 -1
- package/dist/app/sharing/ShareButton.d.ts.map +1 -1
- package/dist/app/sharing/ShareButton.js +9 -8
- package/dist/app/sharing/ShareButton.js.map +1 -1
- package/dist/chat-history/ChatHistoryList.d.ts +16 -3
- package/dist/chat-history/ChatHistoryList.d.ts.map +1 -1
- package/dist/chat-history/ChatHistoryList.js +25 -15
- package/dist/chat-history/ChatHistoryList.js.map +1 -1
- package/dist/chat-history.css +109 -9
- package/dist/composer/TiptapComposer.js +1 -1
- package/dist/composer/TiptapComposer.js.map +1 -1
- package/package.json +10 -3
- package/src/app/agent-page/AgentContextTab.spec.ts +50 -2
- package/src/app/agent-page/AgentContextTab.tsx +1 -0
- package/src/app/agentkit/react/components.interaction.spec.tsx +2 -0
- package/src/app/agentkit/react/components.spec.tsx +11 -6
- package/src/app/agentkit/react/components.tsx +3 -0
- package/src/app/agentkit/react/context.tsx +6 -0
- package/src/app/agentkit/react/data-chart-layout.ts +25 -0
- package/src/app/agentkit/react/index.ts +1 -0
- package/src/app/agentkit/react/root.tsx +4 -0
- package/src/app/agentkit/react/styles.css +31 -6
- package/src/app/agentkit/react/transcript-layout.ts +2 -0
- package/src/app/chat/AgentKitAssistantChat.spec.tsx +201 -27
- package/src/app/chat/AgentKitAssistantChat.tsx +3 -0
- package/src/app/chat/AgentPanel.tsx +8 -8
- package/src/app/chat/MultiTabAssistantChat.spec.tsx +270 -3
- package/src/app/chat/MultiTabAssistantChat.tsx +81 -158
- package/src/app/chat/agentkit-chat/action-widget.spec.tsx +62 -0
- package/src/app/chat/agentkit-chat/action-widget.tsx +4 -0
- package/src/app/chat/agentkit-chat/rail.ts +11 -0
- package/src/app/chat/chat/index.ts +10 -0
- package/src/app/chat/chat/surface-types.ts +3 -0
- package/src/app/chat/chat/tool-call-display.spec.tsx +29 -0
- package/src/app/chat/chat/tool-call-display.tsx +17 -1
- package/src/app/chat/chat/tool-render-registry.tsx +5 -0
- package/src/app/chat/chat/widgets/DataChartRenderer.spec.tsx +377 -17
- package/src/app/chat/chat/widgets/DataChartRenderer.tsx +232 -63
- package/src/app/chat/chat/widgets/DataChartWidget.spec.tsx +67 -0
- package/src/app/chat/chat/widgets/DataChartWidget.tsx +39 -5
- package/src/app/chat/chat/widgets/DataInsightsWidget.tsx +13 -2
- package/src/app/chat/chat/widgets/DataWidgetDisplayControls.tsx +6 -4
- package/src/app/chat/chat/widgets/builtin-tool-renderers.tsx +5 -1
- package/src/app/chat/chat-first/chat-history.spec.tsx +79 -0
- package/src/app/chat/chat-first/chat-history.tsx +75 -22
- package/src/app/chat/conversation/AgentConversation.spec.tsx +51 -1
- package/src/app/chat/conversation/AgentConversation.tsx +11 -2
- package/src/app/chat/ownership-history/ChatOwnerAvatar.tsx +27 -0
- package/src/app/chat/ownership-history/index.tsx +67 -0
- package/src/app/chat/ownership-history/ownership-history.spec.tsx +3146 -0
- package/src/app/chat/ownership-history/rows.ts +156 -0
- package/src/app/chat/ownership-history/useOwnershipChatHistory.ts +709 -0
- package/src/app/i18n/catalogs/ar-SA.ts +3 -0
- package/src/app/i18n/catalogs/de-DE.ts +3 -0
- package/src/app/i18n/catalogs/en-US.ts +3 -0
- package/src/app/i18n/catalogs/es-ES.ts +3 -0
- package/src/app/i18n/catalogs/fr-FR.ts +3 -0
- package/src/app/i18n/catalogs/hi-IN.ts +3 -0
- package/src/app/i18n/catalogs/ja-JP.ts +3 -0
- package/src/app/i18n/catalogs/ko-KR.ts +3 -0
- package/src/app/i18n/catalogs/pt-BR.ts +3 -0
- package/src/app/i18n/catalogs/zh-CN.ts +3 -0
- package/src/app/i18n/catalogs/zh-TW.ts +3 -0
- package/src/app/shared/CommandMenu.spec.tsx +175 -6
- package/src/app/shared/CommandMenu.tsx +24 -7
- package/src/app/sharing/ShareButton.tsx +12 -10
- package/src/chat-history/ChatHistoryList.spec.tsx +51 -0
- package/src/chat-history/ChatHistoryList.tsx +87 -26
- package/src/chat-history/ChatHistoryRailSections.spec.tsx +12 -4
- package/src/chat-history.css +109 -9
- package/src/composer/TiptapComposer.tsx +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
2
2
|
import {
|
|
3
3
|
IconDots,
|
|
4
|
+
IconLink,
|
|
4
5
|
IconPencil,
|
|
5
6
|
IconPinned,
|
|
6
7
|
IconPinnedOff,
|
|
@@ -9,7 +10,7 @@ import {
|
|
|
9
10
|
} from "@tabler/icons-react";
|
|
10
11
|
import React, { useMemo, useRef, useState } from "react";
|
|
11
12
|
|
|
12
|
-
import { Skeleton } from "../design-system/components.js";
|
|
13
|
+
import { Skeleton, Tooltip } from "../design-system/components.js";
|
|
13
14
|
import { cn } from "../utils.js";
|
|
14
15
|
|
|
15
16
|
/** How the viewer got access to a chat; the app supplies the translated copy. */
|
|
@@ -25,7 +26,12 @@ export interface ChatHistoryItem {
|
|
|
25
26
|
titleText?: string;
|
|
26
27
|
subtitle?: React.ReactNode;
|
|
27
28
|
detail?: React.ReactNode;
|
|
28
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* A shared row's owner mark, kept on one line beside the timestamp. Hovering
|
|
31
|
+
* it shows `ownerLabel` and `accessLabel`, which also head the row menu.
|
|
32
|
+
*/
|
|
33
|
+
ownerAvatar?: React.ReactNode;
|
|
34
|
+
/** Already-translated owner name for a shared row. */
|
|
29
35
|
ownerLabel?: React.ReactNode;
|
|
30
36
|
/** Already-translated access description, e.g. "Shared with you". */
|
|
31
37
|
accessLabel?: React.ReactNode;
|
|
@@ -33,9 +39,14 @@ export interface ChatHistoryItem {
|
|
|
33
39
|
timestamp?: React.ReactNode;
|
|
34
40
|
pinned?: boolean;
|
|
35
41
|
disabled?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The viewer can open the chat but not rename, pin or delete it, e.g. a chat
|
|
44
|
+
* someone shared. The menu keeps the owner header and Copy link.
|
|
45
|
+
*/
|
|
46
|
+
readOnly?: boolean;
|
|
36
47
|
/**
|
|
37
48
|
* Presentation only: drops the row menu and context menu while the row stays
|
|
38
|
-
* selectable.
|
|
49
|
+
* selectable, e.g. for a draft that has not been saved yet.
|
|
39
50
|
*/
|
|
40
51
|
hideActions?: boolean;
|
|
41
52
|
}
|
|
@@ -59,6 +70,7 @@ export interface ChatHistoryListLabels {
|
|
|
59
70
|
rename: string;
|
|
60
71
|
pin: string;
|
|
61
72
|
unpin: string;
|
|
73
|
+
copyLink: string;
|
|
62
74
|
delete: string;
|
|
63
75
|
}
|
|
64
76
|
|
|
@@ -72,6 +84,8 @@ export interface ChatHistoryListProps {
|
|
|
72
84
|
onRename?: (id: string, nextTitle: string) => void;
|
|
73
85
|
renameMaxLength?: number;
|
|
74
86
|
onDelete?: (id: string) => void;
|
|
87
|
+
/** Shown on every row, read-only ones included. */
|
|
88
|
+
onCopyLink?: (id: string) => void;
|
|
75
89
|
renderRowActions?: (item: ChatHistoryItem) => React.ReactNode;
|
|
76
90
|
renderAdditionalRowActions?: (
|
|
77
91
|
item: ChatHistoryItem,
|
|
@@ -104,6 +118,7 @@ const DEFAULT_LABELS: ChatHistoryListLabels = {
|
|
|
104
118
|
rename: "Rename",
|
|
105
119
|
pin: "Pin to top",
|
|
106
120
|
unpin: "Unpin from top",
|
|
121
|
+
copyLink: "Copy link",
|
|
107
122
|
delete: "Delete",
|
|
108
123
|
};
|
|
109
124
|
|
|
@@ -117,6 +132,7 @@ export function ChatHistoryList({
|
|
|
117
132
|
onRename,
|
|
118
133
|
renameMaxLength,
|
|
119
134
|
onDelete,
|
|
135
|
+
onCopyLink,
|
|
120
136
|
renderRowActions,
|
|
121
137
|
renderAdditionalRowActions,
|
|
122
138
|
searchValue,
|
|
@@ -141,9 +157,11 @@ export function ChatHistoryList({
|
|
|
141
157
|
rename: labels?.rename ?? DEFAULT_LABELS.rename,
|
|
142
158
|
pin: labels?.pin ?? DEFAULT_LABELS.pin,
|
|
143
159
|
unpin: labels?.unpin ?? DEFAULT_LABELS.unpin,
|
|
160
|
+
copyLink: labels?.copyLink ?? DEFAULT_LABELS.copyLink,
|
|
144
161
|
delete: labels?.delete ?? DEFAULT_LABELS.delete,
|
|
145
162
|
}),
|
|
146
163
|
[
|
|
164
|
+
labels?.copyLink,
|
|
147
165
|
labels?.delete,
|
|
148
166
|
labels?.options,
|
|
149
167
|
labels?.pin,
|
|
@@ -252,6 +270,7 @@ export function ChatHistoryList({
|
|
|
252
270
|
onRename={onRename}
|
|
253
271
|
renameMaxLength={renameMaxLength}
|
|
254
272
|
onDelete={onDelete}
|
|
273
|
+
onCopyLink={onCopyLink}
|
|
255
274
|
renderRowActions={renderRowActions}
|
|
256
275
|
renderAdditionalRowActions={renderAdditionalRowActions}
|
|
257
276
|
labels={resolvedLabels}
|
|
@@ -289,6 +308,7 @@ type ChatHistoryRowProps = {
|
|
|
289
308
|
onRename?: (id: string, nextTitle: string) => void;
|
|
290
309
|
renameMaxLength?: number;
|
|
291
310
|
onDelete?: (id: string) => void;
|
|
311
|
+
onCopyLink?: (id: string) => void;
|
|
292
312
|
renderRowActions?: (item: ChatHistoryItem) => React.ReactNode;
|
|
293
313
|
renderAdditionalRowActions?: (
|
|
294
314
|
item: ChatHistoryItem,
|
|
@@ -297,6 +317,21 @@ type ChatHistoryRowProps = {
|
|
|
297
317
|
labels: ChatHistoryListLabels;
|
|
298
318
|
};
|
|
299
319
|
|
|
320
|
+
function ChatHistoryOwnerSummary({ item }: { item: ChatHistoryItem }) {
|
|
321
|
+
return (
|
|
322
|
+
<span className="an-chat-history-owner">
|
|
323
|
+
{item.ownerLabel != null && (
|
|
324
|
+
<span className="an-chat-history-owner__name">{item.ownerLabel}</span>
|
|
325
|
+
)}
|
|
326
|
+
{item.accessLabel != null && (
|
|
327
|
+
<span className="an-chat-history-owner__access">
|
|
328
|
+
{item.accessLabel}
|
|
329
|
+
</span>
|
|
330
|
+
)}
|
|
331
|
+
</span>
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
|
|
300
335
|
const ChatHistoryRow = React.memo(function ChatHistoryRow({
|
|
301
336
|
item,
|
|
302
337
|
active,
|
|
@@ -306,6 +341,7 @@ const ChatHistoryRow = React.memo(function ChatHistoryRow({
|
|
|
306
341
|
onRename,
|
|
307
342
|
renameMaxLength,
|
|
308
343
|
onDelete,
|
|
344
|
+
onCopyLink,
|
|
309
345
|
renderRowActions,
|
|
310
346
|
renderAdditionalRowActions,
|
|
311
347
|
labels,
|
|
@@ -315,12 +351,13 @@ const ChatHistoryRow = React.memo(function ChatHistoryRow({
|
|
|
315
351
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
316
352
|
const renameInputRef = useRef<HTMLInputElement | null>(null);
|
|
317
353
|
|
|
354
|
+
const editable = !item.readOnly;
|
|
355
|
+
const hasOwner = item.ownerLabel != null || item.accessLabel != null;
|
|
318
356
|
const hasMenu =
|
|
319
357
|
!item.hideActions &&
|
|
320
358
|
Boolean(
|
|
321
|
-
onTogglePin ||
|
|
322
|
-
|
|
323
|
-
onDelete ||
|
|
359
|
+
(editable && (onTogglePin || onRename || onDelete)) ||
|
|
360
|
+
onCopyLink ||
|
|
324
361
|
renderRowActions ||
|
|
325
362
|
renderAdditionalRowActions,
|
|
326
363
|
);
|
|
@@ -402,6 +439,22 @@ const ChatHistoryRow = React.memo(function ChatHistoryRow({
|
|
|
402
439
|
>
|
|
403
440
|
<div className="an-chat-history-row__topline">
|
|
404
441
|
<span className="an-chat-history-row__title">{item.title}</span>
|
|
442
|
+
{item.ownerAvatar != null && (
|
|
443
|
+
<Tooltip
|
|
444
|
+
trigger={
|
|
445
|
+
<span
|
|
446
|
+
className="an-chat-history-row__owner-mark"
|
|
447
|
+
data-access-basis={item.accessBasis}
|
|
448
|
+
>
|
|
449
|
+
{item.ownerAvatar}
|
|
450
|
+
</span>
|
|
451
|
+
}
|
|
452
|
+
content={
|
|
453
|
+
hasOwner ? <ChatHistoryOwnerSummary item={item} /> : null
|
|
454
|
+
}
|
|
455
|
+
disabled={!hasOwner}
|
|
456
|
+
/>
|
|
457
|
+
)}
|
|
405
458
|
{item.timestamp != null && (
|
|
406
459
|
<span className="an-chat-history-row__timestamp">
|
|
407
460
|
{item.timestamp}
|
|
@@ -414,23 +467,6 @@ const ChatHistoryRow = React.memo(function ChatHistoryRow({
|
|
|
414
467
|
{item.detail != null && (
|
|
415
468
|
<div className="an-chat-history-row__detail">{item.detail}</div>
|
|
416
469
|
)}
|
|
417
|
-
{(item.ownerLabel != null || item.accessLabel != null) && (
|
|
418
|
-
<div
|
|
419
|
-
className="an-chat-history-row__access"
|
|
420
|
-
data-access-basis={item.accessBasis}
|
|
421
|
-
>
|
|
422
|
-
{item.ownerLabel != null && (
|
|
423
|
-
<span className="an-chat-history-row__owner">
|
|
424
|
-
{item.ownerLabel}
|
|
425
|
-
</span>
|
|
426
|
-
)}
|
|
427
|
-
{item.accessLabel != null && (
|
|
428
|
-
<span className="an-chat-history-row__access-label">
|
|
429
|
-
{item.accessLabel}
|
|
430
|
-
</span>
|
|
431
|
-
)}
|
|
432
|
-
</div>
|
|
433
|
-
)}
|
|
434
470
|
</button>
|
|
435
471
|
)}
|
|
436
472
|
|
|
@@ -463,11 +499,22 @@ const ChatHistoryRow = React.memo(function ChatHistoryRow({
|
|
|
463
499
|
side="bottom"
|
|
464
500
|
sideOffset={4}
|
|
465
501
|
>
|
|
502
|
+
{hasOwner && (
|
|
503
|
+
<div
|
|
504
|
+
className="an-chat-history-row__menu-owner"
|
|
505
|
+
data-access-basis={item.accessBasis}
|
|
506
|
+
>
|
|
507
|
+
{item.ownerAvatar != null && (
|
|
508
|
+
<span aria-hidden="true">{item.ownerAvatar}</span>
|
|
509
|
+
)}
|
|
510
|
+
<ChatHistoryOwnerSummary item={item} />
|
|
511
|
+
</div>
|
|
512
|
+
)}
|
|
466
513
|
{renderRowActions ? (
|
|
467
514
|
renderRowActions(item)
|
|
468
515
|
) : (
|
|
469
516
|
<>
|
|
470
|
-
{onRename && (
|
|
517
|
+
{editable && onRename && (
|
|
471
518
|
<button
|
|
472
519
|
type="button"
|
|
473
520
|
role="menuitem"
|
|
@@ -478,7 +525,7 @@ const ChatHistoryRow = React.memo(function ChatHistoryRow({
|
|
|
478
525
|
<span>{labels.rename}</span>
|
|
479
526
|
</button>
|
|
480
527
|
)}
|
|
481
|
-
{onTogglePin && (
|
|
528
|
+
{editable && onTogglePin && (
|
|
482
529
|
<button
|
|
483
530
|
type="button"
|
|
484
531
|
role="menuitem"
|
|
@@ -496,10 +543,24 @@ const ChatHistoryRow = React.memo(function ChatHistoryRow({
|
|
|
496
543
|
<span>{item.pinned ? labels.unpin : labels.pin}</span>
|
|
497
544
|
</button>
|
|
498
545
|
)}
|
|
546
|
+
{onCopyLink && (
|
|
547
|
+
<button
|
|
548
|
+
type="button"
|
|
549
|
+
role="menuitem"
|
|
550
|
+
className="an-chat-history-row__menu-item"
|
|
551
|
+
onClick={() => {
|
|
552
|
+
setMenuOpen(false);
|
|
553
|
+
onCopyLink(item.id);
|
|
554
|
+
}}
|
|
555
|
+
>
|
|
556
|
+
<IconLink size={13} strokeWidth={1.8} />
|
|
557
|
+
<span>{labels.copyLink}</span>
|
|
558
|
+
</button>
|
|
559
|
+
)}
|
|
499
560
|
{renderAdditionalRowActions?.(item, () =>
|
|
500
561
|
setMenuOpen(false),
|
|
501
562
|
)}
|
|
502
|
-
{onDelete && (
|
|
563
|
+
{editable && onDelete && (
|
|
503
564
|
<button
|
|
504
565
|
type="button"
|
|
505
566
|
role="menuitem"
|
|
@@ -273,7 +273,7 @@ describe("ChatHistoryRail sections", () => {
|
|
|
273
273
|
expect(onLoadMore).toHaveBeenCalledOnce();
|
|
274
274
|
});
|
|
275
275
|
|
|
276
|
-
it("
|
|
276
|
+
it("keeps a shared row on one line with the owner mark", () => {
|
|
277
277
|
renderRail([
|
|
278
278
|
{
|
|
279
279
|
id: "shared",
|
|
@@ -281,16 +281,24 @@ describe("ChatHistoryRail sections", () => {
|
|
|
281
281
|
{
|
|
282
282
|
id: "s1",
|
|
283
283
|
title: "Roadmap",
|
|
284
|
+
ownerAvatar: <span>P</span>,
|
|
284
285
|
ownerLabel: "Pat Lee",
|
|
285
286
|
accessLabel: "Shared with your organization",
|
|
286
287
|
accessBasis: "organization",
|
|
288
|
+
readOnly: true,
|
|
287
289
|
},
|
|
288
290
|
],
|
|
289
291
|
},
|
|
290
292
|
]);
|
|
291
|
-
const
|
|
292
|
-
expect(
|
|
293
|
-
|
|
293
|
+
const row = container.querySelector(".an-chat-history-row")!;
|
|
294
|
+
expect(
|
|
295
|
+
row
|
|
296
|
+
.querySelector(".an-chat-history-row__owner-mark")
|
|
297
|
+
?.getAttribute("data-access-basis"),
|
|
298
|
+
).toBe("organization");
|
|
299
|
+
expect(row.querySelector(".an-chat-history-row__button")?.textContent).toBe(
|
|
300
|
+
"RoadmapP",
|
|
301
|
+
);
|
|
294
302
|
});
|
|
295
303
|
|
|
296
304
|
it("selecting a section row and New chat work as in the flat rail", () => {
|
package/src/chat-history.css
CHANGED
|
@@ -46,6 +46,11 @@
|
|
|
46
46
|
min-height: 0;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/* A rail inside a popover, such as All chats, scrolls instead of growing. */
|
|
50
|
+
.an-chat-history--rail.an-chat-history--capped .an-chat-history__list {
|
|
51
|
+
max-height: 16rem;
|
|
52
|
+
}
|
|
53
|
+
|
|
49
54
|
.an-chat-history-rail .an-chat-history__state:empty {
|
|
50
55
|
display: none;
|
|
51
56
|
}
|
|
@@ -71,19 +76,60 @@
|
|
|
71
76
|
padding: 0 4px;
|
|
72
77
|
}
|
|
73
78
|
|
|
74
|
-
.an-chat-history-
|
|
79
|
+
.an-chat-history-row__owner-mark {
|
|
80
|
+
display: inline-flex;
|
|
81
|
+
flex-shrink: 0;
|
|
82
|
+
align-self: center;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* The active row has no timestamp; keep its avatar clear of the ⋯ trigger. */
|
|
86
|
+
.an-chat-history--rail
|
|
87
|
+
.an-chat-history-row--has-menu
|
|
88
|
+
.an-chat-history-row__owner-mark:last-child {
|
|
89
|
+
margin-inline-end: 18px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.an-chat-owner-avatar {
|
|
93
|
+
display: inline-flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
flex-shrink: 0;
|
|
97
|
+
width: 16px;
|
|
98
|
+
height: 16px;
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
border-radius: 9999px;
|
|
101
|
+
background: hsl(var(--muted));
|
|
102
|
+
/* guard:allow-raw-color — the initial sits on an emailToColor badge in both themes */
|
|
103
|
+
color: #fff;
|
|
104
|
+
font-size: 8px;
|
|
105
|
+
font-weight: 600;
|
|
106
|
+
line-height: 1;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.an-chat-owner-avatar__image {
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 100%;
|
|
112
|
+
object-fit: cover;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.an-chat-history-owner {
|
|
75
116
|
display: flex;
|
|
76
|
-
|
|
117
|
+
flex-direction: column;
|
|
118
|
+
gap: 1px;
|
|
77
119
|
min-width: 0;
|
|
78
|
-
|
|
79
|
-
font-size: 10px;
|
|
80
|
-
color: hsl(var(--muted-foreground) / 0.7);
|
|
120
|
+
text-align: start;
|
|
81
121
|
}
|
|
82
122
|
|
|
83
|
-
.an-chat-history-
|
|
123
|
+
.an-chat-history-owner__name {
|
|
124
|
+
min-width: 0;
|
|
84
125
|
overflow: hidden;
|
|
85
126
|
text-overflow: ellipsis;
|
|
86
127
|
white-space: nowrap;
|
|
128
|
+
font-weight: 500;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.an-chat-history-owner__access {
|
|
132
|
+
color: hsl(var(--muted-foreground));
|
|
87
133
|
}
|
|
88
134
|
|
|
89
135
|
.an-chat-history__state--error {
|
|
@@ -149,7 +195,10 @@
|
|
|
149
195
|
}
|
|
150
196
|
|
|
151
197
|
.an-chat-history-rail__disclosure,
|
|
152
|
-
.an-chat-history-rail__new-chat
|
|
198
|
+
.an-chat-history-rail__new-chat,
|
|
199
|
+
.an-chat-history-rail__section-toggle,
|
|
200
|
+
.an-chat-history-rail__load-more,
|
|
201
|
+
.an-chat-history-rail__retry {
|
|
153
202
|
display: flex;
|
|
154
203
|
align-items: center;
|
|
155
204
|
border: 0;
|
|
@@ -160,17 +209,52 @@
|
|
|
160
209
|
}
|
|
161
210
|
|
|
162
211
|
.an-chat-history-rail__disclosure:hover,
|
|
163
|
-
.an-chat-history-rail__new-chat:hover
|
|
212
|
+
.an-chat-history-rail__new-chat:hover,
|
|
213
|
+
.an-chat-history-rail__section-toggle:hover,
|
|
214
|
+
.an-chat-history-rail__load-more:hover,
|
|
215
|
+
.an-chat-history-rail__retry:hover {
|
|
164
216
|
background: hsl(var(--accent) / 0.5);
|
|
165
217
|
color: hsl(var(--accent-foreground));
|
|
166
218
|
}
|
|
167
219
|
|
|
168
220
|
.an-chat-history-rail__disclosure:focus-visible,
|
|
169
|
-
.an-chat-history-rail__new-chat:focus-visible
|
|
221
|
+
.an-chat-history-rail__new-chat:focus-visible,
|
|
222
|
+
.an-chat-history-rail__section-toggle:focus-visible,
|
|
223
|
+
.an-chat-history-rail__load-more:focus-visible,
|
|
224
|
+
.an-chat-history-rail__retry:focus-visible {
|
|
170
225
|
outline: 2px solid hsl(var(--ring));
|
|
171
226
|
outline-offset: -2px;
|
|
172
227
|
}
|
|
173
228
|
|
|
229
|
+
/* Show all, Load more and Retry match New chat: 12px muted text, not a button. */
|
|
230
|
+
.an-chat-history-rail__section-toggle,
|
|
231
|
+
.an-chat-history-rail__load-more,
|
|
232
|
+
.an-chat-history-rail__retry {
|
|
233
|
+
flex: 0 0 auto;
|
|
234
|
+
gap: 4px;
|
|
235
|
+
height: auto;
|
|
236
|
+
min-height: 26px;
|
|
237
|
+
padding: 4px 10px;
|
|
238
|
+
font-size: 12px;
|
|
239
|
+
font-weight: 500;
|
|
240
|
+
line-height: 1.4;
|
|
241
|
+
box-shadow: none;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.an-chat-history-rail__section-toggle svg,
|
|
245
|
+
.an-chat-history-rail__load-more svg,
|
|
246
|
+
.an-chat-history-rail__retry svg {
|
|
247
|
+
width: 13px;
|
|
248
|
+
height: 13px;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.an-chat-history__state .an-chat-history-rail__retry {
|
|
252
|
+
display: inline-flex;
|
|
253
|
+
min-height: 22px;
|
|
254
|
+
margin-inline-start: 4px;
|
|
255
|
+
padding: 2px 6px;
|
|
256
|
+
}
|
|
257
|
+
|
|
174
258
|
.an-chat-history-rail__disclosure {
|
|
175
259
|
justify-content: center;
|
|
176
260
|
flex: 0 0 auto;
|
|
@@ -267,6 +351,7 @@
|
|
|
267
351
|
|
|
268
352
|
.an-chat-history-row__title {
|
|
269
353
|
min-width: 0;
|
|
354
|
+
margin-inline-end: auto;
|
|
270
355
|
overflow: hidden;
|
|
271
356
|
text-overflow: ellipsis;
|
|
272
357
|
white-space: nowrap;
|
|
@@ -435,6 +520,21 @@
|
|
|
435
520
|
box-shadow: var(--agent-kit-overlay-elevation);
|
|
436
521
|
}
|
|
437
522
|
|
|
523
|
+
.an-chat-history-row__menu-owner {
|
|
524
|
+
display: flex;
|
|
525
|
+
align-items: center;
|
|
526
|
+
gap: 8px;
|
|
527
|
+
max-width: 260px;
|
|
528
|
+
margin-bottom: 4px;
|
|
529
|
+
padding: 6px 8px 8px;
|
|
530
|
+
border-bottom: 1px solid hsl(var(--border));
|
|
531
|
+
font-size: 12px;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.an-chat-history-row__menu-owner .an-chat-history-owner__access {
|
|
535
|
+
font-size: 11px;
|
|
536
|
+
}
|
|
537
|
+
|
|
438
538
|
.an-chat-history-row__menu-item {
|
|
439
539
|
display: flex;
|
|
440
540
|
align-items: center;
|
|
@@ -2207,7 +2207,7 @@ function ModelSelector({
|
|
|
2207
2207
|
? `. Agent: ${selectedAgentLabel}`
|
|
2208
2208
|
: ""
|
|
2209
2209
|
}`}
|
|
2210
|
-
className="agent-composer-model-button flex min-w-0 max-w-none shrink
|
|
2210
|
+
className="agent-composer-model-button flex min-w-0 max-w-none shrink items-center gap-1 overflow-hidden rounded-md px-2 py-1 text-[12px] font-medium text-muted-foreground hover:bg-accent/50 hover:text-foreground"
|
|
2211
2211
|
>
|
|
2212
2212
|
<span className="min-w-0 truncate">
|
|
2213
2213
|
{selectedAgentOption?.icon ? (
|