@nextclaw/ui 0.15.3 → 0.15.5
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 +38 -0
- package/dist/assets/abnfDiagram-VRR7QNED-BYpK0F5F.js +1 -0
- package/dist/assets/aiden0z-pptx-renderer.es-D87ywFdC.js +94 -0
- package/dist/assets/api-IlX_CbwU.js +13 -0
- package/dist/assets/app-presenter-provider-Bbl_MVbg.js +106 -0
- package/dist/assets/app-presenter-provider-D3BuuOyZ.css +1 -0
- package/dist/assets/appearance-settings-page-80fLa4-9.js +1 -0
- package/dist/assets/arc-DFELHWM2.js +1 -0
- package/dist/assets/architecture-TIHT7OUA-ClwVFq-K.js +1 -0
- package/dist/assets/architectureDiagram-ZJ3FMSHR-CvRhdovL.js +36 -0
- package/dist/assets/array-BqYdCIE6.js +1 -0
- package/dist/assets/blockDiagram-677ZJIJ3-DVYNkbR_.js +132 -0
- package/dist/assets/{book-open-C3mJGwiy.js → book-open-CN7Shpij.js} +1 -1
- package/dist/assets/c4Diagram-LMCZKHZV-B1w-iwRe.js +10 -0
- package/dist/assets/channel-BEHOSFc5.js +1 -0
- package/dist/assets/channels-list-page-R7M6pzp6.js +8 -0
- package/dist/assets/chat-page-152YuwfU.js +1 -0
- package/dist/assets/chunk-2Q5K7J3B-DrIhesSX.js +1 -0
- package/dist/assets/chunk-32BRIVSS-kG3lg0bC.js +1 -0
- package/dist/assets/chunk-52WLFC77-BLeB7iGk.js +10 -0
- package/dist/assets/chunk-5FCAYU7R-BQga1Rr7.js +1 -0
- package/dist/assets/chunk-5HE753X5-DU81hkcF.js +1 -0
- package/dist/assets/chunk-5JV3BV7I-C2bAx0m7.js +1 -0
- package/dist/assets/chunk-5TONJI2A-BExIIgWY.js +2 -0
- package/dist/assets/chunk-5VM5RSS4-C3XB05yh.js +15 -0
- package/dist/assets/chunk-7BUUIJ7U-JiyRtrGu.js +1 -0
- package/dist/assets/chunk-BIQX33UG-BZRV20pI.js +1 -0
- package/dist/assets/chunk-C7G6YPKG-AsyDSQ9j.js +1 -0
- package/dist/assets/chunk-CQNSW5MT-iN-fiXVA.js +1 -0
- package/dist/assets/chunk-CYSBUYHQ-DhC_TRzI.js +1 -0
- package/dist/assets/chunk-DseTPa7n.js +1 -0
- package/dist/assets/chunk-EMLP6XTP-QFLK8R6d.js +1 -0
- package/dist/assets/chunk-EX3LRPZG-DzUwhkCz.js +231 -0
- package/dist/assets/chunk-FWX5IMBZ-DFelpZBy.js +2 -0
- package/dist/assets/chunk-HOUHSVGY-BMPwFEwN.js +1 -0
- package/dist/assets/chunk-ICXQ74PX-DH8NJMok.js +2 -0
- package/dist/assets/chunk-JG7HCLWE-D-95AsO4.js +2 -0
- package/dist/assets/chunk-JWPE2WC7-DIaTv8kx.js +1 -0
- package/dist/assets/chunk-KEIR6QF5-A3jEqwzn.js +161 -0
- package/dist/assets/chunk-MOJQB5TN-BPFLzWgj.js +88 -0
- package/dist/assets/chunk-MOZMSUNE-DR_fzxG0.js +1 -0
- package/dist/assets/chunk-OGEWGWER-TIcEoPPH.js +1 -0
- package/dist/assets/chunk-OSBZ3O6U-BALNvSfG.js +1 -0
- package/dist/assets/chunk-PUDLZKDR-I-EXhf_k.js +156 -0
- package/dist/assets/chunk-Q4XR5HBZ-uvIGstBS.js +70 -0
- package/dist/assets/chunk-QBLGF6JB-r-TjLdxa.js +1 -0
- package/dist/assets/chunk-R7FJI6CG-N-1LDgvy.js +1 -0
- package/dist/assets/chunk-RYQCIY6F-jxNASx65.js +1 -0
- package/dist/assets/chunk-U6XO7XAA-Cphbuc7q.js +2 -0
- package/dist/assets/chunk-V7JOEXUC-BLEuBf1s.js +206 -0
- package/dist/assets/chunk-VAUOI2AC-Dpcz6BhT.js +1 -0
- package/dist/assets/chunk-VR4S4FIN-BAUbR0ke.js +1 -0
- package/dist/assets/chunk-WYO6CB5R-Do6SJrnY.js +127 -0
- package/dist/assets/chunk-XXDRQBXY-C2QjjwYX.js +1 -0
- package/dist/assets/chunk-Y2CYZVJY-BGrd8tLy.js +1 -0
- package/dist/assets/chunk-YOTPTUD7-CQqvMTCr.js +1 -0
- package/dist/assets/chunk-ZGVPDNZ5-B7kWWaXv.js +62 -0
- package/dist/assets/chunk-ZIRB5QZD-DTU0cDNh.js +32 -0
- package/dist/assets/classDiagram-OUVF2IWQ-DESMaY3_.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-DwOlByYH.js +1 -0
- package/dist/assets/config-split-page-BlfvfmTm.js +1 -0
- package/dist/assets/confirm-dialog-Dt8Kdbgp.js +5 -0
- package/dist/assets/cose-bilkent-JH36ORCC-B9LrtV-q.js +1 -0
- package/dist/assets/cynefin-VYW2F7L2-CzjeeOq9.js +1 -0
- package/dist/assets/cynefinDiagram-TSTJHNR4-BfjvW4su.js +62 -0
- package/dist/assets/cytoscape.esm-CRW8q92n.js +321 -0
- package/dist/assets/dagre-DkiXZKkL.js +1 -0
- package/dist/assets/dagre-VKFMJZFB-B1pQKQSY.js +4 -0
- package/dist/assets/defaultLocale-Cdv9x6q7.js +1 -0
- package/dist/assets/desktop-update-config-DreMJu9z.js +1 -0
- package/dist/assets/diagram-FQU43EPY-cB4EZdaP.js +3 -0
- package/dist/assets/diagram-G47NLZAW-CtW8im1B.js +24 -0
- package/dist/assets/diagram-NH7WQ7WH-BDCtrCCm.js +24 -0
- package/dist/assets/diagram-OA4YK3LP-DEMJ42Gt.js +30 -0
- package/dist/assets/diagram-WEI45ONY-CdCcxSYU.js +41 -0
- package/dist/assets/dist-D5ycbwCo.js +41 -0
- package/dist/assets/dist-dw-gAfM_.js +1 -0
- package/dist/assets/doc-browser-C9u7N9vH.js +1 -0
- package/dist/assets/doc-browser-DJQ5XPsi2.js +1 -0
- package/dist/assets/doc-browser-context-CCdW9TJf.js +1 -0
- package/dist/assets/docx-preview-zis3U0Fa.js +20 -0
- package/dist/assets/download-CyPgglKr.js +1 -0
- package/dist/assets/ebnfDiagram-CCIWWBDH-DBZETBwE.js +1 -0
- package/dist/assets/erDiagram-Q63AITRT-y2zDXprP.js +85 -0
- package/dist/assets/eventmodeling-45OFAUF4-C38BqG8w.js +1 -0
- package/dist/assets/{external-link-CU0kzzIP.js → external-link-BahW1sl3.js} +1 -1
- package/dist/assets/eye-D8gGXMkD.js +1 -0
- package/dist/assets/flowDiagram-23GEKE2U-BoKk8RRq.js +1 -0
- package/dist/assets/folder-DGWqFDvE.js +1 -0
- package/dist/assets/{form-actions-BvCp_0lS.js → form-actions-D2imZLnU.js} +1 -1
- package/dist/assets/ganttDiagram-NO4QXBWP-D2DP344e.js +292 -0
- package/dist/assets/gitGraph-TEB2WS4Q-IsQHHJuS.js +1 -0
- package/dist/assets/gitGraphDiagram-IHSO6WYX-D37uiwA2.js +106 -0
- package/dist/assets/graphlib-BcNFQr5y.js +1 -0
- package/dist/assets/index-0av6WO9-.css +1 -0
- package/dist/assets/index-CT0iYlxV.js +2 -0
- package/dist/assets/info-DKCQHKI2-ofy2qlHI.js +1 -0
- package/dist/assets/infoDiagram-FWYZ7A6U-CG-WAIRi.js +2 -0
- package/dist/assets/init-D8TjIqfm.js +1 -0
- package/dist/assets/ishikawaDiagram-FXEZZL3T-WeCTnW0f.js +70 -0
- package/dist/assets/journeyDiagram-5HDEW3XC-DUFBW9Td.js +139 -0
- package/dist/assets/jszip.min-CP5uPNQa.js +2 -0
- package/dist/assets/kanban-definition-HUTT4EX6-B0lxgMpg.js +89 -0
- package/dist/assets/katex-wEmrEFTg.js +257 -0
- package/dist/assets/line-B78frP_c.js +1 -0
- package/dist/assets/linear-C6lVEcb2.js +1 -0
- package/dist/assets/loader-circle-DtKek-qG.js +1 -0
- package/dist/assets/logo-badge-CuPetu-v.js +1 -0
- package/dist/assets/map-Bdri5UL5.js +1 -0
- package/dist/assets/mcp-marketplace-page-4qMwFDpz.js +1 -0
- package/dist/assets/mcp-marketplace-page-BbxN5aZF.js +9 -0
- package/dist/assets/mermaid-parser.core-Cue18vLo.js +4 -0
- package/dist/assets/mermaid.core-CXwWRh5i.js +11 -0
- package/dist/assets/mindmap-definition-LN4V7U3C-CFxz0P0-.js +96 -0
- package/dist/assets/model-config-page-DiJcvBML.js +1 -0
- package/dist/assets/ordinal-Cbd8t4LB.js +1 -0
- package/dist/assets/packet-7NZHBO7P-Rfopfa1o.js +1 -0
- package/dist/assets/path-DzBnMI1r.js +1 -0
- package/dist/assets/pegDiagram-2B236MQR-B_Qt9zyT.js +1 -0
- package/dist/assets/pie-RZYD4A2V-CJR1xKEv.js +1 -0
- package/dist/assets/pieDiagram-ENE6RG2P-CRQdSuwS.js +39 -0
- package/dist/assets/plus-BwgE-Zwf.js +1 -0
- package/dist/assets/popover-Btp7KVc3.js +1 -0
- package/dist/assets/preload-helper-D4M6sveU.js +1 -0
- package/dist/assets/provider-models-BoUhFo9R.js +1 -0
- package/dist/assets/provider-scoped-model-input-DZMtoAJG.js +1 -0
- package/dist/assets/providers-config-page-DfiWveEF.js +1 -0
- package/dist/assets/quadrantDiagram-ABIIQ3AL-D5kPpttq.js +7 -0
- package/dist/assets/radar-I7S5WNFK-CDg8Z-1r.js +1 -0
- package/dist/assets/railroad-3IZDKUUU-BHnNmjxO.js +1 -0
- package/dist/assets/railroad-abnf-AHOZXSZD-DGtNcusW.js +1 -0
- package/dist/assets/railroad-ebnf-EBAXGLYW-BRFtsQmm.js +1 -0
- package/dist/assets/railroad-peg-LSFZ7HO6-Bj5IypCA.js +1 -0
- package/dist/assets/railroadDiagram-RFXS5EU6-DGh_TGlQ.js +1 -0
- package/dist/assets/react-BY-U3h3t.js +8 -0
- package/dist/assets/{refresh-cw-CILd1vAP.js → refresh-cw-Cme5qFej.js} +1 -1
- package/dist/assets/remote-BaVECEZw.js +1 -0
- package/dist/assets/requirementDiagram-TGXJPOKE-EmFph0H_.js +84 -0
- package/dist/assets/rotate-cw-CMRZxIkH.js +1 -0
- package/dist/assets/rough.esm-wJ1d3nQl.js +1 -0
- package/dist/assets/runtime-config-page-wygwvMB4.js +1 -0
- package/dist/assets/sankeyDiagram-HTMAVEWB-BXWB5Ugi.js +40 -0
- package/dist/assets/{save-ByJqcPTP.js → save-DNg2yJTS.js} +1 -1
- package/dist/assets/{search-DVIV6pfD.js → search-3ykfrAFt.js} +1 -1
- package/dist/assets/search-config-page-DrVKa_Ls.js +1 -0
- package/dist/assets/secrets-config-page-B39uQ5kF.js +3 -0
- package/dist/assets/security-config-BPzet76z.js +1 -0
- package/dist/assets/select-B5EecXJt.js +1 -0
- package/dist/assets/sequenceDiagram-DBY2YBRQ-ClKnO7v0.js +162 -0
- package/dist/assets/setting-row-Qv1Ps79v.js +1 -0
- package/dist/assets/{settings-2-CH5shGg_.js → settings-2-D-3um9Az.js} +1 -1
- package/dist/assets/sizeCapture-X5ZJPWSS-DSo-t5ou.js +1 -0
- package/dist/assets/{skeleton-DeX1FKw7.js → skeleton-BgkzQd4U.js} +1 -1
- package/dist/assets/src-Dad2ZbCt.js +1 -0
- package/dist/assets/stateDiagram-2N3HPSRC-BvAalBfz.js +1 -0
- package/dist/assets/stateDiagram-v2-6OUMAXLB-CfMU38yc.js +1 -0
- package/dist/assets/swimlanes-5IMT3BWC-DdVqVa1a.js +2 -0
- package/dist/assets/swimlanesDiagram-G3AALYLV-D9Zb9X57.js +8 -0
- package/dist/assets/tabs-BVD8gp3y.js +1 -0
- package/dist/assets/tag-chip-0qn-f3Bo.js +1 -0
- package/dist/assets/timeline-definition-FHXFAJF6-D4ar8IQY.js +120 -0
- package/dist/assets/trash-2-cnsMppRC.js +1 -0
- package/dist/assets/treeView-QDETBFTQ-Uy7M0WvH.js +1 -0
- package/dist/assets/treemap-6X3UGDF4-BJfGV7KX.js +1 -0
- package/dist/assets/use-config-D6yx0lb0.js +1 -0
- package/dist/assets/use-confirm-dialog-C_o0eQeH.js +1 -0
- package/dist/assets/use-viewport-layout-BWav4KCL.js +1 -0
- package/dist/assets/vennDiagram-L72KCM5P-CDXJ_i3p.js +34 -0
- package/dist/assets/wardley-OPB4EBWU-q263iF3K.js +1 -0
- package/dist/assets/wardleyDiagram-EHGQE667-D-dSuT_7.js +78 -0
- package/dist/assets/x-B3o1dWR5.js +1 -0
- package/dist/assets/xlsx-DUqJhg5u.js +64 -0
- package/dist/assets/xychartDiagram-FW5EYKEG-C9JCzsZF.js +7 -0
- package/dist/index.html +35 -28
- package/package.json +11 -6
- package/src/features/chat/components/chat-popover-content.tsx +1 -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 +2 -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 +97 -65
- package/src/features/chat/features/input/input-surface-plugins/__tests__/slash-command-plugin.test.ts +43 -0
- package/src/features/chat/features/input/input-surface-plugins/slash-command-plugin.utils.ts +14 -10
- package/src/features/chat/features/input/utils/__tests__/chat-input-bar.utils.test.ts +51 -0
- package/src/features/chat/features/input/utils/chat-input-bar.utils.ts +61 -21
- package/src/features/chat/features/message/components/__tests__/chat-message-list.container.test.tsx +42 -10
- package/src/features/chat/features/message/components/chat-inline-file-preview.tsx +80 -0
- package/src/features/chat/features/message/components/chat-message-list.container.tsx +66 -56
- package/src/features/chat/features/message/utils/__tests__/chat-message-file-operation.utils.test.ts +30 -0
- package/src/features/chat/features/message/utils/chat-message-texts.utils.ts +2 -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 +424 -129
- 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 +3 -1
- 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 +13 -22
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +96 -194
- 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 +61 -7
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel.tsx +34 -8
- 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 +157 -13
- package/src/features/chat/features/workspace/utils/chat-thread-workspace-session.utils.ts +151 -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 +66 -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 +196 -43
- package/src/features/chat/index.ts +1 -0
- package/src/features/chat/managers/__tests__/chat-thread-workspace.manager.test.ts +101 -0
- package/src/features/chat/managers/__tests__/chat-thread.manager.test.ts +48 -60
- package/src/features/chat/managers/chat-session-list.manager.ts +1 -0
- package/src/features/chat/managers/chat-thread.manager.ts +137 -162
- package/src/features/chat/pages/ncp-chat-page.tsx +1 -2
- package/src/features/chat/stores/__tests__/chat-thread.store.test.ts +87 -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 +77 -40
- package/src/features/chat/types/chat-input-bar.types.ts +2 -0
- 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/common/__tests__/brand-header.test.tsx +17 -7
- package/src/shared/components/common/brand-header.tsx +34 -34
- 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/hooks/use-server-path-read.ts +10 -5
- package/src/shared/lib/api/__tests__/server-path.utils.test.ts +28 -0
- package/src/shared/lib/api/types.ts +3 -3
- package/src/shared/lib/api/utils/server-path.utils.ts +20 -20
- package/src/shared/lib/i18n/locales/en-US/chat.json +25 -1
- package/src/shared/lib/i18n/locales/en-US/core.json +6 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +25 -1
- package/src/shared/lib/i18n/locales/zh-CN/core.json +6 -0
- package/src/shared/lib/session-project/__tests__/workspace-file-breadcrumb.test.ts +1 -4
- package/src/shared/lib/session-project/workspace-file-breadcrumb.utils.ts +1 -18
- 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/src/features/chat/components/layout/__tests__/chat-sidebar-utility-menu.test.tsx +0 -55
- /package/dist/assets/{config-hints-C_iP1zl_.js → config-hints-LxG80Uj5.js} +0 -0
- /package/dist/assets/{host-capabilities-9bB_998Z.js → host-capabilities-CFbAfrrA.js} +0 -0
- /package/dist/assets/{middleware-BILWbJE4.js → middleware-CAXxl-af.js} +0 -0
|
@@ -16,26 +16,37 @@ import type {
|
|
|
16
16
|
ChatChildSessionTab,
|
|
17
17
|
ChatThreadSnapshot,
|
|
18
18
|
ChatWorkspaceNavigationEntry,
|
|
19
|
+
ChatWorkspacePanelKind,
|
|
19
20
|
ChatWorkspaceFileTab,
|
|
20
21
|
} from '@/features/chat/stores/chat-thread.store';
|
|
21
22
|
import { useChatThreadStore } from '@/features/chat/stores/chat-thread.store';
|
|
23
|
+
import { normalizeChatWorkspacePanelWidth } from '@/features/chat/features/workspace/utils/chat-workspace-panel-layout.utils';
|
|
22
24
|
import { t } from '@/shared/lib/i18n';
|
|
23
25
|
import {
|
|
24
26
|
areWorkspaceNavigationEntriesEqual,
|
|
27
|
+
closeWorkspaceTabSnapshot,
|
|
28
|
+
createWorkspaceSelectionPatch,
|
|
25
29
|
createSideChatDraft,
|
|
26
30
|
materializeSideChatDraftSnapshot,
|
|
27
31
|
upsertChildSessionTab,
|
|
28
32
|
} from '@/features/chat/features/workspace/utils/chat-thread-workspace-session.utils';
|
|
29
33
|
import {
|
|
30
|
-
filterNavigationHistoryEntries,
|
|
31
34
|
pushNavigationHistoryEntry,
|
|
32
35
|
stepNavigationHistory,
|
|
33
36
|
} from '@/shared/lib/navigation-history';
|
|
37
|
+
import {
|
|
38
|
+
resolveAlternateWorkspaceFileViewer,
|
|
39
|
+
type ChatWorkspaceFileViewer,
|
|
40
|
+
} from '@/features/chat/features/workspace/utils/chat-workspace-file-viewer.utils';
|
|
41
|
+
import {
|
|
42
|
+
createWorkspaceFileTab,
|
|
43
|
+
upsertWorkspaceFileTab,
|
|
44
|
+
} from '@/features/chat/features/workspace/utils/chat-workspace-file-tab.utils';
|
|
34
45
|
|
|
35
46
|
type WorkspaceChildReadState = Parameters<ChatSessionListManager['markVisibleWorkspaceChildRead']>[0];
|
|
36
47
|
export type ChatVisibleWorkspaceSelection =
|
|
37
48
|
| { kind: 'child-session'; tab: WorkspaceChildReadState }
|
|
38
|
-
| { kind:
|
|
49
|
+
| { kind: Exclude<ChatWorkspacePanelKind, 'child-session'> }
|
|
39
50
|
| null;
|
|
40
51
|
|
|
41
52
|
export class ChatThreadManager {
|
|
@@ -85,6 +96,7 @@ export class ChatThreadManager {
|
|
|
85
96
|
activeSideChatDraft: null,
|
|
86
97
|
workspaceFileTabs: [],
|
|
87
98
|
activeWorkspaceFileKey: null,
|
|
99
|
+
closedWorkspaceTabEntries: [],
|
|
88
100
|
workspaceNavigationHistory: [],
|
|
89
101
|
workspaceNavigationHistoryIndex: 0,
|
|
90
102
|
});
|
|
@@ -102,56 +114,29 @@ export class ChatThreadManager {
|
|
|
102
114
|
return useChatSessionListStore.getState().snapshot.selectedSessionKey ?? null;
|
|
103
115
|
};
|
|
104
116
|
|
|
105
|
-
private
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
)
|
|
109
|
-
const
|
|
110
|
-
if (!normalizedPath) {
|
|
111
|
-
return null;
|
|
112
|
-
}
|
|
113
|
-
const normalizedParentSessionKey = parentSessionKey?.trim() || null;
|
|
114
|
-
const previewViewer =
|
|
115
|
-
action.viewMode === 'preview' &&
|
|
116
|
-
action.previewViewer !== 'rendered' &&
|
|
117
|
-
(action.previewViewer === 'auto' || action.previewViewer === 'source' || /\.html?$/i.test(normalizedPath))
|
|
118
|
-
? 'source'
|
|
119
|
-
: action.previewViewer ?? null;
|
|
120
|
-
const tabViewIdentity = action.viewMode === 'preview' && previewViewer === 'rendered' ? 'preview:rendered' : action.viewMode;
|
|
121
|
-
return {
|
|
122
|
-
key: `${normalizedParentSessionKey ?? 'draft'}::${tabViewIdentity}::${normalizedPath}`,
|
|
123
|
-
parentSessionKey: normalizedParentSessionKey,
|
|
124
|
-
path: normalizedPath,
|
|
125
|
-
label: action.label?.trim() || null,
|
|
126
|
-
viewMode: action.viewMode,
|
|
127
|
-
previewViewer,
|
|
128
|
-
line: action.line ?? null,
|
|
129
|
-
column: action.column ?? null,
|
|
130
|
-
rawText: action.rawText ?? null,
|
|
131
|
-
contentUrl: action.contentUrl?.trim() || null,
|
|
132
|
-
mimeType: action.mimeType?.trim() || null,
|
|
133
|
-
beforeText: action.beforeText ?? null,
|
|
134
|
-
afterText: action.afterText ?? null,
|
|
135
|
-
patchText: action.patchText ?? null,
|
|
136
|
-
oldStartLine: action.oldStartLine ?? null,
|
|
137
|
-
newStartLine: action.newStartLine ?? null,
|
|
138
|
-
fullLines: action.fullLines,
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
private upsertWorkspaceFileTab = (nextTab: ChatWorkspaceFileTab): ChatWorkspaceFileTab[] => {
|
|
117
|
+
private activateWorkspaceFileTab = (
|
|
118
|
+
nextTab: ChatWorkspaceFileTab,
|
|
119
|
+
adjacentToKey?: string,
|
|
120
|
+
) => {
|
|
121
|
+
const { parentSessionKey } = nextTab;
|
|
143
122
|
const { workspaceFileTabs } = useChatThreadStore.getState().snapshot;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
123
|
+
this.setWorkspaceSelection({
|
|
124
|
+
workspacePanelParentKey: parentSessionKey,
|
|
125
|
+
activeWorkspacePanelKind: 'file',
|
|
126
|
+
workspaceFileTabs: upsertWorkspaceFileTab(
|
|
127
|
+
workspaceFileTabs,
|
|
128
|
+
nextTab,
|
|
129
|
+
adjacentToKey,
|
|
130
|
+
),
|
|
131
|
+
activeWorkspaceFileKey: nextTab.key,
|
|
132
|
+
activeChildSessionKey: null,
|
|
133
|
+
activeSideChatDraft: null,
|
|
134
|
+
}, {
|
|
135
|
+
kind: 'file',
|
|
136
|
+
key: nextTab.key,
|
|
153
137
|
});
|
|
154
|
-
|
|
138
|
+
this.ensureWorkspaceParentRoute(parentSessionKey);
|
|
139
|
+
this.onWorkspacePanelOpened?.();
|
|
155
140
|
};
|
|
156
141
|
|
|
157
142
|
private ensureWorkspaceParentRoute = (parentSessionKey: string | null) => {
|
|
@@ -166,52 +151,6 @@ export class ChatThreadManager {
|
|
|
166
151
|
}
|
|
167
152
|
};
|
|
168
153
|
|
|
169
|
-
private createWorkspaceSelectionPatch = (
|
|
170
|
-
entry: ChatWorkspaceNavigationEntry,
|
|
171
|
-
snapshot: ChatThreadSnapshot,
|
|
172
|
-
): Partial<ChatThreadSnapshot> | null => {
|
|
173
|
-
if (entry.kind === 'cron') {
|
|
174
|
-
return {
|
|
175
|
-
activeWorkspacePanelKind: 'cron',
|
|
176
|
-
activeChildSessionKey: null,
|
|
177
|
-
activeSideChatDraft: null,
|
|
178
|
-
activeWorkspaceFileKey: null,
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
if (entry.kind === 'file') {
|
|
182
|
-
if (!snapshot.workspaceFileTabs.some((tab) => tab.key === entry.key)) {
|
|
183
|
-
return null;
|
|
184
|
-
}
|
|
185
|
-
return {
|
|
186
|
-
activeWorkspacePanelKind: 'file',
|
|
187
|
-
activeChildSessionKey: null,
|
|
188
|
-
activeSideChatDraft: null,
|
|
189
|
-
activeWorkspaceFileKey: entry.key,
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
if (entry.kind === 'side-chat-draft') {
|
|
193
|
-
const { activeSideChatDraft } = snapshot;
|
|
194
|
-
if (activeSideChatDraft?.draftKey !== entry.key) {
|
|
195
|
-
return null;
|
|
196
|
-
}
|
|
197
|
-
return {
|
|
198
|
-
activeWorkspacePanelKind: 'side-chat-draft',
|
|
199
|
-
activeChildSessionKey: null,
|
|
200
|
-
activeSideChatDraft,
|
|
201
|
-
activeWorkspaceFileKey: null,
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
if (!entry.key) {
|
|
205
|
-
return null;
|
|
206
|
-
}
|
|
207
|
-
return {
|
|
208
|
-
activeWorkspacePanelKind: 'child-session',
|
|
209
|
-
activeChildSessionKey: entry.key,
|
|
210
|
-
activeSideChatDraft: null,
|
|
211
|
-
activeWorkspaceFileKey: null,
|
|
212
|
-
};
|
|
213
|
-
};
|
|
214
|
-
|
|
215
154
|
private setWorkspaceSelection = (
|
|
216
155
|
patch: Partial<ChatThreadSnapshot>,
|
|
217
156
|
entry: ChatWorkspaceNavigationEntry,
|
|
@@ -225,13 +164,74 @@ export class ChatThreadManager {
|
|
|
225
164
|
entry,
|
|
226
165
|
areWorkspaceNavigationEntriesEqual,
|
|
227
166
|
);
|
|
167
|
+
const closedWorkspaceTabEntries =
|
|
168
|
+
patch.workspacePanelParentKey &&
|
|
169
|
+
patch.workspacePanelParentKey !== snapshot.workspacePanelParentKey
|
|
170
|
+
? []
|
|
171
|
+
: snapshot.closedWorkspaceTabEntries.filter(
|
|
172
|
+
(candidate) => !areWorkspaceNavigationEntriesEqual(candidate, entry),
|
|
173
|
+
);
|
|
228
174
|
useChatThreadStore.getState().setSnapshot({
|
|
229
175
|
...patch,
|
|
176
|
+
closedWorkspaceTabEntries,
|
|
230
177
|
workspaceNavigationHistory: [...history.entries],
|
|
231
178
|
workspaceNavigationHistoryIndex: history.index,
|
|
232
179
|
});
|
|
233
180
|
};
|
|
234
181
|
|
|
182
|
+
private openWorkspacePage = (
|
|
183
|
+
rawParentSessionKey: string,
|
|
184
|
+
kind: 'overview' | 'child-sessions' | 'project-files' | 'cron',
|
|
185
|
+
) => {
|
|
186
|
+
const parentSessionKey = rawParentSessionKey.trim();
|
|
187
|
+
if (!parentSessionKey) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
this.setWorkspaceSelection({
|
|
191
|
+
workspacePanelParentKey: parentSessionKey,
|
|
192
|
+
activeWorkspacePanelKind: kind,
|
|
193
|
+
activeChildSessionKey: null,
|
|
194
|
+
activeSideChatDraft: null,
|
|
195
|
+
activeWorkspaceFileKey: null,
|
|
196
|
+
}, { kind });
|
|
197
|
+
this.ensureWorkspaceParentRoute(parentSessionKey);
|
|
198
|
+
this.onWorkspacePanelOpened?.();
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
openWorkspaceOverview = (sessionKey: string) => {
|
|
202
|
+
this.openWorkspacePage(sessionKey, 'overview');
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
toggleWorkspacePanel = (sessionKey: string) => {
|
|
206
|
+
const normalizedSessionKey = sessionKey.trim();
|
|
207
|
+
if (!normalizedSessionKey) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
const { snapshot } = useChatThreadStore.getState();
|
|
211
|
+
if (
|
|
212
|
+
snapshot.workspacePanelParentKey === normalizedSessionKey &&
|
|
213
|
+
snapshot.activeWorkspacePanelKind
|
|
214
|
+
) {
|
|
215
|
+
this.closeWorkspacePanel();
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
this.openWorkspaceOverview(normalizedSessionKey);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
setWorkspacePanelWidth = (width: number) => {
|
|
222
|
+
this.syncSnapshot({
|
|
223
|
+
workspacePanelWidth: normalizeChatWorkspacePanelWidth(width),
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
openChildSessions = (sessionKey: string) => {
|
|
228
|
+
this.openWorkspacePage(sessionKey, 'child-sessions');
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
openProjectFiles = (sessionKey: string) => {
|
|
232
|
+
this.openWorkspacePage(sessionKey, 'project-files');
|
|
233
|
+
};
|
|
234
|
+
|
|
235
235
|
openChildSessionPanel = (params: {
|
|
236
236
|
parentSessionKey: string;
|
|
237
237
|
activeChildSessionKey?: string | null;
|
|
@@ -317,23 +317,43 @@ export class ChatThreadManager {
|
|
|
317
317
|
|
|
318
318
|
openFilePreview = (action: ChatFileOpenActionViewModel) => {
|
|
319
319
|
const parentSessionKey = this.resolveWorkspaceParentSessionKey();
|
|
320
|
-
const nextTab =
|
|
320
|
+
const nextTab = createWorkspaceFileTab(action, parentSessionKey);
|
|
321
321
|
if (!nextTab) {
|
|
322
322
|
return;
|
|
323
323
|
}
|
|
324
|
-
this.
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
324
|
+
this.activateWorkspaceFileTab(nextTab);
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
openWorkspaceFileViewer = (
|
|
328
|
+
fileKey: string,
|
|
329
|
+
viewer?: ChatWorkspaceFileViewer,
|
|
330
|
+
) => {
|
|
331
|
+
const sourceTab = useChatThreadStore.getState().snapshot.workspaceFileTabs
|
|
332
|
+
.find((tab) => tab.key === fileKey.trim());
|
|
333
|
+
if (!sourceTab || sourceTab.viewMode !== 'preview') {
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
const nextViewer = viewer ?? resolveAlternateWorkspaceFileViewer(
|
|
337
|
+
sourceTab.path,
|
|
338
|
+
sourceTab.previewViewer,
|
|
339
|
+
);
|
|
340
|
+
if (!nextViewer) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
const nextTab = createWorkspaceFileTab({
|
|
344
|
+
path: sourceTab.path,
|
|
345
|
+
label: sourceTab.label ?? undefined,
|
|
346
|
+
viewMode: 'preview',
|
|
347
|
+
previewViewer: nextViewer,
|
|
348
|
+
line: sourceTab.line ?? undefined,
|
|
349
|
+
column: sourceTab.column ?? undefined,
|
|
350
|
+
rawText: sourceTab.rawText ?? undefined,
|
|
351
|
+
contentUrl: sourceTab.contentUrl ?? undefined,
|
|
352
|
+
mimeType: sourceTab.mimeType ?? undefined,
|
|
353
|
+
}, sourceTab.parentSessionKey);
|
|
354
|
+
if (nextTab) {
|
|
355
|
+
this.activateWorkspaceFileTab(nextTab, sourceTab.key);
|
|
356
|
+
}
|
|
337
357
|
};
|
|
338
358
|
|
|
339
359
|
private openSessionFromToolAction = (action: ChatToolActionViewModel) => {
|
|
@@ -450,44 +470,12 @@ export class ChatThreadManager {
|
|
|
450
470
|
});
|
|
451
471
|
};
|
|
452
472
|
|
|
453
|
-
|
|
454
|
-
const normalizedFileKey = fileKey.trim();
|
|
455
|
-
if (!normalizedFileKey) {
|
|
456
|
-
return;
|
|
457
|
-
}
|
|
473
|
+
closeWorkspaceTab = (entry: ChatWorkspaceNavigationEntry) => {
|
|
458
474
|
const { snapshot } = useChatThreadStore.getState();
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
(
|
|
462
|
-
);
|
|
463
|
-
const history = filterNavigationHistoryEntries(
|
|
464
|
-
{
|
|
465
|
-
entries: snapshot.workspaceNavigationHistory,
|
|
466
|
-
index: snapshot.workspaceNavigationHistoryIndex,
|
|
467
|
-
},
|
|
468
|
-
(entry) => entry.kind !== 'file' || entry.key !== normalizedFileKey,
|
|
469
|
-
);
|
|
470
|
-
const nextPatch: Partial<ChatThreadSnapshot> = {
|
|
471
|
-
workspaceFileTabs: nextTabs,
|
|
472
|
-
workspaceNavigationHistory: [...history.entries],
|
|
473
|
-
workspaceNavigationHistoryIndex: history.index,
|
|
474
|
-
};
|
|
475
|
-
if (activeWorkspaceFileKey === normalizedFileKey) {
|
|
476
|
-
const nextSnapshot = {
|
|
477
|
-
...snapshot,
|
|
478
|
-
workspaceFileTabs: nextTabs,
|
|
479
|
-
};
|
|
480
|
-
const restoreEntry = history.entries[history.index];
|
|
481
|
-
const restorePatch = restoreEntry
|
|
482
|
-
? this.createWorkspaceSelectionPatch(restoreEntry, nextSnapshot)
|
|
483
|
-
: null;
|
|
484
|
-
Object.assign(nextPatch, restorePatch ?? {
|
|
485
|
-
activeWorkspacePanelKind: null,
|
|
486
|
-
activeSideChatDraft: null,
|
|
487
|
-
activeWorkspaceFileKey: null,
|
|
488
|
-
});
|
|
475
|
+
const patch = closeWorkspaceTabSnapshot(snapshot, entry);
|
|
476
|
+
if (patch) {
|
|
477
|
+
useChatThreadStore.getState().setSnapshot(patch);
|
|
489
478
|
}
|
|
490
|
-
useChatThreadStore.getState().setSnapshot(nextPatch);
|
|
491
479
|
};
|
|
492
480
|
|
|
493
481
|
closeWorkspacePanel = () => {
|
|
@@ -497,27 +485,14 @@ export class ChatThreadManager {
|
|
|
497
485
|
activeChildSessionKey: null,
|
|
498
486
|
activeSideChatDraft: null,
|
|
499
487
|
activeWorkspaceFileKey: null,
|
|
488
|
+
closedWorkspaceTabEntries: [],
|
|
500
489
|
workspaceNavigationHistory: [],
|
|
501
490
|
workspaceNavigationHistoryIndex: 0,
|
|
502
491
|
});
|
|
503
492
|
};
|
|
504
493
|
|
|
505
494
|
openSessionCronPanel = (sessionKey: string) => {
|
|
506
|
-
|
|
507
|
-
if (!parentSessionKey) {
|
|
508
|
-
return;
|
|
509
|
-
}
|
|
510
|
-
this.setWorkspaceSelection({
|
|
511
|
-
workspacePanelParentKey: parentSessionKey,
|
|
512
|
-
activeWorkspacePanelKind: 'cron',
|
|
513
|
-
activeChildSessionKey: null,
|
|
514
|
-
activeSideChatDraft: null,
|
|
515
|
-
activeWorkspaceFileKey: null,
|
|
516
|
-
}, {
|
|
517
|
-
kind: 'cron',
|
|
518
|
-
});
|
|
519
|
-
this.ensureWorkspaceParentRoute(parentSessionKey);
|
|
520
|
-
this.onWorkspacePanelOpened?.();
|
|
495
|
+
this.openWorkspacePage(sessionKey, 'cron');
|
|
521
496
|
};
|
|
522
497
|
|
|
523
498
|
goBackWorkspacePanel = () => {
|
|
@@ -540,7 +515,7 @@ export class ChatThreadManager {
|
|
|
540
515
|
if (!step) {
|
|
541
516
|
return;
|
|
542
517
|
}
|
|
543
|
-
const selectionPatch =
|
|
518
|
+
const selectionPatch = createWorkspaceSelectionPatch(step.entry, snapshot);
|
|
544
519
|
if (!selectionPatch) {
|
|
545
520
|
return;
|
|
546
521
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useEffect,
|
|
3
3
|
useMemo,
|
|
4
|
-
useState,
|
|
5
4
|
} from "react";
|
|
6
5
|
import { useLocation, useNavigate, useParams } from "react-router-dom";
|
|
7
6
|
import {
|
|
@@ -51,7 +50,7 @@ function useNcpChatUiBindings() {
|
|
|
51
50
|
|
|
52
51
|
export function NcpChatPage({ view }: ChatPageProps) {
|
|
53
52
|
const appPresenter = useAppPresenter();
|
|
54
|
-
const
|
|
53
|
+
const presenter = useMemo(() => new ChatPresenter(appPresenter), [appPresenter]);
|
|
55
54
|
return (
|
|
56
55
|
<ChatPresenterProvider presenter={presenter}>
|
|
57
56
|
<NcpChatPageContent view={view} />
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { beforeEach, describe, expect, it } from 'vitest';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
useChatThreadStore,
|
|
4
|
+
} from '@/features/chat/stores/chat-thread.store';
|
|
5
|
+
import { CHAT_WORKSPACE_PANEL_DEFAULT_WIDTH } from '@/features/chat/features/workspace/utils/chat-workspace-panel-layout.utils';
|
|
3
6
|
|
|
4
7
|
const chatThreadWorkspaceStorageKey = 'nextclaw.chat.workspace-panel.state';
|
|
5
8
|
|
|
@@ -25,8 +28,10 @@ function resetChatThreadStore() {
|
|
|
25
28
|
activeSideChatDraft: null,
|
|
26
29
|
workspaceFileTabs: [],
|
|
27
30
|
activeWorkspaceFileKey: null,
|
|
31
|
+
closedWorkspaceTabEntries: [],
|
|
28
32
|
workspaceNavigationHistory: [],
|
|
29
33
|
workspaceNavigationHistoryIndex: 0,
|
|
34
|
+
workspacePanelWidth: CHAT_WORKSPACE_PANEL_DEFAULT_WIDTH,
|
|
30
35
|
},
|
|
31
36
|
});
|
|
32
37
|
}
|
|
@@ -60,6 +65,10 @@ describe('chat thread workspace panel persistence', () => {
|
|
|
60
65
|
},
|
|
61
66
|
],
|
|
62
67
|
activeWorkspaceFileKey: 'session-1::preview::README.md',
|
|
68
|
+
closedWorkspaceTabEntries: [
|
|
69
|
+
{ kind: 'project-files' },
|
|
70
|
+
{ kind: 'child-session', key: 'child-session-2' },
|
|
71
|
+
],
|
|
63
72
|
workspaceNavigationHistory: [
|
|
64
73
|
{ kind: 'child-session', key: 'child-session-1' },
|
|
65
74
|
{ kind: 'file', key: 'session-1::preview::README.md' },
|
|
@@ -75,6 +84,10 @@ describe('chat thread workspace panel persistence', () => {
|
|
|
75
84
|
workspacePanelParentKey: 'session-1',
|
|
76
85
|
activeWorkspacePanelKind: 'file',
|
|
77
86
|
activeWorkspaceFileKey: 'session-1::preview::README.md',
|
|
87
|
+
closedWorkspaceTabEntries: [
|
|
88
|
+
{ kind: 'project-files' },
|
|
89
|
+
{ kind: 'child-session', key: 'child-session-2' },
|
|
90
|
+
],
|
|
78
91
|
workspaceNavigationHistory: [
|
|
79
92
|
{ kind: 'child-session', key: 'child-session-1' },
|
|
80
93
|
{ kind: 'file', key: 'session-1::preview::README.md' },
|
|
@@ -118,6 +131,79 @@ describe('chat thread workspace panel persistence', () => {
|
|
|
118
131
|
expect(persisted.state.snapshot.activeSideChatDraft).toBeUndefined();
|
|
119
132
|
});
|
|
120
133
|
|
|
134
|
+
it('persists the stable workspace pages', async () => {
|
|
135
|
+
useChatThreadStore.getState().setSnapshot({
|
|
136
|
+
workspacePanelParentKey: 'session-1',
|
|
137
|
+
activeWorkspacePanelKind: 'project-files',
|
|
138
|
+
workspaceNavigationHistory: [
|
|
139
|
+
{ kind: 'overview' },
|
|
140
|
+
{ kind: 'child-sessions' },
|
|
141
|
+
{ kind: 'project-files' },
|
|
142
|
+
],
|
|
143
|
+
workspaceNavigationHistoryIndex: 2,
|
|
144
|
+
workspacePanelWidth: 620,
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
const persisted = window.localStorage.getItem(chatThreadWorkspaceStorageKey);
|
|
148
|
+
resetChatThreadStore();
|
|
149
|
+
if (persisted) {
|
|
150
|
+
window.localStorage.setItem(chatThreadWorkspaceStorageKey, persisted);
|
|
151
|
+
}
|
|
152
|
+
await useChatThreadStore.persist.rehydrate();
|
|
153
|
+
|
|
154
|
+
expect(useChatThreadStore.getState().snapshot).toMatchObject({
|
|
155
|
+
workspacePanelParentKey: 'session-1',
|
|
156
|
+
activeWorkspacePanelKind: 'project-files',
|
|
157
|
+
workspaceNavigationHistory: [
|
|
158
|
+
{ kind: 'overview' },
|
|
159
|
+
{ kind: 'child-sessions' },
|
|
160
|
+
{ kind: 'project-files' },
|
|
161
|
+
],
|
|
162
|
+
workspaceNavigationHistoryIndex: 2,
|
|
163
|
+
workspacePanelWidth: 620,
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
it('keeps the active file tab when persistence trims older workspace tabs', async () => {
|
|
168
|
+
const workspaceFileTabs = Array.from({ length: 9 }, (_, index) => ({
|
|
169
|
+
key: `session-1::preview::file-${index}.txt`,
|
|
170
|
+
parentSessionKey: 'session-1',
|
|
171
|
+
path: `file-${index}.txt`,
|
|
172
|
+
viewMode: 'preview' as const,
|
|
173
|
+
previewViewer: 'source' as const,
|
|
174
|
+
}));
|
|
175
|
+
const activeWorkspaceFileKey = workspaceFileTabs[8]!.key;
|
|
176
|
+
useChatThreadStore.getState().setSnapshot({
|
|
177
|
+
workspacePanelParentKey: 'session-1',
|
|
178
|
+
activeWorkspacePanelKind: 'file',
|
|
179
|
+
workspaceFileTabs,
|
|
180
|
+
activeWorkspaceFileKey,
|
|
181
|
+
workspaceNavigationHistory: [
|
|
182
|
+
{ kind: 'file', key: activeWorkspaceFileKey },
|
|
183
|
+
],
|
|
184
|
+
workspaceNavigationHistoryIndex: 0,
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
const persisted = window.localStorage.getItem(chatThreadWorkspaceStorageKey);
|
|
188
|
+
resetChatThreadStore();
|
|
189
|
+
if (persisted) {
|
|
190
|
+
window.localStorage.setItem(chatThreadWorkspaceStorageKey, persisted);
|
|
191
|
+
}
|
|
192
|
+
await useChatThreadStore.persist.rehydrate();
|
|
193
|
+
|
|
194
|
+
expect(useChatThreadStore.getState().snapshot).toMatchObject({
|
|
195
|
+
workspacePanelParentKey: 'session-1',
|
|
196
|
+
activeWorkspacePanelKind: 'file',
|
|
197
|
+
activeWorkspaceFileKey,
|
|
198
|
+
});
|
|
199
|
+
expect(useChatThreadStore.getState().snapshot.workspaceFileTabs).toHaveLength(8);
|
|
200
|
+
expect(
|
|
201
|
+
useChatThreadStore.getState().snapshot.workspaceFileTabs.some(
|
|
202
|
+
(tab) => tab.key === activeWorkspaceFileKey,
|
|
203
|
+
),
|
|
204
|
+
).toBe(true);
|
|
205
|
+
});
|
|
206
|
+
|
|
121
207
|
it('hydrates the workspace panel state and repairs stale active file keys', async () => {
|
|
122
208
|
window.localStorage.setItem(
|
|
123
209
|
chatThreadWorkspaceStorageKey,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it } from "vitest";
|
|
2
|
+
import {
|
|
3
|
+
DEFAULT_CHAT_MESSAGE_LAYOUT,
|
|
4
|
+
useChatMessageLayoutStore,
|
|
5
|
+
} from "@/features/chat/stores/chat-message-layout.store";
|
|
6
|
+
|
|
7
|
+
const STORAGE_KEY = "nextclaw.chat.message-layout";
|
|
8
|
+
|
|
9
|
+
describe("chat message layout store", () => {
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
window.localStorage.clear();
|
|
12
|
+
useChatMessageLayoutStore.setState({
|
|
13
|
+
layout: DEFAULT_CHAT_MESSAGE_LAYOUT,
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("preserves an existing card layout preference", async () => {
|
|
18
|
+
window.localStorage.setItem(
|
|
19
|
+
STORAGE_KEY,
|
|
20
|
+
JSON.stringify({ state: { layout: "card" }, version: 1 }),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
await useChatMessageLayoutStore.persist.rehydrate();
|
|
24
|
+
expect(useChatMessageLayoutStore.getState().layout).toBe("card");
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("falls back to the flat layout for an invalid persisted layout", async () => {
|
|
28
|
+
window.localStorage.setItem(
|
|
29
|
+
STORAGE_KEY,
|
|
30
|
+
JSON.stringify({ state: { layout: "unknown" }, version: 1 }),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
await useChatMessageLayoutStore.persist.rehydrate();
|
|
34
|
+
|
|
35
|
+
expect(useChatMessageLayoutStore.getState().layout).toBe("flat");
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ChatMessageLayout } from "@nextclaw/agent-chat-ui";
|
|
2
|
+
import { create } from "zustand";
|
|
3
|
+
import { createJSONStorage, persist } from "zustand/middleware";
|
|
4
|
+
|
|
5
|
+
const CHAT_MESSAGE_LAYOUT_STORAGE_KEY = "nextclaw.chat.message-layout";
|
|
6
|
+
const CHAT_MESSAGE_LAYOUT_STORAGE_VERSION = 1;
|
|
7
|
+
export const DEFAULT_CHAT_MESSAGE_LAYOUT: ChatMessageLayout = "flat";
|
|
8
|
+
|
|
9
|
+
type ChatMessageLayoutStore = {
|
|
10
|
+
layout: ChatMessageLayout;
|
|
11
|
+
setLayout: (layout: ChatMessageLayout) => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
function resolvePersistedLayout(persistedState: unknown): ChatMessageLayout {
|
|
15
|
+
if (!persistedState || typeof persistedState !== "object") {
|
|
16
|
+
return DEFAULT_CHAT_MESSAGE_LAYOUT;
|
|
17
|
+
}
|
|
18
|
+
const { layout } = persistedState as { layout?: unknown };
|
|
19
|
+
return layout === "flat" || layout === "card"
|
|
20
|
+
? layout
|
|
21
|
+
: DEFAULT_CHAT_MESSAGE_LAYOUT;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const useChatMessageLayoutStore = create<ChatMessageLayoutStore>()(
|
|
25
|
+
persist(
|
|
26
|
+
(set) => ({
|
|
27
|
+
layout: DEFAULT_CHAT_MESSAGE_LAYOUT,
|
|
28
|
+
setLayout: (layout) => set({ layout }),
|
|
29
|
+
}),
|
|
30
|
+
{
|
|
31
|
+
name: CHAT_MESSAGE_LAYOUT_STORAGE_KEY,
|
|
32
|
+
version: CHAT_MESSAGE_LAYOUT_STORAGE_VERSION,
|
|
33
|
+
storage: createJSONStorage(() => window.localStorage),
|
|
34
|
+
partialize: (state) => ({ layout: state.layout }),
|
|
35
|
+
merge: (persistedState, currentState) => ({
|
|
36
|
+
...currentState,
|
|
37
|
+
layout: resolvePersistedLayout(persistedState),
|
|
38
|
+
}),
|
|
39
|
+
},
|
|
40
|
+
),
|
|
41
|
+
);
|