@nextclaw/ui 0.15.21 → 0.15.23
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 +69 -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-Glw2OGXK.js +13 -0
- package/dist/assets/appearance-settings-page-Bl_W_9m7.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-C7E4Sxwd.js +8 -0
- package/dist/assets/chat-page-BT6dNI-4.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-D5BgtKrm.js +1 -0
- package/dist/assets/confirm-dialog-Bf907Azu.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-BwuyBPJb.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-CtLyEJeO.js +1 -0
- package/dist/assets/dist-dv_SUR54.js +1 -0
- package/dist/assets/doc-browser-C23NDGh5.js +1 -0
- package/dist/assets/doc-browser-DlOOhBxI.js +1 -0
- package/dist/assets/doc-browser-context-BIBjkwfV.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-DvvxCpL4.js → form-actions-DAzi68Cn.js} +1 -1
- 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-BLNg2yg0.css +1 -0
- package/dist/assets/index-D3EKjEyK.js +107 -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-BSg5u0r4.js +1 -0
- package/dist/assets/{map-BAAdHTqR.js → map-CcZzEoz6.js} +1 -1
- package/dist/assets/mcp-marketplace-page-ByhvQQj5.js +9 -0
- package/dist/assets/mcp-marketplace-page-CytXwnUs.js +1 -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-bgEx3MjQ.js +1 -0
- package/dist/assets/navigation-link-CB0OQbnY.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-CNjWdLhZ.js +1 -0
- package/dist/assets/provider-scoped-model-input-8F6JMd2n.js +1 -0
- package/dist/assets/providers-config-page-CxpTjR81.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-Bk2ydNTe.js +8 -0
- package/dist/assets/{refresh-cw-C2e94pmp.js → refresh-cw-Ba0LZou4.js} +1 -1
- package/dist/assets/remote-Dv38PuMV.js +1 -0
- package/dist/assets/{requirementDiagram-TGXJPOKE-D8YV0-Jz.js → requirementDiagram-TGXJPOKE-CyVUzEX5.js} +1 -1
- package/dist/assets/rotate-cw-IkYVk9JX.js +1 -0
- package/dist/assets/runtime-config-page-C0ByyUVr.js +1 -0
- package/dist/assets/{sankeyDiagram-HTMAVEWB-C2vA4ojE.js → sankeyDiagram-HTMAVEWB-JK6bFmYB.js} +1 -1
- package/dist/assets/{save-CkwDOgvt.js → save-DTOAvqzt.js} +1 -1
- package/dist/assets/{search-CLXM2reO.js → search-D4X5DNMe.js} +1 -1
- package/dist/assets/search-config-page-Cr6254K5.js +1 -0
- package/dist/assets/{secrets-config-page-DQ_Curaj.js → secrets-config-page-W2Hx332d.js} +2 -2
- package/dist/assets/security-config-1E8OF4kR.js +1 -0
- package/dist/assets/select-CDv0g2Pj.js +41 -0
- package/dist/assets/{sequenceDiagram-DBY2YBRQ-B9LBmpUo.js → sequenceDiagram-DBY2YBRQ-BR5IokXV.js} +1 -1
- package/dist/assets/{settings-2-B9IT2HGd.js → settings-2-CoxzNABp.js} +1 -1
- package/dist/assets/{sizeCapture-X5ZJPWSS-9UIfya9-.js → sizeCapture-X5ZJPWSS-SxG_YnMA.js} +1 -1
- package/dist/assets/skeleton-DW018fJv.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-CDkB5smU.js → tag-chip-CjkZEoS2.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-CavtY1vJ.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-PTXYTEwz.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 +8 -8
- package/src/app/components/layout/page-layout.tsx +15 -6
- package/src/app/components/layout/sidebar-rail.styles.ts +0 -2
- package/src/app/components/layout/sidebar.tsx +2 -2
- package/src/app/styles/charcoal-theme.css +85 -0
- package/src/app/styles/design-system.css +23 -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/chat-sidebar-list-mode-switch.tsx +2 -2
- package/src/features/chat/components/conversation/__tests__/chat-conversation-content.test.tsx +46 -4
- package/src/features/chat/components/conversation/__tests__/chat-conversation-header-section.test.tsx +17 -1
- 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 +24 -11
- package/src/features/chat/components/conversation/chat-conversation-header-section.tsx +30 -31
- package/src/features/chat/components/conversation/chat-conversation-header.tsx +1 -1
- 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-read-state.test.tsx +1 -1
- package/src/features/chat/components/layout/__tests__/chat-sidebar-session-area.test.tsx +52 -0
- package/src/features/chat/components/layout/__tests__/chat-sidebar-toolbar.test.tsx +6 -0
- package/src/features/chat/components/layout/__tests__/chat-sidebar.test.tsx +11 -17
- package/src/features/chat/components/layout/chat-page-shell.tsx +7 -15
- package/src/features/chat/components/layout/chat-sidebar-desktop-layout.tsx +32 -42
- package/src/features/chat/components/layout/chat-sidebar-toolbar.tsx +16 -67
- package/src/features/chat/components/layout/chat-sidebar-utility-menu.tsx +1 -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 +258 -9
- package/src/features/chat/features/conversation/components/session-conversation-area.tsx +51 -34
- package/src/features/chat/features/conversation/components/session-conversation-input.tsx +50 -39
- 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 +109 -0
- package/src/features/chat/features/conversation/hooks/use-chat-composer-reference-intent.ts +46 -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-attachments.ts +1 -0
- 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 +84 -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 +18 -0
- 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 -97
- 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 +23 -0
- package/src/features/chat/features/input/utils/__tests__/chat-input-bar.utils.test.ts +105 -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 +5 -0
- package/src/features/chat/features/input/utils/chat-inline-token.utils.ts +97 -32
- package/src/features/chat/features/input/utils/chat-input-bar.utils.ts +1 -1
- package/src/features/chat/features/input/utils/chat-input-toolbar.utils.ts +64 -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 +81 -172
- 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 +203 -0
- 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 +1 -0
- package/src/features/chat/features/message/utils/chat-message-timeline.utils.ts +204 -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/chat-sidebar-session-item.tsx +10 -10
- package/src/features/chat/features/session/components/chat-sidebar-session-list.tsx +2 -2
- 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/components/session-header/chat-session-header-menu-item.tsx +1 -1
- package/src/features/chat/features/session/components/session-header/chat-session-project-badge.tsx +1 -1
- package/src/features/chat/features/session/components/session-header/chat-session-switcher-groups.tsx +1 -1
- package/src/features/chat/features/session/components/session-header/chat-session-title-switcher.tsx +1 -1
- 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__/chat-session-display.utils.test.ts +26 -0
- package/src/features/chat/features/session/utils/__tests__/ncp-session-adapter.utils.test.ts +23 -2
- package/src/features/chat/features/session/utils/chat-context-window-indicator.utils.ts +44 -5
- package/src/features/chat/features/session/utils/chat-session-display.utils.ts +48 -12
- package/src/features/chat/features/session/utils/ncp-session-adapter.utils.ts +23 -4
- package/src/features/chat/features/session/utils/ncp-session-context-metadata.utils.ts +42 -4
- package/src/features/chat/features/welcome/components/__tests__/chat-conversation-welcome.test.tsx +6 -0
- package/src/features/chat/features/welcome/components/__tests__/chat-welcome.test.tsx +27 -9
- package/src/features/chat/features/welcome/components/chat-welcome-agent-picker.tsx +1 -1
- package/src/features/chat/features/welcome/components/chat-welcome-project-picker.tsx +11 -17
- package/src/features/chat/features/welcome/components/chat-welcome-prompt-suggestions.tsx +37 -0
- package/src/features/chat/features/welcome/components/chat-welcome-session-type-picker.tsx +1 -1
- package/src/features/chat/features/welcome/components/chat-welcome.tsx +35 -33
- 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 +73 -3
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel.test.tsx +22 -2
- 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 +102 -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 +223 -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 +106 -0
- package/src/features/chat/managers/__tests__/chat-session-list.manager.test.ts +53 -5
- package/src/features/chat/managers/__tests__/chat-thread-workspace.manager.test.ts +93 -1
- package/src/features/chat/managers/__tests__/chat-thread.manager.test.ts +3 -10
- 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 +145 -0
- package/src/features/chat/managers/chat-session-list.manager.ts +14 -25
- package/src/features/chat/managers/chat-thread.manager.ts +32 -16
- package/src/features/chat/managers/provider-model-catalog-notice.manager.ts +121 -0
- package/src/features/chat/pages/__tests__/ncp-chat-page.test.tsx +3 -9
- package/src/features/chat/pages/ncp-chat-page.tsx +0 -1
- 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 +6 -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/cron/components/cron-task-discovery.tsx +1 -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/marketplace/components/marketplace-page-parts.tsx +1 -1
- package/src/features/notifications/components/__tests__/app-notification-toast.test.tsx +31 -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/components/panel-app-list-item.tsx +1 -1
- package/src/features/panel-apps/components/panel-app-toolbar.tsx +2 -2
- package/src/features/panel-apps/components/panel-apps-list.tsx +4 -4
- 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-auth-section.tsx +90 -59
- package/src/features/settings/components/config/provider-form-detail-pane.tsx +307 -0
- package/src/features/settings/components/config/provider-form.tsx +149 -367
- 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/components/config/provider-status-badge.tsx +4 -2
- 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__/providers-config-page.test.tsx +12 -0
- package/src/features/settings/pages/__tests__/search-config-page.test.tsx +48 -0
- package/src/features/settings/pages/providers-config-page.tsx +2 -1
- 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/index.css +1 -1
- package/src/platforms/desktop/types/desktop-update.types.ts +5 -0
- package/src/platforms/mobile/components/__tests__/mobile-app-shell.test.tsx +13 -7
- package/src/platforms/mobile/components/__tests__/mobile-bottom-nav.test.tsx +18 -20
- 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 +5 -2
- 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/path-picker/server-path-picker-directory-list.tsx +1 -1
- package/src/shared/components/path-picker/server-path-picker-locations.tsx +1 -1
- package/src/shared/components/path-picker/server-path-picker-navigation-bar.tsx +3 -3
- package/src/shared/components/settings/settings-page.tsx +1 -1
- package/src/shared/components/ui/actions/__tests__/icon-action-button.test.tsx +1 -1
- package/src/shared/components/ui/actions/icon-action-button.tsx +1 -1
- package/src/shared/components/ui/button.tsx +4 -4
- 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/dialog.tsx +1 -1
- package/src/shared/components/ui/input.tsx +1 -1
- package/src/shared/components/ui/scroll-area.tsx +2 -0
- package/src/shared/components/ui/select.tsx +1 -1
- package/src/shared/components/ui/switch.tsx +1 -1
- 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/components/ui/tabs.tsx +1 -1
- package/src/shared/components/ui/textarea.tsx +1 -1
- 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 +7 -0
- package/src/shared/lib/api/types.ts +38 -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 +45 -17
- 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 +45 -17
- 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/provider-models/__tests__/anonymous-provider-configuration.test.ts +40 -0
- package/src/shared/lib/provider-models/index.ts +4 -3
- 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-CHo2gekJ.js +0 -13
- package/dist/assets/app-presenter-provider-2_DmWYT9.js +0 -108
- package/dist/assets/app-presenter-provider-D3BuuOyZ.css +0 -1
- package/dist/assets/appearance-settings-page-BEy2UE7R.js +0 -1
- package/dist/assets/architecture-TIHT7OUA-Cii4JyA2.js +0 -1
- package/dist/assets/book-open-BrZL4o9L.js +0 -1
- package/dist/assets/card-B5rRLu_6.js +0 -1
- package/dist/assets/channel-BSKkTPe8.js +0 -1
- package/dist/assets/channels-list-page-C1dnm68I.js +0 -8
- package/dist/assets/chat-page-Dz6tvZ91.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-6y6W6dz4.js +0 -1
- package/dist/assets/confirm-dialog-q1CpEmR8.js +0 -5
- package/dist/assets/cynefin-VYW2F7L2-fSLIS0X3.js +0 -1
- package/dist/assets/desktop-update-config-DrdlwP4j.js +0 -1
- package/dist/assets/dist-C9EX46wM.js +0 -41
- package/dist/assets/doc-browser-BfttDSti.js +0 -1
- package/dist/assets/doc-browser-DH-3hDnI.js +0 -1
- package/dist/assets/doc-browser-context-TU2heon0.js +0 -1
- package/dist/assets/eventmodeling-45OFAUF4-XVcQGgha.js +0 -1
- package/dist/assets/eye-B-3dyZNA.js +0 -1
- package/dist/assets/flowDiagram-23GEKE2U-BiFSctqz.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-CXDPLDFD.css +0 -1
- package/dist/assets/index-k_eWScvN.js +0 -2
- package/dist/assets/info-DKCQHKI2-CQ2qjGhU.js +0 -1
- package/dist/assets/loader-circle-B35NlHTI.js +0 -1
- package/dist/assets/logo-badge-DB51c0cS.js +0 -1
- package/dist/assets/mcp-marketplace-page-CkPtwPBk.js +0 -1
- package/dist/assets/mcp-marketplace-page-DWtsIqml.js +0 -9
- package/dist/assets/model-config-page-D6cGNnMM.js +0 -1
- package/dist/assets/navigation-link-BSJEUiwD.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-BRVe5jSJ.js +0 -1
- package/dist/assets/popover-Bp9IpE_N.js +0 -1
- package/dist/assets/provider-models-CXUgDxGR.js +0 -1
- package/dist/assets/provider-scoped-model-input-dk7fz9NL.js +0 -1
- package/dist/assets/providers-config-page-DTP2YfxA.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-D6ShNq95.js +0 -8
- package/dist/assets/remote-FllhXW3o.js +0 -1
- package/dist/assets/rotate-cw-CTC-Qszi.js +0 -1
- package/dist/assets/runtime-config-page-C57OLdPm.js +0 -1
- package/dist/assets/search-config-page-tnJXaaSr.js +0 -1
- package/dist/assets/security-config-S00DjFfO.js +0 -1
- package/dist/assets/select-CNFBf00l.js +0 -1
- package/dist/assets/skeleton-Dc06gatK.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-BuNr8LSO.js +0 -1
- package/dist/assets/trash-2-GchaJuEM.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-C69rR15i.js +0 -1
- package/dist/assets/use-confirm-dialog-DF_EgPYx.js +0 -1
- package/dist/assets/use-viewport-layout-BACNZyMY.js +0 -1
- package/dist/assets/wardley-OPB4EBWU-LatRT_Lx.js +0 -1
- package/dist/assets/x-BXFquY9e.js +0 -1
- package/src/features/chat/features/welcome/components/chat-welcome-capability-grid.tsx +0 -59
- /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,9 +1,11 @@
|
|
|
1
1
|
import { render, screen, waitFor } from "@testing-library/react";
|
|
2
2
|
import userEvent from "@testing-library/user-event";
|
|
3
|
+
import { MemoryRouter } from "react-router-dom";
|
|
3
4
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
4
5
|
|
|
5
6
|
import type { CronJobView } from "@/shared/lib/api";
|
|
6
7
|
import { setLanguage } from "@/shared/lib/i18n";
|
|
8
|
+
import { buildSessionPath } from "@/features/chat";
|
|
7
9
|
import { CronConfig } from "@/features/cron";
|
|
8
10
|
|
|
9
11
|
const mocks = vi.hoisted(() => ({
|
|
@@ -12,7 +14,6 @@ const mocks = vi.hoisted(() => ({
|
|
|
12
14
|
deleteJob: vi.fn(),
|
|
13
15
|
refetch: vi.fn(),
|
|
14
16
|
runJob: vi.fn(),
|
|
15
|
-
selectSession: vi.fn(),
|
|
16
17
|
toggleJob: vi.fn(),
|
|
17
18
|
cronParams: vi.fn(),
|
|
18
19
|
cronQuery: {
|
|
@@ -26,14 +27,20 @@ const mocks = vi.hoisted(() => ({
|
|
|
26
27
|
},
|
|
27
28
|
}));
|
|
28
29
|
|
|
29
|
-
vi.mock("@/features/chat", () =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
vi.mock("@/features/chat", async () => {
|
|
31
|
+
const routeUtils = await vi.importActual<{
|
|
32
|
+
buildSessionPath: typeof buildSessionPath;
|
|
33
|
+
}>("@/features/chat/features/session/utils/chat-session-route.utils");
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
buildSessionPath: routeUtils.buildSessionPath,
|
|
37
|
+
usePresenter: () => ({
|
|
38
|
+
chatSessionListManager: {
|
|
39
|
+
createSession: mocks.createSession,
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
};
|
|
43
|
+
});
|
|
37
44
|
|
|
38
45
|
vi.mock("@/features/cron/hooks/use-cron-jobs", () => ({
|
|
39
46
|
useCronJobs: (params: unknown) => {
|
|
@@ -77,6 +84,14 @@ function createJob(overrides: Partial<CronJobView> = {}): CronJobView {
|
|
|
77
84
|
};
|
|
78
85
|
}
|
|
79
86
|
|
|
87
|
+
function renderCronConfig() {
|
|
88
|
+
return render(
|
|
89
|
+
<MemoryRouter>
|
|
90
|
+
<CronConfig />
|
|
91
|
+
</MemoryRouter>,
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
80
95
|
describe("CronConfig", () => {
|
|
81
96
|
beforeEach(() => {
|
|
82
97
|
setLanguage("zh");
|
|
@@ -110,8 +125,12 @@ describe("CronConfig", () => {
|
|
|
110
125
|
});
|
|
111
126
|
|
|
112
127
|
it("shows current task metrics and distinguishes bound and dedicated sessions", () => {
|
|
113
|
-
|
|
128
|
+
renderCronConfig();
|
|
114
129
|
|
|
130
|
+
expect(
|
|
131
|
+
screen.getByRole("heading", { level: 1, name: "定时任务" }),
|
|
132
|
+
).toBeTruthy();
|
|
133
|
+
expect(screen.queryByText("自动化工作台")).toBeNull();
|
|
115
134
|
expect(screen.getByText("全部任务")).toBeTruthy();
|
|
116
135
|
expect(screen.getAllByText("运行中").length).toBeGreaterThan(0);
|
|
117
136
|
expect(screen.getAllByText("需要关注").length).toBeGreaterThan(0);
|
|
@@ -123,7 +142,7 @@ describe("CronConfig", () => {
|
|
|
123
142
|
|
|
124
143
|
it("keeps one inline task preview open at a time", async () => {
|
|
125
144
|
const user = userEvent.setup();
|
|
126
|
-
|
|
145
|
+
renderCronConfig();
|
|
127
146
|
|
|
128
147
|
const agentPreview = document.getElementById(
|
|
129
148
|
"cron-job-preview-agent-radar",
|
|
@@ -152,9 +171,70 @@ describe("CronConfig", () => {
|
|
|
152
171
|
).toBe("true");
|
|
153
172
|
});
|
|
154
173
|
|
|
174
|
+
it("links available execution sessions from inline task previews", async () => {
|
|
175
|
+
const user = userEvent.setup();
|
|
176
|
+
renderCronConfig();
|
|
177
|
+
|
|
178
|
+
await user.click(
|
|
179
|
+
screen.getByRole("button", { name: "展开任务 Agent 产品雷达" }),
|
|
180
|
+
);
|
|
181
|
+
const sessionLink = screen.getByRole("link", {
|
|
182
|
+
name: "session:research",
|
|
183
|
+
});
|
|
184
|
+
expect(sessionLink.getAttribute("href")).toBe(
|
|
185
|
+
buildSessionPath("session:research"),
|
|
186
|
+
);
|
|
187
|
+
expect(sessionLink.className).toContain(
|
|
188
|
+
"text-[hsl(var(--link-foreground))]",
|
|
189
|
+
);
|
|
190
|
+
expect(sessionLink.className.split(" ")).toContain("underline");
|
|
191
|
+
expect(sessionLink.querySelector("svg")).toBeNull();
|
|
192
|
+
|
|
193
|
+
await user.click(
|
|
194
|
+
screen.getByRole("button", { name: "展开任务 重要邮件监控" }),
|
|
195
|
+
);
|
|
196
|
+
expect(
|
|
197
|
+
screen.getByRole("link", { name: "cron:mail-watch" }).getAttribute("href"),
|
|
198
|
+
).toBe(buildSessionPath("cron:mail-watch"));
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
it("keeps a dedicated execution session unavailable before its first run", async () => {
|
|
202
|
+
mocks.cronQuery.data = {
|
|
203
|
+
jobs: [
|
|
204
|
+
createJob({
|
|
205
|
+
id: "not-run",
|
|
206
|
+
name: "尚未执行的任务",
|
|
207
|
+
payload: {
|
|
208
|
+
kind: "agent_turn",
|
|
209
|
+
message: "等待第一次执行。",
|
|
210
|
+
agentId: "main",
|
|
211
|
+
sessionId: null,
|
|
212
|
+
},
|
|
213
|
+
state: {
|
|
214
|
+
nextRunAt: "2026-07-21T01:00:00.000Z",
|
|
215
|
+
lastRunAt: null,
|
|
216
|
+
lastStatus: null,
|
|
217
|
+
lastError: null,
|
|
218
|
+
},
|
|
219
|
+
}),
|
|
220
|
+
],
|
|
221
|
+
total: 1,
|
|
222
|
+
summary: { total: 1, enabled: 1, disabled: 0, attention: 0 },
|
|
223
|
+
};
|
|
224
|
+
const user = userEvent.setup();
|
|
225
|
+
renderCronConfig();
|
|
226
|
+
|
|
227
|
+
await user.click(
|
|
228
|
+
screen.getByRole("button", { name: "展开任务 尚未执行的任务" }),
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
expect(screen.getByText("cron:not-run")).toBeTruthy();
|
|
232
|
+
expect(screen.queryByRole("link", { name: "cron:not-run" })).toBeNull();
|
|
233
|
+
});
|
|
234
|
+
|
|
155
235
|
it("hands a typed request to a new AI draft conversation", async () => {
|
|
156
236
|
const user = userEvent.setup();
|
|
157
|
-
|
|
237
|
+
renderCronConfig();
|
|
158
238
|
|
|
159
239
|
const input = screen.getByLabelText("描述你想安排的任务");
|
|
160
240
|
await user.type(input, "每天早上整理项目风险{Enter}");
|
|
@@ -171,7 +251,7 @@ describe("CronConfig", () => {
|
|
|
171
251
|
summary: { total: 0, enabled: 0, disabled: 0, attention: 0 },
|
|
172
252
|
};
|
|
173
253
|
const user = userEvent.setup();
|
|
174
|
-
|
|
254
|
+
renderCronConfig();
|
|
175
255
|
|
|
176
256
|
await user.click(screen.getByRole("button", { name: /每日 AI 新闻简报/ }));
|
|
177
257
|
|
|
@@ -183,9 +263,9 @@ describe("CronConfig", () => {
|
|
|
183
263
|
expect(mocks.createSession).not.toHaveBeenCalled();
|
|
184
264
|
});
|
|
185
265
|
|
|
186
|
-
it("
|
|
266
|
+
it("exposes the bound session destination from task details", async () => {
|
|
187
267
|
const user = userEvent.setup();
|
|
188
|
-
|
|
268
|
+
renderCronConfig();
|
|
189
269
|
|
|
190
270
|
await user.click(
|
|
191
271
|
screen.getByRole("button", { name: "编辑 Agent 产品雷达" }),
|
|
@@ -193,13 +273,14 @@ describe("CronConfig", () => {
|
|
|
193
273
|
expect(screen.getByRole("dialog")).toBeTruthy();
|
|
194
274
|
expect(screen.getByText("当前系统只保存最近一次执行快照。")).toBeTruthy();
|
|
195
275
|
|
|
196
|
-
|
|
197
|
-
|
|
276
|
+
expect(
|
|
277
|
+
screen.getByRole("link", { name: "打开会话" }).getAttribute("href"),
|
|
278
|
+
).toBe(buildSessionPath("session:research"));
|
|
198
279
|
});
|
|
199
280
|
|
|
200
281
|
it("keeps enablement as an independent row action", async () => {
|
|
201
282
|
const user = userEvent.setup();
|
|
202
|
-
|
|
283
|
+
renderCronConfig();
|
|
203
284
|
|
|
204
285
|
await user.click(screen.getAllByRole("switch")[0]);
|
|
205
286
|
expect(mocks.toggleJob).toHaveBeenCalledWith({
|
|
@@ -226,7 +307,7 @@ describe("CronConfig", () => {
|
|
|
226
307
|
summary: { total: 12, enabled: 10, disabled: 2, attention: 1 },
|
|
227
308
|
};
|
|
228
309
|
const user = userEvent.setup();
|
|
229
|
-
|
|
310
|
+
renderCronConfig();
|
|
230
311
|
|
|
231
312
|
expect(screen.getByText("1–10 / 12")).toBeTruthy();
|
|
232
313
|
await user.click(screen.getByRole("button", { name: "展开任务 任务 1" }));
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
Search,
|
|
10
10
|
} from "lucide-react";
|
|
11
11
|
|
|
12
|
-
import { PageLayout } from "@/app/components/layout/page-layout";
|
|
12
|
+
import { PageHeader, PageLayout } from "@/app/components/layout/page-layout";
|
|
13
13
|
import { usePresenter } from "@/features/chat";
|
|
14
14
|
import { CronJobDetailDialog } from "@/features/cron/components/cron-job-detail-dialog";
|
|
15
15
|
import { CronJobRow } from "@/features/cron/components/cron-job-row";
|
|
@@ -24,13 +24,13 @@ import {
|
|
|
24
24
|
useToggleCronJob,
|
|
25
25
|
} from "@/features/cron/hooks/use-cron-jobs";
|
|
26
26
|
import { Button } from "@/shared/components/ui/button";
|
|
27
|
+
import { IconActionButton } from "@/shared/components/ui/actions/icon-action-button";
|
|
27
28
|
import { Input } from "@/shared/components/ui/input";
|
|
28
29
|
import type {
|
|
29
30
|
CronJobView,
|
|
30
31
|
CronListStatus,
|
|
31
32
|
CronListSummaryView,
|
|
32
33
|
} from "@/shared/lib/api";
|
|
33
|
-
import { describeCronSession } from "@/shared/lib/cron";
|
|
34
34
|
import { useConfirmDialog } from "@/shared/hooks/use-confirm-dialog";
|
|
35
35
|
import { t } from "@/shared/lib/i18n";
|
|
36
36
|
import { cn } from "@/shared/lib/utils";
|
|
@@ -232,10 +232,6 @@ export function CronConfig() {
|
|
|
232
232
|
runCronJob.mutate({ id: job.id, force });
|
|
233
233
|
};
|
|
234
234
|
|
|
235
|
-
const handleOpenSession = (job: CronJobView) => {
|
|
236
|
-
presenter.chatSessionListManager.selectSession(describeCronSession(job));
|
|
237
|
-
};
|
|
238
|
-
|
|
239
235
|
const handlePageChange = (nextPage: number) => {
|
|
240
236
|
setExpandedJobId(null);
|
|
241
237
|
setPage(nextPage);
|
|
@@ -248,24 +244,20 @@ export function CronConfig() {
|
|
|
248
244
|
const hasTasks = (summary?.total ?? 0) > 0;
|
|
249
245
|
|
|
250
246
|
return (
|
|
251
|
-
<PageLayout className="space-y-
|
|
252
|
-
<
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
<
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
<Button
|
|
266
|
-
variant="ghost"
|
|
267
|
-
size="icon"
|
|
268
|
-
className="h-8 w-8"
|
|
247
|
+
<PageLayout className="space-y-6">
|
|
248
|
+
<PageHeader
|
|
249
|
+
headingLevel={1}
|
|
250
|
+
title={t("cronPageTitle")}
|
|
251
|
+
description={t("cronPageDescription")}
|
|
252
|
+
actions={(
|
|
253
|
+
<IconActionButton
|
|
254
|
+
size="lg"
|
|
255
|
+
label={t("refresh")}
|
|
256
|
+
icon={(
|
|
257
|
+
<RefreshCw
|
|
258
|
+
className={cn("h-4 w-4", cronQuery.isFetching && "animate-spin")}
|
|
259
|
+
/>
|
|
260
|
+
)}
|
|
269
261
|
onClick={() => {
|
|
270
262
|
if (page === 0) {
|
|
271
263
|
setExpandedJobId(null);
|
|
@@ -274,14 +266,9 @@ export function CronConfig() {
|
|
|
274
266
|
handlePageChange(0);
|
|
275
267
|
}
|
|
276
268
|
}}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
className={cn("h-4 w-4", cronQuery.isFetching && "animate-spin")}
|
|
281
|
-
/>
|
|
282
|
-
</Button>
|
|
283
|
-
</div>
|
|
284
|
-
</header>
|
|
269
|
+
/>
|
|
270
|
+
)}
|
|
271
|
+
/>
|
|
285
272
|
|
|
286
273
|
{hasTasks ? (
|
|
287
274
|
<CronTaskComposer
|
|
@@ -456,7 +443,6 @@ export function CronConfig() {
|
|
|
456
443
|
}
|
|
457
444
|
}}
|
|
458
445
|
onDelete={handleDelete}
|
|
459
|
-
onOpenSession={handleOpenSession}
|
|
460
446
|
onRun={handleRun}
|
|
461
447
|
onToggle={handleToggle}
|
|
462
448
|
/>
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { Play, Trash2 } from "lucide-react";
|
|
2
3
|
|
|
4
|
+
import { buildSessionPath } from "@/features/chat";
|
|
3
5
|
import type { CronJobView } from "@/shared/lib/api";
|
|
4
|
-
import {
|
|
6
|
+
import { NavigationLink } from "@/shared/components/actions/navigation-link";
|
|
7
|
+
import { Button, buttonVariants } from "@/shared/components/ui/button";
|
|
5
8
|
import {
|
|
6
9
|
Sheet,
|
|
7
10
|
SheetContent,
|
|
@@ -12,6 +15,7 @@ import {
|
|
|
12
15
|
} from "@/shared/components/ui/overlays/sheet";
|
|
13
16
|
import { Switch } from "@/shared/components/ui/switch";
|
|
14
17
|
import {
|
|
18
|
+
canOpenCronSession,
|
|
15
19
|
describeCronSchedule,
|
|
16
20
|
describeCronSession,
|
|
17
21
|
formatCronDate,
|
|
@@ -24,7 +28,7 @@ function DetailRow({
|
|
|
24
28
|
value,
|
|
25
29
|
}: {
|
|
26
30
|
readonly label: string;
|
|
27
|
-
readonly value:
|
|
31
|
+
readonly value: ReactNode;
|
|
28
32
|
}) {
|
|
29
33
|
return (
|
|
30
34
|
<div className="flex items-start justify-between gap-4 border-b border-border/50 py-3 last:border-b-0">
|
|
@@ -41,7 +45,6 @@ type CronJobDetailDialogProps = {
|
|
|
41
45
|
readonly open: boolean;
|
|
42
46
|
readonly onDelete: (job: CronJobView) => void;
|
|
43
47
|
readonly onOpenChange: (open: boolean) => void;
|
|
44
|
-
readonly onOpenSession: (job: CronJobView) => void;
|
|
45
48
|
readonly onRun: (job: CronJobView) => void;
|
|
46
49
|
readonly onToggle: (job: CronJobView, enabled: boolean) => void;
|
|
47
50
|
};
|
|
@@ -51,7 +54,6 @@ export function CronJobDetailDialog({
|
|
|
51
54
|
open,
|
|
52
55
|
onDelete,
|
|
53
56
|
onOpenChange,
|
|
54
|
-
onOpenSession,
|
|
55
57
|
onRun,
|
|
56
58
|
onToggle,
|
|
57
59
|
}: CronJobDetailDialogProps) {
|
|
@@ -61,7 +63,9 @@ export function CronJobDetailDialog({
|
|
|
61
63
|
|
|
62
64
|
const sessionKey = describeCronSession(job);
|
|
63
65
|
const isBound = Boolean(job.payload.sessionId?.trim());
|
|
64
|
-
const
|
|
66
|
+
const sessionHref = canOpenCronSession(job)
|
|
67
|
+
? buildSessionPath(sessionKey)
|
|
68
|
+
: null;
|
|
65
69
|
const status = job.state.lastStatus
|
|
66
70
|
? t(
|
|
67
71
|
`cronLastStatus${job.state.lastStatus[0].toUpperCase()}${job.state.lastStatus.slice(1)}`,
|
|
@@ -114,7 +118,22 @@ export function CronJobDetailDialog({
|
|
|
114
118
|
label={t("cronAgentLabel")}
|
|
115
119
|
value={job.payload.agentId?.trim() || "main"}
|
|
116
120
|
/>
|
|
117
|
-
<DetailRow
|
|
121
|
+
<DetailRow
|
|
122
|
+
label={t("cronSessionLabel")}
|
|
123
|
+
value={
|
|
124
|
+
sessionHref ? (
|
|
125
|
+
<NavigationLink
|
|
126
|
+
href={sessionHref}
|
|
127
|
+
size="xs"
|
|
128
|
+
className="text-[hsl(var(--link-foreground))] underline decoration-[1.2px] underline-offset-2 hover:text-[hsl(var(--link-foreground-hover))]"
|
|
129
|
+
>
|
|
130
|
+
{sessionKey}
|
|
131
|
+
</NavigationLink>
|
|
132
|
+
) : (
|
|
133
|
+
sessionKey
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
/>
|
|
118
137
|
<DetailRow
|
|
119
138
|
label={t("cronCreatedAt")}
|
|
120
139
|
value={formatCronDate(job.createdAt)}
|
|
@@ -175,7 +194,7 @@ export function CronJobDetailDialog({
|
|
|
175
194
|
/>
|
|
176
195
|
</section>
|
|
177
196
|
|
|
178
|
-
{!
|
|
197
|
+
{!sessionHref ? (
|
|
179
198
|
<p className="text-xs text-muted-foreground">
|
|
180
199
|
{t("cronSessionAvailableAfterRun")}
|
|
181
200
|
</p>
|
|
@@ -191,14 +210,21 @@ export function CronJobDetailDialog({
|
|
|
191
210
|
<Trash2 className="mr-2 h-4 w-4" />
|
|
192
211
|
{t("delete")}
|
|
193
212
|
</Button>
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
213
|
+
{sessionHref ? (
|
|
214
|
+
<NavigationLink
|
|
215
|
+
href={sessionHref}
|
|
216
|
+
className={cn(
|
|
217
|
+
buttonVariants({ variant: "outline" }),
|
|
218
|
+
"hover:no-underline",
|
|
219
|
+
)}
|
|
220
|
+
>
|
|
221
|
+
{t("cronOpenSession")}
|
|
222
|
+
</NavigationLink>
|
|
223
|
+
) : (
|
|
224
|
+
<Button variant="outline" disabled>
|
|
225
|
+
{t("cronOpenSession")}
|
|
226
|
+
</Button>
|
|
227
|
+
)}
|
|
202
228
|
<Button onClick={() => onRun(job)}>
|
|
203
229
|
<Play className="mr-2 h-4 w-4" />
|
|
204
230
|
{t("cronRunNow")}
|
|
@@ -10,7 +10,9 @@ import {
|
|
|
10
10
|
TriangleAlert,
|
|
11
11
|
} from "lucide-react";
|
|
12
12
|
|
|
13
|
+
import { buildSessionPath } from "@/features/chat";
|
|
13
14
|
import type { CronJobView } from "@/shared/lib/api";
|
|
15
|
+
import { NavigationLink } from "@/shared/components/actions/navigation-link";
|
|
14
16
|
import { Button } from "@/shared/components/ui/button";
|
|
15
17
|
import {
|
|
16
18
|
Popover,
|
|
@@ -25,6 +27,7 @@ import {
|
|
|
25
27
|
TooltipTrigger,
|
|
26
28
|
} from "@/shared/components/ui/tooltip";
|
|
27
29
|
import {
|
|
30
|
+
canOpenCronSession,
|
|
28
31
|
describeCronSchedule,
|
|
29
32
|
describeCronSession,
|
|
30
33
|
formatCronDate,
|
|
@@ -92,6 +95,10 @@ export function CronJobRow({
|
|
|
92
95
|
const StatusIcon = needsAttention ? TriangleAlert : Check;
|
|
93
96
|
const jobLabel = job.name || job.id;
|
|
94
97
|
const previewId = `cron-job-preview-${job.id}`;
|
|
98
|
+
const sessionKey = describeCronSession(job);
|
|
99
|
+
const sessionHref = canOpenCronSession(job)
|
|
100
|
+
? buildSessionPath(sessionKey)
|
|
101
|
+
: null;
|
|
95
102
|
|
|
96
103
|
return (
|
|
97
104
|
<div
|
|
@@ -248,7 +255,17 @@ export function CronJobRow({
|
|
|
248
255
|
{t("cronSessionLabel")}
|
|
249
256
|
</dt>
|
|
250
257
|
<dd className="mt-0.5 truncate font-medium text-foreground">
|
|
251
|
-
{
|
|
258
|
+
{sessionHref ? (
|
|
259
|
+
<NavigationLink
|
|
260
|
+
href={sessionHref}
|
|
261
|
+
size="xs"
|
|
262
|
+
className="max-w-full truncate text-[11px] text-[hsl(var(--link-foreground))] underline decoration-[1.2px] underline-offset-2 hover:text-[hsl(var(--link-foreground-hover))]"
|
|
263
|
+
>
|
|
264
|
+
{sessionKey}
|
|
265
|
+
</NavigationLink>
|
|
266
|
+
) : (
|
|
267
|
+
sessionKey
|
|
268
|
+
)}
|
|
252
269
|
</dd>
|
|
253
270
|
</div>
|
|
254
271
|
<div className="min-w-0">
|
|
@@ -94,7 +94,7 @@ export const CronTaskComposer = forwardRef<
|
|
|
94
94
|
ref={ref}
|
|
95
95
|
value={value}
|
|
96
96
|
onChange={(event) => onChange(event.target.value)}
|
|
97
|
-
className="pl-9 pr-11
|
|
97
|
+
className="pl-9 pr-11"
|
|
98
98
|
placeholder={t("cronComposerPlaceholder")}
|
|
99
99
|
aria-label={t("cronComposerLabel")}
|
|
100
100
|
/>
|
|
@@ -23,7 +23,7 @@ describe("InboxDeliveryContent", () => {
|
|
|
23
23
|
it("renders static HTML in an isolated document", () => {
|
|
24
24
|
render(
|
|
25
25
|
<InboxDeliveryContent
|
|
26
|
-
content={'<meta http-equiv="refresh" content="0;url=https://example.com"><h1 onclick="alert(1)">Report</h1><script>alert(1)</script>'}
|
|
26
|
+
content={'<meta http-equiv="refresh" content="0;url=https://example.com"><h1 onclick="alert(1)">Report</h1><a href="https://example.com/report">Source</a><a href="javascript:alert(1)">Unsafe</a><script>alert(1)</script>'}
|
|
27
27
|
contentType="html"
|
|
28
28
|
fillHeight
|
|
29
29
|
title="HTML report"
|
|
@@ -31,7 +31,9 @@ describe("InboxDeliveryContent", () => {
|
|
|
31
31
|
);
|
|
32
32
|
|
|
33
33
|
const frame = screen.getByTitle<HTMLIFrameElement>("HTML report");
|
|
34
|
-
expect(frame.getAttribute("sandbox")).toBe(
|
|
34
|
+
expect(frame.getAttribute("sandbox")).toBe(
|
|
35
|
+
"allow-popups allow-popups-to-escape-sandbox",
|
|
36
|
+
);
|
|
35
37
|
expect(frame.className).toContain("h-full");
|
|
36
38
|
expect(frame.className).toContain("border-0");
|
|
37
39
|
expect(frame.srcdoc).toContain("Content-Security-Policy");
|
|
@@ -40,6 +42,10 @@ describe("InboxDeliveryContent", () => {
|
|
|
40
42
|
expect(frame.srcdoc).not.toContain("http-equiv=\"refresh\"");
|
|
41
43
|
expect(frame.srcdoc).not.toContain("onclick");
|
|
42
44
|
expect(frame.srcdoc).not.toContain("<script");
|
|
45
|
+
expect(frame.srcdoc).toContain('href="https://example.com/report"');
|
|
46
|
+
expect(frame.srcdoc).toContain('target="_blank"');
|
|
47
|
+
expect(frame.srcdoc).toContain('rel="noopener noreferrer"');
|
|
48
|
+
expect(frame.srcdoc).not.toContain("javascript:");
|
|
43
49
|
});
|
|
44
50
|
|
|
45
51
|
it("preserves the iframe instance while the surrounding view rerenders", () => {
|
|
@@ -3,6 +3,7 @@ import { MemoryRouter } from "react-router-dom";
|
|
|
3
3
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
4
4
|
import { InboxReaderDialog } from "@/features/inbox/components/inbox-reader-dialog";
|
|
5
5
|
import { useInboxStore } from "@/features/inbox/stores/inbox.store";
|
|
6
|
+
import { t } from "@/shared/lib/i18n";
|
|
6
7
|
|
|
7
8
|
const mocks = vi.hoisted(() => ({
|
|
8
9
|
closeReader: vi.fn(),
|
|
@@ -54,24 +55,29 @@ describe("InboxReaderDialog", () => {
|
|
|
54
55
|
});
|
|
55
56
|
});
|
|
56
57
|
|
|
57
|
-
it("renders one accessible reader with friendly Markdown output", () => {
|
|
58
|
+
it("renders one accessible compact reader with friendly Markdown output", () => {
|
|
58
59
|
render(<MemoryRouter><InboxReaderDialog /></MemoryRouter>);
|
|
59
60
|
|
|
60
61
|
expect(screen.getAllByRole("dialog")).toHaveLength(1);
|
|
61
62
|
const title = screen.getByRole("heading", { name: "A considered report" });
|
|
62
|
-
expect(title).
|
|
63
|
+
expect(title.className).toContain("text-sm");
|
|
63
64
|
expect(document.activeElement).toBe(title);
|
|
65
|
+
expect(screen.getByText("A concise summary").className).toContain("sr-only");
|
|
64
66
|
expect(screen.getByText(/Important result/)).toBeTruthy();
|
|
65
67
|
expect(screen.queryByText("**Important** result")).toBeNull();
|
|
68
|
+
expect(screen.queryByRole("button", { name: t("inboxPrevious") })).toBeNull();
|
|
69
|
+
expect(screen.queryByRole("button", { name: t("inboxNext") })).toBeNull();
|
|
66
70
|
});
|
|
67
71
|
|
|
68
|
-
it("
|
|
72
|
+
it("lets HTML fill the reading area without changing the compact chrome", () => {
|
|
69
73
|
mocks.contentType = "html";
|
|
70
74
|
render(<MemoryRouter><InboxReaderDialog /></MemoryRouter>);
|
|
71
75
|
|
|
72
76
|
const title = screen.getByRole("heading", { name: "A considered report" });
|
|
73
77
|
expect(title.className).toContain("text-sm");
|
|
74
78
|
expect(screen.getByText("A concise summary").className).toContain("sr-only");
|
|
75
|
-
|
|
79
|
+
const htmlPreview = screen.getAllByTitle("A considered report")
|
|
80
|
+
.find((element) => element.tagName === "IFRAME");
|
|
81
|
+
expect(htmlPreview?.className).toContain("h-full");
|
|
76
82
|
});
|
|
77
83
|
});
|