@theia/ai-ide 1.74.0-next.38 → 1.74.0-next.44
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/lib/browser/chat-session-item.d.ts +15 -0
- package/lib/browser/chat-session-item.d.ts.map +1 -1
- package/lib/browser/chat-session-item.js +34 -13
- package/lib/browser/chat-session-item.js.map +1 -1
- package/lib/browser/chat-session-tooltip.d.ts +2 -2
- package/lib/browser/chat-session-tooltip.d.ts.map +1 -1
- package/lib/browser/chat-session-tooltip.js +19 -4
- package/lib/browser/chat-session-tooltip.js.map +1 -1
- package/lib/browser/chat-sessions-welcome-message-provider.d.ts +31 -1
- package/lib/browser/chat-sessions-welcome-message-provider.d.ts.map +1 -1
- package/lib/browser/chat-sessions-welcome-message-provider.js +131 -17
- package/lib/browser/chat-sessions-welcome-message-provider.js.map +1 -1
- package/lib/browser/chat-sessions-welcome-message-provider.spec.js +92 -0
- package/lib/browser/chat-sessions-welcome-message-provider.spec.js.map +1 -1
- package/package.json +23 -23
- package/src/browser/chat-session-item.tsx +76 -21
- package/src/browser/chat-session-tooltip.ts +17 -4
- package/src/browser/chat-sessions-welcome-message-provider.spec.ts +105 -1
- package/src/browser/chat-sessions-welcome-message-provider.tsx +170 -31
- package/src/browser/style/index.css +56 -3
|
@@ -23,6 +23,21 @@ export interface ChatSessionItemProps {
|
|
|
23
23
|
actions?: ChatSessionItemAction[];
|
|
24
24
|
/** Invoked when an action is triggered, with the action and this item's session. */
|
|
25
25
|
onAction?: (action: ChatSessionItemAction, session: ChatSessionMetadata) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Whether this session has child sessions. The children themselves are rendered separately by
|
|
28
|
+
* the parent list; this only drives the expand/collapse toggle.
|
|
29
|
+
*/
|
|
30
|
+
hasChildSessions?: boolean;
|
|
31
|
+
/** Whether this item is a child of a parent session. */
|
|
32
|
+
isChildSession?: boolean;
|
|
33
|
+
/** Depth level for indentation. */
|
|
34
|
+
depth?: number;
|
|
35
|
+
/** Whether the parent session is expanded. */
|
|
36
|
+
isExpanded?: boolean;
|
|
37
|
+
/** Whether any descendant session needs user action; shows a warning badge on this row. */
|
|
38
|
+
descendantNeedsAttention?: boolean;
|
|
39
|
+
/** Called when the user toggles the expand/collapse state. */
|
|
40
|
+
onToggleExpand?: () => void;
|
|
26
41
|
}
|
|
27
42
|
export interface ChatSessionItemComponentProps extends ChatSessionItemProps {
|
|
28
43
|
formatTimeAgo: (date: number) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-session-item.d.ts","sourceRoot":"","sources":["../../src/browser/chat-session-item.tsx"],"names":[],"mappings":"AAgBA,OAAO,EACH,gBAAgB,EAAE,WAAW,EAAe,mBAAmB,EAClE,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAwB,KAAK,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAgC,YAAY,EAAmB,MAAM,yBAAyB,CAAC;AACtG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAEhG,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAGhF,+EAA+E;AAC/E,MAAM,WAAW,mBAAmB;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACrC,QAAQ,CAAC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,mBAAmB,CAAC;IAC7B,uGAAuG;IACvG,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,WAAW,EAAE,mBAAmB,CAAC;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,0FAA0F;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OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,wDAAwD;IACxD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,2FAA2F;IAC3F,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,8DAA8D;IAC9D,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AA0CD,MAAM,WAAW,6BAA8B,SAAQ,oBAAoB;IACvE,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAC3C;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,6BAA6B,GAAG,KAAK,CAAC,YAAY,CA0MxF"}
|
|
@@ -55,7 +55,8 @@ function useTimeAgo(date, formatter) {
|
|
|
55
55
|
return formatter(date);
|
|
56
56
|
}
|
|
57
57
|
function ChatSessionItem(props) {
|
|
58
|
-
const { session, isRestored, chatService, chatAgentService, hoverService, markdownRenderer, unreadState, onClick, actions, onAction, formatTimeAgo } = props;
|
|
58
|
+
const { session, isRestored, chatService, chatAgentService, hoverService, markdownRenderer, unreadState, onClick, actions, onAction, formatTimeAgo, hasChildSessions, isChildSession, depth, isExpanded, descendantNeedsAttention, onToggleExpand } = props;
|
|
59
|
+
const currentDepth = depth ?? 0;
|
|
59
60
|
// eslint-disable-next-line no-null/no-null
|
|
60
61
|
const itemRef = React.useRef(null);
|
|
61
62
|
const hoverActiveRef = React.useRef(false);
|
|
@@ -111,8 +112,8 @@ function ChatSessionItem(props) {
|
|
|
111
112
|
// once the session is actually opened.
|
|
112
113
|
const loadedSession = chatService.getSession(session.sessionId);
|
|
113
114
|
const tooltip = loadedSession
|
|
114
|
-
? (0, chat_session_tooltip_1.buildSessionTooltip)(loadedSession, session, chatAgentService, markdownRenderer, hasUnread)
|
|
115
|
-
: (0, chat_session_tooltip_1.buildRestoredSessionTooltip)(session, chatAgentService);
|
|
115
|
+
? (0, chat_session_tooltip_1.buildSessionTooltip)(loadedSession, session, chatAgentService, markdownRenderer, hasUnread, descendantNeedsAttention)
|
|
116
|
+
: (0, chat_session_tooltip_1.buildRestoredSessionTooltip)(session, chatAgentService, descendantNeedsAttention);
|
|
116
117
|
// The tooltip may hold a markdown render result; dispose it once the hover is torn down
|
|
117
118
|
// (or right away if we no longer intend to show it).
|
|
118
119
|
if (!hoverActiveRef.current) {
|
|
@@ -120,7 +121,7 @@ function ChatSessionItem(props) {
|
|
|
120
121
|
return;
|
|
121
122
|
}
|
|
122
123
|
hoverService.requestHover({ content: tooltip.element, target, position: 'left', onHide: () => tooltip.dispose() });
|
|
123
|
-
}, [session, chatService, chatAgentService, hoverService, markdownRenderer, hasUnread]);
|
|
124
|
+
}, [session, chatService, chatAgentService, hoverService, markdownRenderer, hasUnread, descendantNeedsAttention]);
|
|
124
125
|
React.useEffect(() => () => { hoverActiveRef.current = false; }, []);
|
|
125
126
|
const handleMouseLeave = React.useCallback(() => {
|
|
126
127
|
hoverActiveRef.current = false;
|
|
@@ -142,14 +143,20 @@ function ChatSessionItem(props) {
|
|
|
142
143
|
// so the waiting state takes precedence over the generic working spinner: it signals that the
|
|
143
144
|
// user, not the agent, needs to act.
|
|
144
145
|
const isWorking = status !== undefined && ai_chat_1.ChatSessionStatus.isInProgress(status);
|
|
145
|
-
const
|
|
146
|
+
const ownWaitingForInput = status !== undefined && ai_chat_1.ChatSessionStatus.requiresUserAction(status);
|
|
147
|
+
// A row whose (possibly nested) delegated child needs action shows the same bell + dot as a row
|
|
148
|
+
// that needs action itself, so the signal is consistent and stands out even when collapsed.
|
|
149
|
+
const isWaitingForInput = ownWaitingForInput || descendantNeedsAttention === true;
|
|
146
150
|
const showWorking = isWorking && !isWaitingForInput;
|
|
147
|
-
const showUnread = hasUnread && !isWorking && !hasError;
|
|
148
|
-
const attentionLabel =
|
|
149
|
-
?
|
|
150
|
-
|
|
151
|
+
const showUnread = hasUnread && !isWorking && !hasError && !isWaitingForInput;
|
|
152
|
+
const attentionLabel = ownWaitingForInput
|
|
153
|
+
? (status === 'awaitingApproval'
|
|
154
|
+
? nls_1.nls.localize('theia/ai/ide/requiresApproval', 'Requires your approval')
|
|
155
|
+
: nls_1.nls.localize('theia/ai/ide/waitingForInput', 'Waiting for your input'))
|
|
156
|
+
: nls_1.nls.localize('theia/ai/ide/childInteractionNeeded', 'A delegated session needs your attention');
|
|
151
157
|
const itemClasses = [
|
|
152
158
|
'theia-chat-session-item',
|
|
159
|
+
isChildSession && 'theia-chat-session-item-child',
|
|
153
160
|
isWaitingForInput && 'theia-chat-session-item-attention',
|
|
154
161
|
showWorking && 'theia-chat-session-item-working',
|
|
155
162
|
hasError && !isWorking && 'theia-chat-session-item-error',
|
|
@@ -160,11 +167,25 @@ function ChatSessionItem(props) {
|
|
|
160
167
|
: showWorking
|
|
161
168
|
? `${(0, browser_1.codicon)('loading')} theia-animation-spin`
|
|
162
169
|
: agentIcon;
|
|
163
|
-
return (React.createElement("div", { ref: itemRef, className: itemClasses, role: "button", tabIndex: 0, onClick: onClick, onKeyDown: handleKeyDown, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onMouseOver: handleMouseOver },
|
|
170
|
+
return (React.createElement("div", { ref: itemRef, className: itemClasses, role: "button", tabIndex: 0, style: { '--tree-indent': `${currentDepth * 12}px` }, onClick: onClick, onKeyDown: handleKeyDown, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onMouseOver: handleMouseOver },
|
|
164
171
|
React.createElement("div", { className: "theia-chat-session-item-icon-col" },
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
172
|
+
hasChildSessions ? (React.createElement("span", { className: "theia-chat-session-item-expand-icon", onClick: e => {
|
|
173
|
+
e.stopPropagation();
|
|
174
|
+
onToggleExpand?.();
|
|
175
|
+
}, onKeyDown: e => {
|
|
176
|
+
if ((0, browser_1.isActivationKey)(e)) {
|
|
177
|
+
e.preventDefault();
|
|
178
|
+
e.stopPropagation();
|
|
179
|
+
onToggleExpand?.();
|
|
180
|
+
}
|
|
181
|
+
}, onMouseDown: e => e.preventDefault(), role: "button", tabIndex: 0, "aria-expanded": isExpanded, "aria-label": isExpanded
|
|
182
|
+
? nls_1.nls.localize('theia/ai/ide/collapseSession', 'Collapse {0}', title)
|
|
183
|
+
: nls_1.nls.localize('theia/ai/ide/expandSession', 'Expand {0}', title) },
|
|
184
|
+
React.createElement("span", { className: `codicon ${isExpanded ? 'codicon-chevron-down' : 'codicon-chevron-right'}` }))) : (React.createElement("span", { className: "theia-chat-session-item-expand-icon theia-chat-session-item-expand-placeholder", "aria-hidden": "true" })),
|
|
185
|
+
React.createElement("span", { className: "theia-chat-session-item-status-icon" },
|
|
186
|
+
isRestored && !isWaitingForInput ? (React.createElement("span", { className: `${(0, browser_1.codicon)('archive')} theia-chat-session-item-archive-icon`, title: nls_1.nls.localize('theia/ai/ide/restoredSession', 'Restored session') })) : (React.createElement("span", { className: `theia-chat-session-item-agent-icon ${iconClass}`, title: isWaitingForInput ? attentionLabel : undefined })),
|
|
187
|
+
showUnread && (React.createElement("span", { className: "theia-chat-session-item-unread-dot", "aria-label": nls_1.nls.localize('theia/ai/ide/tooltip/unread', 'Unread') })),
|
|
188
|
+
isWaitingForInput && (React.createElement("span", { className: "theia-chat-session-item-attention-dot", "aria-label": attentionLabel })))),
|
|
168
189
|
React.createElement("div", { className: "theia-chat-session-item-content" },
|
|
169
190
|
React.createElement("div", { className: "theia-chat-session-item-title-line" },
|
|
170
191
|
React.createElement("span", { className: "theia-chat-session-item-title", title: title }, title)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-session-item.js","sourceRoot":"","sources":["../../src/browser/chat-session-item.tsx"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,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vC,cAAc,GAAI,CACrC,CACE,CACL;QACN,6BAAK,SAAS,EAAC,iCAAiC;YAC5C,6BAAK,SAAS,EAAC,oCAAoC;gBAC/C,8BAAM,SAAS,EAAC,+BAA+B,EAAC,KAAK,EAAE,KAAK,IAAG,KAAK,CAAQ,CAC1E;YACN,6BAAK,SAAS,EAAC,kCAAkC,IAAE,QAAQ,CAAO,CAChE;QACL,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,IAAI,CAC1C,6BAAK,SAAS,EAAC,iCAAiC,IAC3C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CACnB,gCAAQ,GAAG,EAAE,MAAM,CAAC,SAAS,EACzB,SAAS,EAAE,kCAAkC,MAAM,CAAC,SAAS,EAAE,EAC/D,KAAK,EAAE,MAAM,CAAC,OAAO,IAAI,EAAE,KACvB,IAAA,6BAAmB,EAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,EAC7C,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,GAAI,CAC5E,CAAC,CACA,CACT,CACC,CACT,CAAC;AACN,CAAC"}
|
|
@@ -8,10 +8,10 @@ import { Disposable } from '@theia/core';
|
|
|
8
8
|
export interface SessionTooltip extends Disposable {
|
|
9
9
|
element: HTMLElement;
|
|
10
10
|
}
|
|
11
|
-
export declare function buildSessionTooltip(session: ChatSession, metadata: ChatSessionMetadata, agentService: ChatAgentService, markdownRenderer: MarkdownRenderer, isUnread: boolean): SessionTooltip;
|
|
11
|
+
export declare function buildSessionTooltip(session: ChatSession, metadata: ChatSessionMetadata, agentService: ChatAgentService, markdownRenderer: MarkdownRenderer, isUnread: boolean, descendantNeedsAttention?: boolean): SessionTooltip;
|
|
12
12
|
/**
|
|
13
13
|
* Build a tooltip for a session that hasn't been loaded yet (i.e. a restored / persisted entry
|
|
14
14
|
* shown on the home view). Avoids any restore I/O so hover does not promote the item to Active.
|
|
15
15
|
*/
|
|
16
|
-
export declare function buildRestoredSessionTooltip(metadata: ChatSessionMetadata, agentService: ChatAgentService): SessionTooltip;
|
|
16
|
+
export declare function buildRestoredSessionTooltip(metadata: ChatSessionMetadata, agentService: ChatAgentService, descendantNeedsAttention?: boolean): SessionTooltip;
|
|
17
17
|
//# sourceMappingURL=chat-session-tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-session-tooltip.d.ts","sourceRoot":"","sources":["../../src/browser/chat-session-tooltip.ts"],"names":[],"mappings":"AAgBA,OAAO,EACH,gBAAgB,EAAyC,WAAW,EAAE,mBAAmB,EAE5F,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAEhG,OAAO,EAAE,UAAU,EAAwB,MAAM,aAAa,CAAC;AAK/D;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,UAAU;IAC9C,OAAO,EAAE,WAAW,CAAC;CACxB;AAuDD,wBAAgB,mBAAmB,CAC/B,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,mBAAmB,EACnD,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAClE,QAAQ,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"chat-session-tooltip.d.ts","sourceRoot":"","sources":["../../src/browser/chat-session-tooltip.ts"],"names":[],"mappings":"AAgBA,OAAO,EACH,gBAAgB,EAAyC,WAAW,EAAE,mBAAmB,EAE5F,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAEhG,OAAO,EAAE,UAAU,EAAwB,MAAM,aAAa,CAAC;AAK/D;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,UAAU;IAC9C,OAAO,EAAE,WAAW,CAAC;CACxB;AAuDD,wBAAgB,mBAAmB,CAC/B,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,mBAAmB,EACnD,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAClE,QAAQ,EAAE,OAAO,EAAE,wBAAwB,GAAE,OAAe,GAC7D,cAAc,CA0GhB;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACvC,QAAQ,EAAE,mBAAmB,EAAE,YAAY,EAAE,gBAAgB,EAAE,wBAAwB,GAAE,OAAe,GACzG,cAAc,CA6BhB"}
|
|
@@ -71,7 +71,7 @@ function addDefinitionEntry(definitionList, term, detail) {
|
|
|
71
71
|
detailElement.textContent = detail;
|
|
72
72
|
definitionList.appendChild(detailElement);
|
|
73
73
|
}
|
|
74
|
-
function buildSessionTooltip(session, metadata, agentService, markdownRenderer, isUnread) {
|
|
74
|
+
function buildSessionTooltip(session, metadata, agentService, markdownRenderer, isUnread, descendantNeedsAttention = false) {
|
|
75
75
|
const toDispose = new core_1.DisposableCollection();
|
|
76
76
|
const requests = session.model.getRequests();
|
|
77
77
|
const lastRequest = requests.at(-1);
|
|
@@ -92,6 +92,14 @@ function buildSessionTooltip(session, metadata, agentService, markdownRenderer,
|
|
|
92
92
|
badge.textContent = nls_1.nls.localize('theia/ai/ide/waitingForInput', 'Waiting for your input');
|
|
93
93
|
container.appendChild(badge);
|
|
94
94
|
}
|
|
95
|
+
else if (descendantNeedsAttention) {
|
|
96
|
+
// The session itself is not awaiting the user, but one of its delegated children is;
|
|
97
|
+
// surface that instead of the generic running badge so the reason is clear.
|
|
98
|
+
const badge = document.createElement('div');
|
|
99
|
+
badge.className = 'theia-chat-session-badge-attention-tooltip';
|
|
100
|
+
badge.textContent = nls_1.nls.localize('theia/ai/ide/childInteractionNeeded', 'A delegated session needs your attention');
|
|
101
|
+
container.appendChild(badge);
|
|
102
|
+
}
|
|
95
103
|
else if (ai_chat_1.ChatSessionStatus.isInProgress(status)) {
|
|
96
104
|
const badge = document.createElement('div');
|
|
97
105
|
badge.className = 'theia-chat-session-badge-running-tooltip';
|
|
@@ -167,12 +175,19 @@ function buildSessionTooltip(session, metadata, agentService, markdownRenderer,
|
|
|
167
175
|
* Build a tooltip for a session that hasn't been loaded yet (i.e. a restored / persisted entry
|
|
168
176
|
* shown on the home view). Avoids any restore I/O so hover does not promote the item to Active.
|
|
169
177
|
*/
|
|
170
|
-
function buildRestoredSessionTooltip(metadata, agentService) {
|
|
178
|
+
function buildRestoredSessionTooltip(metadata, agentService, descendantNeedsAttention = false) {
|
|
171
179
|
const container = document.createElement('div');
|
|
172
180
|
container.className = 'theia-chat-session-tooltip';
|
|
173
181
|
const badge = document.createElement('div');
|
|
174
|
-
|
|
175
|
-
|
|
182
|
+
if (descendantNeedsAttention) {
|
|
183
|
+
// A persisted parent whose delegated child needs the user; show that rather than "Restored".
|
|
184
|
+
badge.className = 'theia-chat-session-badge-attention-tooltip';
|
|
185
|
+
badge.textContent = nls_1.nls.localize('theia/ai/ide/childInteractionNeeded', 'A delegated session needs your attention');
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
badge.className = 'theia-chat-session-badge-restored-tooltip';
|
|
189
|
+
badge.textContent = nls_1.nls.localize('theia/ai/ide/restoredSession', 'Restored session');
|
|
190
|
+
}
|
|
176
191
|
container.appendChild(badge);
|
|
177
192
|
const definitionList = document.createElement('dl');
|
|
178
193
|
if (metadata.pinnedAgentId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-session-tooltip.js","sourceRoot":"","sources":["../../src/browser/chat-session-tooltip.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AA0EhF,
|
|
1
|
+
{"version":3,"file":"chat-session-toolt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CAAC,8BAA8B,EAAE,kBAAkB,CAAC,CAAC;IACzF,CAAC;IACD,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAE7B,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAEpD,IAAI,QAAQ,CAAC,aAAa,EAAE,CAAC;QACzB,MAAM,SAAS,GAAG,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,IAAI,IAAI,QAAQ,CAAC,aAAa,CAAC;QAChG,kBAAkB,CAAC,cAAc,EAAE,SAAG,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,GAAG,GAAG,SAAS,CAAC,CAAC;IACxF,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACzC,kBAAkB,CAAC,cAAc,EAAE,SAAG,CAAC,QAAQ,CAAC,mCAAmC,EAAE,eAAe,CAAC,EACjG,GAAG,IAAI,CAAC,cAAc,EAAE,KAAK,IAAA,+BAAa,EAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAEtE,SAAS,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IACtC,qGAAqG;IACrG,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;AACtD,CAAC"}
|
|
@@ -10,6 +10,12 @@ export interface SectionedSessions {
|
|
|
10
10
|
active: ChatSessionMetadata[];
|
|
11
11
|
restored: ChatSessionMetadata[];
|
|
12
12
|
}
|
|
13
|
+
/** A session row with its optional child sessions. */
|
|
14
|
+
export interface SessionRow {
|
|
15
|
+
session: ChatSessionMetadata;
|
|
16
|
+
isRestored: boolean;
|
|
17
|
+
childSessions: SessionRow[];
|
|
18
|
+
}
|
|
13
19
|
export interface VisibleSessionSlots {
|
|
14
20
|
activeCount: number;
|
|
15
21
|
restoredCount: number;
|
|
@@ -40,6 +46,8 @@ export declare class ChatSessionsWelcomeMessageProvider implements ChatWelcomeMe
|
|
|
40
46
|
protected get markdownRenderer(): MarkdownRenderer;
|
|
41
47
|
/** Persisted sessions index sorted newest first. May include duplicates of active sessions. */
|
|
42
48
|
protected _persistedSessions: ChatSessionMetadata[];
|
|
49
|
+
/** Expanded root session IDs (default collapsed). */
|
|
50
|
+
protected expandedRoots: Set<string>;
|
|
43
51
|
protected readonly onStateChangedEmitter: Emitter<void>;
|
|
44
52
|
readonly onStateChanged: Event<void>;
|
|
45
53
|
protected init(): void;
|
|
@@ -58,8 +66,30 @@ export declare class ChatSessionsWelcomeMessageProvider implements ChatWelcomeMe
|
|
|
58
66
|
*/
|
|
59
67
|
protected getSections(): SectionedSessions;
|
|
60
68
|
renderWelcomeMessage(): React.ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* Builds one {@link SessionRow} per session (carrying its own restored flag), then nests each child
|
|
71
|
+
* row under its immediate parent's row to reconstruct the full (multi-level) delegation hierarchy.
|
|
72
|
+
* Two passes on purpose: the first creates a row for every session so the second can link each child
|
|
73
|
+
* to its parent. Sessions are ordered by recency, not parent-first, so a child may precede its parent
|
|
74
|
+
* here; linking in a single pass would miss parents not yet created.
|
|
75
|
+
*/
|
|
76
|
+
protected buildRows(sections: SectionedSessions): SessionRow[];
|
|
61
77
|
protected renderSessionsSection(sections: SectionedSessions): React.ReactNode;
|
|
62
|
-
protected
|
|
78
|
+
protected toggleExpand: (sessionId: string) => void;
|
|
79
|
+
/** Whether a loaded session currently needs user action (approval or input). */
|
|
80
|
+
protected sessionRequiresAction(sessionId: string): boolean;
|
|
81
|
+
/** Whether any descendant (at any depth) of the given row currently needs user action. */
|
|
82
|
+
protected descendantRequiresAction(row: SessionRow): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Expands every ancestor of the given session (walking the immediate-parent chain) so a deeply
|
|
85
|
+
* delegated session becomes visible. The caller is responsible for triggering a re-render.
|
|
86
|
+
*/
|
|
87
|
+
protected expandAncestors(session: ChatSession): void;
|
|
88
|
+
/** Collects the enabled session-item actions for a session, sorted by priority. */
|
|
89
|
+
protected getSessionActions(session: ChatSessionMetadata): ChatSessionItemAction[];
|
|
90
|
+
protected renderSessionRow: (row: SessionRow) => React.ReactNode;
|
|
91
|
+
/** Renders a session row and, when expanded, its child rows recursively so nested delegations show. */
|
|
92
|
+
protected renderSessionRowAtDepth(row: SessionRow, depth: number): React.ReactNode;
|
|
63
93
|
protected handleSessionItemAction: (action: ChatSessionItemAction, session: ChatSessionMetadata) => void;
|
|
64
94
|
protected handleSessionItemClick: (sessionId: string) => Promise<void>;
|
|
65
95
|
protected handleBrowseAllChats: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-sessions-welcome-message-provider.d.ts","sourceRoot":"","sources":["../../src/browser/chat-sessions-welcome-message-provider.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAE1F,OAAO,EACH,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,mBAAmB,EAClE,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAE,qBAAqB,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAEnH,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAwB,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC7H,OAAO,EAAE,gBAAgB,EAAuB,YAAY,EAAmB,MAAM,yBAAyB,CAAC;AAC/G,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,8DAA8D,CAAC;AAGzH,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAKlD,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,mBAAmB,CAe/H;
|
|
1
|
+
{"version":3,"file":"chat-sessions-welcome-message-provider.d.ts","sourceRoot":"","sources":["../../src/browser/chat-sessions-welcome-message-provider.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAE1F,OAAO,EACH,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,mBAAmB,EAClE,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAE,qBAAqB,EAAE,iCAAiC,EAAE,MAAM,yCAAyC,CAAC;AAEnH,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAwB,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC7H,OAAO,EAAE,gBAAgB,EAAuB,YAAY,EAAmB,MAAM,yBAAyB,CAAC;AAC/G,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,8DAA8D,CAAC;AAGzH,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAKlD,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACnC;AAED,sDAAsD;AACtD,MAAM,WAAW,UAAU;IACvB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,UAAU,EAAE,CAAC;CAC/B;AAWD,MAAM,WAAW,mBAAmB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACzB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,uBAAuB,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS;IA+BlF,SAAS,CAAC,uBAAuB,GAAI,QAAQ,qBAAqB,EAAE,SAAS,mBAAmB,KAAG,IAAI,CAErG;IAEF,SAAS,CAAC,sBAAsB,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAGzE;IAEF,SAAS,CAAC,oBAAoB,QAAO,IAAI,CAEvC;CACL"}
|
|
@@ -34,6 +34,14 @@ const inversify_1 = require("@theia/core/shared/inversify");
|
|
|
34
34
|
const React = require("@theia/core/shared/react");
|
|
35
35
|
/** When both Active and Restored sections are non-empty, keep at least this many Restored slots. */
|
|
36
36
|
const RESTORED_MIN_RESERVATION = 5;
|
|
37
|
+
/**
|
|
38
|
+
* The id of a session's immediate parent for tree building. Falls back to the root session id for
|
|
39
|
+
* sessions persisted before immediate-parent tracking existed, so their hierarchy still renders
|
|
40
|
+
* (flat under the root, as before).
|
|
41
|
+
*/
|
|
42
|
+
function parentIdOf(session) {
|
|
43
|
+
return session.parentSessionId ?? session.rootSessionId;
|
|
44
|
+
}
|
|
37
45
|
/**
|
|
38
46
|
* Allocates the capped number of visible items between the Active and Restored sections of the
|
|
39
47
|
* overview. When both sections are non-empty, up to {@link RESTORED_MIN_RESERVATION} slots are
|
|
@@ -56,19 +64,29 @@ function computeVisibleSessionSlots(activeTotal, restoredTotal, maxSessions) {
|
|
|
56
64
|
const restoredCount = Math.min(restoredTotal, cap - activeCount);
|
|
57
65
|
return { activeCount, restoredCount };
|
|
58
66
|
}
|
|
59
|
-
function SessionsList({
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
function SessionsList({ rows, maxSessions, renderRow, onBrowseAll }) {
|
|
68
|
+
// Children are rendered inline by their parent row, so only top-level rows appear in the
|
|
69
|
+
// sections. A child whose parent session is not in the list falls back to top-level (orphan).
|
|
70
|
+
const topLevelRows = rows.filter(row => {
|
|
71
|
+
const parentId = parentIdOf(row.session);
|
|
72
|
+
if (!parentId) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
return !rows.some(r => r.session.sessionId === parentId);
|
|
76
|
+
});
|
|
77
|
+
const activeRows = topLevelRows.filter(row => !row.isRestored);
|
|
78
|
+
const restoredRows = topLevelRows.filter(row => row.isRestored);
|
|
79
|
+
const { activeCount, restoredCount } = computeVisibleSessionSlots(activeRows.length, restoredRows.length, maxSessions);
|
|
80
|
+
const activeVisible = activeRows.slice(0, activeCount);
|
|
81
|
+
const restoredVisible = restoredRows.slice(0, restoredCount);
|
|
82
|
+
const hiddenCount = topLevelRows.length - activeVisible.length - restoredVisible.length;
|
|
65
83
|
return (React.createElement("div", { className: "theia-WelcomeMessage-SessionsList" },
|
|
66
84
|
activeVisible.length > 0 && (React.createElement("div", { className: "theia-WelcomeMessage-SessionsGroup" },
|
|
67
85
|
React.createElement("div", { className: "theia-WelcomeMessage-SessionsHeader" }, nls_1.nls.localizeByDefault('Active')),
|
|
68
|
-
activeVisible.map(
|
|
86
|
+
activeVisible.map(row => renderRow(row)))),
|
|
69
87
|
restoredVisible.length > 0 && (React.createElement("div", { className: "theia-WelcomeMessage-SessionsGroup" },
|
|
70
88
|
React.createElement("div", { className: "theia-WelcomeMessage-SessionsHeader" }, nls_1.nls.localize('theia/ai/ide/sectionRestored', 'Restored')),
|
|
71
|
-
restoredVisible.map(
|
|
89
|
+
restoredVisible.map(row => renderRow(row)))),
|
|
72
90
|
hiddenCount > 0 && (React.createElement("div", { className: "theia-WelcomeMessage-SessionsFooter" },
|
|
73
91
|
React.createElement("a", { className: "theia-WelcomeMessage-FooterLink", ...(0, browser_1.buttonKeyboardProps)(nls_1.nls.localize('theia/ai/ide/browseAllChats', 'Browse all chats...')), onClick: onBrowseAll, onKeyDown: e => {
|
|
74
92
|
if ((0, browser_1.isActivationKey)(e)) {
|
|
@@ -86,16 +104,21 @@ let ChatSessionsWelcomeMessageProvider = class ChatSessionsWelcomeMessageProvide
|
|
|
86
104
|
this.onUnreadChanged = this.onUnreadChangedEmitter.event;
|
|
87
105
|
/** Persisted sessions index sorted newest first. May include duplicates of active sessions. */
|
|
88
106
|
this._persistedSessions = [];
|
|
107
|
+
/** Expanded root session IDs (default collapsed). */
|
|
108
|
+
this.expandedRoots = new Set();
|
|
89
109
|
this.onStateChangedEmitter = new core_1.Emitter();
|
|
90
110
|
this.onStateChanged = this.onStateChangedEmitter.event;
|
|
91
|
-
this.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
111
|
+
this.toggleExpand = (sessionId) => {
|
|
112
|
+
this.expandedRoots = new Set(this.expandedRoots);
|
|
113
|
+
if (this.expandedRoots.has(sessionId)) {
|
|
114
|
+
this.expandedRoots.delete(sessionId);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
this.expandedRoots.add(sessionId);
|
|
118
|
+
}
|
|
119
|
+
this.onStateChangedEmitter.fire();
|
|
98
120
|
};
|
|
121
|
+
this.renderSessionRow = (row) => this.renderSessionRowAtDepth(row, 0);
|
|
99
122
|
this.handleSessionItemAction = (action, session) => {
|
|
100
123
|
this.commandRegistry.executeCommand(action.commandId, session);
|
|
101
124
|
};
|
|
@@ -201,12 +224,25 @@ let ChatSessionsWelcomeMessageProvider = class ChatSessionsWelcomeMessageProvide
|
|
|
201
224
|
const reqs = session.model.getRequests();
|
|
202
225
|
const state = {
|
|
203
226
|
unread: false,
|
|
227
|
+
requiresAction: ai_chat_1.ChatSessionStatus.requiresUserAction(session.model.status),
|
|
204
228
|
seenRequests: reqs.length,
|
|
205
229
|
seenCompleted: this.countCompleted(reqs),
|
|
206
230
|
listener: new core_1.DisposableCollection()
|
|
207
231
|
};
|
|
208
232
|
this.unreadSessions.set(session.id, state);
|
|
209
233
|
session.model.onDidChange(() => {
|
|
234
|
+
const requiresAction = ai_chat_1.ChatSessionStatus.requiresUserAction(session.model.status);
|
|
235
|
+
// Only react to a change in whether this session needs user action (approval/input) - i.e. a
|
|
236
|
+
// transition into or out of that state - not to every model change while the state is stable.
|
|
237
|
+
if (requiresAction !== state.requiresAction) {
|
|
238
|
+
state.requiresAction = requiresAction;
|
|
239
|
+
// When a delegated child starts needing action, auto-expand its ancestors so the whole
|
|
240
|
+
// subtree is revealed naturally. Don't auto-collapse afterwards: leave that to the user.
|
|
241
|
+
if (requiresAction) {
|
|
242
|
+
this.expandAncestors(session);
|
|
243
|
+
}
|
|
244
|
+
this.onStateChangedEmitter.fire();
|
|
245
|
+
}
|
|
210
246
|
const current = session.model.getRequests();
|
|
211
247
|
if (current.length > state.seenRequests || this.countCompleted(current) > state.seenCompleted) {
|
|
212
248
|
// Only silently update the seen counts (instead of flashing the unread badge)
|
|
@@ -268,7 +304,9 @@ let ChatSessionsWelcomeMessageProvider = class ChatSessionsWelcomeMessageProvide
|
|
|
268
304
|
saveDate: session.lastInteraction?.getTime() ?? Date.now(),
|
|
269
305
|
location: session.model.location,
|
|
270
306
|
pinnedAgentId: session.pinnedAgent?.id,
|
|
271
|
-
hasError: session.model.status === 'failed'
|
|
307
|
+
hasError: session.model.status === 'failed',
|
|
308
|
+
rootSessionId: session.rootSessionId,
|
|
309
|
+
parentSessionId: session.parentSessionId
|
|
272
310
|
}));
|
|
273
311
|
const restored = this._persistedSessions.filter(metadata => !activeIds.has(metadata.sessionId));
|
|
274
312
|
return { active, restored };
|
|
@@ -285,12 +323,88 @@ let ChatSessionsWelcomeMessageProvider = class ChatSessionsWelcomeMessageProvide
|
|
|
285
323
|
}
|
|
286
324
|
return this.renderSessionsSection(sections);
|
|
287
325
|
}
|
|
326
|
+
/**
|
|
327
|
+
* Builds one {@link SessionRow} per session (carrying its own restored flag), then nests each child
|
|
328
|
+
* row under its immediate parent's row to reconstruct the full (multi-level) delegation hierarchy.
|
|
329
|
+
* Two passes on purpose: the first creates a row for every session so the second can link each child
|
|
330
|
+
* to its parent. Sessions are ordered by recency, not parent-first, so a child may precede its parent
|
|
331
|
+
* here; linking in a single pass would miss parents not yet created.
|
|
332
|
+
*/
|
|
333
|
+
buildRows(sections) {
|
|
334
|
+
const allSessions = [...sections.active, ...sections.restored];
|
|
335
|
+
const activeIds = new Set(sections.active.map(s => s.sessionId));
|
|
336
|
+
const rowsById = new Map();
|
|
337
|
+
for (const session of allSessions) {
|
|
338
|
+
rowsById.set(session.sessionId, { session, isRestored: !activeIds.has(session.sessionId), childSessions: [] });
|
|
339
|
+
}
|
|
340
|
+
for (const session of allSessions) {
|
|
341
|
+
const parentId = parentIdOf(session);
|
|
342
|
+
if (parentId) {
|
|
343
|
+
rowsById.get(parentId)?.childSessions.push(rowsById.get(session.sessionId));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
return [...rowsById.values()];
|
|
347
|
+
}
|
|
288
348
|
renderSessionsSection(sections) {
|
|
289
349
|
const maxSessions = this.preferenceService.get(ai_chat_preferences_1.WELCOME_SCREEN_SESSIONS_PREF, 20);
|
|
350
|
+
const rows = this.buildRows(sections);
|
|
290
351
|
return (React.createElement("div", { className: "theia-WelcomeMessage", key: "sessions-section" },
|
|
291
352
|
React.createElement("div", { className: "theia-WelcomeMessage-SessionsSection" },
|
|
292
|
-
React.createElement(SessionsList, {
|
|
353
|
+
React.createElement(SessionsList, { rows: rows, maxSessions: maxSessions, renderRow: this.renderSessionRow, onBrowseAll: this.handleBrowseAllChats }))));
|
|
354
|
+
}
|
|
355
|
+
/** Whether a loaded session currently needs user action (approval or input). */
|
|
356
|
+
sessionRequiresAction(sessionId) {
|
|
357
|
+
const session = this.chatService.getSession(sessionId);
|
|
358
|
+
return session !== undefined && ai_chat_1.ChatSessionStatus.requiresUserAction(session.model.status);
|
|
359
|
+
}
|
|
360
|
+
/** Whether any descendant (at any depth) of the given row currently needs user action. */
|
|
361
|
+
descendantRequiresAction(row) {
|
|
362
|
+
return row.childSessions.some(child => this.sessionRequiresAction(child.session.sessionId) || this.descendantRequiresAction(child));
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Expands every ancestor of the given session (walking the immediate-parent chain) so a deeply
|
|
366
|
+
* delegated session becomes visible. The caller is responsible for triggering a re-render.
|
|
367
|
+
*/
|
|
368
|
+
expandAncestors(session) {
|
|
369
|
+
// Resolve the next ancestor for a given session id. Prefer the loaded session, but fall back to
|
|
370
|
+
// the persisted index: an ancestor may not be loaded in memory (e.g. a child opened directly via
|
|
371
|
+
// "Browse all chats"). Without the fallback the walk stops at the first persisted-only ancestor,
|
|
372
|
+
// leaving the child hidden under a still-collapsed root.
|
|
373
|
+
const persistedById = new Map(this._persistedSessions.map(metadata => [metadata.sessionId, metadata]));
|
|
374
|
+
const parentIdFor = (id) => {
|
|
375
|
+
const loaded = this.chatService.getSession(id);
|
|
376
|
+
if (loaded) {
|
|
377
|
+
return loaded.parentSessionId ?? loaded.rootSessionId;
|
|
378
|
+
}
|
|
379
|
+
const metadata = persistedById.get(id);
|
|
380
|
+
return metadata && parentIdOf(metadata);
|
|
381
|
+
};
|
|
382
|
+
const visited = new Set();
|
|
383
|
+
let parentId = session.parentSessionId ?? session.rootSessionId;
|
|
384
|
+
while (parentId && !visited.has(parentId)) {
|
|
385
|
+
visited.add(parentId);
|
|
386
|
+
this.expandedRoots.add(parentId);
|
|
387
|
+
parentId = parentIdFor(parentId);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
/** Collects the enabled session-item actions for a session, sorted by priority. */
|
|
391
|
+
getSessionActions(session) {
|
|
392
|
+
return this.chatSessionItemActionContributions
|
|
393
|
+
.getContributions()
|
|
394
|
+
.flatMap(c => c.getActions(session))
|
|
395
|
+
.filter(action => this.commandRegistry.isEnabled(action.commandId, session))
|
|
396
|
+
.sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0));
|
|
397
|
+
}
|
|
398
|
+
/** Renders a session row and, when expanded, its child rows recursively so nested delegations show. */
|
|
399
|
+
renderSessionRowAtDepth(row, depth) {
|
|
400
|
+
const hasChildSessions = row.childSessions.length > 0;
|
|
401
|
+
const isExpanded = hasChildSessions && this.expandedRoots.has(row.session.sessionId);
|
|
402
|
+
const descendantNeedsAttention = this.descendantRequiresAction(row);
|
|
403
|
+
return (React.createElement(React.Fragment, { key: row.session.sessionId },
|
|
404
|
+
React.createElement(chat_session_item_1.ChatSessionItem, { session: row.session, isRestored: row.isRestored, chatService: this.chatService, chatAgentService: this.chatAgentService, hoverService: this.hoverService, markdownRenderer: this.markdownRenderer, unreadState: this, onClick: () => this.handleSessionItemClick(row.session.sessionId), actions: this.getSessionActions(row.session), onAction: this.handleSessionItemAction, formatTimeAgo: date => (0, chat_date_utils_1.formatTimeAgo)(date), hasChildSessions: hasChildSessions, isChildSession: depth > 0, depth: depth, isExpanded: isExpanded, descendantNeedsAttention: descendantNeedsAttention, onToggleExpand: hasChildSessions ? () => this.toggleExpand(row.session.sessionId) : undefined }),
|
|
405
|
+
isExpanded && row.childSessions.map(child => this.renderSessionRowAtDepth(child, depth + 1))));
|
|
293
406
|
}
|
|
407
|
+
;
|
|
294
408
|
};
|
|
295
409
|
exports.ChatSessionsWelcomeMessageProvider = ChatSessionsWelcomeMessageProvider;
|
|
296
410
|
tslib_1.__decorate([
|