@nextclaw/ui 0.15.22 → 0.15.24
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 +66 -0
- package/dist/assets/{abnfDiagram-VRR7QNED-M4g_AyR8.js → abnfDiagram-VRR7QNED-DvTjgVMf.js} +1 -1
- package/dist/assets/{aiden0z-pptx-renderer.es-Bd99vut2.js → aiden0z-pptx-renderer.es-C1nfBAXR.js} +1 -1
- package/dist/assets/api-BxPNDp30.js +13 -0
- package/dist/assets/appearance-settings-page-DpVJjvkB.js +1 -0
- package/dist/assets/{arc-IO7WNWOB.js → arc-BvhODBXv.js} +1 -1
- package/dist/assets/architecture-TIHT7OUA-Bjp9jf0h.js +1 -0
- package/dist/assets/{architectureDiagram-ZJ3FMSHR-Dc-lvdUh.js → architectureDiagram-ZJ3FMSHR-BKO9RgNS.js} +1 -1
- package/dist/assets/{blockDiagram-677ZJIJ3-CcsoWpIY.js → blockDiagram-677ZJIJ3-DHpDXy7D.js} +1 -1
- package/dist/assets/{c4Diagram-LMCZKHZV-Bsrtg6b2.js → c4Diagram-LMCZKHZV-BG_iQnDr.js} +1 -1
- package/dist/assets/channel-5T3pdR-s.js +1 -0
- package/dist/assets/channels-list-page-DRaNWAxC.js +8 -0
- package/dist/assets/chat-page-BuFDmG5_.js +1 -0
- package/dist/assets/chunk-2Q5K7J3B-DTZ3tGfE.js +1 -0
- package/dist/assets/{chunk-32BRIVSS-Bt08t8oG.js → chunk-32BRIVSS-DR9M0LLx.js} +1 -1
- package/dist/assets/{chunk-52WLFC77-Ddx68Xzx.js → chunk-52WLFC77-698iC3BB.js} +1 -1
- package/dist/assets/{chunk-5FCAYU7R-B7p9_q55.js → chunk-5FCAYU7R-DikTj9Ey.js} +1 -1
- package/dist/assets/{chunk-5HE753X5-D52KvdTm.js → chunk-5HE753X5-ko0o7_q0.js} +1 -1
- package/dist/assets/{chunk-5JV3BV7I-C329h8nI.js → chunk-5JV3BV7I-CEHufhgo.js} +1 -1
- package/dist/assets/{chunk-5TONJI2A-BZyUBxWt.js → chunk-5TONJI2A-CGgno1cu.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-BUiYXZmu.js → chunk-5VM5RSS4-DkiB4cUQ.js} +1 -1
- package/dist/assets/{chunk-7BUUIJ7U-B7o-mn4r.js → chunk-7BUUIJ7U-DzptcytQ.js} +1 -1
- package/dist/assets/{chunk-BIQX33UG-Bey9GoRP.js → chunk-BIQX33UG-DMRSQJvT.js} +1 -1
- package/dist/assets/{chunk-C7G6YPKG-C6tosszM.js → chunk-C7G6YPKG-Bw1BwwuY.js} +1 -1
- package/dist/assets/{chunk-CQNSW5MT-BNrdkgGQ.js → chunk-CQNSW5MT-C0z6eHBk.js} +1 -1
- package/dist/assets/{chunk-CYSBUYHQ-DHODFeyB.js → chunk-CYSBUYHQ-ByPyAouO.js} +1 -1
- package/dist/assets/{chunk-EMLP6XTP-BcmLjrcq.js → chunk-EMLP6XTP-CJlAXWZg.js} +1 -1
- package/dist/assets/{chunk-EX3LRPZG-r-_eEtJI.js → chunk-EX3LRPZG-Dqq4zKJu.js} +1 -1
- package/dist/assets/{chunk-FWX5IMBZ-DOObDWbf.js → chunk-FWX5IMBZ-B0SNoCmi.js} +2 -2
- package/dist/assets/{chunk-HOUHSVGY-Bd0FnbWZ.js → chunk-HOUHSVGY-DG_GJih_.js} +1 -1
- package/dist/assets/{chunk-ICXQ74PX-ntNwAm4_.js → chunk-ICXQ74PX-Drxk_6bE.js} +1 -1
- package/dist/assets/{chunk-JG7HCLWE-YtRpblZN.js → chunk-JG7HCLWE-DdLFPpnd.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-De5-D9ta.js → chunk-JWPE2WC7-B8M4G76F.js} +1 -1
- package/dist/assets/{chunk-MOJQB5TN-CdvKhyp2.js → chunk-MOJQB5TN-XP6FJHY_.js} +1 -1
- package/dist/assets/{chunk-MOZMSUNE-DJMMN_lu.js → chunk-MOZMSUNE-C_6x18Qw.js} +1 -1
- package/dist/assets/{chunk-OGEWGWER-DOFWVw3O.js → chunk-OGEWGWER-N25BzCmG.js} +1 -1
- package/dist/assets/{chunk-OSBZ3O6U-DZkrIN9r.js → chunk-OSBZ3O6U-ASDEm7y0.js} +1 -1
- package/dist/assets/{chunk-PUDLZKDR-D1wma2Yf.js → chunk-PUDLZKDR-CTlvAcn7.js} +1 -1
- package/dist/assets/{chunk-Q4XR5HBZ-CjPy94Lz.js → chunk-Q4XR5HBZ-Da9BWfB6.js} +1 -1
- package/dist/assets/{chunk-QBLGF6JB-Hy1bEgS-.js → chunk-QBLGF6JB-Bi6RpTJO.js} +1 -1
- package/dist/assets/{chunk-R7FJI6CG-CUPIHyh-.js → chunk-R7FJI6CG-DkMsSPvK.js} +1 -1
- package/dist/assets/{chunk-RYQCIY6F-D5Ua4pcv.js → chunk-RYQCIY6F-DZp0eU-j.js} +1 -1
- package/dist/assets/{chunk-U6XO7XAA-DaUQcqb7.js → chunk-U6XO7XAA-vfinDSrj.js} +1 -1
- package/dist/assets/{chunk-V7JOEXUC-DX2zLfQe.js → chunk-V7JOEXUC-C9Nksccs.js} +1 -1
- package/dist/assets/chunk-VAUOI2AC-HLGIHQ6k.js +1 -0
- package/dist/assets/{chunk-VR4S4FIN-CFA-WQik.js → chunk-VR4S4FIN-Xv6zfwXs.js} +1 -1
- package/dist/assets/{chunk-WYO6CB5R-Bk2HeDvJ.js → chunk-WYO6CB5R-mOJNzbWl.js} +2 -2
- package/dist/assets/chunk-XXDRQBXY-Dl0m6Ni-.js +1 -0
- package/dist/assets/{chunk-YOTPTUD7-DUG4FpBN.js → chunk-YOTPTUD7-1-aKSu4o.js} +1 -1
- package/dist/assets/{chunk-ZGVPDNZ5-70JdIGo0.js → chunk-ZGVPDNZ5-OJ8veMpK.js} +1 -1
- package/dist/assets/{chunk-ZIRB5QZD-XZdgBt5L.js → chunk-ZIRB5QZD-SR_Nq_PP.js} +1 -1
- package/dist/assets/classDiagram-OUVF2IWQ-DcDnzGNX.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-BKXKMzKM.js +1 -0
- package/dist/assets/config-split-page-BVWVDbvG.js +1 -0
- package/dist/assets/confirm-dialog-mA2iVzxh.js +5 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-B-PQoGX-.js → cose-bilkent-JH36ORCC-NjVgz2Bw.js} +1 -1
- package/dist/assets/cynefin-VYW2F7L2-BWg7U2UD.js +1 -0
- package/dist/assets/{cynefinDiagram-TSTJHNR4-BoLCPEM0.js → cynefinDiagram-TSTJHNR4-B_17LDqD.js} +1 -1
- package/dist/assets/{dagre-D7Ie4eXr.js → dagre-CMe101gk.js} +1 -1
- package/dist/assets/{dagre-VKFMJZFB-CKRrwZA-.js → dagre-VKFMJZFB-qo8nLb3B.js} +1 -1
- package/dist/assets/desktop-update-config-DyQb1LXr.js +1 -0
- package/dist/assets/{diagram-FQU43EPY-CASL1J3_.js → diagram-FQU43EPY-Ba3XIklC.js} +1 -1
- package/dist/assets/{diagram-G47NLZAW-CvLPBIzf.js → diagram-G47NLZAW-CG45TcUx.js} +1 -1
- package/dist/assets/{diagram-NH7WQ7WH-Ba6fGdYP.js → diagram-NH7WQ7WH-2F2HrwV-.js} +1 -1
- package/dist/assets/{diagram-OA4YK3LP-DkpfgEjM.js → diagram-OA4YK3LP-CXfWH9NZ.js} +1 -1
- package/dist/assets/{diagram-WEI45ONY-BP5UMVsN.js → diagram-WEI45ONY-CH_4yepc.js} +1 -1
- package/dist/assets/dist-B4Pf5X3Q.js +1 -0
- package/dist/assets/dist-DHEWkGWX.js +1 -0
- package/dist/assets/doc-browser-CtO_HtRy.js +1 -0
- package/dist/assets/doc-browser-context-CuGI6PQc.js +1 -0
- package/dist/assets/doc-browser-eMUagyBV.js +1 -0
- package/dist/assets/{docx-preview-D0tp3a9T.js → docx-preview-CoM4JK7_.js} +1 -1
- package/dist/assets/{ebnfDiagram-CCIWWBDH-TJKbUcmc.js → ebnfDiagram-CCIWWBDH-BwiG4Ea1.js} +1 -1
- package/dist/assets/{erDiagram-Q63AITRT-DzGPKkKH.js → erDiagram-Q63AITRT-BML3hpnQ.js} +1 -1
- package/dist/assets/eventmodeling-45OFAUF4-SB-J4tpq.js +1 -0
- package/dist/assets/flowDiagram-23GEKE2U-BQ_u-eLM.js +1 -0
- package/dist/assets/form-actions-BOfIyG3O.js +1 -0
- package/dist/assets/{ganttDiagram-NO4QXBWP-JhJzsGp2.js → ganttDiagram-NO4QXBWP-80enfWbD.js} +1 -1
- package/dist/assets/gitGraph-TEB2WS4Q-DPxNwsFd.js +1 -0
- package/dist/assets/{gitGraphDiagram-IHSO6WYX-DZ1CKMj8.js → gitGraphDiagram-IHSO6WYX-CVLqXr-b.js} +1 -1
- package/dist/assets/host-capabilities-D9C4CBK5.js +1 -0
- package/dist/assets/index-BjBdWHV1.js +107 -0
- package/dist/assets/index-DmpmjAGQ.css +1 -0
- package/dist/assets/info-DKCQHKI2-DNlNGH90.js +1 -0
- package/dist/assets/{infoDiagram-FWYZ7A6U-BNXNKfRQ.js → infoDiagram-FWYZ7A6U-Dyvs2t0i.js} +1 -1
- package/dist/assets/{ishikawaDiagram-FXEZZL3T-DoiEfjNw.js → ishikawaDiagram-FXEZZL3T-sSnxDKfh.js} +1 -1
- package/dist/assets/{journeyDiagram-5HDEW3XC-D6oK2HSy.js → journeyDiagram-5HDEW3XC-D22V71Mf.js} +1 -1
- package/dist/assets/{kanban-definition-HUTT4EX6-B2UnLOH-.js → kanban-definition-HUTT4EX6-D3ds0p-g.js} +1 -1
- package/dist/assets/{line-BM7PoxY5.js → line-CbyFs065.js} +1 -1
- package/dist/assets/{linear-B3DiqMjk.js → linear-4DKtnZBS.js} +1 -1
- package/dist/assets/loader-circle-Df8wF2Pr.js +1 -0
- package/dist/assets/{map-BAAdHTqR.js → map-CcZzEoz6.js} +1 -1
- package/dist/assets/mcp-marketplace-page-DI49IKxp.js +1 -0
- package/dist/assets/mcp-marketplace-page-ofDqbOIF.js +9 -0
- package/dist/assets/{mermaid-parser.core-BeMviefY.js → mermaid-parser.core-DPmMOjXD.js} +2 -2
- package/dist/assets/{mermaid.core-D0Q77r9I.js → mermaid.core-BSf-ddRa.js} +3 -3
- package/dist/assets/{mindmap-definition-LN4V7U3C-BQ7r7bR8.js → mindmap-definition-LN4V7U3C-BUTwWPyx.js} +1 -1
- package/dist/assets/model-config-page-D73Tu3jW.js +1 -0
- package/dist/assets/navigation-link-CAFOcXNg.js +3 -0
- package/dist/assets/{ordinal-Bt2N4IkA.js → ordinal-BgLYtOZE.js} +1 -1
- package/dist/assets/packet-7NZHBO7P-BpeiqkBZ.js +1 -0
- package/dist/assets/{pegDiagram-2B236MQR-B-C9-LGz.js → pegDiagram-2B236MQR-BEu_ZBjc.js} +1 -1
- package/dist/assets/pie-RZYD4A2V-Cy1yxsPd.js +1 -0
- package/dist/assets/{pieDiagram-ENE6RG2P-CtirZLtn.js → pieDiagram-ENE6RG2P-CAwAwuBd.js} +1 -1
- package/dist/assets/plus-DVU5RLCS.js +1 -0
- package/dist/assets/provider-scoped-model-input-BaJJJYMX.js +1 -0
- package/dist/assets/providers-config-page-BL6IRVBm.js +1 -0
- package/dist/assets/{quadrantDiagram-ABIIQ3AL-DiBWAzDU.js → quadrantDiagram-ABIIQ3AL-CwE6F-_2.js} +1 -1
- package/dist/assets/radar-I7S5WNFK-CEcPKCj8.js +1 -0
- package/dist/assets/railroad-3IZDKUUU-CW38eNDs.js +1 -0
- package/dist/assets/railroad-abnf-AHOZXSZD-ByrylcXf.js +1 -0
- package/dist/assets/railroad-ebnf-EBAXGLYW-CNB6GwP-.js +1 -0
- package/dist/assets/railroad-peg-LSFZ7HO6-x6hnqlBG.js +1 -0
- package/dist/assets/{railroadDiagram-RFXS5EU6-CP6b3PBI.js → railroadDiagram-RFXS5EU6-xgLekU3B.js} +1 -1
- package/dist/assets/react-BC_orpAj.js +8 -0
- package/dist/assets/{refresh-cw-CkKwPztT.js → refresh-cw-CWDp_JnN.js} +1 -1
- package/dist/assets/remote-T24O58lH.js +1 -0
- package/dist/assets/{requirementDiagram-TGXJPOKE-D8YV0-Jz.js → requirementDiagram-TGXJPOKE-CyVUzEX5.js} +1 -1
- package/dist/assets/rotate-cw-BqhwSV5p.js +1 -0
- package/dist/assets/runtime-config-page-CXUx017t.js +1 -0
- package/dist/assets/{sankeyDiagram-HTMAVEWB-C2vA4ojE.js → sankeyDiagram-HTMAVEWB-JK6bFmYB.js} +1 -1
- package/dist/assets/{save-BINMWate.js → save-Cnr71JON.js} +1 -1
- package/dist/assets/{search-7M38azRp.js → search-CCX11X2m.js} +1 -1
- package/dist/assets/search-config-page-BB6d5gT7.js +1 -0
- package/dist/assets/{secrets-config-page-2mVejXf2.js → secrets-config-page-DYsDeT9K.js} +2 -2
- package/dist/assets/security-config-CVPgqL7G.js +1 -0
- package/dist/assets/select-DvwBu99K.js +41 -0
- package/dist/assets/{sequenceDiagram-DBY2YBRQ-B9LBmpUo.js → sequenceDiagram-DBY2YBRQ-BR5IokXV.js} +1 -1
- package/dist/assets/{settings-2-DqZstREV.js → settings-2-Dmv6zMne.js} +1 -1
- package/dist/assets/{sizeCapture-X5ZJPWSS-9UIfya9-.js → sizeCapture-X5ZJPWSS-SxG_YnMA.js} +1 -1
- package/dist/assets/skeleton-C5tWata3.js +1 -0
- package/dist/assets/{src-DKf77Yzo.js → src-vgz8E_-O.js} +1 -1
- package/dist/assets/{stateDiagram-2N3HPSRC-oTW44vds.js → stateDiagram-2N3HPSRC-DD4OoYhn.js} +1 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-ZC6dFORv.js +1 -0
- package/dist/assets/{swimlanes-5IMT3BWC-Cf7lcsay.js → swimlanes-5IMT3BWC-BWkFeyCT.js} +2 -2
- package/dist/assets/swimlanesDiagram-G3AALYLV-CRkh51Im.js +8 -0
- package/dist/assets/{tag-chip-BoDaLnWt.js → tag-chip-gMPvx7n_.js} +1 -1
- package/dist/assets/{timeline-definition-FHXFAJF6-DoCuWKDJ.js → timeline-definition-FHXFAJF6-VTRPy6KA.js} +1 -1
- package/dist/assets/treeView-QDETBFTQ-Bw0DSCH7.js +1 -0
- package/dist/assets/treemap-6X3UGDF4-DFWBFcfh.js +1 -0
- package/dist/assets/use-confirm-dialog-D_3-QpZU.js +1 -0
- package/dist/assets/{vennDiagram-L72KCM5P-CpU0pzGe.js → vennDiagram-L72KCM5P-Bvk42Pek.js} +1 -1
- package/dist/assets/wardley-OPB4EBWU-CoWturk0.js +1 -0
- package/dist/assets/{wardleyDiagram-EHGQE667-CkN6nn6-.js → wardleyDiagram-EHGQE667-DOFjx2s3.js} +1 -1
- package/dist/assets/x-BEWSqeux.js +1 -0
- package/dist/assets/{xychartDiagram-FW5EYKEG-DATpapm2.js → xychartDiagram-FW5EYKEG-DY5yRTUc.js} +1 -1
- package/dist/index.html +30 -32
- package/index.html +8 -0
- package/package.json +9 -9
- package/src/app/components/layout/page-layout.tsx +15 -6
- package/src/app/styles/charcoal-theme.css +85 -0
- package/src/app/styles/design-system.css +11 -13
- package/src/features/agents/components/__tests__/agents-page.test.tsx +36 -24
- package/src/features/agents/components/agent-advanced-config-fields.tsx +7 -7
- package/src/features/agents/components/agent-details-dialog.tsx +8 -8
- package/src/features/agents/components/agent-dialogs.tsx +7 -7
- package/src/features/agents/components/agents-page.tsx +42 -62
- package/src/features/chat/components/conversation/__tests__/chat-conversation-content.test.tsx +27 -3
- package/src/features/chat/components/conversation/__tests__/chat-conversation-header-section.test.tsx +16 -0
- package/src/features/chat/components/conversation/__tests__/chat-conversation-panel.test.tsx +8 -22
- package/src/features/chat/components/conversation/__tests__/chat-conversation-workspace-section.test.tsx +69 -3
- package/src/features/chat/components/conversation/chat-conversation-content.tsx +20 -6
- package/src/features/chat/components/conversation/chat-conversation-header-section.tsx +30 -31
- package/src/features/chat/components/conversation/chat-conversation-panel.tsx +1 -8
- package/src/features/chat/components/conversation/chat-conversation-workspace-section.tsx +16 -4
- package/src/features/chat/components/layout/__tests__/chat-page-shell.test.tsx +23 -0
- package/src/features/chat/components/layout/__tests__/chat-sidebar-toolbar.test.tsx +6 -0
- package/src/features/chat/components/layout/chat-page-shell.tsx +5 -4
- package/src/features/chat/components/layout/chat-sidebar-toolbar.tsx +4 -4
- package/src/features/chat/components/providers/chat-presenter.provider.tsx +2 -0
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-area.test.tsx +84 -12
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-input.streaming.test.tsx +243 -5
- package/src/features/chat/features/conversation/components/session-conversation-area.tsx +48 -31
- package/src/features/chat/features/conversation/components/session-conversation-input.tsx +46 -37
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-controller.test.tsx +128 -1
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-input-state.test.tsx +67 -1
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-slash-commands.test.tsx +4 -0
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-provider-model-catalog.test.tsx +161 -0
- package/src/features/chat/features/conversation/hooks/use-chat-composer-reference-intent.ts +55 -0
- package/src/features/chat/features/conversation/hooks/use-session-conversation-composer-nodes.ts +26 -0
- package/src/features/chat/features/conversation/hooks/use-session-conversation-controller.ts +45 -12
- package/src/features/chat/features/conversation/hooks/use-session-conversation-input-query.ts +28 -3
- package/src/features/chat/features/conversation/hooks/use-session-conversation-input-state.ts +91 -37
- package/src/features/chat/features/conversation/hooks/use-session-conversation-recovery-actions.ts +64 -0
- package/src/features/chat/features/conversation/hooks/use-session-conversation-slash-commands.ts +2 -0
- package/src/features/chat/features/conversation/hooks/use-session-provider-model-catalog.ts +159 -0
- package/src/features/chat/features/conversation/utils/__tests__/session-message-composer.utils.test.ts +34 -0
- package/src/features/chat/features/conversation/utils/session-conversation-input-toolbar.utils.ts +23 -1
- package/src/features/chat/features/conversation/utils/session-message-composer.utils.ts +117 -0
- package/src/features/chat/features/conversation/utils/session-queued-input.utils.ts +10 -98
- package/src/features/chat/features/input/input-surface-plugins/__tests__/slash-command-plugin.test.ts +2 -1
- package/src/features/chat/features/input/input-surface-plugins/slash-command-plugin.utils.ts +3 -1
- package/src/features/chat/features/input/utils/__tests__/chat-composer-state.utils.test.ts +22 -1
- package/src/features/chat/features/input/utils/__tests__/chat-inline-token.utils.test.ts +52 -0
- package/src/features/chat/features/input/utils/__tests__/chat-input-bar.utils.test.ts +111 -0
- package/src/features/chat/features/input/utils/chat-composer-state.utils.ts +27 -2
- package/src/features/chat/features/input/utils/chat-composer-token-protocol.utils.ts +10 -0
- package/src/features/chat/features/input/utils/chat-conversation-excerpt-token.utils.ts +59 -0
- package/src/features/chat/features/input/utils/chat-inline-token.utils.ts +123 -32
- package/src/features/chat/features/input/utils/chat-input-bar.utils.ts +1 -0
- package/src/features/chat/features/input/utils/chat-input-toolbar.utils.ts +97 -10
- package/src/features/chat/features/message/components/__tests__/chat-message-assistant-header.container.test.tsx +149 -0
- package/src/features/chat/features/message/components/__tests__/chat-message-inline-editor.test.tsx +59 -0
- package/src/features/chat/features/message/components/__tests__/chat-message-list.container.test.tsx +123 -90
- package/src/features/chat/features/message/components/__tests__/chat-message-timeline-dividers.test.tsx +43 -0
- package/src/features/chat/features/message/components/chat-message-inline-editor.tsx +111 -0
- package/src/features/chat/features/message/components/chat-message-list.container.tsx +120 -171
- package/src/features/chat/features/message/components/chat-message-timeline-dividers.tsx +75 -0
- package/src/features/chat/features/message/hooks/use-chat-inline-token-actions.ts +125 -0
- package/src/features/chat/features/message/hooks/use-chat-message-actions.tsx +187 -0
- package/src/features/chat/features/message/utils/__tests__/chat-message-action-targets.utils.test.ts +89 -0
- package/src/features/chat/features/message/utils/__tests__/chat-message-timeline-compaction.utils.test.ts +194 -0
- package/src/features/chat/features/message/utils/__tests__/chat-message-timeline-continuation-compaction.utils.test.ts +167 -0
- package/src/features/chat/features/message/utils/__tests__/chat-message-timeline.utils.test.ts +175 -1
- package/src/features/chat/features/message/utils/__tests__/chat-message.utils.test.ts +26 -0
- package/src/features/chat/features/message/utils/chat-message-action-targets.utils.ts +28 -0
- package/src/features/chat/features/message/utils/chat-message-part.utils.ts +38 -0
- package/src/features/chat/features/message/utils/chat-message-texts.utils.ts +6 -0
- package/src/features/chat/features/message/utils/chat-message-timeline.utils.ts +201 -7
- package/src/features/chat/features/ncp/hooks/__tests__/use-ncp-agent-runtime.test.tsx +180 -1
- package/src/features/chat/features/ncp/hooks/__tests__/use-ncp-session-conversation.test.tsx +184 -10
- package/src/features/chat/features/ncp/hooks/use-hydrated-ncp-agent.integration.test.tsx +57 -0
- package/src/features/chat/features/ncp/hooks/use-ncp-session-conversation.ts +90 -1
- package/src/features/chat/features/ncp/utils/__tests__/ncp-chat-query-derived.utils.test.ts +110 -0
- package/src/features/chat/features/ncp/utils/ncp-chat-query-derived.utils.ts +65 -3
- package/src/features/chat/features/session/components/session-header/__tests__/chat-session-header-actions.test.tsx +17 -0
- package/src/features/chat/features/session/components/session-header/chat-session-header-actions.tsx +63 -54
- package/src/features/chat/features/session/hooks/__tests__/use-selected-session-context-window-indicator.test.tsx +87 -0
- package/src/features/chat/features/session/utils/__tests__/ncp-session-adapter.utils.test.ts +19 -0
- package/src/features/chat/features/session/utils/chat-context-window-indicator.utils.ts +44 -5
- package/src/features/chat/features/session/utils/ncp-session-adapter.utils.ts +10 -0
- package/src/features/chat/features/session/utils/ncp-session-context-metadata.utils.ts +42 -4
- package/src/features/chat/features/welcome/components/__tests__/chat-welcome.test.tsx +17 -2
- package/src/features/chat/features/welcome/components/chat-welcome-project-picker.tsx +8 -3
- package/src/features/chat/features/welcome/components/chat-welcome.tsx +2 -2
- package/src/features/chat/features/welcome/utils/__tests__/chat-welcome-project-options.utils.test.ts +22 -6
- package/src/features/chat/features/welcome/utils/chat-welcome-project-options.utils.ts +13 -0
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel-content.test.tsx +72 -2
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel.test.tsx +21 -1
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-text-selection.test.tsx +75 -0
- package/src/features/chat/features/workspace/components/__tests__/workspace-text-selection-menu.test.tsx +109 -0
- package/src/features/chat/features/workspace/components/chat-session-workspace-directory-browser.tsx +145 -26
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +42 -18
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-content.tsx +50 -10
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-nav.tsx +48 -22
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel.tsx +13 -2
- package/src/features/chat/features/workspace/components/workspace-text-selection-menu.tsx +45 -0
- package/src/features/chat/features/workspace/utils/__tests__/chat-workspace-panel-view-model.utils.test.ts +80 -0
- package/src/features/chat/features/workspace/utils/__tests__/workspace-text-excerpt.utils.test.ts +54 -0
- package/src/features/chat/features/workspace/utils/chat-thread-workspace-session.utils.ts +47 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-file-tab.utils.ts +16 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-panel-view-model.utils.ts +22 -1
- package/src/features/chat/features/workspace/utils/workspace-text-excerpt.utils.ts +53 -0
- package/src/features/chat/index.ts +1 -0
- package/src/features/chat/managers/__tests__/chat-composer-intent.manager.test.ts +129 -0
- package/src/features/chat/managers/__tests__/chat-session-list.manager.test.ts +38 -2
- package/src/features/chat/managers/__tests__/chat-thread-workspace.manager.test.ts +93 -1
- package/src/features/chat/managers/__tests__/provider-model-catalog-notice.manager.test.ts +57 -0
- package/src/features/chat/managers/chat-composer-intent.manager.ts +190 -0
- package/src/features/chat/managers/chat-session-list.manager.ts +13 -4
- package/src/features/chat/managers/chat-thread.manager.ts +30 -11
- package/src/features/chat/managers/provider-model-catalog-notice.manager.ts +121 -0
- package/src/features/chat/presenters/chat.presenter.ts +3 -0
- package/src/features/chat/stores/__tests__/chat-composer-draft.store.test.ts +55 -0
- package/src/features/chat/stores/chat-composer-draft.store.ts +92 -0
- package/src/features/chat/stores/chat-thread.store.ts +2 -4
- package/src/features/chat/types/chat-input-bar.types.ts +8 -0
- package/src/features/chat/types/chat-input.types.ts +5 -0
- package/src/features/chat/types/chat-message.types.ts +5 -0
- package/src/features/cron/components/__tests__/cron-config.test.tsx +100 -19
- package/src/features/cron/components/cron-config.tsx +19 -33
- package/src/features/cron/components/cron-job-detail-dialog.tsx +42 -16
- package/src/features/cron/components/cron-job-row.tsx +18 -1
- package/src/features/inbox/components/inbox-delivery-content.test.tsx +8 -2
- package/src/features/inbox/components/inbox-delivery-content.tsx +1 -1
- package/src/features/inbox/components/inbox-reader-dialog.test.tsx +10 -4
- package/src/features/inbox/components/inbox-reader-dialog.tsx +37 -61
- package/src/features/inbox/pages/inbox-page.tsx +90 -98
- package/src/features/notifications/components/__tests__/app-notification-toast.test.tsx +28 -6
- package/src/features/notifications/components/app-notification-toast.tsx +54 -15
- package/src/features/notifications/managers/__tests__/app-notification.manager.test.ts +2 -0
- package/src/features/notifications/managers/app-notification.manager.ts +3 -0
- package/src/features/panel-apps/utils/panel-app-doc-browser.utils.tsx +1 -0
- package/src/features/pwa/managers/__tests__/pwa-shell-theme.manager.test.ts +9 -0
- package/src/features/pwa/managers/pwa-shell-theme.manager.ts +1 -0
- package/src/features/service-apps/components/__tests__/service-apps-panel.test.tsx +5 -4
- package/src/features/service-apps/components/service-app-list-item.tsx +470 -0
- package/src/features/service-apps/components/service-apps-panel.tsx +76 -490
- package/src/features/settings/components/config/__tests__/provider-models-section.test.tsx +239 -0
- package/src/features/settings/components/config/provider-form-detail-pane.tsx +307 -0
- package/src/features/settings/components/config/provider-form.tsx +149 -360
- package/src/features/settings/components/config/provider-model-list.tsx +293 -0
- package/src/features/settings/components/config/provider-model-suggestions-panel.tsx +151 -0
- package/src/features/settings/components/config/provider-models-section.tsx +178 -149
- package/src/features/settings/hooks/__tests__/use-provider-connectivity.test.tsx +98 -0
- package/src/features/settings/hooks/__tests__/use-provider-model-suggestions.test.tsx +107 -0
- package/src/features/settings/hooks/use-provider-connectivity.ts +132 -0
- package/src/features/settings/hooks/use-provider-model-suggestions.ts +51 -0
- package/src/features/settings/pages/__tests__/appearance-settings-page.test.tsx +2 -2
- package/src/features/settings/pages/__tests__/search-config-page.test.tsx +48 -0
- package/src/features/settings/pages/search-config-page.tsx +17 -8
- package/src/features/settings/utils/__tests__/provider-form-support.utils.test.ts +42 -0
- package/src/features/settings/utils/provider-form-context.utils.ts +2 -0
- package/src/features/settings/utils/provider-form-model.utils.ts +25 -0
- package/src/features/settings/utils/provider-form-support.utils.ts +21 -5
- package/src/features/side-dock/components/__tests__/side-dock.test.tsx +1 -0
- package/src/features/side-dock/configs/side-dock-built-in-items.config.ts +0 -9
- package/src/index.css +1 -1
- package/src/platforms/desktop/types/desktop-update.types.ts +5 -0
- package/src/shared/components/actions/__tests__/navigation-link.test.tsx +14 -3
- package/src/shared/components/actions/navigation-link.tsx +35 -15
- package/src/shared/components/common/__tests__/agent-avatar.test.tsx +3 -2
- package/src/shared/components/common/agent-avatar.tsx +3 -3
- package/src/shared/components/doc-browser/__tests__/doc-browser.test.tsx +66 -0
- package/src/shared/components/doc-browser/doc-browser-panel-parts.tsx +4 -1
- package/src/shared/components/doc-browser/doc-browser-renderer.types.ts +1 -0
- package/src/shared/components/doc-browser/doc-browser.tsx +9 -0
- package/src/shared/components/doc-browser/hooks/use-doc-browser-scroll-restoration.ts +126 -0
- package/src/shared/components/settings/settings-page.tsx +1 -1
- package/src/shared/components/ui/context-menu/__tests__/context-menu.test.tsx +103 -0
- package/src/shared/components/ui/context-menu/context-menu.tsx +263 -0
- package/src/shared/components/ui/tab-strip/__tests__/compact-tab-strip.test.tsx +19 -6
- package/src/shared/components/ui/tab-strip/compact-tab-strip.tsx +28 -67
- package/src/shared/hooks/use-config.ts +33 -1
- package/src/shared/lib/api/__tests__/ncp-session-query-cache.utils.test.ts +26 -0
- package/src/shared/lib/api/ncp-session-query-cache.utils.ts +7 -10
- package/src/shared/lib/api/ncp-session.types.ts +6 -0
- package/src/shared/lib/api/types.ts +36 -1
- package/src/shared/lib/api/utils/config.utils.ts +14 -0
- package/src/shared/lib/cron/cron-job-view.utils.ts +4 -0
- package/src/shared/lib/host-capabilities/__tests__/host-capability.manager.test.ts +26 -0
- package/src/shared/lib/host-capabilities/host-capability.manager.ts +28 -0
- package/src/shared/lib/i18n/locales/en-US/chat.json +39 -4
- package/src/shared/lib/i18n/locales/en-US/core.json +26 -0
- package/src/shared/lib/i18n/locales/en-US/doc-browser.json +1 -0
- package/src/shared/lib/i18n/locales/en-US/search.json +1 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +39 -4
- package/src/shared/lib/i18n/locales/zh-CN/core.json +26 -0
- package/src/shared/lib/i18n/locales/zh-CN/doc-browser.json +1 -0
- package/src/shared/lib/i18n/locales/zh-CN/search.json +1 -0
- package/src/shared/lib/session-project/__tests__/workspace-file-breadcrumb.test.ts +28 -1
- package/src/shared/lib/session-project/workspace-file-breadcrumb.utils.ts +23 -0
- package/src/shared/lib/theme/index.test.ts +11 -0
- package/src/shared/lib/theme/index.ts +2 -0
- package/dist/assets/api-B1yHQYs-.js +0 -13
- package/dist/assets/app-presenter-provider-D3BuuOyZ.css +0 -1
- package/dist/assets/app-presenter-provider-uP9waOzv.js +0 -108
- package/dist/assets/appearance-settings-page-C9Zq3hP9.js +0 -1
- package/dist/assets/architecture-TIHT7OUA-Cii4JyA2.js +0 -1
- package/dist/assets/book-open-oSmyVXea.js +0 -1
- package/dist/assets/card-CGvJZTZp.js +0 -1
- package/dist/assets/channel-BSKkTPe8.js +0 -1
- package/dist/assets/channels-list-page-5BTxpQHw.js +0 -8
- package/dist/assets/chat-page-jTvli8Jp.js +0 -1
- package/dist/assets/chunk-2Q5K7J3B-CDMOR1xZ.js +0 -1
- package/dist/assets/chunk-VAUOI2AC-BRvqNW76.js +0 -1
- package/dist/assets/chunk-XXDRQBXY-CwX_mqJ3.js +0 -1
- package/dist/assets/classDiagram-OUVF2IWQ-RzbGxG77.js +0 -1
- package/dist/assets/classDiagram-v2-EOCWNBFH-C_gWB7WT.js +0 -1
- package/dist/assets/config-split-page-BgBsUmp1.js +0 -1
- package/dist/assets/confirm-dialog-h849QRWO.js +0 -5
- package/dist/assets/cynefin-VYW2F7L2-fSLIS0X3.js +0 -1
- package/dist/assets/desktop-update-config-BGGHxClR.js +0 -1
- package/dist/assets/dist-CxUhurq9.js +0 -41
- package/dist/assets/doc-browser-0eL8AX42.js +0 -1
- package/dist/assets/doc-browser-DEqE9lsh.js +0 -1
- package/dist/assets/doc-browser-context-DkzFIUoK.js +0 -1
- package/dist/assets/eventmodeling-45OFAUF4-XVcQGgha.js +0 -1
- package/dist/assets/eye-gOWQGt8N.js +0 -1
- package/dist/assets/flowDiagram-23GEKE2U-BiFSctqz.js +0 -1
- package/dist/assets/form-actions-CgjYZUzM.js +0 -1
- package/dist/assets/gitGraph-TEB2WS4Q-C014uXqS.js +0 -1
- package/dist/assets/host-capabilities-B-TtABsP.js +0 -1
- package/dist/assets/index-DSAUWCfl.js +0 -2
- package/dist/assets/index-G7cBryJ4.css +0 -1
- package/dist/assets/info-DKCQHKI2-CQ2qjGhU.js +0 -1
- package/dist/assets/loader-circle-BAuycGf6.js +0 -1
- package/dist/assets/logo-badge-BNcsDsUM.js +0 -1
- package/dist/assets/mcp-marketplace-page-BX39MtPa.js +0 -9
- package/dist/assets/mcp-marketplace-page-CkDtOEA4.js +0 -1
- package/dist/assets/model-config-page-7MIXg2fQ.js +0 -1
- package/dist/assets/navigation-link-B3iFOdxx.js +0 -1
- package/dist/assets/packet-7NZHBO7P-6IFyydij.js +0 -1
- package/dist/assets/pie-RZYD4A2V-spXQC_wr.js +0 -1
- package/dist/assets/plus-yvhFgfal.js +0 -1
- package/dist/assets/popover-Cpep_rJe.js +0 -1
- package/dist/assets/provider-models-CUrptZ-o.js +0 -1
- package/dist/assets/provider-scoped-model-input-CHmOzz7x.js +0 -1
- package/dist/assets/providers-config-page-A6J7Y0II.js +0 -1
- package/dist/assets/radar-I7S5WNFK-DWVA8lvY.js +0 -1
- package/dist/assets/railroad-3IZDKUUU-Ce51u8y1.js +0 -1
- package/dist/assets/railroad-abnf-AHOZXSZD-D7i7cqI_.js +0 -1
- package/dist/assets/railroad-ebnf-EBAXGLYW-BEg2hcPs.js +0 -1
- package/dist/assets/railroad-peg-LSFZ7HO6-CxROSzbi.js +0 -1
- package/dist/assets/react-BCJGCjrP.js +0 -8
- package/dist/assets/remote-FD-ZfSIn.js +0 -1
- package/dist/assets/rotate-cw-DrJMfHhp.js +0 -1
- package/dist/assets/runtime-config-page-DwjO-Vs6.js +0 -1
- package/dist/assets/search-config-page-T6tMhXbP.js +0 -1
- package/dist/assets/security-config-DD5RrjDe.js +0 -1
- package/dist/assets/select-BvidP5Oa.js +0 -1
- package/dist/assets/skeleton-BEQW2Dva.js +0 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-Bui4RXQK.js +0 -1
- package/dist/assets/swimlanesDiagram-G3AALYLV-DTwUsCBz.js +0 -8
- package/dist/assets/tabs-BeLxVmkt.js +0 -1
- package/dist/assets/trash-2-CYUskMMN.js +0 -1
- package/dist/assets/treeView-QDETBFTQ-D5zsTiuL.js +0 -1
- package/dist/assets/treemap-6X3UGDF4-CR3dxqNs.js +0 -1
- package/dist/assets/use-config-CxKRXXCl.js +0 -1
- package/dist/assets/use-confirm-dialog-HASTvOP2.js +0 -1
- package/dist/assets/use-viewport-layout-CJxkjoRz.js +0 -1
- package/dist/assets/wardley-OPB4EBWU-LatRT_Lx.js +0 -1
- package/dist/assets/x-DdUwjre5.js +0 -1
- /package/dist/assets/{array-CAkJT3no.js → array-NADKd9aU.js} +0 -0
- /package/dist/assets/{chunk-KEIR6QF5-BgdDoWEH.js → chunk-KEIR6QF5-BuyuzJJL.js} +0 -0
- /package/dist/assets/{chunk-Y2CYZVJY-pTllD0P3.js → chunk-Y2CYZVJY-D_B2ZRNt.js} +0 -0
- /package/dist/assets/{config-hints-S3g-UVZb.js → config-hints-BcfVUMij.js} +0 -0
- /package/dist/assets/{cytoscape.esm-DmURt-5G.js → cytoscape.esm-BANTlgza.js} +0 -0
- /package/dist/assets/{defaultLocale-BKy_KP3O.js → defaultLocale-C4_L0aEs.js} +0 -0
- /package/dist/assets/{dist-IgNNB7K9.js → dist-DAPEIJbz.js} +0 -0
- /package/dist/assets/{graphlib-xw_TBHyH.js → graphlib-ChqXg0dI.js} +0 -0
- /package/dist/assets/{init-C9xlLIAu.js → init-D8wZg9xq.js} +0 -0
- /package/dist/assets/{jszip.min-Das2IAnb.js → jszip.min-CkbBfwAQ.js} +0 -0
- /package/dist/assets/{katex-DSy1eD2d.js → katex-TZJFa0J_.js} +0 -0
- /package/dist/assets/{middleware-Df-a4x-q.js → middleware-B3k-TSmZ.js} +0 -0
- /package/dist/assets/{path-DB0USYHi.js → path-DodfxcX7.js} +0 -0
- /package/dist/assets/{rough.esm-B1B52ZQS.js → rough.esm-CUaa1Rbe.js} +0 -0
- /package/dist/assets/{xlsx-DfjC_iml.js → xlsx-CxByi7bR.js} +0 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { render, screen } from "@testing-library/react";
|
|
1
|
+
import { act, render, screen } from "@testing-library/react";
|
|
2
2
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
3
|
import type { PersistStorage, StorageValue } from "zustand/middleware";
|
|
4
4
|
import { ChatConversationWorkspaceSection } from "@/features/chat/components/conversation/chat-conversation-workspace-section";
|
|
5
|
+
import { ChatSessionListManager } from "@/features/chat/managers/chat-session-list.manager";
|
|
6
|
+
import { ChatThreadManager } from "@/features/chat/managers/chat-thread.manager";
|
|
7
|
+
import { useChatSessionListStore } from "@/features/chat/stores/chat-session-list.store";
|
|
5
8
|
import { useChatQueryStore } from "@/features/chat/stores/ncp-chat-query.store";
|
|
6
9
|
import { useChatThreadStore } from "@/features/chat/stores/chat-thread.store";
|
|
7
10
|
import type { NcpSessionSummaryView } from "@/shared/lib/api";
|
|
@@ -90,8 +93,7 @@ describe("ChatConversationWorkspaceSection", () => {
|
|
|
90
93
|
activeChildSessionKey: null,
|
|
91
94
|
workspaceNavigationHistory: [],
|
|
92
95
|
workspaceNavigationHistoryIndex: 0,
|
|
93
|
-
|
|
94
|
-
sessionWorkingDir: null,
|
|
96
|
+
draftProjectRoot: null,
|
|
95
97
|
workspacePanelWidth: 620,
|
|
96
98
|
},
|
|
97
99
|
});
|
|
@@ -156,4 +158,68 @@ describe("ChatConversationWorkspaceSection", () => {
|
|
|
156
158
|
|
|
157
159
|
expect(screen.getByTestId("workspace-panel")).toBeTruthy();
|
|
158
160
|
});
|
|
161
|
+
|
|
162
|
+
it("uses the selected draft project before the first message creates a session", () => {
|
|
163
|
+
useChatThreadStore.getState().setSnapshot({
|
|
164
|
+
draftProjectRoot: "/Users/peiwang/Projects/draft-project",
|
|
165
|
+
workspacePanelParentKey: null,
|
|
166
|
+
activeWorkspacePanelKind: "project-files",
|
|
167
|
+
workspaceFileTabs: [],
|
|
168
|
+
activeWorkspaceFileKey: null,
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
render(
|
|
172
|
+
<ChatConversationWorkspaceSection
|
|
173
|
+
layoutMode="desktop"
|
|
174
|
+
sessionKey={null}
|
|
175
|
+
/>,
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
expect(mocks.panelProps).toHaveBeenCalledWith(
|
|
179
|
+
expect.objectContaining({
|
|
180
|
+
sessionProjectRoot: "/Users/peiwang/Projects/draft-project",
|
|
181
|
+
sessionWorkingDir: "/Users/peiwang/Projects/draft-project",
|
|
182
|
+
}),
|
|
183
|
+
);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it("keeps the workspace panel mounted while a root draft materializes", () => {
|
|
187
|
+
useChatSessionListStore.getState().setSnapshot({ selectedSessionKey: null });
|
|
188
|
+
useChatThreadStore.getState().setSnapshot({
|
|
189
|
+
draftProjectRoot: "/Users/peiwang/Projects/nextbot",
|
|
190
|
+
workspacePanelParentKey: null,
|
|
191
|
+
activeWorkspacePanelKind: "project-files",
|
|
192
|
+
workspaceFileTabs: [],
|
|
193
|
+
activeWorkspaceFileKey: null,
|
|
194
|
+
});
|
|
195
|
+
const uiManager = {
|
|
196
|
+
goToSession: vi.fn(),
|
|
197
|
+
isAtChatRoot: vi.fn(() => true),
|
|
198
|
+
} as unknown as ConstructorParameters<typeof ChatThreadManager>[0];
|
|
199
|
+
const manager = new ChatThreadManager(
|
|
200
|
+
uiManager,
|
|
201
|
+
new ChatSessionListManager(uiManager),
|
|
202
|
+
);
|
|
203
|
+
function WorkspaceHarness() {
|
|
204
|
+
const sessionKey = useChatSessionListStore(
|
|
205
|
+
(state) => state.snapshot.selectedSessionKey,
|
|
206
|
+
);
|
|
207
|
+
return (
|
|
208
|
+
<ChatConversationWorkspaceSection
|
|
209
|
+
layoutMode="desktop"
|
|
210
|
+
sessionKey={sessionKey}
|
|
211
|
+
/>
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
render(<WorkspaceHarness />);
|
|
216
|
+
const draftPanel = screen.getByTestId("workspace-panel");
|
|
217
|
+
|
|
218
|
+
act(() => manager.materializeRootDraftSession("session-1"));
|
|
219
|
+
|
|
220
|
+
expect(screen.getByTestId("workspace-panel")).toBe(draftPanel);
|
|
221
|
+
expect(uiManager.goToSession).toHaveBeenCalledWith("session-1", {
|
|
222
|
+
replace: true,
|
|
223
|
+
});
|
|
224
|
+
});
|
|
159
225
|
});
|
|
@@ -18,44 +18,54 @@ import { t } from "@/shared/lib/i18n";
|
|
|
18
18
|
|
|
19
19
|
type ChatConversationContentProps = {
|
|
20
20
|
bottomSlot?: ReactNode;
|
|
21
|
-
|
|
21
|
+
canContinue?: boolean;
|
|
22
22
|
isHistoryLoading: boolean;
|
|
23
23
|
hasPreviousMessages: boolean;
|
|
24
24
|
historyError: Error | null;
|
|
25
25
|
isLoadingPreviousMessages: boolean;
|
|
26
26
|
isContextCompacting?: boolean;
|
|
27
27
|
isSending: boolean;
|
|
28
|
+
messageActionsDisabled?: boolean;
|
|
28
29
|
messages: readonly NcpMessage[];
|
|
29
30
|
sessionKey: string | null;
|
|
30
31
|
showWelcome: boolean;
|
|
31
32
|
onLoadPreviousMessages: () => Promise<void>;
|
|
33
|
+
onContinueRun?: () => Promise<void> | void;
|
|
34
|
+
onEditMessage?: (payload: {
|
|
35
|
+
readonly message: NcpMessage;
|
|
36
|
+
readonly messageId: string;
|
|
37
|
+
}) => Promise<void> | void;
|
|
32
38
|
welcomeSlot?: ReactNode;
|
|
33
39
|
};
|
|
34
40
|
|
|
35
41
|
export function ChatConversationContent({
|
|
36
42
|
bottomSlot,
|
|
37
|
-
|
|
43
|
+
canContinue = false,
|
|
38
44
|
isHistoryLoading,
|
|
39
45
|
hasPreviousMessages,
|
|
40
46
|
historyError,
|
|
41
47
|
isLoadingPreviousMessages,
|
|
42
48
|
isContextCompacting = false,
|
|
43
49
|
isSending,
|
|
50
|
+
messageActionsDisabled = false,
|
|
44
51
|
messages,
|
|
45
52
|
sessionKey,
|
|
46
53
|
showWelcome,
|
|
47
54
|
onLoadPreviousMessages,
|
|
55
|
+
onContinueRun,
|
|
56
|
+
onEditMessage,
|
|
48
57
|
welcomeSlot,
|
|
49
58
|
}: ChatConversationContentProps) {
|
|
50
59
|
const threadRef = useRef<HTMLDivElement | null>(null);
|
|
51
60
|
const contentRef = useRef<HTMLDivElement | null>(null);
|
|
61
|
+
const hasConversationContent = messages.length > 0 || isSending;
|
|
52
62
|
const { isAtBottom, onScroll, scrollToBottom } = useStickyBottomScroll({
|
|
53
63
|
contentRef,
|
|
54
64
|
scrollRef: threadRef,
|
|
55
65
|
resetKey: sessionKey,
|
|
56
66
|
isLoading: isHistoryLoading,
|
|
57
|
-
hasContent:
|
|
58
|
-
contentVersion: messages[messages.length - 1] ??
|
|
67
|
+
hasContent: hasConversationContent,
|
|
68
|
+
contentVersion: messages[messages.length - 1] ?? isSending,
|
|
59
69
|
});
|
|
60
70
|
const hasMessages = messages.length > 0;
|
|
61
71
|
const handleScroll = useCallback(
|
|
@@ -89,7 +99,7 @@ export function ChatConversationContent({
|
|
|
89
99
|
(welcomeSlot ?? null)
|
|
90
100
|
) : (
|
|
91
101
|
<div ref={contentRef} className="pb-7">
|
|
92
|
-
{
|
|
102
|
+
{hasConversationContent ? (
|
|
93
103
|
<ChatConversationTrack className="relative py-4 sm:py-5">
|
|
94
104
|
{historyError ? (
|
|
95
105
|
<div role="alert" className="flex h-8 justify-center">
|
|
@@ -109,8 +119,12 @@ export function ChatConversationContent({
|
|
|
109
119
|
/>
|
|
110
120
|
) : null}
|
|
111
121
|
<ChatMessageListContainer
|
|
122
|
+
canContinue={canContinue}
|
|
112
123
|
messages={messages}
|
|
113
|
-
isSending={isSending
|
|
124
|
+
isSending={isSending}
|
|
125
|
+
messageActionsDisabled={messageActionsDisabled}
|
|
126
|
+
onContinueRun={onContinueRun}
|
|
127
|
+
onEditMessage={onEditMessage}
|
|
114
128
|
scrollRef={threadRef}
|
|
115
129
|
sessionKey={sessionKey}
|
|
116
130
|
/>
|
|
@@ -89,14 +89,10 @@ export function ChatConversationHeaderSection({
|
|
|
89
89
|
const shouldShowHeaderAgentAvatar =
|
|
90
90
|
normalizedAgentId.length > 0 && normalizedAgentId.toLowerCase() !== "main";
|
|
91
91
|
const isWorkspaceOpen = Boolean(
|
|
92
|
-
sessionKey &&
|
|
93
|
-
snapshot.workspacePanelParentKey === sessionKey &&
|
|
92
|
+
snapshot.workspacePanelParentKey === sessionKey &&
|
|
94
93
|
snapshot.activeWorkspacePanelKind,
|
|
95
94
|
);
|
|
96
95
|
const toggleWorkspace = () => {
|
|
97
|
-
if (!sessionKey) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
96
|
presenter.chatThreadManager.toggleWorkspacePanel(sessionKey);
|
|
101
97
|
};
|
|
102
98
|
|
|
@@ -154,33 +150,36 @@ export function ChatConversationHeaderSection({
|
|
|
154
150
|
) : null
|
|
155
151
|
}
|
|
156
152
|
actions={
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
<
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
/>
|
|
170
|
-
) : null}
|
|
171
|
-
<ChatSessionHeaderActions
|
|
172
|
-
sessionKey={sessionKey}
|
|
173
|
-
canDeleteSession={canDeleteSession}
|
|
174
|
-
isDeletePending={snapshot.isDeletePending}
|
|
175
|
-
currentPath={sessionProjectRoot ?? selectedSession?.workingDir ?? null}
|
|
176
|
-
defaultWorkspacePath={defaultWorkspacePath}
|
|
177
|
-
metadata={selectedSession?.metadata ?? null}
|
|
178
|
-
isWorkspaceOpen={isWorkspaceOpen}
|
|
179
|
-
onToggleWorkspace={toggleWorkspace}
|
|
180
|
-
onDeleteSession={presenter.chatThreadManager.deleteSession}
|
|
153
|
+
<div className="flex shrink-0 items-center gap-1.5">
|
|
154
|
+
{layoutMode === "mobile" && sessionKey ? (
|
|
155
|
+
<IconActionButton
|
|
156
|
+
icon={<SquarePen className="h-4 w-4" />}
|
|
157
|
+
label={t("chatSidebarNewTask")}
|
|
158
|
+
tooltip={false}
|
|
159
|
+
onClick={() =>
|
|
160
|
+
presenter.chatSessionListManager.createSession({
|
|
161
|
+
sessionType: newSessionTypePreference.selectedSessionType,
|
|
162
|
+
})
|
|
163
|
+
}
|
|
181
164
|
/>
|
|
182
|
-
|
|
183
|
-
|
|
165
|
+
) : null}
|
|
166
|
+
<ChatSessionHeaderActions
|
|
167
|
+
sessionKey={sessionKey}
|
|
168
|
+
canDeleteSession={canDeleteSession}
|
|
169
|
+
isDeletePending={snapshot.isDeletePending}
|
|
170
|
+
currentPath={
|
|
171
|
+
sessionProjectRoot ??
|
|
172
|
+
selectedSession?.workingDir ??
|
|
173
|
+
snapshot.draftProjectRoot ??
|
|
174
|
+
defaultWorkspacePath
|
|
175
|
+
}
|
|
176
|
+
defaultWorkspacePath={defaultWorkspacePath}
|
|
177
|
+
metadata={selectedSession?.metadata ?? null}
|
|
178
|
+
isWorkspaceOpen={isWorkspaceOpen}
|
|
179
|
+
onToggleWorkspace={toggleWorkspace}
|
|
180
|
+
onDeleteSession={presenter.chatThreadManager.deleteSession}
|
|
181
|
+
/>
|
|
182
|
+
</div>
|
|
184
183
|
}
|
|
185
184
|
/>
|
|
186
185
|
);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useCallback } from "react";
|
|
2
1
|
import { ChatConversationHeaderSection } from "@/features/chat/components/conversation/chat-conversation-header-section";
|
|
3
2
|
import { ChatConversationParentBanner } from "@/features/chat/components/conversation/chat-conversation-parent-banner";
|
|
4
3
|
import { ChatConversationWorkspaceSection } from "@/features/chat/components/conversation/chat-conversation-workspace-section";
|
|
@@ -19,12 +18,6 @@ export function ChatConversationPanel({
|
|
|
19
18
|
const sessionKey = useChatSessionListStore(
|
|
20
19
|
(state) => state.snapshot.selectedSessionKey,
|
|
21
20
|
);
|
|
22
|
-
const handleSessionMaterialized = useCallback((materializedSessionKey: string) => {
|
|
23
|
-
if (!presenter.chatUiManager.isAtChatRoot()) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
presenter.chatUiManager.goToSession(materializedSessionKey, { replace: true });
|
|
27
|
-
}, [presenter]);
|
|
28
21
|
|
|
29
22
|
return (
|
|
30
23
|
<section className="relative flex-1 min-h-0 flex overflow-hidden bg-background">
|
|
@@ -37,7 +30,7 @@ export function ChatConversationPanel({
|
|
|
37
30
|
<SessionConversationArea
|
|
38
31
|
consumeDraftIntent
|
|
39
32
|
sessionKey={sessionKey}
|
|
40
|
-
onSessionMaterialized={
|
|
33
|
+
onSessionMaterialized={presenter.chatThreadManager.materializeRootDraftSession}
|
|
41
34
|
/>
|
|
42
35
|
</div>
|
|
43
36
|
|
|
@@ -2,6 +2,8 @@ import { ChatSessionWorkspacePanel } from "@/features/chat/features/workspace/co
|
|
|
2
2
|
import { useNcpChatSelectedSession } from "@/features/chat/features/ncp/hooks/use-ncp-chat-derived-state";
|
|
3
3
|
import { useChatConversationWorkspaceState } from "@/features/chat/features/workspace/hooks/use-chat-conversation-workspace-state";
|
|
4
4
|
import { useChatThreadStore } from "@/features/chat/stores/chat-thread.store";
|
|
5
|
+
import { useChatQueryStore } from "@/features/chat/stores/ncp-chat-query.store";
|
|
6
|
+
import { normalizeSessionProjectRootValue } from "@/shared/lib/session-project";
|
|
5
7
|
|
|
6
8
|
type ChatConversationWorkspaceSectionProps = {
|
|
7
9
|
layoutMode: "desktop" | "mobile";
|
|
@@ -13,7 +15,15 @@ export function ChatConversationWorkspaceSection({
|
|
|
13
15
|
sessionKey,
|
|
14
16
|
}: ChatConversationWorkspaceSectionProps) {
|
|
15
17
|
const snapshot = useChatThreadStore((state) => state.snapshot);
|
|
18
|
+
const defaultWorkspacePath = useChatQueryStore((state) =>
|
|
19
|
+
normalizeSessionProjectRootValue(
|
|
20
|
+
state.snapshot.configQuery?.data?.agents.defaults.workspace,
|
|
21
|
+
),
|
|
22
|
+
);
|
|
16
23
|
const selectedSession = useNcpChatSelectedSession(sessionKey);
|
|
24
|
+
const draftProjectRoot = sessionKey
|
|
25
|
+
? null
|
|
26
|
+
: snapshot.draftProjectRoot ?? defaultWorkspacePath;
|
|
17
27
|
const {
|
|
18
28
|
childSessionTabs,
|
|
19
29
|
activeSideChatDraft,
|
|
@@ -29,7 +39,7 @@ export function ChatConversationWorkspaceSection({
|
|
|
29
39
|
return (
|
|
30
40
|
<ChatSessionWorkspacePanel
|
|
31
41
|
sessionKey={sessionKey}
|
|
32
|
-
childSessionTabs={childSessionTabs}
|
|
42
|
+
childSessionTabs={sessionKey ? childSessionTabs : []}
|
|
33
43
|
activeChildSessionKey={snapshot.activeChildSessionKey ?? null}
|
|
34
44
|
activeSideChatDraft={activeSideChatDraft}
|
|
35
45
|
workspaceFileTabs={workspaceFileTabs}
|
|
@@ -38,10 +48,12 @@ export function ChatConversationWorkspaceSection({
|
|
|
38
48
|
workspaceNavigationHistory={snapshot.workspaceNavigationHistory}
|
|
39
49
|
workspaceNavigationHistoryIndex={snapshot.workspaceNavigationHistoryIndex}
|
|
40
50
|
activePanelKind={snapshot.activeWorkspacePanelKind ?? null}
|
|
41
|
-
sessionCronJobs={sessionCronJobs}
|
|
42
|
-
sessionProjectRoot={selectedSession?.projectRoot ??
|
|
51
|
+
sessionCronJobs={sessionKey ? sessionCronJobs : []}
|
|
52
|
+
sessionProjectRoot={selectedSession?.projectRoot ?? draftProjectRoot}
|
|
43
53
|
sessionWorkingDir={
|
|
44
|
-
selectedSession?.workingDir ??
|
|
54
|
+
selectedSession?.workingDir ??
|
|
55
|
+
selectedSession?.projectRoot ??
|
|
56
|
+
draftProjectRoot
|
|
45
57
|
}
|
|
46
58
|
workspacePanelWidth={snapshot.workspacePanelWidth}
|
|
47
59
|
displayMode={layoutMode === "mobile" ? "overlay" : "docked"}
|
|
@@ -39,6 +39,29 @@ vi.mock("@/features/marketplace", () => ({
|
|
|
39
39
|
}));
|
|
40
40
|
|
|
41
41
|
describe("ChatPageLayout", () => {
|
|
42
|
+
it("uses the same canvas width for management pages", () => {
|
|
43
|
+
const agentsView = render(
|
|
44
|
+
<ChatPageLayout view="agents" confirmDialog={<div />} />,
|
|
45
|
+
);
|
|
46
|
+
const agentsCanvas = screen.getByText("Agents").parentElement;
|
|
47
|
+
|
|
48
|
+
expect(agentsCanvas?.className).toContain("max-w-[min(1180px,100%)]");
|
|
49
|
+
agentsView.unmount();
|
|
50
|
+
|
|
51
|
+
const cronView = render(
|
|
52
|
+
<ChatPageLayout view="cron" confirmDialog={<div />} />,
|
|
53
|
+
);
|
|
54
|
+
const cronCanvas = screen.getByText("Cron").parentElement;
|
|
55
|
+
|
|
56
|
+
expect(cronCanvas?.className).toContain("max-w-[min(1180px,100%)]");
|
|
57
|
+
cronView.unmount();
|
|
58
|
+
|
|
59
|
+
render(<ChatPageLayout view="skills" confirmDialog={<div />} />);
|
|
60
|
+
const skillsCanvas = screen.getByText("Marketplace").parentElement;
|
|
61
|
+
|
|
62
|
+
expect(skillsCanvas?.className).toContain("max-w-[min(1180px,100%)]");
|
|
63
|
+
});
|
|
64
|
+
|
|
42
65
|
it("uses the dedicated mobile chat shell instead of the desktop split layout", () => {
|
|
43
66
|
useViewportLayoutMock.mockReturnValue({
|
|
44
67
|
mode: "mobile",
|
|
@@ -37,11 +37,17 @@ describe("ChatSidebarToolbar", () => {
|
|
|
37
37
|
render(<ChatSidebarDesktopToolbar {...toolbarProps} />);
|
|
38
38
|
|
|
39
39
|
expect(searchIconClassName()).toContain("pointer-events-none");
|
|
40
|
+
expect(
|
|
41
|
+
screen.getByPlaceholderText("Search conversations...").className,
|
|
42
|
+
).toContain("border-0");
|
|
40
43
|
});
|
|
41
44
|
|
|
42
45
|
it("keeps mobile search icon transparent to pointer input", () => {
|
|
43
46
|
render(<ChatSidebarMobileToolbar {...toolbarProps} />);
|
|
44
47
|
|
|
45
48
|
expect(searchIconClassName()).toContain("pointer-events-none");
|
|
49
|
+
expect(
|
|
50
|
+
screen.getByPlaceholderText("Search conversations...").className,
|
|
51
|
+
).toContain("border-0");
|
|
46
52
|
});
|
|
47
53
|
});
|
|
@@ -11,6 +11,7 @@ export type MainPanelView = "chat" | "cron" | "skills" | "agents" | "inbox";
|
|
|
11
11
|
export type ChatPageProps = {
|
|
12
12
|
view: MainPanelView;
|
|
13
13
|
};
|
|
14
|
+
const MANAGEMENT_PAGE_CANVAS_WIDTH_CLASS = "max-w-[min(1180px,100%)]";
|
|
14
15
|
type UseChatSessionSyncParams = {
|
|
15
16
|
routeSessionKey: string | null;
|
|
16
17
|
syncRouteSessionSelection: (routeSessionKey: string | null) => void;
|
|
@@ -44,24 +45,24 @@ export function ChatPageLayout({ view, confirmDialog }: ChatPageLayoutProps) {
|
|
|
44
45
|
) : (
|
|
45
46
|
<section className="flex-1 min-h-0 overflow-hidden bg-background">
|
|
46
47
|
{view === "inbox" ? (
|
|
47
|
-
<div className=
|
|
48
|
+
<div className={`mx-auto flex h-full min-h-0 w-full flex-col py-4 sm:px-6 sm:py-5 ${MANAGEMENT_PAGE_CANVAS_WIDTH_CLASS}`}>
|
|
48
49
|
<InboxPage />
|
|
49
50
|
</div>
|
|
50
51
|
) : view === "cron" ? (
|
|
51
52
|
<div className="h-full overflow-auto custom-scrollbar">
|
|
52
|
-
<div className=
|
|
53
|
+
<div className={`mx-auto w-full px-4 py-4 sm:px-6 sm:py-5 ${MANAGEMENT_PAGE_CANVAS_WIDTH_CLASS}`}>
|
|
53
54
|
<CronConfig />
|
|
54
55
|
</div>
|
|
55
56
|
</div>
|
|
56
57
|
) : view === "agents" ? (
|
|
57
58
|
<div className="h-full overflow-auto custom-scrollbar">
|
|
58
|
-
<div className=
|
|
59
|
+
<div className={`mx-auto w-full px-4 py-4 sm:px-6 sm:py-5 ${MANAGEMENT_PAGE_CANVAS_WIDTH_CLASS}`}>
|
|
59
60
|
<AgentsPage />
|
|
60
61
|
</div>
|
|
61
62
|
</div>
|
|
62
63
|
) : (
|
|
63
64
|
<div className="h-full overflow-hidden">
|
|
64
|
-
<div className=
|
|
65
|
+
<div className={`mx-auto flex h-full min-h-0 w-full flex-col px-4 py-4 sm:px-6 sm:py-5 ${MANAGEMENT_PAGE_CANVAS_WIDTH_CLASS}`}>
|
|
65
66
|
<MarketplacePage forcedType="skills" />
|
|
66
67
|
</div>
|
|
67
68
|
</div>
|
|
@@ -197,7 +197,7 @@ export function ChatSidebarDesktopToolbar(props: ChatSidebarToolbarProps) {
|
|
|
197
197
|
value={query}
|
|
198
198
|
onChange={(event) => onQueryChange(event.target.value)}
|
|
199
199
|
placeholder={t("chatSidebarSearchPlaceholder")}
|
|
200
|
-
className="h-8 rounded-lg border-
|
|
200
|
+
className="h-8 rounded-lg border-0 bg-background/55 pl-8 text-xs shadow-none hover:bg-background/75"
|
|
201
201
|
/>
|
|
202
202
|
</div>
|
|
203
203
|
</div>
|
|
@@ -226,7 +226,7 @@ export function ChatSidebarMobileToolbar(props: ChatSidebarToolbarProps) {
|
|
|
226
226
|
value={query}
|
|
227
227
|
onChange={(event) => onQueryChange(event.target.value)}
|
|
228
228
|
placeholder={t("chatSidebarSearchPlaceholder")}
|
|
229
|
-
className="h-9 rounded-full border-
|
|
229
|
+
className="h-9 rounded-full border-0 bg-muted pl-9 pr-3 text-[13px] shadow-none"
|
|
230
230
|
/>
|
|
231
231
|
</div>
|
|
232
232
|
|
|
@@ -240,7 +240,7 @@ export function ChatSidebarMobileToolbar(props: ChatSidebarToolbarProps) {
|
|
|
240
240
|
icon={<Plus className="h-4 w-4" />}
|
|
241
241
|
label={t("chatSidebarNewTask")}
|
|
242
242
|
tooltip={false}
|
|
243
|
-
className="h-9 w-9 shrink-0 rounded-full bg-muted text-foreground shadow-none hover:bg-
|
|
243
|
+
className="h-9 w-9 shrink-0 rounded-full bg-muted text-foreground shadow-none hover:bg-[var(--interaction-hover)] hover:text-accent-foreground"
|
|
244
244
|
/>
|
|
245
245
|
</PopoverTrigger>
|
|
246
246
|
<ChatPopoverContent
|
|
@@ -263,7 +263,7 @@ export function ChatSidebarMobileToolbar(props: ChatSidebarToolbarProps) {
|
|
|
263
263
|
<IconActionButton
|
|
264
264
|
icon={<Plus className="h-4 w-4" />}
|
|
265
265
|
label={t("chatSidebarNewTask")}
|
|
266
|
-
className="h-9 w-9 shrink-0 rounded-full bg-muted text-foreground shadow-none hover:bg-
|
|
266
|
+
className="h-9 w-9 shrink-0 rounded-full bg-muted text-foreground shadow-none hover:bg-[var(--interaction-hover)] hover:text-accent-foreground"
|
|
267
267
|
onClick={() => onCreateSession(defaultSessionType)}
|
|
268
268
|
/>
|
|
269
269
|
)}
|
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
import type { ChatUiManager } from '@/features/chat/managers/chat-ui.manager';
|
|
6
6
|
import type { ChatQueryManager } from '@/features/chat/managers/chat-query.manager';
|
|
7
7
|
import type { ChatThreadManager } from '@/features/chat/managers/chat-thread.manager';
|
|
8
|
+
import type { ChatComposerIntentManager } from '@/features/chat/managers/chat-composer-intent.manager';
|
|
8
9
|
|
|
9
10
|
type PublicManager<T extends object> = Pick<T, keyof T>;
|
|
10
11
|
|
|
@@ -15,6 +16,7 @@ export type ChatPresenterLike = {
|
|
|
15
16
|
chatQueryManager: ChatQueryManager;
|
|
16
17
|
chatSessionListManager: ChatSessionListManager;
|
|
17
18
|
chatThreadManager: ChatThreadManagerLike;
|
|
19
|
+
chatComposerIntentManager: ChatComposerIntentManager;
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
const ChatPresenterContext = createContext<ChatPresenterLike | null>(null);
|
|
@@ -39,7 +39,7 @@ const mocks = vi.hoisted(() => {
|
|
|
39
39
|
selectedSessionType: "default",
|
|
40
40
|
pendingProjectRoot: null,
|
|
41
41
|
composerFocusRequestId: 0,
|
|
42
|
-
sendError: null,
|
|
42
|
+
sendError: null as string | null,
|
|
43
43
|
};
|
|
44
44
|
const inputQuery = {
|
|
45
45
|
defaultModel: undefined as string | undefined,
|
|
@@ -52,6 +52,7 @@ const mocks = vi.hoisted(() => {
|
|
|
52
52
|
selectedSession: null as null | {
|
|
53
53
|
activityPreview?: {
|
|
54
54
|
state: "running" | "completed" | "failed" | "cancelled" | "idle";
|
|
55
|
+
statusKind?: "run-failed" | "run-interrupted";
|
|
55
56
|
statusText?: string;
|
|
56
57
|
replyText?: string;
|
|
57
58
|
};
|
|
@@ -86,11 +87,11 @@ const mocks = vi.hoisted(() => {
|
|
|
86
87
|
isHydrating: false,
|
|
87
88
|
isRunning: true,
|
|
88
89
|
isSending: true,
|
|
89
|
-
hydrateError: null,
|
|
90
|
+
hydrateError: null as Error | null,
|
|
90
91
|
snapshot: {
|
|
91
92
|
activeRun: null,
|
|
92
93
|
contextWindow: null,
|
|
93
|
-
error: null,
|
|
94
|
+
error: null as { code?: string; message: string } | null,
|
|
94
95
|
},
|
|
95
96
|
send: vi.fn(),
|
|
96
97
|
abort: vi.fn(),
|
|
@@ -206,8 +207,11 @@ vi.mock(
|
|
|
206
207
|
vi.mock(
|
|
207
208
|
"@/features/chat/features/conversation/hooks/use-session-conversation-input-state",
|
|
208
209
|
() => ({
|
|
209
|
-
useSessionConversationInputState: (
|
|
210
|
-
|
|
210
|
+
useSessionConversationInputState: (
|
|
211
|
+
initialPrompt?: string | null,
|
|
212
|
+
sessionKey?: string | null,
|
|
213
|
+
) => {
|
|
214
|
+
mocks.initialPromptSpy(initialPrompt, sessionKey);
|
|
211
215
|
return {
|
|
212
216
|
inputActions: mocks.inputActions,
|
|
213
217
|
inputSnapshot: mocks.inputSnapshot,
|
|
@@ -265,7 +269,11 @@ describe("SessionConversationArea input boundary", () => {
|
|
|
265
269
|
mocks.agent.isHydrating = false;
|
|
266
270
|
mocks.agent.isRunning = true;
|
|
267
271
|
mocks.agent.isSending = true;
|
|
272
|
+
mocks.agent.hydrateError = null;
|
|
268
273
|
mocks.agent.snapshot.contextWindow = null;
|
|
274
|
+
mocks.agent.snapshot.error = null;
|
|
275
|
+
mocks.controller.isSending = true;
|
|
276
|
+
mocks.inputSnapshot.sendError = null;
|
|
269
277
|
mocks.inputQuery.defaultModel = undefined;
|
|
270
278
|
mocks.inputQuery.fallbackPreferredModel = undefined;
|
|
271
279
|
mocks.inputQuery.selectedSession = null;
|
|
@@ -319,13 +327,27 @@ describe("SessionConversationArea input boundary", () => {
|
|
|
319
327
|
.toBe("false");
|
|
320
328
|
});
|
|
321
329
|
|
|
322
|
-
it("
|
|
323
|
-
|
|
330
|
+
it("leaves the welcome surface on the first local sending render", () => {
|
|
331
|
+
mocks.agent.isRunning = false;
|
|
332
|
+
mocks.agent.isSending = false;
|
|
333
|
+
mocks.controller.isSending = false;
|
|
334
|
+
const rendered = renderArea(null);
|
|
324
335
|
|
|
325
336
|
expect(screen.getByTestId("conversation-content").dataset.showWelcome).toBe(
|
|
326
337
|
"true",
|
|
327
338
|
);
|
|
328
|
-
|
|
339
|
+
|
|
340
|
+
mocks.controller.isSending = true;
|
|
341
|
+
rendered.rerender(
|
|
342
|
+
<MemoryRouter>
|
|
343
|
+
<SessionConversationArea sessionKey={null} />
|
|
344
|
+
</MemoryRouter>,
|
|
345
|
+
);
|
|
346
|
+
|
|
347
|
+
expect(screen.getByTestId("conversation-content").dataset.showWelcome).toBe(
|
|
348
|
+
"false",
|
|
349
|
+
);
|
|
350
|
+
expect(screen.queryByTestId("welcome")).toBeNull();
|
|
329
351
|
expect(screen.getByTestId("conversation-input")).toBeTruthy();
|
|
330
352
|
});
|
|
331
353
|
|
|
@@ -349,7 +371,13 @@ describe("SessionConversationArea input boundary", () => {
|
|
|
349
371
|
</MemoryRouter>,
|
|
350
372
|
);
|
|
351
373
|
|
|
352
|
-
expect(mocks.initialPromptSpy).toHaveBeenCalledWith(
|
|
374
|
+
expect(mocks.initialPromptSpy).toHaveBeenCalledWith(
|
|
375
|
+
"每天整理项目风险",
|
|
376
|
+
null,
|
|
377
|
+
);
|
|
378
|
+
expect(mocks.inputActions.applyPromptSuggestion).toHaveBeenCalledWith(
|
|
379
|
+
"每天整理项目风险",
|
|
380
|
+
);
|
|
353
381
|
});
|
|
354
382
|
|
|
355
383
|
it("syncs draft preferences with the selected runtime context", () => {
|
|
@@ -380,7 +408,7 @@ describe("SessionConversationArea input boundary", () => {
|
|
|
380
408
|
mocks.inputQuery.selectedSession = {
|
|
381
409
|
activityPreview: {
|
|
382
410
|
state: "failed",
|
|
383
|
-
statusText: "
|
|
411
|
+
statusText: "Invalid API Key",
|
|
384
412
|
},
|
|
385
413
|
status: "idle",
|
|
386
414
|
};
|
|
@@ -388,8 +416,31 @@ describe("SessionConversationArea input boundary", () => {
|
|
|
388
416
|
renderArea("session-1");
|
|
389
417
|
|
|
390
418
|
expect(screen.getByTestId("conversation-bottom-slot")).toBeTruthy();
|
|
391
|
-
expect(screen.getByText(
|
|
392
|
-
|
|
419
|
+
expect(screen.getByText("Invalid API Key")).toBeTruthy();
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
it("renders overlapping runtime failures once with a subdued diagnostic surface", () => {
|
|
423
|
+
const providerError = `Chat Completions API failed (402): {\n "error": "${"x".repeat(240)} END_OF_PROVIDER_ERROR"\n}`;
|
|
424
|
+
mocks.inputSnapshot.sendError = providerError;
|
|
425
|
+
mocks.agent.snapshot.error = { message: providerError };
|
|
426
|
+
mocks.inputQuery.selectedSession = {
|
|
427
|
+
activityPreview: {
|
|
428
|
+
state: "failed",
|
|
429
|
+
statusText: providerError,
|
|
430
|
+
},
|
|
431
|
+
status: "idle",
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
renderArea("session-1");
|
|
435
|
+
|
|
436
|
+
expect(screen.getAllByRole("status")).toHaveLength(1);
|
|
437
|
+
const failureStatus = screen.getByRole("status");
|
|
438
|
+
expect(failureStatus.className).toContain("bg-muted/45");
|
|
439
|
+
expect(failureStatus.className).not.toContain("bg-red");
|
|
440
|
+
const errorDetail = failureStatus.querySelector("pre");
|
|
441
|
+
expect(errorDetail?.className).toContain("max-h-32");
|
|
442
|
+
expect(errorDetail?.className).toContain("overflow-auto");
|
|
443
|
+
expect(errorDetail?.textContent).toBe(providerError);
|
|
393
444
|
});
|
|
394
445
|
|
|
395
446
|
it("does not surface user-cancelled previews as conversation errors", () => {
|
|
@@ -406,4 +457,25 @@ describe("SessionConversationArea input boundary", () => {
|
|
|
406
457
|
expect(screen.queryByTestId("conversation-bottom-slot")).toBeNull();
|
|
407
458
|
expect(screen.queryByText(/出错了|Something went wrong/)).toBeNull();
|
|
408
459
|
});
|
|
460
|
+
|
|
461
|
+
it("does not expose recovered runtime interruption diagnostics as task errors", () => {
|
|
462
|
+
const recoveryDetail = "Run interrupted: internal recovery detail.";
|
|
463
|
+
mocks.agent.snapshot.error = {
|
|
464
|
+
code: "run-interrupted",
|
|
465
|
+
message: recoveryDetail,
|
|
466
|
+
};
|
|
467
|
+
mocks.inputQuery.selectedSession = {
|
|
468
|
+
activityPreview: {
|
|
469
|
+
state: "failed",
|
|
470
|
+
statusKind: "run-interrupted",
|
|
471
|
+
statusText: recoveryDetail,
|
|
472
|
+
},
|
|
473
|
+
status: "idle",
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
renderArea("session-1");
|
|
477
|
+
|
|
478
|
+
expect(screen.queryByTestId("conversation-bottom-slot")).toBeNull();
|
|
479
|
+
expect(screen.queryByText(recoveryDetail)).toBeNull();
|
|
480
|
+
});
|
|
409
481
|
});
|