@nextclaw/ui 0.15.3 → 0.15.4
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/CHANGELOG.md +21 -0
- package/dist/assets/aiden0z-pptx-renderer.es-Bd99vut2.js +94 -0
- package/dist/assets/api-BOXOrpcJ.js +13 -0
- package/dist/assets/app-presenter-provider-CkHLbvZQ.js +106 -0
- package/dist/assets/app-presenter-provider-D3BuuOyZ.css +1 -0
- package/dist/assets/appearance-settings-page-fLIJbx1C.js +1 -0
- package/dist/assets/{book-open-C3mJGwiy.js → book-open-DWUjS6aW.js} +1 -1
- package/dist/assets/channels-list-page-CvCTJraa.js +8 -0
- package/dist/assets/chat-page-B42UUIFR.js +1 -0
- package/dist/assets/chunk-DseTPa7n.js +1 -0
- package/dist/assets/config-split-page-DBgt9S8b.js +1 -0
- package/dist/assets/confirm-dialog-GSXIvoRU.js +5 -0
- package/dist/assets/desktop-update-config-7bmNeWIC.js +1 -0
- package/dist/assets/dist-DC7f4TJH.js +41 -0
- package/dist/assets/doc-browser-CgdoLUT92.js +1 -0
- package/dist/assets/doc-browser-D0monHjG.js +1 -0
- package/dist/assets/doc-browser-context-CGwEOhBy.js +1 -0
- package/dist/assets/docx-preview-eFH9DRsS.js +20 -0
- package/dist/assets/download-DiP9zx-J.js +1 -0
- package/dist/assets/{external-link-CU0kzzIP.js → external-link-C6ZeSPef.js} +1 -1
- package/dist/assets/eye-suvKmtwn.js +1 -0
- package/dist/assets/folder-CMELbQGG.js +1 -0
- package/dist/assets/{form-actions-BvCp_0lS.js → form-actions-CUAzpNe_.js} +1 -1
- package/dist/assets/index-BFeNDQ4R.css +1 -0
- package/dist/assets/index-D_6U-M94.js +2 -0
- package/dist/assets/jszip.min-Das2IAnb.js +2 -0
- package/dist/assets/loader-circle-tYHStefV.js +1 -0
- package/dist/assets/logo-badge-Cu5UGH_4.js +1 -0
- package/dist/assets/mcp-marketplace-page-BUzHDwW6.js +9 -0
- package/dist/assets/mcp-marketplace-page-ohUAdfqJ.js +1 -0
- package/dist/assets/model-config-page-CWP6pyBm.js +1 -0
- package/dist/assets/plus-tywizkeY.js +1 -0
- package/dist/assets/popover-DImguRok.js +1 -0
- package/dist/assets/provider-models-C_yOh6DE.js +1 -0
- package/dist/assets/provider-scoped-model-input-CE7p4SbJ.js +1 -0
- package/dist/assets/providers-config-page-BKPo8SjH.js +1 -0
- package/dist/assets/react-5sjAT_6d.js +8 -0
- package/dist/assets/{refresh-cw-CILd1vAP.js → refresh-cw-CHLBzWWj.js} +1 -1
- package/dist/assets/remote-DXJryUxB.js +1 -0
- package/dist/assets/rotate-cw-BefO5brU.js +1 -0
- package/dist/assets/runtime-config-page-1Axv4QGu.js +1 -0
- package/dist/assets/{save-ByJqcPTP.js → save-BABzyrjB.js} +1 -1
- package/dist/assets/{search-DVIV6pfD.js → search-BTqxG3ZG.js} +1 -1
- package/dist/assets/search-config-page-BkKKmxmS.js +1 -0
- package/dist/assets/secrets-config-page-CWJMyu-k.js +3 -0
- package/dist/assets/security-config-DeQUIXfi.js +1 -0
- package/dist/assets/select-TYZDBNmq.js +1 -0
- package/dist/assets/setting-row-DR23Z_5I.js +1 -0
- package/dist/assets/{settings-2-CH5shGg_.js → settings-2-D8WWcBnw.js} +1 -1
- package/dist/assets/{skeleton-DeX1FKw7.js → skeleton-CloHeg0S.js} +1 -1
- package/dist/assets/tabs-CX-ckWoo.js +1 -0
- package/dist/assets/tag-chip-mCc23Rhb.js +1 -0
- package/dist/assets/trash-2-SAW1Z4Po.js +1 -0
- package/dist/assets/use-config-BucdaK23.js +1 -0
- package/dist/assets/use-confirm-dialog-C95F6sT1.js +1 -0
- package/dist/assets/use-viewport-layout-C6m3Nte7.js +1 -0
- package/dist/assets/x-DtCPHwCu.js +1 -0
- package/dist/assets/xlsx-B6zVt1RK.js +64 -0
- package/dist/index.html +34 -28
- package/package.json +11 -6
- package/src/features/chat/components/__tests__/chat-popover-content.test.tsx +41 -0
- package/src/features/chat/components/chat-popover-content.tsx +26 -0
- package/src/features/chat/components/conversation/__tests__/chat-conversation-content.test.tsx +13 -0
- package/src/features/chat/components/conversation/__tests__/chat-conversation-header-section.test.tsx +21 -11
- package/src/features/chat/components/conversation/__tests__/chat-conversation-header.test.tsx +2 -2
- package/src/features/chat/components/conversation/__tests__/chat-conversation-workspace-section.test.tsx +28 -1
- package/src/features/chat/components/conversation/chat-conversation-content.tsx +5 -4
- package/src/features/chat/components/conversation/chat-conversation-header-section.tsx +9 -18
- package/src/features/chat/components/conversation/chat-conversation-track.tsx +35 -0
- package/src/features/chat/components/conversation/chat-conversation-workspace-section.tsx +1 -0
- package/src/features/chat/components/layout/chat-sidebar-toolbar.tsx +7 -7
- package/src/features/chat/components/layout/chat-sidebar-utility-menu.tsx +3 -14
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-input.streaming.test.tsx +20 -1
- package/src/features/chat/features/conversation/components/session-conversation-input.tsx +69 -54
- package/src/features/chat/features/message/components/chat-message-list.container.tsx +16 -1
- package/src/features/chat/features/message/utils/__tests__/chat-message-file-operation.utils.test.ts +30 -0
- package/src/features/chat/features/session/components/__tests__/chat-sidebar-session-item.test.tsx +37 -0
- package/src/features/chat/features/session/components/chat-sidebar-project-groups.tsx +4 -3
- package/src/features/chat/features/session/components/chat-sidebar-session-item.tsx +3 -8
- package/src/features/chat/features/session/components/session-header/__tests__/chat-session-header-actions.test.tsx +65 -20
- package/src/features/chat/features/session/components/session-header/chat-session-header-actions.tsx +26 -28
- package/src/features/chat/features/session/components/session-header/chat-session-project-badge.tsx +3 -3
- package/src/features/chat/features/session/components/session-header/chat-session-title-switcher.tsx +3 -3
- package/src/features/chat/features/welcome/components/chat-welcome-project-picker.tsx +3 -3
- package/src/features/chat/features/welcome/components/chat-welcome-session-type-picker.tsx +3 -3
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-file-preview.test.tsx +403 -106
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel-content.test.tsx +113 -2
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel.test.tsx +1 -0
- package/src/features/chat/features/workspace/components/chat-session-workspace-directory-browser.tsx +197 -44
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-breadcrumb-browser.tsx +9 -3
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-breadcrumbs.tsx +7 -5
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +57 -177
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-content.tsx +239 -1
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-nav.tsx +56 -6
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel.tsx +29 -7
- package/src/features/chat/features/workspace/components/file-content-preview/use-workspace-file-buffer.ts +42 -0
- package/src/features/chat/features/workspace/components/file-content-preview/workspace-document-preview-state.tsx +18 -0
- package/src/features/chat/features/workspace/components/file-content-preview/workspace-docx-preview.css +89 -0
- package/src/features/chat/features/workspace/components/file-content-preview/workspace-docx-preview.tsx +87 -0
- package/src/features/chat/features/workspace/components/file-content-preview/workspace-presentation-preview.tsx +82 -0
- package/src/features/chat/features/workspace/components/file-content-preview/workspace-spreadsheet-preview.tsx +180 -0
- package/src/features/chat/features/workspace/components/workspace-file-content-preview.tsx +191 -0
- package/src/features/chat/features/workspace/hooks/use-chat-conversation-workspace-state.ts +1 -4
- package/src/features/chat/features/workspace/utils/__tests__/chat-workspace-panel-view-model.utils.test.ts +53 -10
- package/src/features/chat/features/workspace/utils/chat-thread-workspace-session.utils.ts +68 -2
- package/src/features/chat/features/workspace/utils/chat-workspace-file-tab-persistence.utils.ts +17 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-file-tab.utils.ts +63 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-file-viewer.utils.ts +49 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-panel-layout.utils.ts +13 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-panel-view-model.utils.ts +120 -38
- package/src/features/chat/index.ts +1 -0
- package/src/features/chat/managers/__tests__/chat-thread-workspace.manager.test.ts +76 -0
- package/src/features/chat/managers/__tests__/chat-thread.manager.test.ts +44 -60
- package/src/features/chat/managers/chat-thread.manager.ts +123 -126
- package/src/features/chat/pages/ncp-chat-page.tsx +1 -2
- package/src/features/chat/stores/__tests__/chat-thread.store.test.ts +78 -1
- package/src/features/chat/stores/chat-message-layout.store.test.ts +37 -0
- package/src/features/chat/stores/chat-message-layout.store.ts +41 -0
- package/src/features/chat/stores/chat-thread.store.ts +70 -13
- package/src/features/settings/pages/__tests__/appearance-settings-page.test.tsx +25 -8
- package/src/features/settings/pages/appearance-settings-page.tsx +92 -13
- package/src/index.css +36 -2
- package/src/shared/components/__tests__/file-type-icon.test.tsx +61 -0
- package/src/shared/components/doc-browser/__tests__/doc-browser-context.test.tsx +19 -0
- package/src/shared/components/doc-browser/__tests__/doc-browser.test.tsx +16 -0
- package/src/shared/components/doc-browser/doc-browser-context.tsx +1 -0
- package/src/shared/components/doc-browser/doc-browser.tsx +11 -3
- package/src/shared/components/doc-browser/managers/doc-browser.manager.ts +5 -0
- package/src/shared/components/doc-browser/stores/doc-browser.store.ts +6 -1
- package/src/shared/components/doc-browser/types/doc-browser.types.ts +2 -0
- package/src/shared/components/doc-browser/utils/doc-browser-state.utils.ts +11 -0
- package/src/shared/components/file-type-icon.tsx +272 -0
- package/src/shared/components/resizable-right-panel/__tests__/resizable-right-panel.test.tsx +22 -0
- package/src/shared/components/resizable-right-panel/resizable-right-panel.tsx +17 -2
- package/src/shared/components/ui/tab-strip/__tests__/compact-tab-strip.test.tsx +38 -0
- package/src/shared/components/ui/tab-strip/compact-tab-strip.tsx +82 -2
- package/src/shared/lib/api/__tests__/server-path.utils.test.ts +28 -0
- package/src/shared/lib/api/utils/server-path.utils.ts +19 -20
- package/src/shared/lib/i18n/locales/en-US/chat.json +17 -1
- package/src/shared/lib/i18n/locales/en-US/core.json +6 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +17 -1
- package/src/shared/lib/i18n/locales/zh-CN/core.json +6 -0
- package/dist/assets/api-iNBpppzj.js +0 -13
- package/dist/assets/appearance-settings-page-DMffQFR3.js +0 -1
- package/dist/assets/channels-list-page-CCtp0BRS.js +0 -8
- package/dist/assets/chat-page-H5a0dWvO.js +0 -1
- package/dist/assets/config-split-page-CrOJgB-Y.js +0 -1
- package/dist/assets/confirm-dialog-Chv50USy.js +0 -5
- package/dist/assets/desktop-update-config-KzTuXRf_.js +0 -1
- package/dist/assets/dist-BunzmC4B.js +0 -1
- package/dist/assets/dist-ChmGwvtK.js +0 -1
- package/dist/assets/doc-browser-DNRL4Zvd.js +0 -1
- package/dist/assets/doc-browser-Dg0pmkOg.js +0 -1
- package/dist/assets/doc-browser-context-BHY-0FSD.js +0 -1
- package/dist/assets/es2015-DQZ5JWwK.js +0 -41
- package/dist/assets/i18n-provider-Cu8XyZb_.js +0 -1
- package/dist/assets/index-CzfBdvK1.css +0 -1
- package/dist/assets/index-DGqHne1Q.js +0 -104
- package/dist/assets/loader-circle-CDSFuzmk.js +0 -1
- package/dist/assets/mcp-marketplace-page-BeEQK0DL.js +0 -9
- package/dist/assets/mcp-marketplace-page-D6idOTLp.js +0 -1
- package/dist/assets/model-config-page-bNNo-XyG.js +0 -1
- package/dist/assets/plus-D4DsdLN-.js +0 -1
- package/dist/assets/provider-scoped-model-input-IlgQCsoT.js +0 -1
- package/dist/assets/providers-config-page-wLo6CAJw.js +0 -1
- package/dist/assets/react-BPIsQIlO.js +0 -8
- package/dist/assets/remote-uKEYp7AR.js +0 -1
- package/dist/assets/rotate-cw-wPFPg1kH.js +0 -1
- package/dist/assets/runtime-config-page-DDn1sP4G.js +0 -1
- package/dist/assets/search-config-page-B-Cf4iiB.js +0 -1
- package/dist/assets/secrets-config-page-DPKsY8Iw.js +0 -3
- package/dist/assets/security-config-e9SSBlKr.js +0 -1
- package/dist/assets/select-BdgczSNw.js +0 -1
- package/dist/assets/setting-row-BkTVUTKx.js +0 -1
- package/dist/assets/side-dock-BsBvcJ9i.js +0 -3
- package/dist/assets/switch-Cv8Ekb3x.js +0 -1
- package/dist/assets/tag-chip-RB9uKcoC.js +0 -1
- package/dist/assets/tooltip-oQlEN-l6.js +0 -1
- package/dist/assets/use-config-l3W7y8Qz.js +0 -1
- package/dist/assets/use-confirm-dialog-BAxaVOJI.js +0 -1
- package/dist/assets/x-BBMffEN0.js +0 -1
- /package/dist/assets/{config-hints-C_iP1zl_.js → config-hints-fDrYfl0l.js} +0 -0
- /package/dist/assets/{host-capabilities-9bB_998Z.js → host-capabilities-zZvY9U63.js} +0 -0
- /package/dist/assets/{middleware-BILWbJE4.js → middleware-BLMHv9YF.js} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ChatFileOpenActionViewModel } from '@nextclaw/agent-chat-ui';
|
|
2
|
+
import type { ChatWorkspaceFileTab } from '@/features/chat/stores/chat-thread.store';
|
|
3
|
+
import { normalizeWorkspaceFilePreviewViewer } from './chat-workspace-file-viewer.utils';
|
|
4
|
+
|
|
5
|
+
export function createWorkspaceFileTab(
|
|
6
|
+
action: ChatFileOpenActionViewModel,
|
|
7
|
+
parentSessionKey: string | null,
|
|
8
|
+
): ChatWorkspaceFileTab | null {
|
|
9
|
+
const path = action.path.trim();
|
|
10
|
+
if (!path) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const normalizedParentSessionKey = parentSessionKey?.trim() || null;
|
|
14
|
+
const previewViewer = action.viewMode === 'preview'
|
|
15
|
+
? normalizeWorkspaceFilePreviewViewer(path, action.previewViewer)
|
|
16
|
+
: action.previewViewer ?? null;
|
|
17
|
+
const viewIdentity = action.viewMode === 'preview' && previewViewer === 'rendered'
|
|
18
|
+
? 'preview:rendered'
|
|
19
|
+
: action.viewMode;
|
|
20
|
+
return {
|
|
21
|
+
key: `${normalizedParentSessionKey ?? 'draft'}::${viewIdentity}::${path}`,
|
|
22
|
+
parentSessionKey: normalizedParentSessionKey,
|
|
23
|
+
path,
|
|
24
|
+
label: action.label?.trim() || null,
|
|
25
|
+
viewMode: action.viewMode,
|
|
26
|
+
previewViewer,
|
|
27
|
+
line: action.line ?? null,
|
|
28
|
+
column: action.column ?? null,
|
|
29
|
+
rawText: action.rawText ?? null,
|
|
30
|
+
contentUrl: action.contentUrl?.trim() || null,
|
|
31
|
+
mimeType: action.mimeType?.trim() || null,
|
|
32
|
+
beforeText: action.beforeText ?? null,
|
|
33
|
+
afterText: action.afterText ?? null,
|
|
34
|
+
patchText: action.patchText ?? null,
|
|
35
|
+
oldStartLine: action.oldStartLine ?? null,
|
|
36
|
+
newStartLine: action.newStartLine ?? null,
|
|
37
|
+
fullLines: action.fullLines,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function upsertWorkspaceFileTab(
|
|
42
|
+
tabs: readonly ChatWorkspaceFileTab[],
|
|
43
|
+
nextTab: ChatWorkspaceFileTab,
|
|
44
|
+
adjacentToKey?: string,
|
|
45
|
+
): ChatWorkspaceFileTab[] {
|
|
46
|
+
const existingIndex = tabs.findIndex((tab) => tab.key === nextTab.key);
|
|
47
|
+
if (existingIndex !== -1) {
|
|
48
|
+
const nextTabs = [...tabs];
|
|
49
|
+
nextTabs[existingIndex] = { ...tabs[existingIndex], ...nextTab };
|
|
50
|
+
return nextTabs;
|
|
51
|
+
}
|
|
52
|
+
const adjacentIndex = adjacentToKey
|
|
53
|
+
? tabs.findIndex((tab) => tab.key === adjacentToKey)
|
|
54
|
+
: -1;
|
|
55
|
+
if (adjacentIndex === -1) {
|
|
56
|
+
return [nextTab, ...tabs];
|
|
57
|
+
}
|
|
58
|
+
return [
|
|
59
|
+
...tabs.slice(0, adjacentIndex + 1),
|
|
60
|
+
nextTab,
|
|
61
|
+
...tabs.slice(adjacentIndex + 1),
|
|
62
|
+
];
|
|
63
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ChatFilePreviewViewer } from "@nextclaw/agent-chat-ui";
|
|
2
|
+
|
|
3
|
+
export type ChatWorkspaceFileViewer = "source" | "rendered";
|
|
4
|
+
|
|
5
|
+
function resolveDualViewFileKind(path: string): "html" | "markdown" | null {
|
|
6
|
+
if (/\.html?$/i.test(path)) {
|
|
7
|
+
return "html";
|
|
8
|
+
}
|
|
9
|
+
if (/\.mdx?$/i.test(path)) {
|
|
10
|
+
return "markdown";
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function resolveWorkspaceFileViewer(
|
|
16
|
+
path: string,
|
|
17
|
+
viewer?: ChatFilePreviewViewer | null,
|
|
18
|
+
): ChatWorkspaceFileViewer | null {
|
|
19
|
+
const kind = resolveDualViewFileKind(path);
|
|
20
|
+
if (kind === "html") {
|
|
21
|
+
return viewer === "rendered" ? "rendered" : "source";
|
|
22
|
+
}
|
|
23
|
+
if (kind === "markdown") {
|
|
24
|
+
return viewer === "source" ? "source" : "rendered";
|
|
25
|
+
}
|
|
26
|
+
if (viewer === "source" || viewer === "rendered") {
|
|
27
|
+
return viewer;
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function normalizeWorkspaceFilePreviewViewer(
|
|
33
|
+
path: string,
|
|
34
|
+
viewer?: ChatFilePreviewViewer | null,
|
|
35
|
+
): ChatFilePreviewViewer | null {
|
|
36
|
+
return resolveWorkspaceFileViewer(path, viewer) ?? viewer ?? null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function resolveAlternateWorkspaceFileViewer(
|
|
40
|
+
path: string,
|
|
41
|
+
viewer?: ChatFilePreviewViewer | null,
|
|
42
|
+
): ChatWorkspaceFileViewer | null {
|
|
43
|
+
if (!resolveDualViewFileKind(path)) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return resolveWorkspaceFileViewer(path, viewer) === "source"
|
|
47
|
+
? "rendered"
|
|
48
|
+
: "source";
|
|
49
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const CHAT_WORKSPACE_PANEL_DEFAULT_WIDTH = 480;
|
|
2
|
+
export const CHAT_WORKSPACE_PANEL_MIN_WIDTH = 360;
|
|
3
|
+
export const CHAT_WORKSPACE_PANEL_MAX_WIDTH = 860;
|
|
4
|
+
|
|
5
|
+
export function normalizeChatWorkspacePanelWidth(value: unknown): number {
|
|
6
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
7
|
+
return CHAT_WORKSPACE_PANEL_DEFAULT_WIDTH;
|
|
8
|
+
}
|
|
9
|
+
return Math.max(
|
|
10
|
+
CHAT_WORKSPACE_PANEL_MIN_WIDTH,
|
|
11
|
+
Math.min(CHAT_WORKSPACE_PANEL_MAX_WIDTH, value),
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import type { ResolvedChildSessionTab } from "@/features/chat/features/ncp/hooks/use-ncp-child-session-tabs-view";
|
|
2
2
|
import { shouldShowUnreadSessionIndicator } from "@/features/chat/stores/chat-session-list.store";
|
|
3
3
|
import type {
|
|
4
|
+
ChatWorkspacePanelKind,
|
|
4
5
|
ChatWorkspaceFileTab,
|
|
5
6
|
ChatWorkspaceSideChatDraft,
|
|
6
7
|
} from "@/features/chat/stores/chat-thread.store";
|
|
7
8
|
import { t } from "@/shared/lib/i18n";
|
|
9
|
+
import {
|
|
10
|
+
resolveAlternateWorkspaceFileViewer,
|
|
11
|
+
resolveWorkspaceFileViewer,
|
|
12
|
+
type ChatWorkspaceFileViewer,
|
|
13
|
+
} from "@/features/chat/features/workspace/utils/chat-workspace-file-viewer.utils";
|
|
8
14
|
|
|
9
15
|
export type WorkspaceSelection =
|
|
16
|
+
| {
|
|
17
|
+
kind: "overview";
|
|
18
|
+
}
|
|
19
|
+
| {
|
|
20
|
+
kind: "child-sessions";
|
|
21
|
+
}
|
|
10
22
|
| {
|
|
11
23
|
kind: "child-session";
|
|
12
24
|
tab: ResolvedChildSessionTab;
|
|
@@ -15,6 +27,9 @@ export type WorkspaceSelection =
|
|
|
15
27
|
kind: "side-chat-draft";
|
|
16
28
|
draft: ChatWorkspaceSideChatDraft;
|
|
17
29
|
}
|
|
30
|
+
| {
|
|
31
|
+
kind: "project-files";
|
|
32
|
+
}
|
|
18
33
|
| {
|
|
19
34
|
kind: "file";
|
|
20
35
|
file: ChatWorkspaceFileTab;
|
|
@@ -25,13 +40,20 @@ export type WorkspaceSelection =
|
|
|
25
40
|
|
|
26
41
|
export type WorkspaceTabViewModel = {
|
|
27
42
|
key: string;
|
|
28
|
-
kind:
|
|
43
|
+
kind: ChatWorkspacePanelKind;
|
|
29
44
|
title: string;
|
|
30
45
|
tooltip: string;
|
|
31
46
|
active: boolean;
|
|
32
47
|
agentId?: string | null;
|
|
48
|
+
fileName?: string | null;
|
|
33
49
|
showUnreadDot?: boolean;
|
|
34
50
|
viewMode?: "preview" | "diff";
|
|
51
|
+
isRenderedPreview?: boolean;
|
|
52
|
+
alternateViewerAction?: {
|
|
53
|
+
label: string;
|
|
54
|
+
viewer: ChatWorkspaceFileViewer;
|
|
55
|
+
onSelect: () => void;
|
|
56
|
+
} | null;
|
|
35
57
|
onSelect: () => void;
|
|
36
58
|
onClose?: () => void;
|
|
37
59
|
};
|
|
@@ -42,13 +64,12 @@ export function readWorkspaceFileTitle(file: ChatWorkspaceFileTab): string {
|
|
|
42
64
|
}
|
|
43
65
|
|
|
44
66
|
export function resolveWorkspaceSelection(params: {
|
|
45
|
-
activePanelKind?:
|
|
67
|
+
activePanelKind?: ChatWorkspacePanelKind | null;
|
|
46
68
|
activeChildSessionKey: string | null;
|
|
47
69
|
activeSideChatDraft: ChatWorkspaceSideChatDraft | null;
|
|
48
70
|
activeWorkspaceFileKey: string | null;
|
|
49
71
|
childSessionTabs: ResolvedChildSessionTab[];
|
|
50
72
|
workspaceFileTabs: readonly ChatWorkspaceFileTab[];
|
|
51
|
-
sessionCronJobCount: number;
|
|
52
73
|
}): WorkspaceSelection | null {
|
|
53
74
|
const {
|
|
54
75
|
activePanelKind,
|
|
@@ -57,10 +78,21 @@ export function resolveWorkspaceSelection(params: {
|
|
|
57
78
|
activeWorkspaceFileKey,
|
|
58
79
|
childSessionTabs,
|
|
59
80
|
workspaceFileTabs,
|
|
60
|
-
sessionCronJobCount,
|
|
61
81
|
} = params;
|
|
62
82
|
|
|
63
|
-
if (activePanelKind === "
|
|
83
|
+
if (activePanelKind === "overview") {
|
|
84
|
+
return { kind: "overview" };
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (activePanelKind === "child-sessions") {
|
|
88
|
+
return { kind: "child-sessions" };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (activePanelKind === "project-files") {
|
|
92
|
+
return { kind: "project-files" };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (activePanelKind === "cron") {
|
|
64
96
|
return { kind: "cron" };
|
|
65
97
|
}
|
|
66
98
|
|
|
@@ -116,10 +148,6 @@ export function resolveWorkspaceSelection(params: {
|
|
|
116
148
|
};
|
|
117
149
|
}
|
|
118
150
|
|
|
119
|
-
if (sessionCronJobCount > 0) {
|
|
120
|
-
return { kind: "cron" };
|
|
121
|
-
}
|
|
122
|
-
|
|
123
151
|
return null;
|
|
124
152
|
}
|
|
125
153
|
|
|
@@ -127,27 +155,68 @@ export function buildWorkspaceTabsViewModel(params: {
|
|
|
127
155
|
resolvedChildTabs: ResolvedChildSessionTab[];
|
|
128
156
|
activeSideChatDraft: ChatWorkspaceSideChatDraft | null;
|
|
129
157
|
workspaceFileTabs: readonly ChatWorkspaceFileTab[];
|
|
130
|
-
sessionCronJobCount: number;
|
|
131
158
|
activeSelection: WorkspaceSelection | null;
|
|
132
159
|
optimisticReadAtBySessionKey: Record<string, string>;
|
|
133
160
|
onSelectSession: (sessionKey: string) => void;
|
|
134
161
|
onSelectFile: (fileKey: string) => void;
|
|
162
|
+
onOpenFileViewer: (fileKey: string, viewer: ChatWorkspaceFileViewer) => void;
|
|
135
163
|
onCloseFile: (fileKey: string) => void;
|
|
164
|
+
onSelectOverview: () => void;
|
|
165
|
+
onSelectChildSessions: () => void;
|
|
166
|
+
onSelectProjectFiles: () => void;
|
|
136
167
|
onSelectCronJobs: () => void;
|
|
137
168
|
}): WorkspaceTabViewModel[] {
|
|
138
169
|
const {
|
|
139
170
|
activeSideChatDraft,
|
|
140
171
|
resolvedChildTabs,
|
|
141
172
|
workspaceFileTabs,
|
|
142
|
-
sessionCronJobCount,
|
|
143
173
|
activeSelection,
|
|
144
174
|
optimisticReadAtBySessionKey,
|
|
145
175
|
onSelectSession,
|
|
146
176
|
onSelectFile,
|
|
177
|
+
onOpenFileViewer,
|
|
147
178
|
onCloseFile,
|
|
179
|
+
onSelectOverview,
|
|
180
|
+
onSelectChildSessions,
|
|
181
|
+
onSelectProjectFiles,
|
|
148
182
|
onSelectCronJobs,
|
|
149
183
|
} = params;
|
|
150
184
|
|
|
185
|
+
const workspacePages = [
|
|
186
|
+
{
|
|
187
|
+
key: "overview",
|
|
188
|
+
kind: "overview" as const,
|
|
189
|
+
title: t("chatWorkspaceOverview"),
|
|
190
|
+
tooltip: t("chatWorkspaceOverview"),
|
|
191
|
+
active: activeSelection?.kind === "overview",
|
|
192
|
+
onSelect: onSelectOverview,
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
key: "child-sessions",
|
|
196
|
+
kind: "child-sessions" as const,
|
|
197
|
+
title: t("chatWorkspaceChildSessions"),
|
|
198
|
+
tooltip: t("chatWorkspaceChildSessions"),
|
|
199
|
+
active: activeSelection?.kind === "child-sessions",
|
|
200
|
+
onSelect: onSelectChildSessions,
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
key: "cron:session",
|
|
204
|
+
kind: "cron" as const,
|
|
205
|
+
title: t("chatWorkspaceSessionCronJobs"),
|
|
206
|
+
tooltip: t("chatWorkspaceSessionCronJobs"),
|
|
207
|
+
active: activeSelection?.kind === "cron",
|
|
208
|
+
onSelect: onSelectCronJobs,
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
key: "project-files",
|
|
212
|
+
kind: "project-files" as const,
|
|
213
|
+
title: t("chatWorkspaceProjectFiles"),
|
|
214
|
+
tooltip: t("chatWorkspaceProjectFiles"),
|
|
215
|
+
active: activeSelection?.kind === "project-files",
|
|
216
|
+
onSelect: onSelectProjectFiles,
|
|
217
|
+
},
|
|
218
|
+
];
|
|
219
|
+
|
|
151
220
|
const sideChatDraftTabs = activeSideChatDraft
|
|
152
221
|
? [
|
|
153
222
|
{
|
|
@@ -193,31 +262,44 @@ export function buildWorkspaceTabsViewModel(params: {
|
|
|
193
262
|
};
|
|
194
263
|
});
|
|
195
264
|
|
|
196
|
-
const fileTabs = workspaceFileTabs.map((file) =>
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
265
|
+
const fileTabs = workspaceFileTabs.map((file) => {
|
|
266
|
+
const viewer = file.viewMode === "preview"
|
|
267
|
+
? resolveWorkspaceFileViewer(file.path, file.previewViewer)
|
|
268
|
+
: null;
|
|
269
|
+
const alternateViewer = file.viewMode === "preview"
|
|
270
|
+
? resolveAlternateWorkspaceFileViewer(file.path, file.previewViewer)
|
|
271
|
+
: null;
|
|
272
|
+
const fileTitle = readWorkspaceFileTitle(file);
|
|
273
|
+
return {
|
|
274
|
+
key: `file:${file.key}`,
|
|
275
|
+
kind: "file" as const,
|
|
276
|
+
title: viewer === "rendered"
|
|
277
|
+
? `${t("chatWorkspacePreview")}: ${fileTitle}`
|
|
278
|
+
: fileTitle,
|
|
279
|
+
tooltip: file.path,
|
|
280
|
+
fileName: file.path,
|
|
281
|
+
viewMode: file.viewMode,
|
|
282
|
+
isRenderedPreview: viewer === "rendered",
|
|
283
|
+
alternateViewerAction: alternateViewer
|
|
284
|
+
? {
|
|
285
|
+
label: alternateViewer === "rendered"
|
|
286
|
+
? t("chatWorkspaceOpenPreview")
|
|
287
|
+
: t("chatWorkspaceOpenSource"),
|
|
288
|
+
viewer: alternateViewer,
|
|
289
|
+
onSelect: () => onOpenFileViewer(file.key, alternateViewer),
|
|
290
|
+
}
|
|
291
|
+
: null,
|
|
292
|
+
active:
|
|
293
|
+
activeSelection?.kind === "file" && activeSelection.file.key === file.key,
|
|
294
|
+
onSelect: () => onSelectFile(file.key),
|
|
295
|
+
onClose: () => onCloseFile(file.key),
|
|
296
|
+
};
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
return [
|
|
300
|
+
...workspacePages,
|
|
301
|
+
...sideChatDraftTabs,
|
|
302
|
+
...childTabs,
|
|
303
|
+
...fileTabs,
|
|
304
|
+
];
|
|
223
305
|
}
|
|
@@ -6,6 +6,7 @@ export { ChatPresenter } from "./presenters/chat.presenter";
|
|
|
6
6
|
export { ChatDraftIntentManager } from "./managers/chat-draft-intent.manager";
|
|
7
7
|
export { useChatSessionListStore } from "./stores/chat-session-list.store";
|
|
8
8
|
export { useChatThreadStore } from "./stores/chat-thread.store";
|
|
9
|
+
export { useChatMessageLayoutStore } from "./stores/chat-message-layout.store";
|
|
9
10
|
export { useNcpChatSessionTypes } from "./features/session-type/hooks/use-ncp-chat-session-types";
|
|
10
11
|
export {
|
|
11
12
|
buildSessionTypeOptions,
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { ChatThreadManager } from '@/features/chat/managers/chat-thread.manager';
|
|
3
|
+
import { useChatSessionListStore } from '@/features/chat/stores/chat-session-list.store';
|
|
4
|
+
import { useChatThreadStore } from '@/features/chat/stores/chat-thread.store';
|
|
5
|
+
|
|
6
|
+
function createUiManager(): ConstructorParameters<typeof ChatThreadManager>[0] {
|
|
7
|
+
return {
|
|
8
|
+
goToSession: vi.fn(),
|
|
9
|
+
} as unknown as ConstructorParameters<typeof ChatThreadManager>[0];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
describe('ChatThreadManager workspace pages', () => {
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
useChatSessionListStore.setState({
|
|
15
|
+
snapshot: {
|
|
16
|
+
...useChatSessionListStore.getState().snapshot,
|
|
17
|
+
selectedSessionKey: 'parent-session-1',
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
useChatThreadStore.setState({
|
|
21
|
+
snapshot: {
|
|
22
|
+
...useChatThreadStore.getState().snapshot,
|
|
23
|
+
workspacePanelParentKey: null,
|
|
24
|
+
activeWorkspacePanelKind: null,
|
|
25
|
+
activeChildSessionKey: null,
|
|
26
|
+
activeWorkspaceFileKey: null,
|
|
27
|
+
workspaceNavigationHistory: [],
|
|
28
|
+
workspaceNavigationHistoryIndex: 0,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('opens the stable pages as navigable session pages', () => {
|
|
34
|
+
const onWorkspacePanelOpened = vi.fn();
|
|
35
|
+
const manager = new ChatThreadManager(
|
|
36
|
+
createUiManager(),
|
|
37
|
+
{} as ConstructorParameters<typeof ChatThreadManager>[1],
|
|
38
|
+
onWorkspacePanelOpened,
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
manager.openWorkspaceOverview('parent-session-1');
|
|
42
|
+
manager.openChildSessions('parent-session-1');
|
|
43
|
+
manager.openProjectFiles('parent-session-1');
|
|
44
|
+
|
|
45
|
+
expect(useChatThreadStore.getState().snapshot).toMatchObject({
|
|
46
|
+
workspacePanelParentKey: 'parent-session-1',
|
|
47
|
+
activeWorkspacePanelKind: 'project-files',
|
|
48
|
+
workspaceNavigationHistory: [
|
|
49
|
+
{ kind: 'overview' },
|
|
50
|
+
{ kind: 'child-sessions' },
|
|
51
|
+
{ kind: 'project-files' },
|
|
52
|
+
],
|
|
53
|
+
workspaceNavigationHistoryIndex: 2,
|
|
54
|
+
});
|
|
55
|
+
expect(onWorkspacePanelOpened).toHaveBeenCalledTimes(3);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('toggles the current session workspace from the stable header action', () => {
|
|
59
|
+
const manager = new ChatThreadManager(
|
|
60
|
+
createUiManager(),
|
|
61
|
+
{} as ConstructorParameters<typeof ChatThreadManager>[1],
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
manager.toggleWorkspacePanel('parent-session-1');
|
|
65
|
+
expect(useChatThreadStore.getState().snapshot).toMatchObject({
|
|
66
|
+
workspacePanelParentKey: 'parent-session-1',
|
|
67
|
+
activeWorkspacePanelKind: 'overview',
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
manager.toggleWorkspacePanel('parent-session-1');
|
|
71
|
+
expect(useChatThreadStore.getState().snapshot).toMatchObject({
|
|
72
|
+
workspacePanelParentKey: null,
|
|
73
|
+
activeWorkspacePanelKind: null,
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -315,7 +315,7 @@ describe('ChatThreadManager', () => {
|
|
|
315
315
|
expect(useChatThreadStore.getState().snapshot.workspaceFileTabs).toEqual(
|
|
316
316
|
expect.arrayContaining([
|
|
317
317
|
expect.objectContaining({
|
|
318
|
-
key: 'parent-session-1::preview::README.md',
|
|
318
|
+
key: 'parent-session-1::preview:rendered::README.md',
|
|
319
319
|
path: 'README.md',
|
|
320
320
|
viewMode: 'preview',
|
|
321
321
|
}),
|
|
@@ -331,7 +331,31 @@ describe('ChatThreadManager', () => {
|
|
|
331
331
|
});
|
|
332
332
|
|
|
333
333
|
describe('ChatThreadManager workspace file tabs', () => {
|
|
334
|
-
it(
|
|
334
|
+
it.each([
|
|
335
|
+
{ path: 'demo.html', previewViewer: undefined, expectedViewer: 'source' },
|
|
336
|
+
{ path: 'auto.html', previewViewer: 'auto' as const, expectedViewer: 'source' },
|
|
337
|
+
{ path: 'README.md', previewViewer: undefined, expectedViewer: 'rendered' },
|
|
338
|
+
{ path: 'report.docx', previewViewer: 'auto' as const, expectedViewer: 'auto' },
|
|
339
|
+
])('normalizes the viewer for $path', ({ path, previewViewer, expectedViewer }) => {
|
|
340
|
+
const manager = new ChatThreadManager(
|
|
341
|
+
createUiManager(),
|
|
342
|
+
{} as ConstructorParameters<typeof ChatThreadManager>[1],
|
|
343
|
+
);
|
|
344
|
+
|
|
345
|
+
manager.openFilePreview({
|
|
346
|
+
path,
|
|
347
|
+
label: path,
|
|
348
|
+
viewMode: 'preview',
|
|
349
|
+
previewViewer,
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
expect(useChatThreadStore.getState().snapshot.workspaceFileTabs[0]).toMatchObject({
|
|
353
|
+
path,
|
|
354
|
+
previewViewer: expectedViewer,
|
|
355
|
+
});
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
it('opens source and rendered previews for the same file as adjacent workspace tabs', () => {
|
|
335
359
|
const manager = new ChatThreadManager(
|
|
336
360
|
createUiManager(),
|
|
337
361
|
{} as ConstructorParameters<typeof ChatThreadManager>[1],
|
|
@@ -341,10 +365,12 @@ describe('ChatThreadManager workspace file tabs', () => {
|
|
|
341
365
|
path: 'demo.html',
|
|
342
366
|
label: 'demo.html',
|
|
343
367
|
viewMode: 'preview',
|
|
368
|
+
previewViewer: 'source',
|
|
344
369
|
});
|
|
370
|
+
manager.openWorkspaceFileViewer('parent-session-1::preview::demo.html');
|
|
345
371
|
|
|
346
372
|
expect(useChatThreadStore.getState().snapshot).toMatchObject({
|
|
347
|
-
activeWorkspaceFileKey: 'parent-session-1::preview::demo.html',
|
|
373
|
+
activeWorkspaceFileKey: 'parent-session-1::preview:rendered::demo.html',
|
|
348
374
|
workspaceFileTabs: [
|
|
349
375
|
{
|
|
350
376
|
key: 'parent-session-1::preview::demo.html',
|
|
@@ -352,67 +378,25 @@ describe('ChatThreadManager workspace file tabs', () => {
|
|
|
352
378
|
viewMode: 'preview',
|
|
353
379
|
previewViewer: 'source',
|
|
354
380
|
},
|
|
355
|
-
],
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
manager.openFilePreview({
|
|
359
|
-
path: 'auto.html',
|
|
360
|
-
label: 'auto.html',
|
|
361
|
-
viewMode: 'preview',
|
|
362
|
-
previewViewer: 'auto',
|
|
363
|
-
});
|
|
364
|
-
|
|
365
|
-
expect(useChatThreadStore.getState().snapshot).toMatchObject({
|
|
366
|
-
activeWorkspaceFileKey: 'parent-session-1::preview::auto.html',
|
|
367
|
-
workspaceFileTabs: [
|
|
368
381
|
{
|
|
369
|
-
key: 'parent-session-1::preview::
|
|
370
|
-
path: '
|
|
382
|
+
key: 'parent-session-1::preview:rendered::demo.html',
|
|
383
|
+
path: 'demo.html',
|
|
371
384
|
viewMode: 'preview',
|
|
372
|
-
previewViewer: '
|
|
385
|
+
previewViewer: 'rendered',
|
|
373
386
|
},
|
|
374
|
-
expect.objectContaining({
|
|
375
|
-
key: 'parent-session-1::preview::demo.html',
|
|
376
|
-
}),
|
|
377
387
|
],
|
|
378
388
|
});
|
|
379
|
-
});
|
|
380
389
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
createUiManager(),
|
|
384
|
-
{} as ConstructorParameters<typeof ChatThreadManager>[1],
|
|
385
|
-
);
|
|
386
|
-
|
|
387
|
-
manager.openFilePreview({
|
|
388
|
-
path: 'demo.html',
|
|
389
|
-
label: 'demo.html',
|
|
390
|
-
viewMode: 'preview',
|
|
391
|
-
previewViewer: 'source',
|
|
392
|
-
});
|
|
393
|
-
manager.openFilePreview({
|
|
394
|
-
path: 'demo.html',
|
|
395
|
-
label: 'demo.html',
|
|
396
|
-
viewMode: 'preview',
|
|
397
|
-
previewViewer: 'rendered',
|
|
398
|
-
});
|
|
390
|
+
manager.openWorkspaceFileViewer('parent-session-1::preview::demo.html');
|
|
391
|
+
expect(useChatThreadStore.getState().snapshot.workspaceFileTabs).toHaveLength(2);
|
|
399
392
|
|
|
393
|
+
manager.openWorkspaceFileViewer('parent-session-1::preview:rendered::demo.html');
|
|
400
394
|
expect(useChatThreadStore.getState().snapshot).toMatchObject({
|
|
401
|
-
activeWorkspaceFileKey: 'parent-session-1::preview
|
|
402
|
-
workspaceFileTabs: [
|
|
403
|
-
{
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
viewMode: 'preview',
|
|
407
|
-
previewViewer: 'rendered',
|
|
408
|
-
},
|
|
409
|
-
{
|
|
410
|
-
key: 'parent-session-1::preview::demo.html',
|
|
411
|
-
path: 'demo.html',
|
|
412
|
-
viewMode: 'preview',
|
|
413
|
-
previewViewer: 'source',
|
|
414
|
-
},
|
|
415
|
-
],
|
|
395
|
+
activeWorkspaceFileKey: 'parent-session-1::preview::demo.html',
|
|
396
|
+
workspaceFileTabs: expect.arrayContaining([
|
|
397
|
+
expect.objectContaining({ previewViewer: 'source' }),
|
|
398
|
+
expect.objectContaining({ previewViewer: 'rendered' }),
|
|
399
|
+
]),
|
|
416
400
|
});
|
|
417
401
|
});
|
|
418
402
|
});
|
|
@@ -443,14 +427,14 @@ describe('ChatThreadManager workspace navigation', () => {
|
|
|
443
427
|
|
|
444
428
|
expect(useChatThreadStore.getState().snapshot.workspaceNavigationHistory).toEqual([
|
|
445
429
|
{ kind: 'child-session', key: 'child-session-1' },
|
|
446
|
-
{ kind: 'file', key: 'parent-session-1::preview::README.md' },
|
|
430
|
+
{ kind: 'file', key: 'parent-session-1::preview:rendered::README.md' },
|
|
447
431
|
{ kind: 'cron' },
|
|
448
432
|
]);
|
|
449
433
|
|
|
450
434
|
manager.goBackWorkspacePanel();
|
|
451
435
|
expect(useChatThreadStore.getState().snapshot).toMatchObject({
|
|
452
436
|
activeWorkspacePanelKind: 'file',
|
|
453
|
-
activeWorkspaceFileKey: 'parent-session-1::preview::README.md',
|
|
437
|
+
activeWorkspaceFileKey: 'parent-session-1::preview:rendered::README.md',
|
|
454
438
|
workspaceNavigationHistoryIndex: 1,
|
|
455
439
|
});
|
|
456
440
|
|
|
@@ -464,7 +448,7 @@ describe('ChatThreadManager workspace navigation', () => {
|
|
|
464
448
|
manager.goForwardWorkspacePanel();
|
|
465
449
|
expect(useChatThreadStore.getState().snapshot).toMatchObject({
|
|
466
450
|
activeWorkspacePanelKind: 'file',
|
|
467
|
-
activeWorkspaceFileKey: 'parent-session-1::preview::README.md',
|
|
451
|
+
activeWorkspaceFileKey: 'parent-session-1::preview:rendered::README.md',
|
|
468
452
|
workspaceNavigationHistoryIndex: 1,
|
|
469
453
|
});
|
|
470
454
|
});
|
|
@@ -520,7 +504,7 @@ describe('ChatThreadManager workspace navigation', () => {
|
|
|
520
504
|
label: 'README.md',
|
|
521
505
|
viewMode: 'preview',
|
|
522
506
|
});
|
|
523
|
-
manager.closeWorkspaceFile('parent-session-1::preview::README.md');
|
|
507
|
+
manager.closeWorkspaceFile('parent-session-1::preview:rendered::README.md');
|
|
524
508
|
|
|
525
509
|
expect(useChatThreadStore.getState().snapshot).toMatchObject({
|
|
526
510
|
activeWorkspacePanelKind: 'child-session',
|