@nextclaw/ui 0.25.4 → 0.26.1
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 +61 -0
- package/dist/.vite/manifest.json +1158 -1392
- package/dist/assets/{abnfDiagram-VRR7QNED-DX_u5BBX.js → abnfDiagram-VRR7QNED-Dcw10Yt1.js} +1 -1
- package/dist/assets/account-panel-ZM2qzKF4.js +1 -0
- package/dist/assets/{aiden0z-pptx-renderer.es-C-E9e5yB.js → aiden0z-pptx-renderer.es--oNqetPA.js} +1 -1
- package/dist/assets/api-Cjq-o1VN.js +20 -0
- package/dist/assets/app-presenter-provider-C02YPoMr.js +124 -0
- package/dist/assets/appearance-settings-page-B4zouKzg.js +1 -0
- package/dist/assets/{arc-Cxwa624o.js → arc-DBRedCax.js} +1 -1
- package/dist/assets/architecture-TIHT7OUA-CvnC-LeA.js +1 -0
- package/dist/assets/{architectureDiagram-ZJ3FMSHR-D8mCj0H1.js → architectureDiagram-ZJ3FMSHR-Dufhtuv-.js} +1 -1
- package/dist/assets/{blockDiagram-677ZJIJ3-CbGC1IHl.js → blockDiagram-677ZJIJ3-BUk0vtJ7.js} +1 -1
- package/dist/assets/{book-open-xqEj1OLE.js → book-open-AteA89HX.js} +1 -1
- package/dist/assets/{c4Diagram-LMCZKHZV-BQhGC1Vc.js → c4Diagram-LMCZKHZV-CxDcVE9p.js} +1 -1
- package/dist/assets/card-BLXvBstA.js +1 -0
- package/dist/assets/channel-CpMstUPF.js +1 -0
- package/dist/assets/channels-list-page-fj8kMo-T.js +8 -0
- package/dist/assets/chunk-2Q5K7J3B-Djp3VF0s.js +1 -0
- package/dist/assets/{chunk-32BRIVSS-B74ZZwYG.js → chunk-32BRIVSS-DSF3KElA.js} +1 -1
- package/dist/assets/{chunk-52WLFC77-BvmxW_f_.js → chunk-52WLFC77-Costxzr3.js} +1 -1
- package/dist/assets/{chunk-5FCAYU7R-DQvBRnwL.js → chunk-5FCAYU7R-rhqzGGZo.js} +1 -1
- package/dist/assets/{chunk-5HE753X5-CDIH0_y3.js → chunk-5HE753X5-BsEsmIao.js} +1 -1
- package/dist/assets/{chunk-5JV3BV7I-CcevlKd-.js → chunk-5JV3BV7I-Dqw_DCoN.js} +1 -1
- package/dist/assets/{chunk-5TONJI2A-_3dxVdnY.js → chunk-5TONJI2A-Cft82fp8.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-pGO5vvo-.js → chunk-5VM5RSS4-DqNHn9Dl.js} +1 -1
- package/dist/assets/{chunk-7BUUIJ7U-DEKF5uAN.js → chunk-7BUUIJ7U-A5SBEMYY.js} +1 -1
- package/dist/assets/{chunk-BIQX33UG-CjBFgq2r.js → chunk-BIQX33UG-1Ng3mTrH.js} +1 -1
- package/dist/assets/{chunk-C7G6YPKG-e_K9OGTz.js → chunk-C7G6YPKG-DRJEy8ZI.js} +1 -1
- package/dist/assets/{chunk-CQNSW5MT-C2IiHyHz.js → chunk-CQNSW5MT-Bydv_J3J.js} +1 -1
- package/dist/assets/{chunk-CYSBUYHQ-DCC6KmGp.js → chunk-CYSBUYHQ-HkMIg12u.js} +1 -1
- package/dist/assets/{chunk-EMLP6XTP-BYGgekQ0.js → chunk-EMLP6XTP-C5ndDvm3.js} +1 -1
- package/dist/assets/{chunk-EX3LRPZG-FGcwuVsA.js → chunk-EX3LRPZG-DzeloZRo.js} +1 -1
- package/dist/assets/{chunk-FWX5IMBZ-CV3Ih_Os.js → chunk-FWX5IMBZ-n_2_CLTQ.js} +2 -2
- package/dist/assets/{chunk-HOUHSVGY-CXpq_hfV.js → chunk-HOUHSVGY-kx_slvu3.js} +1 -1
- package/dist/assets/{chunk-ICXQ74PX-CZIpjupq.js → chunk-ICXQ74PX-sQLMURqL.js} +1 -1
- package/dist/assets/{chunk-JG7HCLWE-CdgwBpW7.js → chunk-JG7HCLWE-CMUn5Elc.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-BPjAZpOQ.js → chunk-JWPE2WC7-Cra3s-Uk.js} +1 -1
- package/dist/assets/{chunk-MOJQB5TN-DbJDm8to.js → chunk-MOJQB5TN-umcrg5Bi.js} +1 -1
- package/dist/assets/{chunk-MOZMSUNE-BUa1fqKn.js → chunk-MOZMSUNE-BnljD1ig.js} +1 -1
- package/dist/assets/{chunk-OGEWGWER-CtnzLgRu.js → chunk-OGEWGWER-BXx5pQjU.js} +1 -1
- package/dist/assets/{chunk-OSBZ3O6U-fUgdpTUM.js → chunk-OSBZ3O6U-D-1qfdWu.js} +1 -1
- package/dist/assets/{chunk-PUDLZKDR-CtDWZT9-.js → chunk-PUDLZKDR-DLzX78LC.js} +1 -1
- package/dist/assets/{chunk-Q4XR5HBZ-BxnK2qxr.js → chunk-Q4XR5HBZ-DTK-rtW6.js} +1 -1
- package/dist/assets/{chunk-QBLGF6JB-CH4UKoCF.js → chunk-QBLGF6JB-CsFeIGfr.js} +1 -1
- package/dist/assets/{chunk-R7FJI6CG-BxwFoF1v.js → chunk-R7FJI6CG-4xNYUeng.js} +1 -1
- package/dist/assets/{chunk-RYQCIY6F-DpHAmq7O.js → chunk-RYQCIY6F-DJiHiTE5.js} +1 -1
- package/dist/assets/{chunk-U6XO7XAA-BjH2VUHU.js → chunk-U6XO7XAA-BVYkauHz.js} +1 -1
- package/dist/assets/{chunk-V7JOEXUC-DKJZ3HGj.js → chunk-V7JOEXUC-BsazE8cS.js} +1 -1
- package/dist/assets/chunk-VAUOI2AC-BrbiIC1Q.js +1 -0
- package/dist/assets/{chunk-VR4S4FIN-Cf-o2GtI.js → chunk-VR4S4FIN-7RoZQffO.js} +1 -1
- package/dist/assets/{chunk-WYO6CB5R-zeNXGm20.js → chunk-WYO6CB5R-DEuS6N1R.js} +3 -3
- package/dist/assets/chunk-XXDRQBXY-Cx9N40wF.js +1 -0
- package/dist/assets/{chunk-YOTPTUD7-Ck87Kqxe.js → chunk-YOTPTUD7-9KBrosZL.js} +1 -1
- package/dist/assets/{chunk-ZGVPDNZ5-BbfK6Bfd.js → chunk-ZGVPDNZ5-IYgN9f5A.js} +1 -1
- package/dist/assets/{chunk-ZIRB5QZD-BDpzh4Yl.js → chunk-ZIRB5QZD-BUo0-zcp.js} +1 -1
- package/dist/assets/{circle-dashed-CU3yApvP.js → circle-dashed-LSYZTzM7.js} +1 -1
- package/dist/assets/classDiagram-OUVF2IWQ-DFN1v3PQ.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-DRvglADa.js +1 -0
- package/dist/assets/client-DudCRJw4.js +1 -0
- package/dist/assets/config-split-page-G7Kt2BnV.js +1 -0
- package/dist/assets/confirm-dialog-DShT64F6.js +1 -0
- package/dist/assets/context-menu-rd7b_kVD.js +1 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-CQfMxKCT.js → cose-bilkent-JH36ORCC-DhqbC1fR.js} +1 -1
- package/dist/assets/createLucideIcon-D7hvIHV-.js +1 -0
- package/dist/assets/cynefin-VYW2F7L2-DXUGnpJH.js +1 -0
- package/dist/assets/{cynefinDiagram-TSTJHNR4-CxFTiC-p.js → cynefinDiagram-TSTJHNR4-C-TBRi5V.js} +1 -1
- package/dist/assets/{dagre-CaBNMcB1.js → dagre-CrgsRasE.js} +1 -1
- package/dist/assets/{dagre-VKFMJZFB-S_7Hc7bI.js → dagre-VKFMJZFB-BmafJymp.js} +1 -1
- package/dist/assets/desktop-capabilities-page-CzqzFZUY.js +1 -0
- package/dist/assets/desktop-update-config-CgeQ0Ffo.js +1 -0
- package/dist/assets/{diagram-FQU43EPY-C7zENvFb.js → diagram-FQU43EPY-BoOMwa6D.js} +1 -1
- package/dist/assets/{diagram-G47NLZAW-DqYTCqZA.js → diagram-G47NLZAW-Le7N6Uym.js} +1 -1
- package/dist/assets/{diagram-NH7WQ7WH-BfSJtXRc.js → diagram-NH7WQ7WH-Fbpj3-MO.js} +1 -1
- package/dist/assets/{diagram-OA4YK3LP-CFO-j67H.js → diagram-OA4YK3LP-D3QuGGuu.js} +1 -1
- package/dist/assets/{diagram-WEI45ONY-DBQDbTaJ.js → diagram-WEI45ONY-Cxu1uiN6.js} +1 -1
- package/dist/assets/dialog-C7glmAQJ.js +5 -0
- package/dist/assets/doc-browser-context-BlhBAOLH.js +1 -0
- package/dist/assets/doc-browser-dBiR9Qi0.js +1 -0
- package/dist/assets/{docx-preview-B4-aDfvO.js → docx-preview-CkU2psnd.js} +1 -1
- package/dist/assets/download-BYgECE0n.js +1 -0
- package/dist/assets/{ebnfDiagram-CCIWWBDH-CfDNIXFN.js → ebnfDiagram-CCIWWBDH-CCAjuQM6.js} +1 -1
- package/dist/assets/{erDiagram-Q63AITRT-D95rFXMM.js → erDiagram-Q63AITRT-BuzUAq-d.js} +1 -1
- package/dist/assets/es2015-CsjAAQ6X.js +41 -0
- package/dist/assets/eventmodeling-45OFAUF4-ZBfVS3ZC.js +1 -0
- package/dist/assets/extensions-qYL-NpL3.js +1 -0
- package/dist/assets/{eye-C84inPcV.js → eye-BBuTzJ53.js} +1 -1
- package/dist/assets/flowDiagram-23GEKE2U-CqdsKk6x.js +1 -0
- package/dist/assets/form-actions-CLGWO52v.js +1 -0
- package/dist/assets/{ganttDiagram-NO4QXBWP-Bawg0P0r.js → ganttDiagram-NO4QXBWP-cJmWVY8F.js} +1 -1
- package/dist/assets/gitGraph-TEB2WS4Q-fHYFd9Es.js +1 -0
- package/dist/assets/{gitGraphDiagram-IHSO6WYX-BbKh9nbL.js → gitGraphDiagram-IHSO6WYX-F58o-vtP.js} +1 -1
- package/dist/assets/{i18n-20rSH40D.js → i18n-qBGEbcW6.js} +2 -2
- package/dist/assets/info-DKCQHKI2-CSaOL_bb.js +1 -0
- package/dist/assets/{infoDiagram-FWYZ7A6U-DPffZXYh.js → infoDiagram-FWYZ7A6U-Gt59b83C.js} +1 -1
- package/dist/assets/{ishikawaDiagram-FXEZZL3T-CBMsLwZ2.js → ishikawaDiagram-FXEZZL3T-1u4IAj1I.js} +1 -1
- package/dist/assets/{journeyDiagram-5HDEW3XC-Mz5U4OzU.js → journeyDiagram-5HDEW3XC-CCQsfV-5.js} +1 -1
- package/dist/assets/{kanban-definition-HUTT4EX6-FXZq2k19.js → kanban-definition-HUTT4EX6-vlB6O_Zn.js} +1 -1
- package/dist/assets/katex-B4FQSo9k.js +1 -0
- package/dist/assets/keyboard-shortcuts-settings-page-B-wK_6zG.js +1 -0
- package/dist/assets/{line-BZwCgT9K.js → line-D_bHubTL.js} +1 -1
- package/dist/assets/{linear-CTe9mKUw.js → linear-ChlwuS5y.js} +1 -1
- package/dist/assets/loader-circle-BA7EMkih.js +1 -0
- package/dist/assets/login-page-Cd84lpVV.js +1 -0
- package/dist/assets/login-page-VdMyNkFf.js +1 -0
- package/dist/assets/main-CR0SrTBf.js +2 -0
- package/dist/assets/main-DXH6EdXI.css +1 -0
- package/dist/assets/main-i18n-catalog.config-Btp_OowF.js +1 -0
- package/dist/assets/{map-Ci48ZwAp.js → map-oGHTsIu8.js} +1 -1
- package/dist/assets/mcp-marketplace-page-jacRwiI-.js +1 -0
- package/dist/assets/{mermaid-parser.core-CzPD3U_z.js → mermaid-parser.core-CuRe1ZG4.js} +2 -2
- package/dist/assets/{mermaid.core-geIMNPbV.js → mermaid.core-u4YCFKRf.js} +3 -3
- package/dist/assets/{mindmap-definition-LN4V7U3C-xqlKxsr_.js → mindmap-definition-LN4V7U3C-DeJAQYTu.js} +1 -1
- package/dist/assets/model-config-page-D0DQlSDa.js +1 -0
- package/dist/assets/navigation-history-CzErJuPG.js +1 -0
- package/dist/assets/navigation-link-32iM1-e6.js +3 -0
- package/dist/assets/{ordinal-MxnX8yhv.js → ordinal-C6JFfkKN.js} +1 -1
- package/dist/assets/packet-7NZHBO7P-D-YFTczs.js +1 -0
- package/dist/assets/panel-app-CC0bVSu4.js +1 -0
- package/dist/assets/panel-app-i18n-catalog.config-LUSBp5Ce.js +1 -0
- package/dist/assets/panelStandalone-C9EKaApN.js +2 -0
- package/dist/assets/{pegDiagram-2B236MQR-D50MFTN1.js → pegDiagram-2B236MQR-nVMkxShH.js} +1 -1
- package/dist/assets/pie-RZYD4A2V-VEnYu9s5.js +1 -0
- package/dist/assets/{pieDiagram-ENE6RG2P-CpA13oiC.js → pieDiagram-ENE6RG2P-8aUH44QZ.js} +1 -1
- package/dist/assets/privacy-settings-page-Bxxx12OO.js +1 -0
- package/dist/assets/projects-D56yAPNT.js +1 -0
- package/dist/assets/provider-models-C3frdXeW.js +1 -0
- package/dist/assets/provider-scoped-model-input-CYetrPYZ.js +1 -0
- package/dist/assets/providers-config-page-DESB1h8g.js +1 -0
- package/dist/assets/{puzzle-D6gulz7u.js → puzzle-CWHfFyYN.js} +1 -1
- package/dist/assets/pwa-CiGUjpcd.js +1 -0
- package/dist/assets/{quadrantDiagram-ABIIQ3AL-CYCgaj4l.js → quadrantDiagram-ABIIQ3AL-EY8hpFv8.js} +1 -1
- package/dist/assets/radar-I7S5WNFK-BFNIekC1.js +1 -0
- package/dist/assets/railroad-3IZDKUUU-lVqJ3Hak.js +1 -0
- package/dist/assets/railroad-abnf-AHOZXSZD-DYaefdFC.js +1 -0
- package/dist/assets/railroad-ebnf-EBAXGLYW-CTAk6lVq.js +1 -0
- package/dist/assets/railroad-peg-LSFZ7HO6-Cob294tg.js +1 -0
- package/dist/assets/{railroadDiagram-RFXS5EU6-4LKDGlXN.js → railroadDiagram-RFXS5EU6-CNhcIeji.js} +1 -1
- package/dist/assets/{refresh-cw-h9Xq3LY3.js → refresh-cw-y3L6PyLt.js} +1 -1
- package/dist/assets/remote-DiGFV8nP.js +1 -0
- package/dist/assets/{requirementDiagram-TGXJPOKE-CxNOU0JH.js → requirementDiagram-TGXJPOKE-D8Dcs-Rt.js} +1 -1
- package/dist/assets/{rotate-cw-B6xm41Wn.js → rotate-cw-CNE9qSHi.js} +1 -1
- package/dist/assets/runtime-config-page-5o98T-TD.js +1 -0
- package/dist/assets/{sankeyDiagram-HTMAVEWB-DbCBDe2S.js → sankeyDiagram-HTMAVEWB-HTrb6aa-.js} +1 -1
- package/dist/assets/{save-fff_WpY2.js → save-B0p5a0ET.js} +1 -1
- package/dist/assets/search-config-page-CpGcnIzi.js +1 -0
- package/dist/assets/secrets-config-page-C4VTiW3r.js +3 -0
- package/dist/assets/security-config-C5-RQVpS.js +1 -0
- package/dist/assets/select-CctTN205.js +1 -0
- package/dist/assets/{sequenceDiagram-DBY2YBRQ-DA6W2BS_.js → sequenceDiagram-DBY2YBRQ-6f_4X16Y.js} +1 -1
- package/dist/assets/service-apps-panel-CKE5HKNY.js +1 -0
- package/dist/assets/{settings-2-CE3ELQyk.js → settings-2-EPflrNk6.js} +1 -1
- package/dist/assets/{sizeCapture-X5ZJPWSS-T_q_d_VW.js → sizeCapture-X5ZJPWSS-Ck9rsuwL.js} +1 -1
- package/dist/assets/{src-CYpUlx-4.js → src-C8AUg09O.js} +1 -1
- package/dist/assets/{stateDiagram-2N3HPSRC-mi8z2G0a.js → stateDiagram-2N3HPSRC-Cm33MLHu.js} +1 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-BrNv-raG.js +1 -0
- package/dist/assets/status-dot-CensgJZC.js +1 -0
- package/dist/assets/{swimlanes-5IMT3BWC-DkBEhWE4.js → swimlanes-5IMT3BWC-B107vmvM.js} +2 -2
- package/dist/assets/swimlanesDiagram-G3AALYLV-ntcxaPXp.js +8 -0
- package/dist/assets/tag-chip-Bjzb4-qW.js +1 -0
- package/dist/assets/theme-provider-hlle7Skk.js +1 -0
- package/dist/assets/{timeline-definition-FHXFAJF6-BoFmqBw1.js → timeline-definition-FHXFAJF6-CJEoAj33.js} +1 -1
- package/dist/assets/trash-2-C5KH5Rw9.js +1 -0
- package/dist/assets/treeView-QDETBFTQ-DbFmr-gw.js +1 -0
- package/dist/assets/treemap-6X3UGDF4-C8aY96pi.js +1 -0
- package/dist/assets/use-config-CPl_F79t.js +1 -0
- package/dist/assets/use-desktop-capabilities-CEg9-DrQ.js +1 -0
- package/dist/assets/use-viewport-layout-CPZUmTPi.js +1 -0
- package/dist/assets/{vennDiagram-L72KCM5P-BlZ3Or5U.js → vennDiagram-L72KCM5P-DzsUHk5I.js} +1 -1
- package/dist/assets/wardley-OPB4EBWU-D8d6DbbJ.js +1 -0
- package/dist/assets/{wardleyDiagram-EHGQE667-yDfr33i3.js → wardleyDiagram-EHGQE667-1NfFs5ua.js} +1 -1
- package/dist/assets/x--xxUvHKW.js +1 -0
- package/dist/assets/{xychartDiagram-FW5EYKEG-mIXwIGAQ.js → xychartDiagram-FW5EYKEG-Ci8AI3Qo.js} +1 -1
- package/dist/index.html +38 -54
- package/dist/panel-standalone.html +11 -15
- package/package.json +8 -8
- package/src/app/components/layout/__tests__/app-layout.test.tsx +7 -0
- package/src/app/components/layout/__tests__/sidebar.layout.test.tsx +36 -16
- package/src/app/components/layout/app-layout.tsx +18 -46
- package/src/app/components/layout/sidebar-items.tsx +27 -18
- package/src/app/components/layout/sidebar-rail.styles.ts +11 -2
- package/src/app/components/layout/sidebar.tsx +3 -2
- package/src/app/configs/__tests__/app-navigation.config.test.ts +4 -0
- package/src/app/configs/app-navigation.config.ts +41 -86
- package/src/app/configs/page-resource-renderers.config.ts +13 -0
- package/src/app/index.tsx +4 -0
- package/src/app/presenters/app.presenter.ts +13 -2
- package/src/features/agents/components/__tests__/agents-page.test.tsx +4 -0
- package/src/features/agents/components/agent-details-dialog.tsx +5 -2
- package/src/features/agents/components/agents-page.tsx +9 -4
- package/src/features/apps/components/app-package-card.tsx +2 -2
- package/src/features/chat/components/conversation/chat-conversation-content.tsx +32 -19
- package/src/features/chat/components/conversation/chat-conversation-header-section.tsx +1 -0
- package/src/features/chat/components/conversation/chat-conversation-header.tsx +1 -1
- package/src/features/chat/components/conversation/chat-conversation-panel.tsx +2 -2
- package/src/features/chat/components/conversation/chat-conversation-workspace-section.tsx +1 -0
- package/src/features/chat/components/layout/__tests__/chat-page-shell.test.tsx +5 -6
- package/src/features/chat/components/layout/__tests__/chat-sidebar-toolbar.test.tsx +14 -12
- package/src/features/chat/components/layout/chat-page-shell.tsx +31 -64
- package/src/features/chat/components/layout/chat-sidebar-desktop-layout.tsx +8 -5
- package/src/features/chat/components/layout/chat-sidebar-toolbar.tsx +64 -256
- package/src/features/chat/components/layout/chat-sidebar.tsx +8 -30
- package/src/features/chat/components/providers/chat-runtime.provider.tsx +62 -0
- package/src/features/chat/features/conversation/components/__tests__/floating-session-conversation.test.tsx +70 -0
- package/src/features/chat/features/conversation/components/chat-voice-input-panel.tsx +3 -2
- package/src/features/chat/features/conversation/components/floating-session-conversation.tsx +27 -0
- package/src/features/chat/features/conversation/components/session-conversation-area.tsx +1 -0
- package/src/features/chat/features/conversation/components/session-conversation-panel-tab.tsx +25 -0
- package/src/features/chat/features/conversation/hooks/__tests__/use-chat-voice-input.test.tsx +4 -0
- package/src/features/chat/features/conversation/hooks/use-chat-composer-reference-intent.ts +2 -1
- package/src/features/chat/features/message/components/__tests__/chat-inline-panel-app-card.test.tsx +2 -1
- package/src/features/chat/features/message/components/__tests__/chat-message-assistant-header.container.test.tsx +3 -0
- package/src/features/chat/features/message/components/__tests__/chat-message-list-skill-preview.container.test.tsx +3 -0
- package/src/features/chat/features/message/components/__tests__/chat-message-list.container.test.tsx +35 -47
- package/src/features/chat/features/message/components/chat-message-list.container.tsx +6 -10
- package/src/features/chat/features/message/hooks/use-chat-inline-token-actions.ts +7 -3
- package/src/features/chat/features/message/utils/__tests__/chat-message-process-summary.utils.test.ts +52 -6
- package/src/features/chat/features/message/utils/chat-message-process-summary.utils.ts +22 -37
- package/src/features/chat/features/session/components/__tests__/chat-sidebar-project-groups.test.tsx +1 -1
- package/src/features/chat/features/session/components/__tests__/chat-sidebar-session-item.test.tsx +21 -0
- package/src/features/chat/features/session/components/chat-mobile-session-row.tsx +61 -0
- package/src/features/chat/features/session/components/chat-sidebar-project-groups.tsx +4 -37
- package/src/features/chat/features/session/components/chat-sidebar-session-entry.tsx +2 -0
- package/src/features/chat/features/session/components/chat-sidebar-session-item.tsx +18 -7
- package/src/features/chat/features/session/components/chat-sidebar-session-list.tsx +5 -3
- package/src/features/chat/features/session/components/session-header/__tests__/chat-session-header-actions.test.tsx +10 -2
- package/src/features/chat/features/session/components/session-header/chat-session-header-actions.tsx +20 -17
- package/src/features/chat/features/session/components/session-header/chat-session-header-menu-item.tsx +4 -4
- package/src/features/chat/features/session/components/session-header/chat-session-more-actions-menu.tsx +18 -5
- package/src/features/chat/features/session/utils/chat-session-route.utils.ts +12 -0
- package/src/features/chat/features/workspace/components/__tests__/chat-session-child-sessions.test.tsx +28 -0
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-file-preview.test.tsx +9 -0
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel-content.test.tsx +6 -2
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel.test.tsx +49 -12
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +13 -6
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-content.tsx +6 -0
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-nav.tsx +21 -36
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel.tsx +40 -31
- package/src/features/chat/features/workspace/components/child-sessions/chat-session-child-sessions.tsx +6 -1
- package/src/features/chat/features/workspace/components/project-files/workspace-directory-tree.tsx +2 -2
- package/src/features/chat/features/workspace/components/project-files/workspace-project-files-toolbar.tsx +2 -2
- package/src/features/chat/features/workspace/utils/__tests__/chat-workspace-panel-view-model.utils.test.ts +27 -0
- package/src/features/chat/features/workspace/utils/__tests__/workspace-file-panel-route.utils.test.ts +94 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-file-tab-persistence.utils.ts +2 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-file-tab.utils.ts +15 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-panel-view-model.utils.ts +11 -0
- package/src/features/chat/features/workspace/utils/workspace-file-panel-route.utils.ts +147 -0
- package/src/features/chat/index.ts +20 -4
- package/src/features/chat/managers/__tests__/chat-completion-notification.manager.test.ts +8 -0
- package/src/features/chat/managers/__tests__/chat-thread-workspace.manager.test.ts +7 -2
- package/src/features/chat/managers/__tests__/session-surface.manager.test.ts +45 -0
- package/src/features/chat/managers/chat-completion-notification.manager.ts +5 -0
- package/src/features/chat/managers/chat-composer-intent.manager.ts +16 -0
- package/src/features/chat/managers/chat-thread.manager.ts +18 -27
- package/src/features/chat/managers/chat-voice-input.manager.ts +5 -3
- package/src/features/chat/managers/session-surface.manager.ts +46 -0
- package/src/features/chat/pages/__tests__/ncp-chat-page.test.tsx +23 -5
- package/src/features/chat/pages/ncp-chat-page.tsx +6 -86
- package/src/features/chat/presenters/chat.presenter.ts +2 -1
- package/src/features/chat/stores/__tests__/chat-thread.store.test.ts +2 -2
- package/src/features/chat/stores/chat-thread.store.ts +7 -1
- package/src/features/chat/stores/floating-session.store.ts +11 -0
- package/src/features/chat/utils/chat-voice-permissions.utils.test.ts +12 -1
- package/src/features/chat/utils/chat-voice-permissions.utils.ts +6 -1
- package/src/features/cron/components/__tests__/cron-config.test.tsx +4 -0
- package/src/features/cron/components/cron-job-detail-dialog.tsx +3 -1
- package/src/features/cron/components/cron-job-row.tsx +14 -8
- package/src/features/inbox/components/inbox-reader-dialog.test.tsx +3 -0
- package/src/features/inbox/components/inbox-reader-dialog.tsx +6 -1
- package/src/features/inbox/pages/inbox-page.test.ts +3 -0
- package/src/features/inbox/pages/inbox-page.tsx +12 -4
- package/src/features/marketplace/components/__tests__/marketplace-page-detail.test.tsx +5 -1
- package/src/features/marketplace/components/__tests__/marketplace-page.test.tsx +3 -0
- package/src/features/marketplace/components/curated-shelves/__tests__/marketplace-curated-scene-route.test.tsx +2 -0
- package/src/features/marketplace/components/marketplace-list-card.tsx +4 -0
- package/src/features/marketplace/components/mcp/__tests__/mcp-marketplace-page.test.tsx +2 -0
- package/src/features/marketplace/components/mcp/mcp-marketplace-card.tsx +3 -0
- package/src/features/notifications/components/__tests__/app-notification-toast.test.tsx +19 -0
- package/src/features/notifications/components/app-notification-toast.tsx +33 -15
- package/src/features/notifications/managers/app-notification.manager.ts +2 -0
- package/src/features/panel-apps/components/__tests__/panel-app-list-item.test.tsx +13 -4
- package/src/features/panel-apps/components/__tests__/panel-app-toolbar.test.tsx +13 -5
- package/src/features/panel-apps/components/panel-app-list-item.tsx +1 -1
- package/src/features/panel-apps/components/panel-app-main-sidebar-menu-item.tsx +5 -38
- package/src/features/panel-apps/components/panel-app-toolbar.tsx +7 -7
- package/src/features/panel-apps/index.ts +1 -1
- package/src/features/projects/components/project-materials.test.tsx +2 -0
- package/src/features/projects/components/project-skills.tsx +7 -3
- package/src/features/projects/components/work/project-work-item-drawer.test.tsx +2 -0
- package/src/features/projects/components/work/project-work-item-drawer.tsx +3 -1
- package/src/features/right-panel-resources/components/__tests__/page-resource-icon.test.tsx +67 -0
- package/src/features/right-panel-resources/components/__tests__/page-resource-sidebar-nav.test.tsx +183 -0
- package/src/features/right-panel-resources/components/__tests__/system-object-resource.test.tsx +42 -0
- package/src/features/right-panel-resources/components/page-resource-actions-menu.tsx +53 -0
- package/src/features/right-panel-resources/components/page-resource-icon.tsx +245 -0
- package/src/features/right-panel-resources/components/page-resource-sidebar-nav.tsx +119 -0
- package/src/features/right-panel-resources/components/system-object-resource.tsx +100 -0
- package/src/features/right-panel-resources/components/workspace-file-resource.tsx +56 -0
- package/src/features/right-panel-resources/configs/right-panel-resource-routes.config.ts +46 -3
- package/src/features/right-panel-resources/hooks/use-page-resource-actions.ts +190 -0
- package/src/features/right-panel-resources/index.ts +21 -8
- package/src/features/right-panel-resources/managers/__tests__/page-resource.manager.test.ts +149 -0
- package/src/features/right-panel-resources/managers/page-resource.manager.ts +342 -0
- package/src/features/right-panel-resources/pages/resource-page.tsx +114 -0
- package/src/features/right-panel-resources/stores/page-navigation.store.ts +55 -0
- package/src/features/right-panel-resources/types/page-resource.types.ts +11 -0
- package/src/features/right-panel-resources/utils/__tests__/right-panel-resource-route-resolver.utils.test.ts +10 -0
- package/src/features/right-panel-resources/utils/page-resource-identity.utils.ts +61 -0
- package/src/features/right-panel-resources/utils/right-panel-resource-uri.utils.ts +2 -6
- package/src/features/service-apps/components/__tests__/service-apps-panel.test.tsx +2 -0
- package/src/features/service-apps/components/service-app-list-item.tsx +6 -1
- package/src/features/settings/pages/providers-config-page.tsx +2 -2
- package/src/features/side-dock/components/__tests__/side-dock.test.tsx +9 -8
- package/src/features/side-dock/components/side-dock.tsx +14 -47
- package/src/features/side-dock/managers/side-dock.manager.ts +2 -0
- package/src/features/system-status/components/__tests__/desktop-update-config.test.tsx +40 -0
- package/src/features/system-status/components/desktop-update-config.tsx +19 -1
- package/src/platforms/desktop/components/__tests__/desktop-app-shell.test.tsx +2 -0
- package/src/platforms/desktop/components/desktop-app-shell.tsx +3 -14
- package/src/platforms/mobile/components/__tests__/mobile-app-shell.test.tsx +1 -0
- package/src/platforms/mobile/components/__tests__/mobile-bottom-nav.test.tsx +3 -2
- package/src/platforms/mobile/components/mobile-app-shell.tsx +3 -4
- package/src/platforms/mobile/components/mobile-bottom-nav.tsx +7 -7
- package/src/platforms/mobile/components/mobile-settings-shell.tsx +8 -3
- package/src/platforms/mobile/components/mobile-topbar.tsx +4 -4
- package/src/shared/components/doc-browser/__tests__/doc-browser-context.test.tsx +4 -3
- package/src/shared/components/doc-browser/__tests__/doc-browser-tab-strip.test.tsx +0 -5
- package/src/shared/components/doc-browser/__tests__/doc-browser.test.tsx +57 -73
- package/src/shared/components/doc-browser/__tests__/resource-link-interceptor.test.tsx +104 -0
- package/src/shared/components/doc-browser/doc-browser-context.tsx +5 -1
- package/src/shared/components/doc-browser/doc-browser-panel-parts.tsx +1 -1
- package/src/shared/components/doc-browser/doc-browser-tab-strip.tsx +6 -118
- package/src/shared/components/doc-browser/doc-browser.tsx +30 -194
- package/src/shared/components/doc-browser/hooks/use-doc-browser-scroll-restoration.ts +1 -1
- package/src/shared/components/doc-browser/managers/doc-browser.manager.ts +11 -1
- package/src/shared/components/doc-browser/stores/doc-browser.store.ts +3 -7
- package/src/shared/components/doc-browser/types/doc-browser.types.ts +8 -1
- package/src/shared/components/doc-browser/use-doc-link-interceptor.ts +30 -32
- package/src/shared/components/doc-browser/utils/doc-browser-state.utils.ts +6 -6
- package/src/shared/components/ui/context-menu/__tests__/context-menu.test.tsx +105 -1
- package/src/shared/components/ui/context-menu/context-menu-items.tsx +173 -0
- package/src/shared/components/ui/context-menu/context-menu.tsx +99 -112
- package/src/shared/components/ui/dialog.tsx +4 -0
- package/src/shared/components/ui/overlays/sheet.tsx +4 -0
- package/src/shared/components/ui/popover.tsx +10 -4
- package/src/shared/components/workbench/__tests__/workbench-surface.manager.test.ts +70 -0
- package/src/shared/components/workbench/__tests__/workbench-surface.test.tsx +111 -0
- package/src/shared/components/workbench/managers/workbench-surface.manager.ts +120 -0
- package/src/shared/components/workbench/stores/workbench-surface.store.ts +83 -0
- package/src/shared/components/workbench/types/workbench-surface.types.ts +32 -0
- package/src/shared/components/workbench/utils/workbench-surface-geometry.utils.ts +46 -0
- package/src/shared/components/workbench/workbench-surface-toolbar.tsx +102 -0
- package/src/shared/components/workbench/workbench-surface.tsx +401 -0
- package/src/shared/hooks/use-panel-app-scroll-restoration.test.tsx +19 -0
- package/src/shared/hooks/use-panel-app-scroll-restoration.ts +8 -6
- package/src/shared/hooks/use-scroll-restoration.test.tsx +39 -2
- package/src/shared/hooks/use-scroll-restoration.ts +33 -33
- package/src/shared/lib/api/marketplace.types.ts +1 -0
- package/src/shared/lib/i18n/locales/en-US/chat.json +46 -1
- package/src/shared/lib/i18n/locales/en-US/core.json +3 -1
- package/src/shared/lib/i18n/locales/en-US/desktop-update.json +1 -0
- package/src/shared/lib/i18n/locales/en-US/doc-browser.json +1 -1
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +46 -1
- package/src/shared/lib/i18n/locales/zh-CN/core.json +11 -9
- package/src/shared/lib/i18n/locales/zh-CN/desktop-update.json +1 -0
- package/src/shared/lib/navigation-history/index.ts +1 -0
- package/src/shared/lib/navigation-history/navigation-history.utils.ts +1 -1
- package/src/shared/lib/navigation-history/scroll-restoration.manager.test.ts +11 -0
- package/src/shared/lib/navigation-history/scroll-restoration.manager.ts +36 -7
- package/src/shared/lib/navigation-history/view-memory-storage.store.test.ts +37 -0
- package/src/shared/lib/navigation-history/view-memory-storage.store.ts +21 -0
- package/src/shared/lib/transport/__tests__/browser-realtime-recovery.service.test.ts +27 -2
- package/src/shared/lib/transport/__tests__/local-transport.service.test.ts +20 -0
- package/src/shared/lib/transport/__tests__/remote.transport.test.ts +26 -0
- package/src/shared/lib/transport/browser-realtime-recovery.service.ts +32 -5
- package/src/shared/lib/transport/local-transport.service.ts +1 -6
- package/src/shared/lib/transport/remote-transport.service.ts +22 -1
- package/src/shared/lib/ui-document-title/index.ts +1 -0
- package/dist/assets/account-panel-BW4GbzQd.js +0 -1
- package/dist/assets/api-DqzQ-_3w.js +0 -13
- package/dist/assets/app-data-C54N2p8b.js +0 -1
- package/dist/assets/app-presenter-provider-CBZ_-ewx.js +0 -115
- package/dist/assets/appearance-settings-page-C-uZ2Wkf.js +0 -1
- package/dist/assets/architecture-TIHT7OUA-DEt0Abz9.js +0 -1
- package/dist/assets/boxes-D6uPnkGo.js +0 -1
- package/dist/assets/card-BhfAZv5L.js +0 -1
- package/dist/assets/channel-CxQkbwRD.js +0 -1
- package/dist/assets/channels-list-page-Bv7CVSqV.js +0 -8
- package/dist/assets/chevron-down-BL-yMYcX.js +0 -1
- package/dist/assets/chunk-2Q5K7J3B-ClVhziok.js +0 -1
- package/dist/assets/chunk-VAUOI2AC-DZQxkIsv.js +0 -1
- package/dist/assets/chunk-XXDRQBXY-BkExtw5C.js +0 -1
- package/dist/assets/circle-alert-lSa3LRvS.js +0 -1
- package/dist/assets/classDiagram-OUVF2IWQ-Bd6apBb-.js +0 -1
- package/dist/assets/classDiagram-v2-EOCWNBFH-CYxUZGCI.js +0 -1
- package/dist/assets/client-BtGBwLTs.js +0 -1
- package/dist/assets/config-split-page-DqAXKLmG.js +0 -1
- package/dist/assets/confirm-dialog-BTKCWMn6.js +0 -1
- package/dist/assets/createLucideIcon-BNKf0_kc.js +0 -1
- package/dist/assets/cynefin-VYW2F7L2-CV0bFLH9.js +0 -1
- package/dist/assets/desktop-capabilities-page-zLzCSB7A.js +0 -1
- package/dist/assets/desktop-update-config-PmofcFf6.js +0 -1
- package/dist/assets/dialog-Xe73hpQz.js +0 -5
- package/dist/assets/dist-BiIcnf9j.js +0 -1
- package/dist/assets/dist-C5I0v8Qn.js +0 -1
- package/dist/assets/dist-czPa8xFO.js +0 -1
- package/dist/assets/doc-browser-BJrre2S_.js +0 -1
- package/dist/assets/doc-browser-BPqA-zQx.js +0 -1
- package/dist/assets/doc-browser-context-TILuCY5c.js +0 -1
- package/dist/assets/ellipsis-C5YXdOUx.js +0 -1
- package/dist/assets/es2015-cuwbYI-l.js +0 -41
- package/dist/assets/eventmodeling-45OFAUF4-BzkLWWdP.js +0 -1
- package/dist/assets/extensions-CVUFK6Jj.js +0 -1
- package/dist/assets/flowDiagram-23GEKE2U-ukkCsB0j.js +0 -1
- package/dist/assets/form-actions-BRESe-m_.js +0 -1
- package/dist/assets/gitGraph-TEB2WS4Q-BYFhT0Q5.js +0 -1
- package/dist/assets/i18n-provider-BPRq6S7O.js +0 -1
- package/dist/assets/info-DKCQHKI2-CTmlJdcH.js +0 -1
- package/dist/assets/katex-DbZC06Q5.js +0 -1
- package/dist/assets/keyboard-shortcuts-settings-page-CScSXYS4.js +0 -1
- package/dist/assets/loader-circle-K1BDdHR5.js +0 -1
- package/dist/assets/login-page-Dlyvp-81.js +0 -1
- package/dist/assets/login-page-f8qQ4xKY.js +0 -1
- package/dist/assets/logo-badge-C-5-zim6.js +0 -1
- package/dist/assets/main-D2dWy8fM.css +0 -1
- package/dist/assets/main-DMNmwcJE.js +0 -2
- package/dist/assets/main-i18n-catalog.config-DZ-5ollN.js +0 -1
- package/dist/assets/mcp-marketplace-page-FfIfEo6w.js +0 -10
- package/dist/assets/mcp-marketplace-page-sH7VptN_.js +0 -1
- package/dist/assets/model-config-page-Bcm6-pCX.js +0 -1
- package/dist/assets/navigation-link-BAQjgx2F.js +0 -3
- package/dist/assets/packet-7NZHBO7P-BbrI0ZlN.js +0 -1
- package/dist/assets/panel-app-B39rJPj8.js +0 -1
- package/dist/assets/panel-app-i18n-catalog.config-p3qAY_Eq.js +0 -1
- package/dist/assets/panelStandalone-By-6dDXS.js +0 -2
- package/dist/assets/pie-RZYD4A2V-B7zE1ZIr.js +0 -1
- package/dist/assets/plus-LA8-jpxP.js +0 -1
- package/dist/assets/popover-NkrFlWHp.js +0 -1
- package/dist/assets/privacy-settings-page-B1sHLAc1.js +0 -1
- package/dist/assets/projects-Voql-cvx.js +0 -1
- package/dist/assets/provider-models-hrHMcHqg.js +0 -1
- package/dist/assets/provider-scoped-model-input-BQsugx1v.js +0 -1
- package/dist/assets/providers-config-page-BDEdHJbw.js +0 -1
- package/dist/assets/pwa-CzqfYjFx.js +0 -1
- package/dist/assets/radar-I7S5WNFK-1X_q11Ed.js +0 -1
- package/dist/assets/railroad-3IZDKUUU-CIXnuFyE.js +0 -1
- package/dist/assets/railroad-abnf-AHOZXSZD-D6ImKl2r.js +0 -1
- package/dist/assets/railroad-ebnf-EBAXGLYW-2j9d3twU.js +0 -1
- package/dist/assets/railroad-peg-LSFZ7HO6-DMVaJGbm.js +0 -1
- package/dist/assets/remote-BekqL5nA.js +0 -1
- package/dist/assets/runtime-config-page-BH9uF4u_.js +0 -1
- package/dist/assets/search-CUe41wjm.js +0 -1
- package/dist/assets/search-config-page-DWKlMHgH.js +0 -1
- package/dist/assets/secrets-config-page-DiQL088Y.js +0 -3
- package/dist/assets/security-config-DmTDKKY4.js +0 -1
- package/dist/assets/select-CG5YWnwe.js +0 -1
- package/dist/assets/service-apps-panel-CEnyYsQp.js +0 -1
- package/dist/assets/skeleton-Drvn83YW.js +0 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-OlIMT57r.js +0 -1
- package/dist/assets/swimlanesDiagram-G3AALYLV-sLThrh07.js +0 -8
- package/dist/assets/tabs-BuE0qKMh.js +0 -1
- package/dist/assets/tag-chip-B1AYPOKL.js +0 -1
- package/dist/assets/theme-provider-DzvAi3pe.js +0 -1
- package/dist/assets/tooltip-DYcuWhuP.js +0 -1
- package/dist/assets/trash-2-BPPYt2NV.js +0 -1
- package/dist/assets/treeView-QDETBFTQ-CCFyazDE.js +0 -1
- package/dist/assets/treemap-6X3UGDF4-D6wvq1Hz.js +0 -1
- package/dist/assets/use-config-BEdbtpD4.js +0 -1
- package/dist/assets/use-desktop-capabilities-BkuRd2cY.js +0 -1
- package/dist/assets/use-panel-app-scroll-restoration-ZnicIfo3.js +0 -1
- package/dist/assets/use-viewport-layout-BS18drMT.js +0 -1
- package/dist/assets/utils-CBZPzC_b.js +0 -8
- package/dist/assets/wardley-OPB4EBWU-BRzaRyFf.js +0 -1
- package/dist/assets/x-DdXOqLnX.js +0 -1
- package/src/features/panel-apps/components/__tests__/panel-app-main-sidebar-nav.test.tsx +0 -219
- package/src/features/panel-apps/components/panel-app-main-sidebar-nav.tsx +0 -258
- package/src/shared/components/doc-browser/utils/doc-browser-floating-panel.utils.ts +0 -83
- /package/dist/assets/{array-D0DyKZdT.js → array-BV9OtnO8.js} +0 -0
- /package/dist/assets/{chunk-KEIR6QF5-CuZFOa6q.js → chunk-KEIR6QF5-Cx-8EJ4_.js} +0 -0
- /package/dist/assets/{chunk-Y2CYZVJY-Frut-1TF.js → chunk-Y2CYZVJY-Dy1ufvjf.js} +0 -0
- /package/dist/assets/{config-hints-B_C9DAp5.js → config-hints-DbmiyTKg.js} +0 -0
- /package/dist/assets/{cytoscape.esm-BibuhnZD.js → cytoscape.esm-CSCjuT4Z.js} +0 -0
- /package/dist/assets/{defaultLocale-q7sRUXPc.js → defaultLocale-DWTiNsbT.js} +0 -0
- /package/dist/assets/{dist-DhMddrrH.js → dist-BVCSkfWY.js} +0 -0
- /package/dist/assets/{graphlib-BM63WsW3.js → graphlib-B1yb1Wl8.js} +0 -0
- /package/dist/assets/{host-capabilities-B107nwS3.js → host-capabilities-DuIFVsvM.js} +0 -0
- /package/dist/assets/{init-CRMkf9sL.js → init-BF6GH5oe.js} +0 -0
- /package/dist/assets/{jszip.min-6thm2J_a.js → jszip.min-D12teKzP.js} +0 -0
- /package/dist/assets/{katex-B26hhTOT.js → katex-CsAM73R9.js} +0 -0
- /package/dist/assets/{middleware-0o3JF3tS.js → middleware-B--6mAUM.js} +0 -0
- /package/dist/assets/{path-BFMmafCM.js → path-C56XkznJ.js} +0 -0
- /package/dist/assets/{rough.esm-5Tjchx1D.js → rough.esm-CGfeEbtE.js} +0 -0
- /package/dist/assets/{xlsx-BC8ibjXK.js → xlsx-sds5nUpL.js} +0 -0
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useEffect,
|
|
3
|
+
useRef,
|
|
4
|
+
useState,
|
|
5
|
+
type CSSProperties,
|
|
6
|
+
type ReactNode,
|
|
7
|
+
type PointerEvent as ReactPointerEvent,
|
|
8
|
+
} from "react";
|
|
9
|
+
import { useWorkbenchSurfaceStore } from "./stores/workbench-surface.store";
|
|
10
|
+
import {
|
|
11
|
+
DEFAULT_WORKBENCH_SURFACE,
|
|
12
|
+
type WorkbenchResizeEdge,
|
|
13
|
+
} from "./types/workbench-surface.types";
|
|
14
|
+
import type { WorkbenchSurfaceManager } from "./managers/workbench-surface.manager";
|
|
15
|
+
import { WorkbenchSurfaceToolbar } from "./workbench-surface-toolbar";
|
|
16
|
+
import { cn } from "@/shared/lib/utils";
|
|
17
|
+
import { t } from "@/shared/lib/i18n";
|
|
18
|
+
|
|
19
|
+
type WorkbenchSurfaceProps = {
|
|
20
|
+
id: string;
|
|
21
|
+
manager: WorkbenchSurfaceManager;
|
|
22
|
+
title: string;
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
navigation?: ReactNode;
|
|
25
|
+
icon?: ReactNode;
|
|
26
|
+
onClose: () => void;
|
|
27
|
+
closeLabel?: string;
|
|
28
|
+
onPlace?: () => void;
|
|
29
|
+
onOpenMain?: () => void;
|
|
30
|
+
width?: number;
|
|
31
|
+
minWidth?: number;
|
|
32
|
+
maxWidth?: number;
|
|
33
|
+
onWidthCommit?: (width: number) => void;
|
|
34
|
+
fullscreen?: boolean;
|
|
35
|
+
hidden?: boolean;
|
|
36
|
+
testId?: string;
|
|
37
|
+
className?: string;
|
|
38
|
+
focusOnOpen?: boolean;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const EDGE_CLASSES: Record<WorkbenchResizeEdge, string> = {
|
|
42
|
+
left: "left-0 top-3 bottom-3 w-1.5 cursor-ew-resize",
|
|
43
|
+
right: "right-0 top-3 bottom-3 w-1.5 cursor-ew-resize",
|
|
44
|
+
top: "top-0 left-3 right-3 h-1.5 cursor-ns-resize",
|
|
45
|
+
bottom: "bottom-0 left-3 right-3 h-1.5 cursor-ns-resize",
|
|
46
|
+
"top-left": "left-0 top-0 h-3 w-3 cursor-nwse-resize",
|
|
47
|
+
"top-right": "right-0 top-0 h-3 w-3 cursor-nesw-resize",
|
|
48
|
+
"bottom-left": "left-0 bottom-0 h-3 w-3 cursor-nesw-resize",
|
|
49
|
+
"bottom-right": "right-0 bottom-0 h-3 w-3 cursor-nwse-resize",
|
|
50
|
+
};
|
|
51
|
+
const viewport = () => ({
|
|
52
|
+
width: window.innerWidth,
|
|
53
|
+
height: window.innerHeight,
|
|
54
|
+
});
|
|
55
|
+
const blocksDrag = (target: EventTarget | null) =>
|
|
56
|
+
target instanceof Element &&
|
|
57
|
+
Boolean(
|
|
58
|
+
target.closest(
|
|
59
|
+
'button, a, input, textarea, select, [role="menu"], [data-compact-tab-item]',
|
|
60
|
+
),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
/** One stable DOM parent across dock/float/maximize/collapse. Content never owns window mechanics. */
|
|
64
|
+
export function WorkbenchSurface({
|
|
65
|
+
id,
|
|
66
|
+
manager,
|
|
67
|
+
title,
|
|
68
|
+
icon,
|
|
69
|
+
navigation,
|
|
70
|
+
children,
|
|
71
|
+
onClose,
|
|
72
|
+
closeLabel = t("workbenchCloseView"),
|
|
73
|
+
onPlace,
|
|
74
|
+
onOpenMain,
|
|
75
|
+
width = 480,
|
|
76
|
+
minWidth = 320,
|
|
77
|
+
maxWidth = 960,
|
|
78
|
+
onWidthCommit,
|
|
79
|
+
fullscreen = false,
|
|
80
|
+
hidden = false,
|
|
81
|
+
testId,
|
|
82
|
+
className,
|
|
83
|
+
focusOnOpen = false,
|
|
84
|
+
}: WorkbenchSurfaceProps) {
|
|
85
|
+
const state = useWorkbenchSurfaceStore(
|
|
86
|
+
(store) => store.surfaces[id] ?? DEFAULT_WORKBENCH_SURFACE,
|
|
87
|
+
);
|
|
88
|
+
const panelRef = useRef<HTMLElement>(null);
|
|
89
|
+
const interactionCleanup = useRef<(() => void) | null>(null);
|
|
90
|
+
const openerRef = useRef<HTMLElement | null>(null);
|
|
91
|
+
const [compact, setCompact] = useState(() => window.innerWidth < 768);
|
|
92
|
+
const [interacting, setInteracting] = useState(false);
|
|
93
|
+
const [dragWidth, setDragWidth] = useState<number | null>(null);
|
|
94
|
+
const isCompact = compact || fullscreen;
|
|
95
|
+
const floating = state.placement === "floating";
|
|
96
|
+
const overlay = isCompact || state.maximized;
|
|
97
|
+
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
openerRef.current =
|
|
100
|
+
document.activeElement instanceof HTMLElement
|
|
101
|
+
? document.activeElement
|
|
102
|
+
: null;
|
|
103
|
+
if (focusOnOpen) panelRef.current?.focus();
|
|
104
|
+
const onResize = () => {
|
|
105
|
+
setCompact(window.innerWidth < 768);
|
|
106
|
+
manager.constrain(id, viewport());
|
|
107
|
+
};
|
|
108
|
+
onResize();
|
|
109
|
+
window.addEventListener("resize", onResize);
|
|
110
|
+
return () => {
|
|
111
|
+
window.removeEventListener("resize", onResize);
|
|
112
|
+
interactionCleanup.current?.();
|
|
113
|
+
};
|
|
114
|
+
}, [id, manager, focusOnOpen]);
|
|
115
|
+
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
manager.setVisible(id, !hidden);
|
|
118
|
+
return () => manager.setVisible(id, false);
|
|
119
|
+
}, [hidden, id, manager]);
|
|
120
|
+
|
|
121
|
+
const focusControl = () => panelRef.current?.focus();
|
|
122
|
+
const close = () => {
|
|
123
|
+
onClose();
|
|
124
|
+
if (
|
|
125
|
+
openerRef.current?.isConnected &&
|
|
126
|
+
!panelRef.current?.contains(openerRef.current)
|
|
127
|
+
)
|
|
128
|
+
openerRef.current.focus();
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const startInteraction = (
|
|
132
|
+
event: ReactPointerEvent<HTMLElement>,
|
|
133
|
+
edge?: WorkbenchResizeEdge | "dock",
|
|
134
|
+
) => {
|
|
135
|
+
if (
|
|
136
|
+
event.button !== 0 ||
|
|
137
|
+
overlay ||
|
|
138
|
+
state.minimized ||
|
|
139
|
+
(!edge && blocksDrag(event.target))
|
|
140
|
+
)
|
|
141
|
+
return;
|
|
142
|
+
if (!edge && !floating) return;
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
event.stopPropagation();
|
|
145
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
146
|
+
interactionCleanup.current?.();
|
|
147
|
+
manager.focus(id);
|
|
148
|
+
setInteracting(true);
|
|
149
|
+
const start = {
|
|
150
|
+
x: event.clientX,
|
|
151
|
+
y: event.clientY,
|
|
152
|
+
rect: state.rect,
|
|
153
|
+
width,
|
|
154
|
+
};
|
|
155
|
+
let nextWidth = width;
|
|
156
|
+
const move = (next: PointerEvent) => {
|
|
157
|
+
const dx = next.clientX - start.x;
|
|
158
|
+
const dy = next.clientY - start.y;
|
|
159
|
+
if (edge === "dock") {
|
|
160
|
+
nextWidth = Math.max(
|
|
161
|
+
Math.min(minWidth, window.innerWidth),
|
|
162
|
+
Math.min(maxWidth, window.innerWidth, start.width - dx),
|
|
163
|
+
);
|
|
164
|
+
setDragWidth(nextWidth);
|
|
165
|
+
} else if (edge) manager.resize(id, start.rect, edge, dx, dy, viewport());
|
|
166
|
+
else manager.move(id, start.rect, dx, dy, viewport());
|
|
167
|
+
};
|
|
168
|
+
const cleanup = () => {
|
|
169
|
+
window.removeEventListener("pointermove", move);
|
|
170
|
+
window.removeEventListener("pointerup", end);
|
|
171
|
+
window.removeEventListener("pointercancel", end);
|
|
172
|
+
};
|
|
173
|
+
const end = () => {
|
|
174
|
+
cleanup();
|
|
175
|
+
interactionCleanup.current = null;
|
|
176
|
+
setInteracting(false);
|
|
177
|
+
setDragWidth(null);
|
|
178
|
+
if (edge === "dock") onWidthCommit?.(nextWidth);
|
|
179
|
+
};
|
|
180
|
+
interactionCleanup.current = cleanup;
|
|
181
|
+
window.addEventListener("pointermove", move);
|
|
182
|
+
window.addEventListener("pointerup", end);
|
|
183
|
+
window.addEventListener("pointercancel", end);
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
const minimizedIndex = useWorkbenchSurfaceStore((store) =>
|
|
187
|
+
store.visibleSurfaceIds
|
|
188
|
+
.filter((key) => store.surfaces[key]?.minimized)
|
|
189
|
+
.sort()
|
|
190
|
+
.indexOf(id),
|
|
191
|
+
);
|
|
192
|
+
const layer = useWorkbenchSurfaceStore(
|
|
193
|
+
(store) =>
|
|
194
|
+
store.visibleSurfaceIds.filter(
|
|
195
|
+
(key) => (store.surfaces[key]?.layer ?? 0) <= state.layer,
|
|
196
|
+
).length,
|
|
197
|
+
);
|
|
198
|
+
const style: CSSProperties = state.minimized
|
|
199
|
+
? {
|
|
200
|
+
position: "fixed",
|
|
201
|
+
bottom: 12 + Math.max(0, minimizedIndex) * 48,
|
|
202
|
+
right: 12,
|
|
203
|
+
width: "min(360px, calc(100vw - 24px))",
|
|
204
|
+
zIndex: 50 + layer,
|
|
205
|
+
}
|
|
206
|
+
: overlay
|
|
207
|
+
? {
|
|
208
|
+
position: "fixed",
|
|
209
|
+
inset: 0,
|
|
210
|
+
width: "100%",
|
|
211
|
+
height: "100dvh",
|
|
212
|
+
zIndex: 50 + layer,
|
|
213
|
+
}
|
|
214
|
+
: floating
|
|
215
|
+
? {
|
|
216
|
+
position: "fixed",
|
|
217
|
+
left: state.rect.x,
|
|
218
|
+
top: state.rect.y,
|
|
219
|
+
width: state.rect.w,
|
|
220
|
+
height: state.rect.h,
|
|
221
|
+
zIndex: 50 + layer,
|
|
222
|
+
}
|
|
223
|
+
: { width: dragWidth ?? width, height: "100%" };
|
|
224
|
+
|
|
225
|
+
return (
|
|
226
|
+
<aside
|
|
227
|
+
ref={panelRef}
|
|
228
|
+
role="region"
|
|
229
|
+
aria-label={title}
|
|
230
|
+
tabIndex={-1}
|
|
231
|
+
hidden={hidden}
|
|
232
|
+
data-testid={testId}
|
|
233
|
+
data-workbench-surface={id}
|
|
234
|
+
data-placement={state.placement}
|
|
235
|
+
data-maximized={state.maximized || undefined}
|
|
236
|
+
data-minimized={state.minimized || undefined}
|
|
237
|
+
data-theme-surface="workspace-panel"
|
|
238
|
+
className={cn(
|
|
239
|
+
"relative min-h-0 min-w-0 shrink-0 flex-col overflow-hidden bg-card text-card-foreground outline-none",
|
|
240
|
+
hidden ? "hidden" : "flex",
|
|
241
|
+
(floating || state.minimized) && !overlay
|
|
242
|
+
? "rounded-xl border border-border shadow-2xl"
|
|
243
|
+
: "border-l border-border",
|
|
244
|
+
className,
|
|
245
|
+
)}
|
|
246
|
+
style={style}
|
|
247
|
+
onPointerDownCapture={() => manager.focus(id)}
|
|
248
|
+
onFocusCapture={() => manager.focus(id)}
|
|
249
|
+
onKeyDown={(event) => {
|
|
250
|
+
if (
|
|
251
|
+
event.key !== "Escape" ||
|
|
252
|
+
event.defaultPrevented ||
|
|
253
|
+
event.nativeEvent.isComposing
|
|
254
|
+
)
|
|
255
|
+
return;
|
|
256
|
+
if (state.maximized) {
|
|
257
|
+
event.stopPropagation();
|
|
258
|
+
manager.toggleMaximize(id);
|
|
259
|
+
focusControl();
|
|
260
|
+
} else if (floating && !state.minimized) {
|
|
261
|
+
event.stopPropagation();
|
|
262
|
+
manager.minimize(id);
|
|
263
|
+
focusControl();
|
|
264
|
+
}
|
|
265
|
+
}}
|
|
266
|
+
>
|
|
267
|
+
<header
|
|
268
|
+
className="flex min-h-10 shrink-0 select-none items-center gap-2 border-b border-border/60 bg-muted/30 px-2"
|
|
269
|
+
style={{ touchAction: floating ? "none" : undefined }}
|
|
270
|
+
onPointerDown={(event) => startInteraction(event)}
|
|
271
|
+
onDoubleClick={(event) => {
|
|
272
|
+
if (!isCompact && !blocksDrag(event.target))
|
|
273
|
+
manager.toggleMaximize(id);
|
|
274
|
+
}}
|
|
275
|
+
>
|
|
276
|
+
<div
|
|
277
|
+
hidden={state.minimized}
|
|
278
|
+
className={cn(
|
|
279
|
+
"min-w-0 flex-1",
|
|
280
|
+
state.minimized || !navigation ? "hidden" : "flex",
|
|
281
|
+
)}
|
|
282
|
+
>
|
|
283
|
+
{navigation}
|
|
284
|
+
</div>
|
|
285
|
+
<span
|
|
286
|
+
className={cn(
|
|
287
|
+
"flex min-w-0 flex-1 items-center gap-2 px-1 text-xs font-medium",
|
|
288
|
+
floating && !overlay && "cursor-grab active:cursor-grabbing",
|
|
289
|
+
navigation && !state.minimized && "hidden",
|
|
290
|
+
)}
|
|
291
|
+
>
|
|
292
|
+
{icon}
|
|
293
|
+
<span className="truncate">{title}</span>
|
|
294
|
+
</span>
|
|
295
|
+
<WorkbenchSurfaceToolbar
|
|
296
|
+
state={state}
|
|
297
|
+
compact={isCompact}
|
|
298
|
+
onPlace={
|
|
299
|
+
onPlace ??
|
|
300
|
+
(() => manager.place(id, floating ? "docked" : "floating"))
|
|
301
|
+
}
|
|
302
|
+
onMinimize={() => {
|
|
303
|
+
manager.minimize(id);
|
|
304
|
+
focusControl();
|
|
305
|
+
}}
|
|
306
|
+
onRestore={() => manager.restore(id)}
|
|
307
|
+
onMaximize={() => manager.toggleMaximize(id)}
|
|
308
|
+
onClose={close}
|
|
309
|
+
closeLabel={closeLabel}
|
|
310
|
+
onOpenMain={onOpenMain}
|
|
311
|
+
/>
|
|
312
|
+
</header>
|
|
313
|
+
<div
|
|
314
|
+
hidden={state.minimized}
|
|
315
|
+
className={cn(
|
|
316
|
+
"min-h-0 min-w-0 flex-1 flex-col",
|
|
317
|
+
state.minimized ? "hidden" : "flex",
|
|
318
|
+
)}
|
|
319
|
+
>
|
|
320
|
+
{children}
|
|
321
|
+
</div>
|
|
322
|
+
{!overlay && !state.minimized && (
|
|
323
|
+
<WorkbenchResizeHandles
|
|
324
|
+
floating={floating}
|
|
325
|
+
width={dragWidth ?? width}
|
|
326
|
+
minWidth={minWidth}
|
|
327
|
+
maxWidth={maxWidth}
|
|
328
|
+
onWidthCommit={onWidthCommit}
|
|
329
|
+
onPointerDown={startInteraction}
|
|
330
|
+
/>
|
|
331
|
+
)}
|
|
332
|
+
{interacting && (
|
|
333
|
+
<div
|
|
334
|
+
className="fixed inset-0 z-30"
|
|
335
|
+
data-workbench-interaction-shield=""
|
|
336
|
+
/>
|
|
337
|
+
)}
|
|
338
|
+
</aside>
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
function WorkbenchResizeHandles({
|
|
343
|
+
floating,
|
|
344
|
+
width,
|
|
345
|
+
minWidth,
|
|
346
|
+
maxWidth,
|
|
347
|
+
onWidthCommit,
|
|
348
|
+
onPointerDown,
|
|
349
|
+
}: {
|
|
350
|
+
floating: boolean;
|
|
351
|
+
width: number;
|
|
352
|
+
minWidth: number;
|
|
353
|
+
maxWidth: number;
|
|
354
|
+
onWidthCommit?: (width: number) => void;
|
|
355
|
+
onPointerDown: (
|
|
356
|
+
event: ReactPointerEvent<HTMLElement>,
|
|
357
|
+
edge: WorkbenchResizeEdge | "dock",
|
|
358
|
+
) => void;
|
|
359
|
+
}) {
|
|
360
|
+
return floating ? (
|
|
361
|
+
<>
|
|
362
|
+
{(Object.entries(EDGE_CLASSES) as [WorkbenchResizeEdge, string][]).map(
|
|
363
|
+
([edge, classes]) => (
|
|
364
|
+
<div
|
|
365
|
+
key={edge}
|
|
366
|
+
data-workbench-resize={edge}
|
|
367
|
+
className={cn("absolute z-20 touch-none", classes)}
|
|
368
|
+
onPointerDown={(event) => onPointerDown(event, edge)}
|
|
369
|
+
/>
|
|
370
|
+
),
|
|
371
|
+
)}
|
|
372
|
+
</>
|
|
373
|
+
) : onWidthCommit ? (
|
|
374
|
+
<div
|
|
375
|
+
role="separator"
|
|
376
|
+
aria-label={t("workbenchResize")}
|
|
377
|
+
aria-orientation="vertical"
|
|
378
|
+
aria-valuemin={minWidth}
|
|
379
|
+
aria-valuemax={maxWidth}
|
|
380
|
+
aria-valuenow={width}
|
|
381
|
+
tabIndex={0}
|
|
382
|
+
data-testid="resizable-right-panel-handle"
|
|
383
|
+
className="absolute bottom-0 left-0 top-0 z-20 w-1.5 cursor-ew-resize touch-none hover:bg-primary/20 focus-visible:bg-primary/30 focus-visible:outline-none"
|
|
384
|
+
onPointerDown={(event) => onPointerDown(event, "dock")}
|
|
385
|
+
onKeyDown={(event) => {
|
|
386
|
+
if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key))
|
|
387
|
+
return;
|
|
388
|
+
event.preventDefault();
|
|
389
|
+
const next =
|
|
390
|
+
event.key === "Home"
|
|
391
|
+
? minWidth
|
|
392
|
+
: event.key === "End"
|
|
393
|
+
? maxWidth
|
|
394
|
+
: width + (event.key === "ArrowLeft" ? 24 : -24);
|
|
395
|
+
onWidthCommit(
|
|
396
|
+
Math.max(minWidth, Math.min(maxWidth, window.innerWidth, next)),
|
|
397
|
+
);
|
|
398
|
+
}}
|
|
399
|
+
/>
|
|
400
|
+
) : null;
|
|
401
|
+
}
|
|
@@ -64,3 +64,22 @@ describe("usePanelAppScrollRestoration", () => {
|
|
|
64
64
|
expect(postMessage).not.toHaveBeenCalled();
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
|
+
|
|
68
|
+
it("keeps independent URL positions when navigating A to B and back to A", () => {
|
|
69
|
+
scrollRestorationManager.clear();
|
|
70
|
+
const view = render(<PanelAppFrame currentUrl="/a" />);
|
|
71
|
+
const frame = view.getByTestId('panel-app-frame') as HTMLIFrameElement;
|
|
72
|
+
const post = vi.spyOn(frame.contentWindow!, 'postMessage');
|
|
73
|
+
const record = (y: number) => window.dispatchEvent(new MessageEvent('message', {
|
|
74
|
+
source: frame.contentWindow, data: { type: PANEL_APP_SCROLL_RESTORATION_CONTRACT.scrollMessageType, version: PANEL_APP_SCROLL_RESTORATION_CONTRACT.version, target: { kind: 'document' }, x: 0, y },
|
|
75
|
+
}));
|
|
76
|
+
record(400);
|
|
77
|
+
view.rerender(<PanelAppFrame currentUrl="/b" />);
|
|
78
|
+
record(80);
|
|
79
|
+
view.rerender(<PanelAppFrame currentUrl="/a" />);
|
|
80
|
+
fireEvent.load(frame);
|
|
81
|
+
expect(post).toHaveBeenLastCalledWith(expect.objectContaining({ y: 400 }), '*');
|
|
82
|
+
view.rerender(<PanelAppFrame currentUrl="/b" />);
|
|
83
|
+
fireEvent.load(frame);
|
|
84
|
+
expect(post).toHaveBeenLastCalledWith(expect.objectContaining({ y: 80 }), '*');
|
|
85
|
+
});
|
|
@@ -74,13 +74,15 @@ export function usePanelAppScrollRestoration({
|
|
|
74
74
|
isEnabled,
|
|
75
75
|
restorationKey,
|
|
76
76
|
}: UsePanelAppScrollRestorationParams) {
|
|
77
|
+
const routeKey = restorationKey && currentUrl ? JSON.stringify([restorationKey, currentUrl]) : null;
|
|
77
78
|
useEffect(() => {
|
|
78
|
-
if (!currentUrl || !isEnabled || !
|
|
79
|
+
if (!currentUrl || !isEnabled || !routeKey) return;
|
|
80
|
+
const key = routeKey;
|
|
79
81
|
const onMessage = (event: MessageEvent) => {
|
|
80
82
|
if (event.source !== iframeRef.current?.contentWindow || !isScrollMessage(event.data)) {
|
|
81
83
|
return;
|
|
82
84
|
}
|
|
83
|
-
scrollRestorationManager.save(
|
|
85
|
+
scrollRestorationManager.save(key, {
|
|
84
86
|
x: event.data.x,
|
|
85
87
|
y: event.data.y,
|
|
86
88
|
payload: { currentUrl, target: event.data.target } satisfies PanelAppScrollSnapshot,
|
|
@@ -88,11 +90,11 @@ export function usePanelAppScrollRestoration({
|
|
|
88
90
|
};
|
|
89
91
|
window.addEventListener("message", onMessage);
|
|
90
92
|
return () => window.removeEventListener("message", onMessage);
|
|
91
|
-
}, [currentUrl, iframeRef, isEnabled,
|
|
93
|
+
}, [currentUrl, iframeRef, isEnabled, routeKey]);
|
|
92
94
|
|
|
93
95
|
return useCallback(() => {
|
|
94
|
-
if (!currentUrl || !isEnabled || !
|
|
95
|
-
const position = scrollRestorationManager.read(
|
|
96
|
+
if (!currentUrl || !isEnabled || !routeKey) return;
|
|
97
|
+
const position = scrollRestorationManager.read(routeKey);
|
|
96
98
|
if (!position || !isPanelAppScrollSnapshot(position.payload) || position.payload.currentUrl !== currentUrl) {
|
|
97
99
|
return;
|
|
98
100
|
}
|
|
@@ -103,5 +105,5 @@ export function usePanelAppScrollRestoration({
|
|
|
103
105
|
x: position.x,
|
|
104
106
|
y: position.y,
|
|
105
107
|
}, "*");
|
|
106
|
-
}, [currentUrl, iframeRef, isEnabled,
|
|
108
|
+
}, [currentUrl, iframeRef, isEnabled, routeKey]);
|
|
107
109
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { fireEvent, render } from "@testing-library/react";
|
|
2
|
-
import { beforeEach, describe, expect, it } from "vitest";
|
|
1
|
+
import { act, fireEvent, render } from "@testing-library/react";
|
|
2
|
+
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
3
|
import { useScrollRestoration } from "@/shared/hooks/use-scroll-restoration";
|
|
4
4
|
import { scrollRestorationManager } from "@/shared/lib/navigation-history";
|
|
5
5
|
|
|
@@ -60,3 +60,40 @@ describe("useScrollRestoration", () => {
|
|
|
60
60
|
expect(scrollRestorationManager.read("page:first")).toEqual({ x: 0, y: 144 });
|
|
61
61
|
});
|
|
62
62
|
});
|
|
63
|
+
|
|
64
|
+
it("retries delayed content, preserves hidden reading, and yields to explicit user scrolling", () => {
|
|
65
|
+
scrollRestorationManager.clear();
|
|
66
|
+
let notifyResize = () => {};
|
|
67
|
+
vi.stubGlobal("ResizeObserver", class { constructor(callback: () => void) { notifyResize = callback; } observe = () => {}; disconnect = () => {}; });
|
|
68
|
+
let height = 0;
|
|
69
|
+
let position = 0;
|
|
70
|
+
const descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, "scrollTop");
|
|
71
|
+
Object.defineProperty(HTMLElement.prototype, "scrollTop", { configurable: true, get: () => position, set: (value: number) => { position = Math.min(value, height); } });
|
|
72
|
+
try {
|
|
73
|
+
scrollRestorationManager.save("delayed", { x: 0, y: 400 });
|
|
74
|
+
const view = render(<ScrollSurface restorationKey="delayed" />);
|
|
75
|
+
const element = view.getByTestId("scroll-surface");
|
|
76
|
+
fireEvent.scroll(element);
|
|
77
|
+
expect(scrollRestorationManager.read("delayed")?.y).toBe(400);
|
|
78
|
+
height = 800;
|
|
79
|
+
act(() => notifyResize());
|
|
80
|
+
expect(element.scrollTop).toBe(400);
|
|
81
|
+
element.hidden = true;
|
|
82
|
+
element.scrollTop = 0;
|
|
83
|
+
fireEvent.scroll(element);
|
|
84
|
+
expect(scrollRestorationManager.read("delayed")?.y).toBe(400);
|
|
85
|
+
view.unmount();
|
|
86
|
+
|
|
87
|
+
height = 0;
|
|
88
|
+
const second = render(<ScrollSurface restorationKey="delayed" />);
|
|
89
|
+
fireEvent.wheel(second.getByTestId("scroll-surface"));
|
|
90
|
+
height = 800;
|
|
91
|
+
act(() => notifyResize());
|
|
92
|
+
expect(second.getByTestId("scroll-surface").scrollTop).toBe(0);
|
|
93
|
+
second.unmount();
|
|
94
|
+
} finally {
|
|
95
|
+
if (descriptor) Object.defineProperty(HTMLElement.prototype, "scrollTop", descriptor);
|
|
96
|
+
else Reflect.deleteProperty(HTMLElement.prototype, "scrollTop");
|
|
97
|
+
vi.unstubAllGlobals();
|
|
98
|
+
}
|
|
99
|
+
});
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { useCallback, useLayoutEffect, useRef, type RefObject, type UIEvent } from
|
|
2
|
-
import {
|
|
3
|
-
scrollRestorationManager,
|
|
4
|
-
type ScrollRestorationPosition,
|
|
5
|
-
} from "@/shared/lib/navigation-history";
|
|
1
|
+
import { useCallback, useLayoutEffect, useRef, type RefObject, type UIEvent } from 'react';
|
|
2
|
+
import { scrollRestorationManager, type ScrollRestorationPosition } from '@/shared/lib/navigation-history';
|
|
6
3
|
|
|
7
4
|
type UseScrollRestorationParams<T extends HTMLElement> = {
|
|
8
5
|
restorationKey: string | null;
|
|
@@ -10,49 +7,52 @@ type UseScrollRestorationParams<T extends HTMLElement> = {
|
|
|
10
7
|
isEnabled?: boolean;
|
|
11
8
|
};
|
|
12
9
|
|
|
13
|
-
/**
|
|
14
|
-
export function useScrollRestoration<T extends HTMLElement>({
|
|
15
|
-
restorationKey,
|
|
16
|
-
scrollRef,
|
|
17
|
-
isEnabled = true,
|
|
18
|
-
}: UseScrollRestorationParams<T>) {
|
|
10
|
+
/** DOM bridge: retry after delayed layout, yield to user input, never save a loading-time zero. */
|
|
11
|
+
export function useScrollRestoration<T extends HTMLElement>({ restorationKey, scrollRef, isEnabled = true }: UseScrollRestorationParams<T>) {
|
|
19
12
|
const internalScrollRef = useRef<T>(null);
|
|
20
13
|
const lastKnownPositionRef = useRef<ScrollRestorationPosition | null>(null);
|
|
14
|
+
const pendingRef = useRef(false);
|
|
21
15
|
const resolvedScrollRef = scrollRef ?? internalScrollRef;
|
|
22
16
|
|
|
23
17
|
useLayoutEffect(() => {
|
|
24
18
|
if (!isEnabled || !restorationKey) return;
|
|
25
19
|
const element = resolvedScrollRef.current;
|
|
20
|
+
if (!element) return;
|
|
26
21
|
const position = scrollRestorationManager.read(restorationKey);
|
|
27
|
-
|
|
22
|
+
lastKnownPositionRef.current = position;
|
|
23
|
+
pendingRef.current = Boolean(position);
|
|
24
|
+
const restore = () => {
|
|
25
|
+
if (!pendingRef.current || !position) return;
|
|
28
26
|
element.scrollLeft = position.x;
|
|
29
27
|
element.scrollTop = position.y;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
if (Math.abs(element.scrollTop - position.y) < 1 && Math.abs(element.scrollLeft - position.x) < 1) pendingRef.current = false;
|
|
29
|
+
};
|
|
30
|
+
const takeOver = () => { pendingRef.current = false; };
|
|
31
|
+
restore();
|
|
32
|
+
const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(restore);
|
|
33
|
+
observer?.observe(element);
|
|
34
|
+
for (const child of element.children) observer?.observe(child);
|
|
35
|
+
const mutations = typeof MutationObserver === 'undefined' ? null : new MutationObserver(() => {
|
|
36
|
+
for (const child of element.children) observer?.observe(child);
|
|
37
|
+
restore();
|
|
38
|
+
});
|
|
39
|
+
mutations?.observe(element, { childList: true, subtree: true });
|
|
40
|
+
element.addEventListener('wheel', takeOver, { passive: true });
|
|
41
|
+
element.addEventListener('touchstart', takeOver, { passive: true });
|
|
42
|
+
element.addEventListener('pointerdown', takeOver);
|
|
43
|
+
element.addEventListener('keydown', takeOver);
|
|
38
44
|
return () => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
y: element.scrollTop,
|
|
45
|
-
},
|
|
46
|
-
);
|
|
45
|
+
observer?.disconnect(); mutations?.disconnect();
|
|
46
|
+
element.removeEventListener('wheel', takeOver); element.removeEventListener('touchstart', takeOver);
|
|
47
|
+
element.removeEventListener('pointerdown', takeOver); element.removeEventListener('keydown', takeOver);
|
|
48
|
+
if (lastKnownPositionRef.current) scrollRestorationManager.save(restorationKey, lastKnownPositionRef.current);
|
|
49
|
+
pendingRef.current = false;
|
|
47
50
|
};
|
|
48
51
|
}, [isEnabled, restorationKey, resolvedScrollRef]);
|
|
49
52
|
|
|
50
53
|
const onScroll = useCallback((event: UIEvent<T>) => {
|
|
51
|
-
if (!isEnabled || !restorationKey) return;
|
|
52
|
-
const position = {
|
|
53
|
-
x: event.currentTarget.scrollLeft,
|
|
54
|
-
y: event.currentTarget.scrollTop,
|
|
55
|
-
};
|
|
54
|
+
if (!isEnabled || !restorationKey || pendingRef.current || event.currentTarget.closest('[hidden]') !== null) return;
|
|
55
|
+
const position = { x: event.currentTarget.scrollLeft, y: event.currentTarget.scrollTop };
|
|
56
56
|
lastKnownPositionRef.current = position;
|
|
57
57
|
scrollRestorationManager.save(restorationKey, position);
|
|
58
58
|
}, [isEnabled, restorationKey]);
|
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
{
|
|
2
|
+
"pageLayoutActions": "Layout and position",
|
|
3
|
+
"pagePinLeft": "Pin to left sidebar",
|
|
4
|
+
"pageUnpinLeft": "Unpin from left sidebar",
|
|
5
|
+
"pageCopyUri": "Copy resource link",
|
|
6
|
+
"pageCopyFailed": "Could not copy the link. Please try again.",
|
|
7
|
+
"pageActions": "Page actions",
|
|
8
|
+
"pageSidebar": "Pages",
|
|
9
|
+
"resourcePageTitle": "Resource",
|
|
10
|
+
"resourceRetry": "Retry",
|
|
11
|
+
"resourceNotFound": "Resource deleted or not found",
|
|
12
|
+
"resourceInvalid": "Resource type is not registered or its URI is invalid",
|
|
13
|
+
"resourceLoadFailed": "Could not load this resource. Please retry",
|
|
14
|
+
"pageUnavailable": "Page unavailable or unsupported link",
|
|
15
|
+
"workbenchOpenMain": "Open in main area",
|
|
16
|
+
"workbenchDock": "Dock to sidebar",
|
|
17
|
+
"workbenchFloatGroup": "Float view group",
|
|
18
|
+
"workbenchExpand": "Expand view",
|
|
19
|
+
"workbenchCollapse": "Collapse view",
|
|
20
|
+
"workbenchRestoreSize": "Restore size",
|
|
21
|
+
"workbenchMaximize": "Maximize",
|
|
22
|
+
"workbenchCloseView": "Close view",
|
|
23
|
+
"workbenchHideGroup": "Hide view group",
|
|
24
|
+
"workbenchResize": "Resize sidebar",
|
|
25
|
+
"workbenchGlobalGroup": "Global workspace",
|
|
26
|
+
"workbenchSessionGroup": "Conversation workspace",
|
|
27
|
+
"workbenchMoveGlobal": "Move to global sidebar",
|
|
28
|
+
"workbenchFloatView": "Open in floating window",
|
|
29
|
+
"workbenchCloseTab": "Close tab",
|
|
30
|
+
"workbenchFileUnavailable": "This file view is unavailable. Reopen it from the original conversation.",
|
|
31
|
+
"chatSidebarCloseSearch": "Close search",
|
|
2
32
|
"chatPageTitle": "Agent Chat",
|
|
3
33
|
"chatPageDescription": "Chat with your agent directly in UI with multi-session and multi-agent switching.",
|
|
4
34
|
"chatRefresh": "Refresh",
|
|
@@ -252,7 +282,12 @@
|
|
|
252
282
|
"chatHistoryLoadFailed": "Couldn’t load earlier messages",
|
|
253
283
|
"chatHistoryRetry": "Retry",
|
|
254
284
|
"chatProcessSummaryProcessed": "Processed",
|
|
255
|
-
"
|
|
285
|
+
"chatProcessSummaryError": "Failed",
|
|
286
|
+
"chatProcessSummaryStopped": "Stopped",
|
|
287
|
+
"chatProcessDurationHoursMinutes": "{hours}h {minutes}m",
|
|
288
|
+
"chatProcessDurationHours": "{hours}h",
|
|
289
|
+
"chatProcessDurationMinutesSeconds": "{minutes}m {seconds}s",
|
|
290
|
+
"chatProcessDurationSeconds": "{seconds}s",
|
|
256
291
|
"chatToolPayloadLoading": "Loading details",
|
|
257
292
|
"chatToolPayloadLoadFailed": "Couldn’t load details. Try again",
|
|
258
293
|
"chatToolActivityShowMore": "Show next {count} ({remaining} remaining)",
|
|
@@ -610,6 +645,15 @@
|
|
|
610
645
|
"chatBackgroundReplyFallbackTitle": "New reply",
|
|
611
646
|
"chatBackgroundReplyFallbackPreview": "A reply is ready. Open the session to view it.",
|
|
612
647
|
"chatBackgroundReplyOpenAriaLabel": "Open the new reply in {title}",
|
|
648
|
+
"chatFloatingExpand": "Chat in a floating window",
|
|
649
|
+
"chatFloatingConversation": "Floating conversation",
|
|
650
|
+
"chatFloatingMinimize": "Minimize conversation",
|
|
651
|
+
"chatFloatingRestore": "Restore conversation",
|
|
652
|
+
"chatFloatingOpenMain": "Open in main view",
|
|
653
|
+
"chatFloatingClose": "Close floating conversation",
|
|
654
|
+
"chatPanelDock": "Dock to right sidebar",
|
|
655
|
+
"chatPanelOpen": "Chat in right sidebar",
|
|
656
|
+
"chatPanelUnavailable": "This conversation cannot be opened. Open it again from the conversation list.",
|
|
613
657
|
"chatWelcomeTitle": "What would you like to get done?",
|
|
614
658
|
"chatWelcomeContextLabel": "Task context",
|
|
615
659
|
"chatWelcomeProjectPickerLabel": "Choose working directory",
|
|
@@ -654,6 +698,7 @@
|
|
|
654
698
|
"chatInputVoiceNoDevice": "No microphone was detected. Connect or enable an input device, then check again.",
|
|
655
699
|
"chatInputVoiceDeviceBusy": "The microphone cannot be read. Another app or a system restriction may be preventing access. Close other recording apps, check your input device and retry.",
|
|
656
700
|
"chatInputVoiceServiceDenied": "The browser denied access to speech recognition. Check its speech service settings or organization policy, or use a browser that supports speech recognition.",
|
|
701
|
+
"chatInputVoiceInsecureContext": "This page is using an insecure HTTP address, so the browser disables microphone access. Configure HTTPS for a VPS; localhost or 127.0.0.1 is available only for access from the same machine.",
|
|
657
702
|
"chatInputVoiceUnsupported": "Speech input is not supported in this browser.",
|
|
658
703
|
"chatInputVoiceNoSpeech": "Could not hear you. Please try again.",
|
|
659
704
|
"chatInputVoiceFailed": "Voice input failed. Please try again.",
|