@memberjunction/ng-explorer-core 5.21.0 → 5.23.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/dist/generated/lazy-feature-config.d.ts +19 -0
- package/dist/generated/lazy-feature-config.d.ts.map +1 -0
- package/dist/generated/lazy-feature-config.js +144 -0
- package/dist/generated/lazy-feature-config.js.map +1 -0
- package/dist/lib/command-palette/command-palette.component.d.ts +10 -1
- package/dist/lib/command-palette/command-palette.component.d.ts.map +1 -1
- package/dist/lib/command-palette/command-palette.component.js +68 -16
- package/dist/lib/command-palette/command-palette.component.js.map +1 -1
- package/dist/lib/dashboard-preferences-dialog/dashboard-preferences-dialog.component.js +49 -49
- package/dist/lib/dashboard-preferences-dialog/dashboard-preferences-dialog.component.js.map +1 -1
- package/dist/lib/generic/form-toolbar.js +10 -10
- package/dist/lib/generic/form-toolbar.js.map +1 -1
- package/dist/lib/generic/resource-container-component.d.ts +0 -1
- package/dist/lib/generic/resource-container-component.d.ts.map +1 -1
- package/dist/lib/generic/resource-container-component.js +3 -12
- package/dist/lib/generic/resource-container-component.js.map +1 -1
- package/dist/lib/oauth/oauth-callback.component.js +6 -6
- package/dist/lib/oauth/oauth-callback.component.js.map +1 -1
- package/dist/lib/oauth/oauth.module.d.ts +2 -3
- package/dist/lib/oauth/oauth.module.d.ts.map +1 -1
- package/dist/lib/oauth/oauth.module.js +0 -4
- package/dist/lib/oauth/oauth.module.js.map +1 -1
- package/dist/lib/resource-wrappers/chat-collections-resource.component.d.ts +8 -23
- package/dist/lib/resource-wrappers/chat-collections-resource.component.d.ts.map +1 -1
- package/dist/lib/resource-wrappers/chat-collections-resource.component.js +68 -117
- package/dist/lib/resource-wrappers/chat-collections-resource.component.js.map +1 -1
- package/dist/lib/resource-wrappers/chat-conversations-resource.component.d.ts +9 -21
- package/dist/lib/resource-wrappers/chat-conversations-resource.component.d.ts.map +1 -1
- package/dist/lib/resource-wrappers/chat-conversations-resource.component.js +66 -137
- package/dist/lib/resource-wrappers/chat-conversations-resource.component.js.map +1 -1
- package/dist/lib/resource-wrappers/chat-tasks-resource.component.d.ts +3 -19
- package/dist/lib/resource-wrappers/chat-tasks-resource.component.d.ts.map +1 -1
- package/dist/lib/resource-wrappers/chat-tasks-resource.component.js +16 -98
- package/dist/lib/resource-wrappers/chat-tasks-resource.component.js.map +1 -1
- package/dist/lib/resource-wrappers/dashboard-resource.component.d.ts +0 -1
- package/dist/lib/resource-wrappers/dashboard-resource.component.d.ts.map +1 -1
- package/dist/lib/resource-wrappers/dashboard-resource.component.js +4 -12
- package/dist/lib/resource-wrappers/dashboard-resource.component.js.map +1 -1
- package/dist/lib/resource-wrappers/view-resource.component.d.ts +13 -11
- package/dist/lib/resource-wrappers/view-resource.component.d.ts.map +1 -1
- package/dist/lib/resource-wrappers/view-resource.component.js +80 -89
- package/dist/lib/resource-wrappers/view-resource.component.js.map +1 -1
- package/dist/lib/services/lazy-module-registry.d.ts +24 -9
- package/dist/lib/services/lazy-module-registry.d.ts.map +1 -1
- package/dist/lib/services/lazy-module-registry.js +32 -13
- package/dist/lib/services/lazy-module-registry.js.map +1 -1
- package/dist/lib/shell/components/header/app-nav.component.d.ts.map +1 -1
- package/dist/lib/shell/components/header/app-nav.component.js +18 -3
- package/dist/lib/shell/components/header/app-nav.component.js.map +1 -1
- package/dist/lib/shell/components/tabs/component-cache-manager.d.ts +38 -16
- package/dist/lib/shell/components/tabs/component-cache-manager.d.ts.map +1 -1
- package/dist/lib/shell/components/tabs/component-cache-manager.js +57 -35
- package/dist/lib/shell/components/tabs/component-cache-manager.js.map +1 -1
- package/dist/lib/shell/components/tabs/tab-container.component.d.ts +56 -1
- package/dist/lib/shell/components/tabs/tab-container.component.d.ts.map +1 -1
- package/dist/lib/shell/components/tabs/tab-container.component.js +298 -53
- package/dist/lib/shell/components/tabs/tab-container.component.js.map +1 -1
- package/dist/lib/shell/services/settings-dialog.service.d.ts +8 -8
- package/dist/lib/shell/services/settings-dialog.service.d.ts.map +1 -1
- package/dist/lib/shell/services/settings-dialog.service.js +20 -26
- package/dist/lib/shell/services/settings-dialog.service.js.map +1 -1
- package/dist/lib/shell/shell.component.d.ts +26 -2
- package/dist/lib/shell/shell.component.d.ts.map +1 -1
- package/dist/lib/shell/shell.component.js +225 -54
- package/dist/lib/shell/shell.component.js.map +1 -1
- package/dist/lib/shell/shell.module.d.ts +4 -5
- package/dist/lib/shell/shell.module.d.ts.map +1 -1
- package/dist/lib/shell/shell.module.js +4 -8
- package/dist/lib/shell/shell.module.js.map +1 -1
- package/dist/lib/single-dashboard/Components/add-item/add-item.component.js +72 -71
- package/dist/lib/single-dashboard/Components/add-item/add-item.component.js.map +1 -1
- package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.js +11 -11
- package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.js.map +1 -1
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.d.ts +36 -12
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.d.ts.map +1 -1
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.js +78 -50
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.js.map +1 -1
- package/dist/lib/single-dashboard/single-dashboard.component.d.ts +12 -5
- package/dist/lib/single-dashboard/single-dashboard.component.d.ts.map +1 -1
- package/dist/lib/single-dashboard/single-dashboard.component.js +44 -55
- package/dist/lib/single-dashboard/single-dashboard.component.js.map +1 -1
- package/dist/lib/single-list-detail/single-list-detail.component.d.ts +10 -2
- package/dist/lib/single-list-detail/single-list-detail.component.d.ts.map +1 -1
- package/dist/lib/single-list-detail/single-list-detail.component.js +313 -243
- package/dist/lib/single-list-detail/single-list-detail.component.js.map +1 -1
- package/dist/lib/user-menu/base-user-menu.d.ts +4 -0
- package/dist/lib/user-menu/base-user-menu.d.ts.map +1 -1
- package/dist/lib/user-menu/base-user-menu.js +26 -0
- package/dist/lib/user-menu/base-user-menu.js.map +1 -1
- package/dist/lib/user-menu/user-menu.types.d.ts +20 -0
- package/dist/lib/user-menu/user-menu.types.d.ts.map +1 -1
- package/dist/lib/user-menu/user-menu.types.js.map +1 -1
- package/dist/module.d.ts +23 -34
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +33 -74
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +1 -1
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +1 -1
- package/dist/public-api.js.map +1 -1
- package/package.json +38 -47
- package/dist/lib/services/lazy-feature-config.d.ts +0 -16
- package/dist/lib/services/lazy-feature-config.d.ts.map +0 -1
- package/dist/lib/services/lazy-feature-config.js +0 -113
- package/dist/lib/services/lazy-feature-config.js.map +0 -1
|
@@ -5,18 +5,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { Component, ViewEncapsulation, ViewChild, HostListener } from '@angular/core';
|
|
8
|
-
import { NavigationEnd } from '@angular/router';
|
|
9
8
|
import { Metadata, CompositeKey } from '@memberjunction/core';
|
|
10
9
|
import { RegisterClass, UUIDsEqual } from '@memberjunction/global';
|
|
11
10
|
import { BaseResourceComponent } from '@memberjunction/ng-shared';
|
|
12
|
-
import { MJEnvironmentEntityExtended, UserInfoEngine } from '@memberjunction/core-entities';
|
|
11
|
+
import { MJEnvironmentEntityExtended, UserInfoEngine, ConversationEngine } from '@memberjunction/core-entities';
|
|
13
12
|
import { AIEngineBase } from '@memberjunction/ai-engine-base';
|
|
14
|
-
import { Subject, takeUntil
|
|
13
|
+
import { Subject, takeUntil } from 'rxjs';
|
|
15
14
|
import * as i0 from "@angular/core";
|
|
16
15
|
import * as i1 from "@memberjunction/ng-shared";
|
|
17
16
|
import * as i2 from "@memberjunction/ng-conversations";
|
|
18
|
-
import * as i3 from "@
|
|
19
|
-
import * as i4 from "@memberjunction/ng-shared-generic";
|
|
17
|
+
import * as i3 from "@memberjunction/ng-shared-generic";
|
|
20
18
|
const _c0 = ["conversationList"];
|
|
21
19
|
const _c1 = ["chatArea"];
|
|
22
20
|
function ChatConversationsResource_Conditional_0_Conditional_1_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
@@ -82,25 +80,23 @@ function ChatConversationsResource_Conditional_1_Template(rf, ctx) { if (rf & 1)
|
|
|
82
80
|
* Designed to work with the tab system for multi-tab conversation management
|
|
83
81
|
*
|
|
84
82
|
* This component manages its own selection state locally, following the encapsulation pattern:
|
|
85
|
-
* -
|
|
83
|
+
* - ConversationEngine singleton is used for shared DATA (caching, loading, saving)
|
|
86
84
|
* - Local state variables manage SELECTION state (which conversation is active)
|
|
87
85
|
* - State flows down to children via @Input, events flow up via @Output
|
|
88
86
|
*/
|
|
89
87
|
let ChatConversationsResource = class ChatConversationsResource extends BaseResourceComponent {
|
|
90
88
|
navigationService;
|
|
91
|
-
conversationData;
|
|
92
|
-
router;
|
|
93
89
|
mentionAutocompleteService;
|
|
94
90
|
cdr;
|
|
95
91
|
streamingService;
|
|
96
92
|
activeTasksService;
|
|
97
93
|
uiCommandHandler;
|
|
94
|
+
bridge;
|
|
98
95
|
conversationList;
|
|
99
96
|
chatArea;
|
|
100
97
|
currentUser = null;
|
|
101
98
|
destroy$ = new Subject();
|
|
102
99
|
skipUrlUpdate = true; // Skip URL updates during initialization
|
|
103
|
-
lastNavigatedUrl = ''; // Track URL to avoid reacting to our own navigation
|
|
104
100
|
// Ready flag - blocks child rendering until AIEngine is initialized
|
|
105
101
|
isReady = false;
|
|
106
102
|
// LOCAL SELECTION STATE - each wrapper instance manages its own selection
|
|
@@ -129,16 +125,16 @@ let ChatConversationsResource = class ChatConversationsResource extends BaseReso
|
|
|
129
125
|
// User Settings persistence
|
|
130
126
|
USER_SETTING_SIDEBAR_KEY = 'Conversations.SidebarState';
|
|
131
127
|
saveSettingsTimeout = null;
|
|
132
|
-
|
|
128
|
+
engine = ConversationEngine.Instance;
|
|
129
|
+
constructor(navigationService, mentionAutocompleteService, cdr, streamingService, activeTasksService, uiCommandHandler, bridge) {
|
|
133
130
|
super();
|
|
134
131
|
this.navigationService = navigationService;
|
|
135
|
-
this.conversationData = conversationData;
|
|
136
|
-
this.router = router;
|
|
137
132
|
this.mentionAutocompleteService = mentionAutocompleteService;
|
|
138
133
|
this.cdr = cdr;
|
|
139
134
|
this.streamingService = streamingService;
|
|
140
135
|
this.activeTasksService = activeTasksService;
|
|
141
136
|
this.uiCommandHandler = uiCommandHandler;
|
|
137
|
+
this.bridge = bridge;
|
|
142
138
|
}
|
|
143
139
|
async ngOnInit() {
|
|
144
140
|
const md = new Metadata();
|
|
@@ -169,40 +165,25 @@ let ChatConversationsResource = class ChatConversationsResource extends BaseReso
|
|
|
169
165
|
// Initialize global streaming service for PubSub updates
|
|
170
166
|
// This enables reconnection to in-progress agents after browser refresh
|
|
171
167
|
this.streamingService.initialize();
|
|
172
|
-
//
|
|
173
|
-
|
|
174
|
-
const urlState = this.parseUrlState();
|
|
175
|
-
if (urlState) {
|
|
176
|
-
// Set conversationId synchronously so child components see it immediately
|
|
177
|
-
if (urlState.conversationId) {
|
|
178
|
-
this.selectedConversationId = urlState.conversationId;
|
|
179
|
-
this.isNewUnsavedConversation = false;
|
|
180
|
-
}
|
|
181
|
-
if (urlState.artifactId) {
|
|
182
|
-
this.pendingArtifactId = urlState.artifactId;
|
|
183
|
-
this.pendingArtifactVersionNumber = urlState.versionNumber || null;
|
|
184
|
-
}
|
|
185
|
-
// Load the conversation entity asynchronously (non-blocking)
|
|
186
|
-
this.loadConversationEntity(urlState.conversationId);
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
// Check if we have navigation params from config (e.g., from Collections linking here)
|
|
190
|
-
this.applyConfigurationParams();
|
|
191
|
-
}
|
|
192
|
-
// Subscribe to router NavigationEnd events for back/forward button support
|
|
193
|
-
this.router.events
|
|
194
|
-
.pipe(filter((event) => event instanceof NavigationEnd), takeUntil(this.destroy$))
|
|
195
|
-
.subscribe(event => {
|
|
196
|
-
const currentUrl = event.urlAfterRedirects || event.url;
|
|
197
|
-
if (currentUrl !== this.lastNavigatedUrl) {
|
|
198
|
-
this.onExternalNavigation(currentUrl);
|
|
199
|
-
}
|
|
200
|
-
});
|
|
168
|
+
// Apply initial state from tab configuration (populated by shell from URL or nav params)
|
|
169
|
+
this.applyConfigurationParams();
|
|
201
170
|
// Subscribe to actionable commands (open:resource) from the UI command handler service.
|
|
202
171
|
// open:url commands are handled directly by the service; open:resource needs NavigationService.
|
|
203
172
|
this.uiCommandHandler.actionableCommandRequested
|
|
204
173
|
.pipe(takeUntil(this.destroy$))
|
|
205
174
|
.subscribe(command => this.handleActionableCommand(command));
|
|
175
|
+
// Subscribe to bridge switch events so the overlay can hand off a conversation to this workspace
|
|
176
|
+
this.bridge.SwitchEvent$
|
|
177
|
+
.pipe(takeUntil(this.destroy$))
|
|
178
|
+
.subscribe(event => {
|
|
179
|
+
if (event.Target === 'workspace' && event.ConversationID) {
|
|
180
|
+
void this.selectConversation(event.ConversationID);
|
|
181
|
+
this.updateTabTitle();
|
|
182
|
+
this.cdr.detectChanges();
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
// Notify the bridge that the workspace is active
|
|
186
|
+
this.bridge.NotifyWorkspaceActive(true);
|
|
206
187
|
// Enable URL updates after initialization
|
|
207
188
|
this.skipUrlUpdate = false;
|
|
208
189
|
// Update URL to reflect current state
|
|
@@ -213,6 +194,7 @@ let ChatConversationsResource = class ChatConversationsResource extends BaseReso
|
|
|
213
194
|
}, 100);
|
|
214
195
|
}
|
|
215
196
|
ngOnDestroy() {
|
|
197
|
+
this.bridge.NotifyWorkspaceActive(false);
|
|
216
198
|
this.destroy$.next();
|
|
217
199
|
this.destroy$.complete();
|
|
218
200
|
// Clear any pending save timeout
|
|
@@ -233,7 +215,7 @@ let ChatConversationsResource = class ChatConversationsResource extends BaseReso
|
|
|
233
215
|
// Initialize AIEngine, conversations, and mention service in parallel
|
|
234
216
|
await Promise.all([
|
|
235
217
|
AIEngineBase.Instance.Config(false),
|
|
236
|
-
this.
|
|
218
|
+
this.engine.LoadConversations(this.environmentId, this.currentUser, false),
|
|
237
219
|
this.mentionAutocompleteService.initialize(this.currentUser)
|
|
238
220
|
]);
|
|
239
221
|
// Restore active tasks AFTER conversations are cached (uses in-memory lookup)
|
|
@@ -249,28 +231,6 @@ let ChatConversationsResource = class ChatConversationsResource extends BaseReso
|
|
|
249
231
|
this.cdr.detectChanges();
|
|
250
232
|
}
|
|
251
233
|
}
|
|
252
|
-
/**
|
|
253
|
-
* Parse URL query string for conversation state.
|
|
254
|
-
* Query params: conversationId, artifactId, versionNumber
|
|
255
|
-
*/
|
|
256
|
-
parseUrlState() {
|
|
257
|
-
const url = this.router.url;
|
|
258
|
-
const queryIndex = url.indexOf('?');
|
|
259
|
-
if (queryIndex === -1)
|
|
260
|
-
return null;
|
|
261
|
-
const queryString = url.substring(queryIndex + 1);
|
|
262
|
-
const params = new URLSearchParams(queryString);
|
|
263
|
-
const conversationId = params.get('conversationId');
|
|
264
|
-
const artifactId = params.get('artifactId');
|
|
265
|
-
const versionNumber = params.get('versionNumber');
|
|
266
|
-
if (!conversationId && !artifactId)
|
|
267
|
-
return null;
|
|
268
|
-
return {
|
|
269
|
-
conversationId: conversationId || undefined,
|
|
270
|
-
artifactId: artifactId || undefined,
|
|
271
|
-
versionNumber: versionNumber ? parseInt(versionNumber, 10) : undefined
|
|
272
|
-
};
|
|
273
|
-
}
|
|
274
234
|
/**
|
|
275
235
|
* Load the conversation entity asynchronously (non-blocking).
|
|
276
236
|
* The conversationId is already set synchronously, this just loads the full entity.
|
|
@@ -279,58 +239,57 @@ let ChatConversationsResource = class ChatConversationsResource extends BaseReso
|
|
|
279
239
|
if (!conversationId)
|
|
280
240
|
return;
|
|
281
241
|
// Try to get from cache first
|
|
282
|
-
const conversation = this.
|
|
242
|
+
const conversation = this.engine.GetConversation(conversationId);
|
|
283
243
|
if (conversation) {
|
|
284
244
|
this.selectedConversation = conversation;
|
|
245
|
+
this.updateTabTitle();
|
|
285
246
|
}
|
|
286
247
|
// If not in cache, the chat area component will handle loading it
|
|
287
248
|
}
|
|
288
249
|
/**
|
|
289
|
-
* Apply
|
|
250
|
+
* Apply initial state from tab configuration.
|
|
251
|
+
* The shell populates queryParams from the URL, and nav params come from cross-resource linking.
|
|
290
252
|
* Sets state synchronously so child components see values immediately.
|
|
291
253
|
*/
|
|
292
254
|
applyConfigurationParams() {
|
|
293
255
|
const config = this.Data?.Configuration;
|
|
294
256
|
if (!config)
|
|
295
257
|
return;
|
|
258
|
+
// Check queryParams first (shell populates these from the URL for deep-linking)
|
|
259
|
+
const qp = config['queryParams'];
|
|
260
|
+
const conversationId = qp?.['conversationId'] || config.conversationId;
|
|
261
|
+
const artifactId = qp?.['artifactId'] || config.artifactId;
|
|
262
|
+
const versionNumber = qp?.['versionNumber'] ? parseInt(qp['versionNumber'], 10)
|
|
263
|
+
: config.versionNumber ? config.versionNumber : null;
|
|
296
264
|
// Set pending artifact if provided
|
|
297
|
-
if (
|
|
298
|
-
this.pendingArtifactId =
|
|
299
|
-
this.pendingArtifactVersionNumber =
|
|
265
|
+
if (artifactId) {
|
|
266
|
+
this.pendingArtifactId = artifactId;
|
|
267
|
+
this.pendingArtifactVersionNumber = versionNumber;
|
|
300
268
|
}
|
|
301
269
|
// Set conversationId synchronously so child components see it immediately
|
|
302
|
-
if (
|
|
303
|
-
this.selectedConversationId =
|
|
270
|
+
if (conversationId) {
|
|
271
|
+
this.selectedConversationId = conversationId;
|
|
272
|
+
this.bridge.SetActiveFromWorkspace(conversationId);
|
|
304
273
|
this.isNewUnsavedConversation = false;
|
|
305
274
|
// Load entity asynchronously
|
|
306
|
-
this.loadConversationEntity(
|
|
275
|
+
this.loadConversationEntity(conversationId);
|
|
307
276
|
}
|
|
308
277
|
}
|
|
309
278
|
/**
|
|
310
279
|
* Apply navigation state to local selection state.
|
|
311
280
|
* Sets state synchronously so child components see values immediately.
|
|
312
281
|
*/
|
|
313
|
-
applyNavigationState(state) {
|
|
314
|
-
// Set pending artifact if provided (will be consumed by chat area after loading)
|
|
315
|
-
if (state.artifactId) {
|
|
316
|
-
this.pendingArtifactId = state.artifactId;
|
|
317
|
-
this.pendingArtifactVersionNumber = state.versionNumber || null;
|
|
318
|
-
}
|
|
319
|
-
// Set the conversation synchronously
|
|
320
|
-
if (state.conversationId) {
|
|
321
|
-
this.selectedConversationId = state.conversationId;
|
|
322
|
-
this.isNewUnsavedConversation = false;
|
|
323
|
-
this.loadConversationEntity(state.conversationId);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
282
|
/**
|
|
327
283
|
* Select a conversation by ID - loads the entity and updates local state
|
|
328
284
|
*/
|
|
329
285
|
async selectConversation(conversationId) {
|
|
330
286
|
this.selectedConversationId = conversationId;
|
|
331
287
|
this.isNewUnsavedConversation = false;
|
|
288
|
+
// Keep bridge in sync so other consumers (toast suppression, overlay) know
|
|
289
|
+
// which conversation the workspace is viewing
|
|
290
|
+
this.bridge.SetActiveFromWorkspace(conversationId);
|
|
332
291
|
// Load the conversation entity from data service
|
|
333
|
-
const conversation = this.
|
|
292
|
+
const conversation = this.engine.GetConversation(conversationId);
|
|
334
293
|
if (conversation) {
|
|
335
294
|
this.selectedConversation = conversation;
|
|
336
295
|
}
|
|
@@ -371,55 +330,17 @@ let ChatConversationsResource = class ChatConversationsResource extends BaseReso
|
|
|
371
330
|
this.navigationService.UpdateActiveTabQueryParams(queryParams);
|
|
372
331
|
}
|
|
373
332
|
/**
|
|
374
|
-
*
|
|
375
|
-
* Parses the URL and applies the state without triggering a new navigation.
|
|
333
|
+
* Update the tab/browser title based on the currently selected conversation.
|
|
376
334
|
*/
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
// Only handle if we're still on the same base path (same component instance)
|
|
382
|
-
if (currentPath !== newPath) {
|
|
383
|
-
return; // Different route entirely, shell will handle it
|
|
384
|
-
}
|
|
385
|
-
// Parse the new URL state
|
|
386
|
-
const urlState = this.parseUrlFromString(url);
|
|
387
|
-
// Apply the state without triggering URL updates
|
|
388
|
-
this.skipUrlUpdate = true;
|
|
389
|
-
if (urlState) {
|
|
390
|
-
this.applyNavigationState(urlState);
|
|
335
|
+
updateTabTitle() {
|
|
336
|
+
if (this.isNewUnsavedConversation || !this.selectedConversation) {
|
|
337
|
+
this.NotifyDisplayNameChanged('Conversations');
|
|
338
|
+
return;
|
|
391
339
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
this.
|
|
395
|
-
this.selectedConversation = null;
|
|
396
|
-
this.selectedThreadId = null;
|
|
397
|
-
this.pendingArtifactId = null;
|
|
398
|
-
this.pendingArtifactVersionNumber = null;
|
|
340
|
+
const name = this.selectedConversation.Name;
|
|
341
|
+
if (name) {
|
|
342
|
+
this.NotifyDisplayNameChanged(name);
|
|
399
343
|
}
|
|
400
|
-
this.skipUrlUpdate = false;
|
|
401
|
-
// Update the tracked URL
|
|
402
|
-
this.lastNavigatedUrl = url;
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* Parse URL state from a URL string (used for external navigation).
|
|
406
|
-
*/
|
|
407
|
-
parseUrlFromString(url) {
|
|
408
|
-
const queryIndex = url.indexOf('?');
|
|
409
|
-
if (queryIndex === -1)
|
|
410
|
-
return null;
|
|
411
|
-
const queryString = url.substring(queryIndex + 1);
|
|
412
|
-
const params = new URLSearchParams(queryString);
|
|
413
|
-
const conversationId = params.get('conversationId');
|
|
414
|
-
const artifactId = params.get('artifactId');
|
|
415
|
-
const versionNumber = params.get('versionNumber');
|
|
416
|
-
if (!conversationId && !artifactId)
|
|
417
|
-
return null;
|
|
418
|
-
return {
|
|
419
|
-
conversationId: conversationId || undefined,
|
|
420
|
-
artifactId: artifactId || undefined,
|
|
421
|
-
versionNumber: versionNumber ? parseInt(versionNumber, 10) : undefined
|
|
422
|
-
};
|
|
423
344
|
}
|
|
424
345
|
/**
|
|
425
346
|
* Get the environment ID from configuration or use default
|
|
@@ -461,7 +382,7 @@ let ChatConversationsResource = class ChatConversationsResource extends BaseReso
|
|
|
461
382
|
*/
|
|
462
383
|
onConversationDeleted(deletedId) {
|
|
463
384
|
if (this.selectedConversationId === deletedId) {
|
|
464
|
-
const remaining = this.
|
|
385
|
+
const remaining = this.engine.Conversations.filter(c => !UUIDsEqual(c.ID, deletedId));
|
|
465
386
|
if (remaining.length > 0) {
|
|
466
387
|
void this.selectConversation(remaining[0].ID);
|
|
467
388
|
this.updateUrl();
|
|
@@ -483,6 +404,7 @@ let ChatConversationsResource = class ChatConversationsResource extends BaseReso
|
|
|
483
404
|
this.selectedThreadId = null; // Clear thread when switching conversations
|
|
484
405
|
this.isNewUnsavedConversation = false;
|
|
485
406
|
this.updateUrl();
|
|
407
|
+
this.updateTabTitle();
|
|
486
408
|
// Auto-collapse if mobile OR if sidebar is not pinned
|
|
487
409
|
if (this.isMobileView || !this.isSidebarPinned) {
|
|
488
410
|
this.collapseSidebar();
|
|
@@ -681,6 +603,7 @@ let ChatConversationsResource = class ChatConversationsResource extends BaseReso
|
|
|
681
603
|
this.selectedThreadId = null;
|
|
682
604
|
this.isNewUnsavedConversation = true;
|
|
683
605
|
this.updateUrl();
|
|
606
|
+
this.NotifyDisplayNameChanged('New Conversation');
|
|
684
607
|
// Auto-collapse if mobile OR if sidebar is not pinned
|
|
685
608
|
if (this.isMobileView || !this.isSidebarPinned) {
|
|
686
609
|
this.collapseSidebar();
|
|
@@ -697,7 +620,9 @@ let ChatConversationsResource = class ChatConversationsResource extends BaseReso
|
|
|
697
620
|
this.selectedConversationId = event.conversation.ID;
|
|
698
621
|
this.selectedConversation = event.conversation;
|
|
699
622
|
this.isNewUnsavedConversation = false;
|
|
623
|
+
this.bridge.SetActiveFromWorkspace(event.conversation.ID);
|
|
700
624
|
this.updateUrl();
|
|
625
|
+
this.updateTabTitle();
|
|
701
626
|
}
|
|
702
627
|
/**
|
|
703
628
|
* Handle conversation rename event
|
|
@@ -705,6 +630,10 @@ let ChatConversationsResource = class ChatConversationsResource extends BaseReso
|
|
|
705
630
|
onConversationRenamed(event) {
|
|
706
631
|
// Trigger rename animation in the list
|
|
707
632
|
this.renamedConversationId = event.conversationId;
|
|
633
|
+
// Update tab title with the new name
|
|
634
|
+
if (event.name) {
|
|
635
|
+
this.NotifyDisplayNameChanged(event.name);
|
|
636
|
+
}
|
|
708
637
|
// Clear the animation trigger after it completes
|
|
709
638
|
setTimeout(() => {
|
|
710
639
|
this.renamedConversationId = null;
|
|
@@ -845,7 +774,7 @@ let ChatConversationsResource = class ChatConversationsResource extends BaseReso
|
|
|
845
774
|
console.warn('No artifacts found in conversation to open for Report/Dashboard command');
|
|
846
775
|
}
|
|
847
776
|
}
|
|
848
|
-
static ɵfac = function ChatConversationsResource_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ChatConversationsResource)(i0.ɵɵdirectiveInject(i1.NavigationService), i0.ɵɵdirectiveInject(i2.
|
|
777
|
+
static ɵfac = function ChatConversationsResource_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ChatConversationsResource)(i0.ɵɵdirectiveInject(i1.NavigationService), i0.ɵɵdirectiveInject(i2.MentionAutocompleteService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i2.ConversationStreamingService), i0.ɵɵdirectiveInject(i2.ActiveTasksService), i0.ɵɵdirectiveInject(i2.UICommandHandlerService), i0.ɵɵdirectiveInject(i2.ConversationBridgeService)); };
|
|
849
778
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ChatConversationsResource, selectors: [["mj-chat-conversations-resource"]], viewQuery: function ChatConversationsResource_Query(rf, ctx) { if (rf & 1) {
|
|
850
779
|
i0.ɵɵviewQuery(_c0, 5)(_c1, 5);
|
|
851
780
|
} if (rf & 2) {
|
|
@@ -859,7 +788,7 @@ let ChatConversationsResource = class ChatConversationsResource extends BaseReso
|
|
|
859
788
|
i0.ɵɵelement(2, "mj-toast");
|
|
860
789
|
} if (rf & 2) {
|
|
861
790
|
i0.ɵɵconditional(ctx.isReady ? 0 : 1);
|
|
862
|
-
} }, dependencies: [i2.ConversationListComponent, i2.ConversationChatAreaComponent, i2.ToastComponent,
|
|
791
|
+
} }, dependencies: [i2.ConversationListComponent, i2.ConversationChatAreaComponent, i2.ToastComponent, i3.LoadingComponent], styles: ["\n :host {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n }\n\n .chat-conversations-container {\n display: flex;\n width: 100%;\n height: 100%;\n flex: 1;\n overflow: hidden;\n position: relative;\n }\n\n .conversation-sidebar {\n flex-shrink: 0;\n border-right: 1px solid var(--mj-border-default);\n overflow-y: auto;\n background: var(--mj-bg-surface-sunken);\n transition: width 0.3s ease;\n }\n\n /* Disable transitions during initial load to prevent jarring animation */\n .conversation-sidebar.no-transition {\n transition: none !important;\n }\n\n .conversation-sidebar.collapsed {\n width: 0 !important;\n min-width: 0;\n border-right: none;\n overflow: hidden;\n }\n\n /* Resize handle for sidebar */\n .sidebar-resize-handle {\n width: 4px;\n background: transparent;\n cursor: ew-resize;\n flex-shrink: 0;\n position: relative;\n transition: background-color 0.2s;\n }\n\n .sidebar-resize-handle:hover {\n background: var(--mj-brand-primary);\n }\n\n .sidebar-resize-handle:active {\n background: var(--mj-brand-primary-hover);\n }\n\n .sidebar-resize-handle::before {\n content: '';\n position: absolute;\n left: -4px;\n right: -4px;\n top: 0;\n bottom: 0;\n cursor: ew-resize;\n }\n\n .conversation-main {\n flex: 1;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n }\n\n .initializing-container {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n flex: 1;\n }\n "], encapsulation: 2 });
|
|
863
792
|
};
|
|
864
793
|
ChatConversationsResource = __decorate([
|
|
865
794
|
RegisterClass(BaseResourceComponent, 'ChatConversationsResource')
|
|
@@ -940,7 +869,7 @@ export { ChatConversationsResource };
|
|
|
940
869
|
<!-- Toast notifications container -->
|
|
941
870
|
<mj-toast></mj-toast>
|
|
942
871
|
`, encapsulation: ViewEncapsulation.None, styles: ["\n :host {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n }\n\n .chat-conversations-container {\n display: flex;\n width: 100%;\n height: 100%;\n flex: 1;\n overflow: hidden;\n position: relative;\n }\n\n .conversation-sidebar {\n flex-shrink: 0;\n border-right: 1px solid var(--mj-border-default);\n overflow-y: auto;\n background: var(--mj-bg-surface-sunken);\n transition: width 0.3s ease;\n }\n\n /* Disable transitions during initial load to prevent jarring animation */\n .conversation-sidebar.no-transition {\n transition: none !important;\n }\n\n .conversation-sidebar.collapsed {\n width: 0 !important;\n min-width: 0;\n border-right: none;\n overflow: hidden;\n }\n\n /* Resize handle for sidebar */\n .sidebar-resize-handle {\n width: 4px;\n background: transparent;\n cursor: ew-resize;\n flex-shrink: 0;\n position: relative;\n transition: background-color 0.2s;\n }\n\n .sidebar-resize-handle:hover {\n background: var(--mj-brand-primary);\n }\n\n .sidebar-resize-handle:active {\n background: var(--mj-brand-primary-hover);\n }\n\n .sidebar-resize-handle::before {\n content: '';\n position: absolute;\n left: -4px;\n right: -4px;\n top: 0;\n bottom: 0;\n cursor: ew-resize;\n }\n\n .conversation-main {\n flex: 1;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n }\n\n .initializing-container {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n flex: 1;\n }\n "] }]
|
|
943
|
-
}], () => [{ type: i1.NavigationService }, { type: i2.
|
|
872
|
+
}], () => [{ type: i1.NavigationService }, { type: i2.MentionAutocompleteService }, { type: i0.ChangeDetectorRef }, { type: i2.ConversationStreamingService }, { type: i2.ActiveTasksService }, { type: i2.UICommandHandlerService }, { type: i2.ConversationBridgeService }], { conversationList: [{
|
|
944
873
|
type: ViewChild,
|
|
945
874
|
args: ['conversationList']
|
|
946
875
|
}], chatArea: [{
|
|
@@ -953,5 +882,5 @@ export { ChatConversationsResource };
|
|
|
953
882
|
type: HostListener,
|
|
954
883
|
args: ['document:click', ['$event']]
|
|
955
884
|
}] }); })();
|
|
956
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ChatConversationsResource, { className: "ChatConversationsResource", filePath: "src/lib/resource-wrappers/chat-conversations-resource.component.ts", lineNumber:
|
|
885
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ChatConversationsResource, { className: "ChatConversationsResource", filePath: "src/lib/resource-wrappers/chat-conversations-resource.component.ts", lineNumber: 182 }); })();
|
|
957
886
|
//# sourceMappingURL=chat-conversations-resource.component.js.map
|