@opengeni/react 4.2.1-canary.39642758903001 → 4.3.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/dist/app/app-state.js +27 -27
- package/dist/app/components/Composer.js +27 -26
- package/dist/app/components/agent/agent-capability-picker.js +5 -5
- package/dist/app/components/artifacts/artifact-library.js +19 -19
- package/dist/app/components/artifacts/chat-interactive-block.js +16 -16
- package/dist/app/components/artifacts/inline-chat-image.js +31 -30
- package/dist/app/components/artifacts/retained-file-preview.js +35 -34
- package/dist/app/components/artifacts/retained-text-preview.js +5 -5
- package/dist/app/components/artifacts/site-audience.js +5 -5
- package/dist/app/components/artifacts/site-conversations.js +24 -22
- package/dist/app/components/artifacts/site-data.js +20 -20
- package/dist/app/components/artifacts/site-publishing.js +39 -39
- package/dist/app/components/artifacts/site-settings.js +48 -48
- package/dist/app/components/billing-class-mark.js +5 -5
- package/dist/app/components/capabilities/capability-detail-sheet.js +9 -9
- package/dist/app/components/capabilities/capability-logo-source.js +13 -12
- package/dist/app/components/capabilities/connection-account-picker.js +2 -2
- package/dist/app/components/capabilities/connector-tool-permissions.js +5 -5
- package/dist/app/components/capabilities/native-connect-setup.js +14 -13
- package/dist/app/components/capabilities/native-connect-setup.js.map +1 -1
- package/dist/app/components/capabilities/perform-capability-action.js +3 -3
- package/dist/app/components/capabilities/prepared-mcp-setup-card.js +15 -14
- package/dist/app/components/capabilities/session-capability-card.js +78 -77
- package/dist/app/components/capabilities/session-capability-card.js.map +1 -1
- package/dist/app/components/capabilities/session-custom-mcp-card.js +20 -19
- package/dist/app/components/capabilities/session-github-card.js +25 -24
- package/dist/app/components/capabilities/session-machine-card.js +38 -38
- package/dist/app/components/capabilities/use-capabilities-catalog.js +3 -3
- package/dist/app/components/capabilities/use-connection-accounts.js +1 -1
- package/dist/app/components/command-menu/chat-switcher.d.ts +12 -0
- package/dist/app/components/command-menu/chat-switcher.js +142 -0
- package/dist/app/components/command-menu/chat-switcher.js.map +1 -0
- package/dist/app/components/command-menu/command-menu.d.ts +15 -0
- package/dist/app/components/command-menu/command-menu.js +812 -0
- package/dist/app/components/command-menu/command-menu.js.map +1 -0
- package/dist/app/components/command-menu/keycaps.d.ts +21 -0
- package/dist/app/components/command-menu/keycaps.js +12 -0
- package/dist/app/components/command-menu/shortcut-sheet.d.ts +12 -0
- package/dist/app/components/command-menu/shortcut-sheet.js +150 -0
- package/dist/app/components/command-menu/shortcut-sheet.js.map +1 -0
- package/dist/app/components/composer-capabilities-menu-body.js +3 -3
- package/dist/app/components/composer-mobile-plus-panel.js +21 -21
- package/dist/app/components/composer-mobile-plus.js +3 -3
- package/dist/app/components/credit-required-gate.js +1 -1
- package/dist/app/components/credit-required-prompt.js +16 -16
- package/dist/app/components/credits/coupon-redeem.js +2 -2
- package/dist/app/components/credits/credit-refusal-notice.d.ts +18 -0
- package/dist/app/components/credits/credit-refusal-notice.js +17 -0
- package/dist/app/components/cross-slot-deep-link-recovery.js +1 -1
- package/dist/app/components/desktop/app-shots.js +6 -6
- package/dist/app/components/desktop/this-computer.js +4 -4
- package/dist/app/components/feedback.js +5 -5
- package/dist/app/components/follow-up-repository-menu-body.js +7 -7
- package/dist/app/components/follow-up-repository-picker.js +3 -3
- package/dist/app/components/github-app-connect-launcher.js +1 -1
- package/dist/app/components/knowledge/agent-learning-settings.js +6 -6
- package/dist/app/components/machines/connect-machine-dialog.js +18 -18
- package/dist/app/components/manual-repository-editor.js +2 -2
- package/dist/app/components/markdown.js +10 -9
- package/dist/app/components/message-context-pills.js +2 -2
- package/dist/app/components/models/models-ui.js +10 -10
- package/dist/app/components/pickers.js +10 -10
- package/dist/app/components/rail/rail-context.d.ts +6 -0
- package/dist/app/components/rail/rail-context.js +3 -3
- package/dist/app/components/rail/rail-sections.js +61 -55
- package/dist/app/components/rail/session-browse-order-controls.js +2 -2
- package/dist/app/components/rail/session-header.js +50 -36
- package/dist/app/components/rail/session-list.js +59 -52
- package/dist/app/components/rail/session-row-hover-details.js +25 -23
- package/dist/app/components/rail/session-shell.js +96 -91
- package/dist/app/components/repository-picker.js +7 -7
- package/dist/app/components/secrets/session-secrets-panel.js +4 -4
- package/dist/app/components/session/agent-configuration-panel.js +34 -34
- package/dist/app/components/session/banners.js +12 -11
- package/dist/app/components/session/codex-account-indicator.js +12 -12
- package/dist/app/components/session/composer-menu-radio.js +2 -2
- package/dist/app/components/session/conversation-find.js +1 -1
- package/dist/app/components/session/editable-artifacts-workspace.js +45 -45
- package/dist/app/components/session/failed-session-banner.js +12 -12
- package/dist/app/components/session/human-input.js +48 -47
- package/dist/app/components/session/inspector.js +80 -79
- package/dist/app/components/session/inspector.js.map +1 -1
- package/dist/app/components/session/message-actions.js +5 -5
- package/dist/app/components/session/message-resource-attachments.js +21 -20
- package/dist/app/components/session/message-resource-attachments.js.map +1 -1
- package/dist/app/components/session/model-account-indicator.js +11 -11
- package/dist/app/components/session/model-context-inspector.js +2 -2
- package/dist/app/components/session/model-recovery-notice.js +3 -3
- package/dist/app/components/session/new-session-settings-menu.js +13 -13
- package/dist/app/components/session/sandbox-switcher.js +16 -16
- package/dist/app/components/session/sandbox-workspace.js +68 -67
- package/dist/app/components/session/search-markdown-highlight.js +11 -10
- package/dist/app/components/session/search-results-view.js +12 -11
- package/dist/app/components/session/session-admin-access.js +11 -11
- package/dist/app/components/session/session-retention.js +4 -4
- package/dist/app/components/session/session-search-dialog.d.ts +5 -0
- package/dist/app/components/session/session-search-dialog.js +22 -12
- package/dist/app/components/session/session-search-dialog.js.map +1 -1
- package/dist/app/components/session/session-skill-reviews.js +3 -3
- package/dist/app/components/session/session-tenancy-control.js +25 -25
- package/dist/app/components/session/session-usage-limit-section.js +9 -9
- package/dist/app/components/session/session-wait-status.js +11 -9
- package/dist/app/components/session/session-wait-status.js.map +1 -1
- package/dist/app/components/session/subagents.js +17 -15
- package/dist/app/components/session/subscription-account-menu.js +2 -2
- package/dist/app/components/session-connectors-menu-body.js +6 -6
- package/dist/app/components/settings/row-select.js +1 -1
- package/dist/app/components/transcription-settings.js +2 -2
- package/dist/app/components/ui/destructive-confirm.js +8 -8
- package/dist/app/components/usage/usage-entry.js +6 -6
- package/dist/app/components/workspace-composer-plus.js +22 -21
- package/dist/app/embed/session-app.js +264 -258
- package/dist/app/lib/actions/actions-provider.d.ts +30 -0
- package/dist/app/lib/actions/actions-provider.js +32 -0
- package/dist/app/lib/actions/chat-directory.d.ts +30 -0
- package/dist/app/lib/actions/chat-operations.d.ts +11 -0
- package/dist/app/lib/actions/chat-switcher.d.ts +31 -0
- package/dist/app/lib/actions/chords.d.ts +40 -0
- package/dist/app/lib/actions/events.d.ts +6 -0
- package/dist/app/lib/actions/rank.d.ts +17 -0
- package/dist/app/lib/actions/registry.d.ts +71 -0
- package/dist/app/lib/codex-usage-query.js +3 -3
- package/dist/app/lib/composer-connectors.js +14 -13
- package/dist/app/lib/console-text.js +2 -2
- package/dist/app/lib/credit-coverage.d.ts +21 -0
- package/dist/app/lib/credit-coverage.js +15 -0
- package/dist/app/lib/deployment-free-model.js +2 -2
- package/dist/app/lib/events.js +19 -18
- package/dist/app/lib/failed-session-copy.js +5 -5
- package/dist/app/lib/free-credit-gap.d.ts +9 -0
- package/dist/app/lib/free-credit-gap.js +4 -2
- package/dist/app/lib/integration-connect-analytics.d.ts +1 -1
- package/dist/app/lib/integration-connect-analytics.js +1 -1
- package/dist/app/lib/integration-connect-redirect.js +1 -1
- package/dist/app/lib/model-access-onboarding.js +4 -4
- package/dist/app/lib/model-policy.js +1 -1
- package/dist/app/lib/models-route.d.ts +6 -2
- package/dist/app/lib/models-route.js +6 -3
- package/dist/app/lib/models-route.js.map +1 -1
- package/dist/app/lib/move-chat-to-machine.js +3 -3
- package/dist/app/lib/session-branch-cache.js +15 -13
- package/dist/app/lib/session-create.js +2 -2
- package/dist/app/lib/session-group-pagination.js +15 -13
- package/dist/app/lib/session-hover-facts.js +16 -14
- package/dist/app/lib/session-model.js +3 -3
- package/dist/app/lib/session-rail.js +11 -9
- package/dist/app/lib/session-rename.js +3 -3
- package/dist/app/lib/session-search-route.d.ts +1 -1
- package/dist/app/lib/session-search-route.js +1 -1
- package/dist/app/lib/session-ui-features.d.ts +11 -3
- package/dist/app/lib/session-ui-features.js +1 -1
- package/dist/app/lib/sessions-group.js +15 -13
- package/dist/app/lib/turn-failure-analytics.js +7 -7
- package/dist/app/lib/unavailable-session-model.js +2 -2
- package/dist/app/lib/use-duplicate-site.js +2 -2
- package/dist/app/lib/use-follow-up-repositories.js +3 -3
- package/dist/app/lib/use-workspace-machines.js +8 -8
- package/dist/app/lib/use-workspace-model-catalog.js +6 -6
- package/dist/app/lib/use-workspace-rigs.js +4 -4
- package/dist/app/lib/workspace-navigation-preference.js +5 -5
- package/dist/app/lib/workspace-scope-context.js +4 -4
- package/dist/app/routes/artifacts.js +124 -122
- package/dist/app/routes/artifacts.js.map +1 -1
- package/dist/app/routes/retained-artifact.js +69 -68
- package/dist/app/routes/retained-artifact.js.map +1 -1
- package/dist/app/routes/session-unavailable.js +3 -3
- package/dist/app/routes/session.js +168 -166
- package/dist/app/routes/sessions-index-hydration.js +3 -3
- package/dist/app/routes/sessions-index.js +122 -116
- package/dist/artifacts-document.js +4 -4
- package/dist/artifacts-presentation.js +4 -4
- package/dist/artifacts-spreadsheet.js +4 -4
- package/dist/artifacts.js +39 -39
- package/dist/{browser-viewer-ZRFZX3VN.js → browser-viewer-HPUMK7UP.js} +7 -7
- package/dist/{chat-interactive-block-HUMYWVCK.js → chat-interactive-block-22PPECCT.js} +6 -6
- package/dist/{chunk-GVIQ7H62.js → chunk-2LUBBDZV.js} +5 -5
- package/dist/{chunk-SWWYYGQO.js → chunk-325C2TCI.js} +5 -2
- package/dist/chunk-325C2TCI.js.map +1 -0
- package/dist/{chunk-XMMVIY7B.js → chunk-3CCJWHQY.js} +2 -2
- package/dist/{chunk-XS2FZ6DX.js → chunk-3F5ZPIWI.js} +2 -2
- package/dist/{chunk-72US6QNB.js → chunk-3J2YZRY5.js} +2 -2
- package/dist/{chunk-D4YQF4E3.js → chunk-3SMJ2BIQ.js} +2 -2
- package/dist/{chunk-TBJINQXA.js → chunk-3WCYK36X.js} +17 -17
- package/dist/{chunk-WPCF34V6.js → chunk-3WG3CRL7.js} +14 -14
- package/dist/{chunk-JI5BYQKO.js → chunk-3X46PNBX.js} +14 -14
- package/dist/{chunk-UO36FC3S.js → chunk-46I7MMAL.js} +6 -2
- package/dist/chunk-46I7MMAL.js.map +1 -0
- package/dist/{chunk-PBK44WJC.js → chunk-4GJ37O6G.js} +2 -2
- package/dist/chunk-4IWBQUQU.js +152 -0
- package/dist/chunk-4IWBQUQU.js.map +1 -0
- package/dist/{chunk-LEXPBQ56.js → chunk-4SKJX3C4.js} +6 -6
- package/dist/{chunk-ZA6YD2LW.js → chunk-57SYK776.js} +2 -2
- package/dist/{chunk-22LBKJDE.js → chunk-5DIAN5GQ.js} +12 -12
- package/dist/{chunk-LJ3TDK2L.js → chunk-5FA455GR.js} +4 -4
- package/dist/{chunk-N2BEUKXT.js → chunk-5FBZDEHE.js} +228 -228
- package/dist/chunk-5FBZDEHE.js.map +1 -0
- package/dist/{chunk-YPR5INHV.js → chunk-5X3E2Z3D.js} +4 -4
- package/dist/{chunk-OXNWZTEU.js → chunk-5ZJCL6X4.js} +5 -5
- package/dist/{chunk-62OAZ4LO.js → chunk-6C5GQQMC.js} +12 -12
- package/dist/{chunk-VGITH57T.js → chunk-6ERTXDZM.js} +4 -4
- package/dist/{chunk-ZQ7XQZCF.js → chunk-6FX73Y4I.js} +8 -8
- package/dist/{chunk-QZO2KK2F.js → chunk-6P44NG6Y.js} +2 -2
- package/dist/{chunk-N2DDJLTM.js → chunk-6T7Y33JA.js} +3 -3
- package/dist/{chunk-RBAGC2MJ.js → chunk-75VE5QUS.js} +22 -22
- package/dist/{chunk-MRXOGI3O.js → chunk-77CUDSHG.js} +9 -9
- package/dist/{chunk-F2GXK2Z6.js → chunk-7G446JFO.js} +431 -348
- package/dist/chunk-7G446JFO.js.map +1 -0
- package/dist/{chunk-GZ65XQR5.js → chunk-7T7FHSGS.js} +3 -3
- package/dist/{chunk-YGAH34CD.js → chunk-A3S26JSP.js} +8 -8
- package/dist/{chunk-GYPAO6RS.js → chunk-A664GSDM.js} +8 -8
- package/dist/{chunk-JSZSNMDR.js → chunk-ASUYLXKO.js} +2 -2
- package/dist/{chunk-RTK7SUPL.js → chunk-AUUJLVA3.js} +7 -7
- package/dist/{chunk-OOTBYSCA.js → chunk-BBWKPNJB.js} +5 -5
- package/dist/{chunk-BGZIMIUU.js → chunk-BCUYWOQU.js} +2 -2
- package/dist/{chunk-EKN4N4LS.js → chunk-BDFMNJZJ.js} +2 -2
- package/dist/{chunk-YZKGOWCC.js → chunk-BIDXQAGO.js} +2 -2
- package/dist/{chunk-Q2UUANHF.js → chunk-BIKAJ4DY.js} +5 -5
- package/dist/{chunk-5IQBF2X3.js → chunk-BJPJ2OUX.js} +3 -3
- package/dist/{chunk-EY2EMHZW.js → chunk-BPM2OTYK.js} +8 -8
- package/dist/{chunk-MT4TBRQB.js → chunk-BSWS2RUZ.js} +2 -2
- package/dist/{chunk-T7YD3VGK.js → chunk-C52MNKXU.js} +12 -12
- package/dist/{chunk-THNW33K7.js → chunk-CEUDV4OA.js} +18 -18
- package/dist/{chunk-GRLPRM56.js → chunk-CFEFYPNR.js} +8 -2
- package/dist/chunk-CFEFYPNR.js.map +1 -0
- package/dist/{chunk-LHGIS6SZ.js → chunk-CVK74BH7.js} +2 -2
- package/dist/{chunk-DFO2UCYG.js → chunk-CW5I65ZX.js} +11 -11
- package/dist/chunk-DKNTQDVL.js +86 -0
- package/dist/chunk-DKNTQDVL.js.map +1 -0
- package/dist/{chunk-SKRLKQEG.js → chunk-DOSC2HRQ.js} +79 -79
- package/dist/{chunk-KVB6XDLP.js → chunk-DPJ2CWVN.js} +2 -2
- package/dist/{chunk-4J6V4DH7.js → chunk-DXMRO2MU.js} +3 -3
- package/dist/{chunk-42I4O4WQ.js → chunk-EE55IDDR.js} +26 -26
- package/dist/{chunk-2RA6XABP.js → chunk-EEERTLFF.js} +12 -12
- package/dist/{chunk-PTOTKUKO.js → chunk-EEO744XR.js} +8 -8
- package/dist/{chunk-LD3HVI2J.js → chunk-EMFGBAQL.js} +6 -6
- package/dist/{chunk-FQGUK4ST.js → chunk-ENPJKVMN.js} +38 -38
- package/dist/{chunk-HDHK3SXK.js → chunk-EU6RLHMP.js} +4 -4
- package/dist/{chunk-G7VLL3PG.js → chunk-F2YABPRJ.js} +13 -4
- package/dist/chunk-F2YABPRJ.js.map +1 -0
- package/dist/{chunk-MRUWRQBX.js → chunk-FET6XHGS.js} +2 -2
- package/dist/{chunk-M6KUY3YH.js → chunk-FIICQA55.js} +2 -2
- package/dist/{chunk-NLWLCYCT.js → chunk-FTZXCPE3.js} +19 -19
- package/dist/{chunk-FN2KA3MJ.js → chunk-FUS76DO4.js} +3 -3
- package/dist/{chunk-AM4IIPWI.js → chunk-G7N5NPRJ.js} +2 -2
- package/dist/{chunk-CCQ7YKOD.js → chunk-GBYZ6653.js} +2 -2
- package/dist/{chunk-SOOWLNC5.js → chunk-GJUPLSC5.js} +330 -109
- package/dist/chunk-GJUPLSC5.js.map +1 -0
- package/dist/{chunk-YKKVIJVX.js → chunk-GQDSC6QZ.js} +5 -5
- package/dist/chunk-GQGNRL2L.js +53 -0
- package/dist/chunk-GQGNRL2L.js.map +1 -0
- package/dist/{chunk-5X6JP75Q.js → chunk-GRSODLVO.js} +4 -4
- package/dist/{chunk-73YP3R5X.js → chunk-GSESCQFY.js} +4 -4
- package/dist/{chunk-KWB5U3ZT.js → chunk-GWRW4N3T.js} +199 -137
- package/dist/chunk-GWRW4N3T.js.map +1 -0
- package/dist/{chunk-RTR7RNG4.js → chunk-GYRU4PNM.js} +9 -7
- package/dist/{chunk-RTR7RNG4.js.map → chunk-GYRU4PNM.js.map} +1 -1
- package/dist/{chunk-MZLEBFUZ.js → chunk-GZD6VBIK.js} +3 -3
- package/dist/{chunk-IZR2QRFF.js → chunk-H3HH5AHS.js} +4 -4
- package/dist/{chunk-DN3TKURW.js → chunk-H3LIIAGE.js} +4 -54
- package/dist/chunk-H3LIIAGE.js.map +1 -0
- package/dist/{chunk-NPLEQMNM.js → chunk-H5GWAG4I.js} +7 -5
- package/dist/{chunk-NPLEQMNM.js.map → chunk-H5GWAG4I.js.map} +1 -1
- package/dist/{chunk-OJPUVUB6.js → chunk-HAOZCLLA.js} +3 -3
- package/dist/{chunk-ZBHDGAYL.js → chunk-HEFE4OZJ.js} +2 -2
- package/dist/{chunk-WTG34JVA.js → chunk-HI75UTI6.js} +2 -2
- package/dist/{chunk-OMBIG3NC.js → chunk-HM633ROV.js} +14 -14
- package/dist/{chunk-WDFZWSKD.js → chunk-HRIP4M6H.js} +3 -3
- package/dist/{chunk-A2BCW6CQ.js → chunk-HU2DRFFI.js} +3 -3
- package/dist/{chunk-PO35PBAB.js → chunk-HVH7FFJH.js} +2 -2
- package/dist/{chunk-EG7KNUF7.js → chunk-HYTXTKST.js} +18 -18
- package/dist/{chunk-TFHG75A4.js → chunk-I4XMDFUJ.js} +7 -7
- package/dist/{chunk-IZHVZZQA.js → chunk-ICAUYWSL.js} +9 -9
- package/dist/{chunk-ZSERYHHT.js → chunk-IDMXEPHL.js} +150 -150
- package/dist/chunk-IDMXEPHL.js.map +1 -0
- package/dist/{chunk-DCLPWYP3.js → chunk-IEVPJ3G6.js} +2 -2
- package/dist/{chunk-EVWZHDSF.js → chunk-IKH3VTA4.js} +2 -2
- package/dist/{chunk-L5UCO2UV.js → chunk-ILBSBZGC.js} +13 -4
- package/dist/chunk-ILBSBZGC.js.map +1 -0
- package/dist/{chunk-IO6K6UYJ.js → chunk-IQ64BNAG.js} +4 -2
- package/dist/chunk-IQ64BNAG.js.map +1 -0
- package/dist/{chunk-TYHLEFD2.js → chunk-IZJNMRIR.js} +9 -9
- package/dist/{chunk-D2SR3TEB.js → chunk-J243WGUA.js} +2 -2
- package/dist/{chunk-QGSGIYE3.js → chunk-J2C6LB6W.js} +4 -4
- package/dist/{chunk-MT6TRTXF.js → chunk-J5MEDX7C.js} +9 -9
- package/dist/{chunk-6QHUKBJP.js → chunk-J7SKOO44.js} +2 -2
- package/dist/{chunk-W2QK7PYS.js → chunk-JAAST75A.js} +11 -11
- package/dist/{chunk-NQCMS4AJ.js → chunk-JQCGPTZ6.js} +9 -9
- package/dist/chunk-JRJUSKDY.js +832 -0
- package/dist/chunk-JRJUSKDY.js.map +1 -0
- package/dist/{chunk-CMUXJHGH.js → chunk-JRSCWQMC.js} +9 -9
- package/dist/{chunk-Q4OHNGGB.js → chunk-JRXHSVD5.js} +4 -4
- package/dist/{chunk-SD2K5ZN5.js → chunk-JXYLDT6X.js} +4 -4
- package/dist/{chunk-S3M5WCZW.js → chunk-KA4LV7G6.js} +35 -50
- package/dist/chunk-KA4LV7G6.js.map +1 -0
- package/dist/{chunk-IXX6ZOL2.js → chunk-KGTMHEAP.js} +7 -7
- package/dist/{chunk-22OBGVEJ.js → chunk-KOXVGPW4.js} +3 -3
- package/dist/{chunk-NOZ5CGZE.js → chunk-L5GPPMUB.js} +2 -2
- package/dist/{chunk-KIHYJM5F.js → chunk-LXJT4WAW.js} +58 -58
- package/dist/{chunk-KIHYJM5F.js.map → chunk-LXJT4WAW.js.map} +1 -1
- package/dist/{chunk-4FOOHMTU.js → chunk-LY6727IF.js} +1 -1
- package/dist/{chunk-PT7MTXRE.js → chunk-MAOCN7J6.js} +2 -2
- package/dist/{chunk-4K2JSJNX.js → chunk-MB5LZVDO.js} +2 -2
- package/dist/chunk-MF464AKA.js +139 -0
- package/dist/chunk-MF464AKA.js.map +1 -0
- package/dist/{chunk-UYSZKDQY.js → chunk-MK54JLE4.js} +1 -1
- package/dist/chunk-MK54JLE4.js.map +1 -0
- package/dist/{chunk-5LES64PP.js → chunk-MKOQAVOE.js} +21 -21
- package/dist/{chunk-BMV2SNYX.js → chunk-MUPWNSEJ.js} +18 -18
- package/dist/{chunk-Y5TRG22C.js → chunk-NRXIECWC.js} +2 -2
- package/dist/{chunk-GOE7G5JX.js → chunk-NWSAF6P5.js} +2 -2
- package/dist/chunk-OB3YGXHQ.js +158 -0
- package/dist/chunk-OB3YGXHQ.js.map +1 -0
- package/dist/{chunk-DUM363VS.js → chunk-OFZQJNF6.js} +5 -5
- package/dist/{chunk-CKN5QPEL.js → chunk-OMF7POEY.js} +2 -2
- package/dist/{chunk-MVXKO2BD.js → chunk-OXD6ET34.js} +1 -1
- package/dist/{chunk-47JUEVME.js → chunk-PALX6HWV.js} +21 -21
- package/dist/{chunk-B6OGSG7I.js → chunk-PE3BLBDT.js} +3 -3
- package/dist/{chunk-RVISSNVE.js → chunk-PMZKJOG6.js} +15 -15
- package/dist/{chunk-CESAMXWX.js → chunk-PQUTMG3S.js} +2 -2
- package/dist/{chunk-7VFCOKPG.js → chunk-PWBGODZU.js} +3 -3
- package/dist/{chunk-MOPAXD2H.js → chunk-QCADUTYX.js} +2 -2
- package/dist/{chunk-CT5FBO7E.js → chunk-RPOUJI25.js} +1 -1
- package/dist/{chunk-VE3FKXJ7.js → chunk-RUSXEE7X.js} +35 -32
- package/dist/chunk-RUSXEE7X.js.map +1 -0
- package/dist/{chunk-WKHYOS72.js → chunk-RW4GFE56.js} +3 -3
- package/dist/{chunk-FH4GO7HO.js → chunk-RYLVVDR7.js} +1 -1
- package/dist/{chunk-QZRDCFHI.js → chunk-S66SBBFQ.js} +5 -5
- package/dist/{chunk-CQJFIPAH.js → chunk-S7TNV2I7.js} +14 -14
- package/dist/{chunk-ZBQSIGGR.js → chunk-SC773IMJ.js} +13 -13
- package/dist/{chunk-RZV7SXED.js → chunk-SF3M27AN.js} +37 -12
- package/dist/chunk-SF3M27AN.js.map +1 -0
- package/dist/{chunk-FBJ2HK7A.js → chunk-SGPJ3YS2.js} +20 -20
- package/dist/{chunk-A2EWJQXX.js → chunk-SM5QX6UK.js} +4 -4
- package/dist/chunk-SWCLN6JE.js +40 -0
- package/dist/chunk-SWCLN6JE.js.map +1 -0
- package/dist/{chunk-OS3EQOIS.js → chunk-T4F5TW2X.js} +29 -24
- package/dist/chunk-T4F5TW2X.js.map +1 -0
- package/dist/{chunk-RKZWCTXV.js → chunk-TAEKDMEF.js} +2 -2
- package/dist/{chunk-6AVCAUGL.js → chunk-TASEV25T.js} +3 -3
- package/dist/{chunk-3XOISKZC.js → chunk-TLGDPMUX.js} +6 -6
- package/dist/{chunk-MOF3XSUM.js → chunk-TREHTIBD.js} +3 -2
- package/dist/chunk-TREHTIBD.js.map +1 -0
- package/dist/{chunk-HUQHJSPV.js → chunk-TTPXGD5S.js} +68 -33
- package/dist/chunk-TTPXGD5S.js.map +1 -0
- package/dist/{chunk-NFCYIZHX.js → chunk-TXIIBNCA.js} +7 -3
- package/dist/{chunk-NFCYIZHX.js.map → chunk-TXIIBNCA.js.map} +1 -1
- package/dist/{chunk-5IUW34PG.js → chunk-TY3QYPJ6.js} +7 -7
- package/dist/{chunk-VQFR4EU4.js → chunk-U3JK5VJV.js} +2 -2
- package/dist/{chunk-2AWMJO54.js → chunk-U42P3RMZ.js} +5 -5
- package/dist/{chunk-2RIUMV7S.js → chunk-UBIJBLUK.js} +234 -234
- package/dist/chunk-UBIJBLUK.js.map +1 -0
- package/dist/{chunk-GUU75DES.js → chunk-UEJTOPLW.js} +8 -8
- package/dist/{chunk-QWCTYLMD.js → chunk-URDONAEJ.js} +240 -204
- package/dist/chunk-URDONAEJ.js.map +1 -0
- package/dist/{chunk-OZOEWLGR.js → chunk-UT6JAORE.js} +4 -4
- package/dist/{chunk-5TELOQA6.js → chunk-UTHPUINA.js} +3 -3
- package/dist/{chunk-SOV7DTTU.js → chunk-V6HZ2HJZ.js} +67 -67
- package/dist/{chunk-SOV7DTTU.js.map → chunk-V6HZ2HJZ.js.map} +1 -1
- package/dist/{chunk-26RQ6JBR.js → chunk-VBVCNH6D.js} +5 -5
- package/dist/{chunk-P646DND6.js → chunk-VCMQPCME.js} +2 -2
- package/dist/{chunk-LV7FMIMM.js → chunk-VGUHAHHV.js} +2 -2
- package/dist/{chunk-GYVXARCY.js → chunk-VIBPFVU4.js} +41 -41
- package/dist/{chunk-KHPOKZ6Z.js → chunk-VMAC66JX.js} +6 -6
- package/dist/{chunk-SHKRS6I5.js → chunk-VRPNETPK.js} +3 -3
- package/dist/{chunk-6U4J6RVS.js → chunk-WCHW4XN7.js} +14 -14
- package/dist/{chunk-CJH6QUQJ.js → chunk-WD3UXNJV.js} +3 -3
- package/dist/{chunk-H5EVWF6L.js → chunk-WR67FJMX.js} +4 -4
- package/dist/{chunk-XLIJ36RG.js → chunk-WRMQ7EX4.js} +5 -5
- package/dist/{chunk-VVFWOBAM.js → chunk-WTJUKYB2.js} +15 -16
- package/dist/chunk-WTJUKYB2.js.map +1 -0
- package/dist/{chunk-7KLCFJ5G.js → chunk-X4PPGXQG.js} +2 -2
- package/dist/{chunk-ZE2JTVCQ.js → chunk-X5BMQXFD.js} +11 -11
- package/dist/{chunk-OYJY4Y4A.js → chunk-XFNLU7EW.js} +14 -7
- package/dist/chunk-XFNLU7EW.js.map +1 -0
- package/dist/{chunk-UECU6LZI.js → chunk-XXRBOSWV.js} +3 -3
- package/dist/{chunk-SPKAIDWX.js → chunk-XZEFCPBL.js} +2 -2
- package/dist/{chunk-EZ5NYRHK.js → chunk-YL6N7QLA.js} +5 -5
- package/dist/{chunk-Q2ZJOECN.js → chunk-YMVTIV5L.js} +19 -19
- package/dist/chunk-YMVTIV5L.js.map +1 -0
- package/dist/{chunk-VAIESMPY.js → chunk-YVBHGMKC.js} +4 -4
- package/dist/{chunk-AR62NQXE.js → chunk-Z2S5VQG7.js} +2 -2
- package/dist/{chunk-2MXUB3ZO.js → chunk-Z5OGTWMZ.js} +15 -2
- package/dist/chunk-Z5OGTWMZ.js.map +1 -0
- package/dist/{chunk-7UQJEADK.js → chunk-ZL2O4BYP.js} +2 -2
- package/dist/{chunk-FOOITLHR.js → chunk-ZZHBT5WQ.js} +2 -2
- package/dist/{chunk-X6VJQJYY.js → chunk-ZZWHKC6A.js} +3 -3
- package/dist/components/timeline-annotation-shared.d.ts +1 -9
- package/dist/composer-messages.js +2 -2
- package/dist/composer.js +15 -15
- package/dist/{computer-viewer-D4NHQB5D.js → computer-viewer-S6TE6TN7.js} +8 -8
- package/dist/connect.js +12 -11
- package/dist/desktop.js +2 -2
- package/dist/editor.js +2 -2
- package/dist/{embedded-new-voice-X4ZW6SY4.js → embedded-new-voice-ZDZPGX25.js} +8 -8
- package/dist/{embedded-voice-4OD6Z3HU.js → embedded-voice-FKCUXSJO.js} +8 -8
- package/dist/{fleet-decision-row-5UCJXTDP.js → fleet-decision-row-VCGWYJAV.js} +2 -2
- package/dist/hooks/page-wake.d.ts +21 -0
- package/dist/hooks/use-session-events.d.ts +1 -0
- package/dist/index.js +206 -205
- package/dist/interaction.js +9 -9
- package/dist/{latest-question-VGVNUGAU.js → latest-question-SINEV4U6.js} +3 -3
- package/dist/lib/format.d.ts +3 -2
- package/dist/machines.js +6 -6
- package/dist/messages/en.d.ts +12 -3
- package/dist/messages.js +1 -1
- package/dist/model-picker-model.js +2 -2
- package/dist/{model-policy-picker-menu-XOPYY6YA.js → model-policy-picker-menu-66JPM3G5.js} +6 -6
- package/dist/model-policy-picker-menu-66JPM3G5.js.map +1 -0
- package/dist/model-policy.js +1 -1
- package/dist/native-previews.js +3 -3
- package/dist/{platform-activity-row-56XOVTRA.js → platform-activity-row-LU5WABI2.js} +2 -2
- package/dist/{queue-surface-implementation-OZDOBJ6W.js → queue-surface-implementation-Y4OUVS7N.js} +8 -7
- package/dist/{queue-surface-implementation-OZDOBJ6W.js.map → queue-surface-implementation-Y4OUVS7N.js.map} +1 -1
- package/dist/realtime.js +7 -7
- package/dist/{sandbox-files-LJCR437H.js → sandbox-files-NBIVKVCZ.js} +11 -11
- package/dist/sandbox-files-NBIVKVCZ.js.map +1 -0
- package/dist/session-app.js +266 -260
- package/dist/session-list-model.js +3 -3
- package/dist/{session-realtime-UISLBZ4A.js → session-realtime-3PALSNMJ.js} +3 -3
- package/dist/session-realtime-3PALSNMJ.js.map +1 -0
- package/dist/session-realtime.js +2 -2
- package/dist/session-ui.js +62 -61
- package/dist/session.d.ts +1 -1
- package/dist/session.js +17 -17
- package/dist/sites.js +2 -2
- package/dist/terminal.js +2 -2
- package/dist/this-computer.js +3 -3
- package/dist/timeline/annotation-model.d.ts +48 -0
- package/dist/{timeline-annotation-markers-ACT7XRMW.js → timeline-annotation-markers-6526H2NM.js} +11 -9
- package/dist/{timeline-annotation-markers-ACT7XRMW.js.map → timeline-annotation-markers-6526H2NM.js.map} +1 -1
- package/dist/{timeline-annotation-selection-2IA7T5VR.js → timeline-annotation-selection-KV5SM6TA.js} +16 -62
- package/dist/timeline-annotation-selection-KV5SM6TA.js.map +1 -0
- package/dist/{timeline-annotations-dialog-W5B2HMYY.js → timeline-annotations-dialog-7CDHWC7Y.js} +12 -10
- package/dist/{timeline-annotations-dialog-W5B2HMYY.js.map → timeline-annotations-dialog-7CDHWC7Y.js.map} +1 -1
- package/dist/timeline-model.d.ts +3 -0
- package/dist/timeline-model.js +40 -14
- package/dist/ui/access-list.js +24 -24
- package/dist/ui/choice-cards.js +2 -2
- package/dist/ui/composer-menu-action.js +2 -2
- package/dist/ui/context-menu.d.ts +3 -1
- package/dist/ui/context-menu.js +3 -1
- package/dist/ui/detail-page.js +3 -3
- package/dist/ui/detail-sheet.js +3 -3
- package/dist/ui/diff-view.js +3 -3
- package/dist/ui/disclosure.js +5 -5
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/flush-form-page.js +5 -5
- package/dist/ui/form-dialog.js +4 -4
- package/dist/ui/list-row.js +5 -5
- package/dist/ui/load-failure.js +3 -3
- package/dist/ui/page-actions.js +3 -3
- package/dist/ui/revision-history.js +11 -11
- package/dist/ui/role-select.js +8 -8
- package/dist/ui/segmented-control.js +1 -1
- package/dist/ui/settings-nav.js +3 -3
- package/dist/ui/toolbar.js +3 -3
- package/dist/usage.js +2 -2
- package/dist/workbench.js +11 -11
- package/package.json +4 -4
- package/src/app/app-state.tsx +2 -1
- package/src/app/components/command-menu/chat-switcher.tsx +135 -0
- package/src/app/components/command-menu/command-menu.tsx +840 -0
- package/src/app/components/command-menu/keycaps.tsx +56 -0
- package/src/app/components/command-menu/shortcut-sheet.tsx +155 -0
- package/src/app/components/credits/credit-refusal-notice.test.tsx +132 -0
- package/src/app/components/credits/credit-refusal-notice.tsx +92 -0
- package/src/app/components/rail/rail-context.tsx +28 -5
- package/src/app/components/rail/rail-sections.tsx +3 -5
- package/src/app/components/rail/session-header-mute.test.tsx +23 -1
- package/src/app/components/rail/session-header.test.tsx +21 -2
- package/src/app/components/rail/session-header.tsx +31 -1
- package/src/app/components/rail/session-list.tsx +89 -16
- package/src/app/components/rail/session-shell.tsx +0 -14
- package/src/app/components/session/session-search-dialog.tsx +12 -1
- package/src/app/embed/session-app.tsx +6 -3
- package/src/app/lib/actions/actions-provider.tsx +486 -0
- package/src/app/lib/actions/actions.test.ts +249 -0
- package/src/app/lib/actions/chat-directory.ts +231 -0
- package/src/app/lib/actions/chat-operations.ts +145 -0
- package/src/app/lib/actions/chat-switcher.ts +62 -0
- package/src/app/lib/actions/chords.ts +185 -0
- package/src/app/lib/actions/events.ts +10 -0
- package/src/app/lib/actions/rank.ts +119 -0
- package/src/app/lib/actions/registry.ts +333 -0
- package/src/app/lib/credit-coverage.test.ts +83 -0
- package/src/app/lib/credit-coverage.tsx +48 -0
- package/src/app/lib/free-credit-gap.test.ts +32 -1
- package/src/app/lib/free-credit-gap.tsx +32 -2
- package/src/app/lib/integration-connect-analytics.test.ts +1 -0
- package/src/app/lib/integration-connect-analytics.tsx +4 -0
- package/src/app/lib/models-route.test.ts +18 -0
- package/src/app/lib/models-route.tsx +26 -4
- package/src/app/lib/session-search-route.tsx +6 -1
- package/src/app/lib/session-ui-features.tsx +28 -9
- package/src/app/routes/session.tsx +74 -16
- package/src/app/routes/sessions-index.tsx +83 -4
- package/src/components/timeline-annotation-selection.tsx +9 -64
- package/src/components/timeline-annotation-shared.ts +9 -57
- package/src/hooks/page-wake.ts +80 -0
- package/src/hooks/use-session-events.ts +309 -81
- package/src/lib/format.ts +3 -2
- package/src/messages/en.ts +13 -3
- package/src/model-picker-model.ts +3 -0
- package/src/model-policy.ts +9 -1
- package/src/session.ts +1 -0
- package/src/timeline/annotation-model.ts +217 -0
- package/src/timeline/projection.ts +27 -21
- package/src/timeline-model.ts +14 -0
- package/src/ui/context-menu.tsx +16 -0
- package/src/ui/dropdown-menu.tsx +4 -1
- package/src/ui/segmented-control.tsx +3 -0
- package/styles/compiled.css +92 -0
- package/dist/app/lib/keyboard-shortcuts.d.ts +0 -51
- package/dist/app/lib/keyboard-shortcuts.js +0 -16
- package/dist/chunk-2MXUB3ZO.js.map +0 -1
- package/dist/chunk-2RIUMV7S.js.map +0 -1
- package/dist/chunk-53IXIUYP.js +0 -39
- package/dist/chunk-53IXIUYP.js.map +0 -1
- package/dist/chunk-DN3TKURW.js.map +0 -1
- package/dist/chunk-F2GXK2Z6.js.map +0 -1
- package/dist/chunk-G7VLL3PG.js.map +0 -1
- package/dist/chunk-GRLPRM56.js.map +0 -1
- package/dist/chunk-HUQHJSPV.js.map +0 -1
- package/dist/chunk-IO6K6UYJ.js.map +0 -1
- package/dist/chunk-KWB5U3ZT.js.map +0 -1
- package/dist/chunk-L5UCO2UV.js.map +0 -1
- package/dist/chunk-MOF3XSUM.js.map +0 -1
- package/dist/chunk-N2BEUKXT.js.map +0 -1
- package/dist/chunk-OS3EQOIS.js.map +0 -1
- package/dist/chunk-OYJY4Y4A.js.map +0 -1
- package/dist/chunk-Q2ZJOECN.js.map +0 -1
- package/dist/chunk-QWCTYLMD.js.map +0 -1
- package/dist/chunk-RZV7SXED.js.map +0 -1
- package/dist/chunk-S3M5WCZW.js.map +0 -1
- package/dist/chunk-SOOWLNC5.js.map +0 -1
- package/dist/chunk-SWWYYGQO.js.map +0 -1
- package/dist/chunk-UO36FC3S.js.map +0 -1
- package/dist/chunk-UYSZKDQY.js.map +0 -1
- package/dist/chunk-VE3FKXJ7.js.map +0 -1
- package/dist/chunk-VVFWOBAM.js.map +0 -1
- package/dist/chunk-ZSERYHHT.js.map +0 -1
- package/dist/timeline-annotation-selection-2IA7T5VR.js.map +0 -1
- package/src/app/lib/keyboard-shortcuts.test.ts +0 -47
- package/src/app/lib/keyboard-shortcuts.tsx +0 -58
- /package/dist/app/{lib/keyboard-shortcuts.js.map → components/command-menu/keycaps.js.map} +0 -0
- /package/dist/{browser-viewer-ZRFZX3VN.js.map → app/components/credits/credit-refusal-notice.js.map} +0 -0
- /package/dist/{chat-interactive-block-HUMYWVCK.js.map → app/lib/actions/actions-provider.js.map} +0 -0
- /package/dist/{computer-viewer-D4NHQB5D.js.map → app/lib/credit-coverage.js.map} +0 -0
- /package/dist/{embedded-new-voice-X4ZW6SY4.js.map → browser-viewer-HPUMK7UP.js.map} +0 -0
- /package/dist/{embedded-voice-4OD6Z3HU.js.map → chat-interactive-block-22PPECCT.js.map} +0 -0
- /package/dist/{chunk-GVIQ7H62.js.map → chunk-2LUBBDZV.js.map} +0 -0
- /package/dist/{chunk-XMMVIY7B.js.map → chunk-3CCJWHQY.js.map} +0 -0
- /package/dist/{chunk-XS2FZ6DX.js.map → chunk-3F5ZPIWI.js.map} +0 -0
- /package/dist/{chunk-72US6QNB.js.map → chunk-3J2YZRY5.js.map} +0 -0
- /package/dist/{chunk-D4YQF4E3.js.map → chunk-3SMJ2BIQ.js.map} +0 -0
- /package/dist/{chunk-TBJINQXA.js.map → chunk-3WCYK36X.js.map} +0 -0
- /package/dist/{chunk-WPCF34V6.js.map → chunk-3WG3CRL7.js.map} +0 -0
- /package/dist/{chunk-JI5BYQKO.js.map → chunk-3X46PNBX.js.map} +0 -0
- /package/dist/{chunk-PBK44WJC.js.map → chunk-4GJ37O6G.js.map} +0 -0
- /package/dist/{chunk-LEXPBQ56.js.map → chunk-4SKJX3C4.js.map} +0 -0
- /package/dist/{chunk-ZA6YD2LW.js.map → chunk-57SYK776.js.map} +0 -0
- /package/dist/{chunk-22LBKJDE.js.map → chunk-5DIAN5GQ.js.map} +0 -0
- /package/dist/{chunk-LJ3TDK2L.js.map → chunk-5FA455GR.js.map} +0 -0
- /package/dist/{chunk-YPR5INHV.js.map → chunk-5X3E2Z3D.js.map} +0 -0
- /package/dist/{chunk-OXNWZTEU.js.map → chunk-5ZJCL6X4.js.map} +0 -0
- /package/dist/{chunk-62OAZ4LO.js.map → chunk-6C5GQQMC.js.map} +0 -0
- /package/dist/{chunk-VGITH57T.js.map → chunk-6ERTXDZM.js.map} +0 -0
- /package/dist/{chunk-ZQ7XQZCF.js.map → chunk-6FX73Y4I.js.map} +0 -0
- /package/dist/{chunk-QZO2KK2F.js.map → chunk-6P44NG6Y.js.map} +0 -0
- /package/dist/{chunk-N2DDJLTM.js.map → chunk-6T7Y33JA.js.map} +0 -0
- /package/dist/{chunk-RBAGC2MJ.js.map → chunk-75VE5QUS.js.map} +0 -0
- /package/dist/{chunk-MRXOGI3O.js.map → chunk-77CUDSHG.js.map} +0 -0
- /package/dist/{chunk-GZ65XQR5.js.map → chunk-7T7FHSGS.js.map} +0 -0
- /package/dist/{chunk-YGAH34CD.js.map → chunk-A3S26JSP.js.map} +0 -0
- /package/dist/{chunk-GYPAO6RS.js.map → chunk-A664GSDM.js.map} +0 -0
- /package/dist/{chunk-JSZSNMDR.js.map → chunk-ASUYLXKO.js.map} +0 -0
- /package/dist/{chunk-RTK7SUPL.js.map → chunk-AUUJLVA3.js.map} +0 -0
- /package/dist/{chunk-OOTBYSCA.js.map → chunk-BBWKPNJB.js.map} +0 -0
- /package/dist/{chunk-BGZIMIUU.js.map → chunk-BCUYWOQU.js.map} +0 -0
- /package/dist/{chunk-EKN4N4LS.js.map → chunk-BDFMNJZJ.js.map} +0 -0
- /package/dist/{chunk-YZKGOWCC.js.map → chunk-BIDXQAGO.js.map} +0 -0
- /package/dist/{chunk-Q2UUANHF.js.map → chunk-BIKAJ4DY.js.map} +0 -0
- /package/dist/{chunk-5IQBF2X3.js.map → chunk-BJPJ2OUX.js.map} +0 -0
- /package/dist/{chunk-EY2EMHZW.js.map → chunk-BPM2OTYK.js.map} +0 -0
- /package/dist/{chunk-MT4TBRQB.js.map → chunk-BSWS2RUZ.js.map} +0 -0
- /package/dist/{chunk-T7YD3VGK.js.map → chunk-C52MNKXU.js.map} +0 -0
- /package/dist/{chunk-THNW33K7.js.map → chunk-CEUDV4OA.js.map} +0 -0
- /package/dist/{chunk-LHGIS6SZ.js.map → chunk-CVK74BH7.js.map} +0 -0
- /package/dist/{chunk-DFO2UCYG.js.map → chunk-CW5I65ZX.js.map} +0 -0
- /package/dist/{chunk-SKRLKQEG.js.map → chunk-DOSC2HRQ.js.map} +0 -0
- /package/dist/{chunk-KVB6XDLP.js.map → chunk-DPJ2CWVN.js.map} +0 -0
- /package/dist/{chunk-4J6V4DH7.js.map → chunk-DXMRO2MU.js.map} +0 -0
- /package/dist/{chunk-42I4O4WQ.js.map → chunk-EE55IDDR.js.map} +0 -0
- /package/dist/{chunk-2RA6XABP.js.map → chunk-EEERTLFF.js.map} +0 -0
- /package/dist/{chunk-PTOTKUKO.js.map → chunk-EEO744XR.js.map} +0 -0
- /package/dist/{chunk-LD3HVI2J.js.map → chunk-EMFGBAQL.js.map} +0 -0
- /package/dist/{chunk-FQGUK4ST.js.map → chunk-ENPJKVMN.js.map} +0 -0
- /package/dist/{chunk-HDHK3SXK.js.map → chunk-EU6RLHMP.js.map} +0 -0
- /package/dist/{chunk-MRUWRQBX.js.map → chunk-FET6XHGS.js.map} +0 -0
- /package/dist/{chunk-M6KUY3YH.js.map → chunk-FIICQA55.js.map} +0 -0
- /package/dist/{chunk-NLWLCYCT.js.map → chunk-FTZXCPE3.js.map} +0 -0
- /package/dist/{chunk-FN2KA3MJ.js.map → chunk-FUS76DO4.js.map} +0 -0
- /package/dist/{chunk-AM4IIPWI.js.map → chunk-G7N5NPRJ.js.map} +0 -0
- /package/dist/{chunk-CCQ7YKOD.js.map → chunk-GBYZ6653.js.map} +0 -0
- /package/dist/{chunk-YKKVIJVX.js.map → chunk-GQDSC6QZ.js.map} +0 -0
- /package/dist/{chunk-5X6JP75Q.js.map → chunk-GRSODLVO.js.map} +0 -0
- /package/dist/{chunk-73YP3R5X.js.map → chunk-GSESCQFY.js.map} +0 -0
- /package/dist/{chunk-MZLEBFUZ.js.map → chunk-GZD6VBIK.js.map} +0 -0
- /package/dist/{chunk-IZR2QRFF.js.map → chunk-H3HH5AHS.js.map} +0 -0
- /package/dist/{chunk-OJPUVUB6.js.map → chunk-HAOZCLLA.js.map} +0 -0
- /package/dist/{chunk-ZBHDGAYL.js.map → chunk-HEFE4OZJ.js.map} +0 -0
- /package/dist/{chunk-WTG34JVA.js.map → chunk-HI75UTI6.js.map} +0 -0
- /package/dist/{chunk-OMBIG3NC.js.map → chunk-HM633ROV.js.map} +0 -0
- /package/dist/{chunk-WDFZWSKD.js.map → chunk-HRIP4M6H.js.map} +0 -0
- /package/dist/{chunk-A2BCW6CQ.js.map → chunk-HU2DRFFI.js.map} +0 -0
- /package/dist/{chunk-PO35PBAB.js.map → chunk-HVH7FFJH.js.map} +0 -0
- /package/dist/{chunk-EG7KNUF7.js.map → chunk-HYTXTKST.js.map} +0 -0
- /package/dist/{chunk-TFHG75A4.js.map → chunk-I4XMDFUJ.js.map} +0 -0
- /package/dist/{chunk-IZHVZZQA.js.map → chunk-ICAUYWSL.js.map} +0 -0
- /package/dist/{chunk-DCLPWYP3.js.map → chunk-IEVPJ3G6.js.map} +0 -0
- /package/dist/{chunk-EVWZHDSF.js.map → chunk-IKH3VTA4.js.map} +0 -0
- /package/dist/{chunk-TYHLEFD2.js.map → chunk-IZJNMRIR.js.map} +0 -0
- /package/dist/{chunk-D2SR3TEB.js.map → chunk-J243WGUA.js.map} +0 -0
- /package/dist/{chunk-QGSGIYE3.js.map → chunk-J2C6LB6W.js.map} +0 -0
- /package/dist/{chunk-MT6TRTXF.js.map → chunk-J5MEDX7C.js.map} +0 -0
- /package/dist/{chunk-6QHUKBJP.js.map → chunk-J7SKOO44.js.map} +0 -0
- /package/dist/{chunk-W2QK7PYS.js.map → chunk-JAAST75A.js.map} +0 -0
- /package/dist/{chunk-NQCMS4AJ.js.map → chunk-JQCGPTZ6.js.map} +0 -0
- /package/dist/{chunk-CMUXJHGH.js.map → chunk-JRSCWQMC.js.map} +0 -0
- /package/dist/{chunk-Q4OHNGGB.js.map → chunk-JRXHSVD5.js.map} +0 -0
- /package/dist/{chunk-SD2K5ZN5.js.map → chunk-JXYLDT6X.js.map} +0 -0
- /package/dist/{chunk-IXX6ZOL2.js.map → chunk-KGTMHEAP.js.map} +0 -0
- /package/dist/{chunk-22OBGVEJ.js.map → chunk-KOXVGPW4.js.map} +0 -0
- /package/dist/{chunk-NOZ5CGZE.js.map → chunk-L5GPPMUB.js.map} +0 -0
- /package/dist/{chunk-4FOOHMTU.js.map → chunk-LY6727IF.js.map} +0 -0
- /package/dist/{chunk-PT7MTXRE.js.map → chunk-MAOCN7J6.js.map} +0 -0
- /package/dist/{chunk-4K2JSJNX.js.map → chunk-MB5LZVDO.js.map} +0 -0
- /package/dist/{chunk-5LES64PP.js.map → chunk-MKOQAVOE.js.map} +0 -0
- /package/dist/{chunk-BMV2SNYX.js.map → chunk-MUPWNSEJ.js.map} +0 -0
- /package/dist/{chunk-Y5TRG22C.js.map → chunk-NRXIECWC.js.map} +0 -0
- /package/dist/{chunk-GOE7G5JX.js.map → chunk-NWSAF6P5.js.map} +0 -0
- /package/dist/{chunk-DUM363VS.js.map → chunk-OFZQJNF6.js.map} +0 -0
- /package/dist/{chunk-CKN5QPEL.js.map → chunk-OMF7POEY.js.map} +0 -0
- /package/dist/{chunk-MVXKO2BD.js.map → chunk-OXD6ET34.js.map} +0 -0
- /package/dist/{chunk-47JUEVME.js.map → chunk-PALX6HWV.js.map} +0 -0
- /package/dist/{chunk-B6OGSG7I.js.map → chunk-PE3BLBDT.js.map} +0 -0
- /package/dist/{chunk-RVISSNVE.js.map → chunk-PMZKJOG6.js.map} +0 -0
- /package/dist/{chunk-CESAMXWX.js.map → chunk-PQUTMG3S.js.map} +0 -0
- /package/dist/{chunk-7VFCOKPG.js.map → chunk-PWBGODZU.js.map} +0 -0
- /package/dist/{chunk-MOPAXD2H.js.map → chunk-QCADUTYX.js.map} +0 -0
- /package/dist/{chunk-CT5FBO7E.js.map → chunk-RPOUJI25.js.map} +0 -0
- /package/dist/{chunk-WKHYOS72.js.map → chunk-RW4GFE56.js.map} +0 -0
- /package/dist/{chunk-FH4GO7HO.js.map → chunk-RYLVVDR7.js.map} +0 -0
- /package/dist/{chunk-QZRDCFHI.js.map → chunk-S66SBBFQ.js.map} +0 -0
- /package/dist/{chunk-CQJFIPAH.js.map → chunk-S7TNV2I7.js.map} +0 -0
- /package/dist/{chunk-ZBQSIGGR.js.map → chunk-SC773IMJ.js.map} +0 -0
- /package/dist/{chunk-FBJ2HK7A.js.map → chunk-SGPJ3YS2.js.map} +0 -0
- /package/dist/{chunk-A2EWJQXX.js.map → chunk-SM5QX6UK.js.map} +0 -0
- /package/dist/{chunk-RKZWCTXV.js.map → chunk-TAEKDMEF.js.map} +0 -0
- /package/dist/{chunk-6AVCAUGL.js.map → chunk-TASEV25T.js.map} +0 -0
- /package/dist/{chunk-3XOISKZC.js.map → chunk-TLGDPMUX.js.map} +0 -0
- /package/dist/{chunk-5IUW34PG.js.map → chunk-TY3QYPJ6.js.map} +0 -0
- /package/dist/{chunk-VQFR4EU4.js.map → chunk-U3JK5VJV.js.map} +0 -0
- /package/dist/{chunk-2AWMJO54.js.map → chunk-U42P3RMZ.js.map} +0 -0
- /package/dist/{chunk-GUU75DES.js.map → chunk-UEJTOPLW.js.map} +0 -0
- /package/dist/{chunk-OZOEWLGR.js.map → chunk-UT6JAORE.js.map} +0 -0
- /package/dist/{chunk-5TELOQA6.js.map → chunk-UTHPUINA.js.map} +0 -0
- /package/dist/{chunk-26RQ6JBR.js.map → chunk-VBVCNH6D.js.map} +0 -0
- /package/dist/{chunk-P646DND6.js.map → chunk-VCMQPCME.js.map} +0 -0
- /package/dist/{chunk-LV7FMIMM.js.map → chunk-VGUHAHHV.js.map} +0 -0
- /package/dist/{chunk-GYVXARCY.js.map → chunk-VIBPFVU4.js.map} +0 -0
- /package/dist/{chunk-KHPOKZ6Z.js.map → chunk-VMAC66JX.js.map} +0 -0
- /package/dist/{chunk-SHKRS6I5.js.map → chunk-VRPNETPK.js.map} +0 -0
- /package/dist/{chunk-6U4J6RVS.js.map → chunk-WCHW4XN7.js.map} +0 -0
- /package/dist/{chunk-CJH6QUQJ.js.map → chunk-WD3UXNJV.js.map} +0 -0
- /package/dist/{chunk-H5EVWF6L.js.map → chunk-WR67FJMX.js.map} +0 -0
- /package/dist/{chunk-XLIJ36RG.js.map → chunk-WRMQ7EX4.js.map} +0 -0
- /package/dist/{chunk-7KLCFJ5G.js.map → chunk-X4PPGXQG.js.map} +0 -0
- /package/dist/{chunk-ZE2JTVCQ.js.map → chunk-X5BMQXFD.js.map} +0 -0
- /package/dist/{chunk-UECU6LZI.js.map → chunk-XXRBOSWV.js.map} +0 -0
- /package/dist/{chunk-SPKAIDWX.js.map → chunk-XZEFCPBL.js.map} +0 -0
- /package/dist/{chunk-EZ5NYRHK.js.map → chunk-YL6N7QLA.js.map} +0 -0
- /package/dist/{chunk-VAIESMPY.js.map → chunk-YVBHGMKC.js.map} +0 -0
- /package/dist/{chunk-AR62NQXE.js.map → chunk-Z2S5VQG7.js.map} +0 -0
- /package/dist/{chunk-7UQJEADK.js.map → chunk-ZL2O4BYP.js.map} +0 -0
- /package/dist/{chunk-FOOITLHR.js.map → chunk-ZZHBT5WQ.js.map} +0 -0
- /package/dist/{chunk-X6VJQJYY.js.map → chunk-ZZWHKC6A.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-XOPYY6YA.js.map → computer-viewer-S6TE6TN7.js.map} +0 -0
- /package/dist/{sandbox-files-LJCR437H.js.map → embedded-new-voice-ZDZPGX25.js.map} +0 -0
- /package/dist/{session-realtime-UISLBZ4A.js.map → embedded-voice-FKCUXSJO.js.map} +0 -0
- /package/dist/{fleet-decision-row-5UCJXTDP.js.map → fleet-decision-row-VCGWYJAV.js.map} +0 -0
- /package/dist/{latest-question-VGVNUGAU.js.map → latest-question-SINEV4U6.js.map} +0 -0
- /package/dist/{platform-activity-row-56XOVTRA.js.map → platform-activity-row-LU5WABI2.js.map} +0 -0
|
@@ -0,0 +1,840 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ⌘K menu: find a chat by its title, or run any action, from one field.
|
|
3
|
+
*
|
|
4
|
+
* It opens instantly from what the app already knows (chats the sidebar has
|
|
5
|
+
* loaded and the chats opened recently) and merges the server's title search as
|
|
6
|
+
* it arrives. Tab on a chat shows that chat's actions; the chords of chat
|
|
7
|
+
* actions work on the highlighted chat while the menu is open.
|
|
8
|
+
*/
|
|
9
|
+
import {
|
|
10
|
+
useCallback,
|
|
11
|
+
useEffect,
|
|
12
|
+
useId,
|
|
13
|
+
useLayoutEffect,
|
|
14
|
+
useMemo,
|
|
15
|
+
useRef,
|
|
16
|
+
useState,
|
|
17
|
+
type KeyboardEvent as ReactKeyboardEvent,
|
|
18
|
+
type ReactNode,
|
|
19
|
+
type RefObject,
|
|
20
|
+
} from "react";
|
|
21
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
22
|
+
import {
|
|
23
|
+
ArchiveIcon,
|
|
24
|
+
ArrowUpRightIcon,
|
|
25
|
+
ChevronRightIcon,
|
|
26
|
+
CornerDownLeftIcon,
|
|
27
|
+
MessageSquareIcon,
|
|
28
|
+
PinIcon,
|
|
29
|
+
SearchIcon,
|
|
30
|
+
TextSearchIcon,
|
|
31
|
+
type LucideIcon,
|
|
32
|
+
} from "lucide-react";
|
|
33
|
+
import type { SessionListRow } from "../../../session-list-model";
|
|
34
|
+
import { useAppContext } from "../../app-context";
|
|
35
|
+
import {
|
|
36
|
+
readChatDirectory,
|
|
37
|
+
rememberChats,
|
|
38
|
+
useChatDirectoryVersion,
|
|
39
|
+
type ChatRecord,
|
|
40
|
+
} from "../../lib/actions/chat-directory";
|
|
41
|
+
import { matchesChord, type Chord } from "../../lib/actions/chords";
|
|
42
|
+
import { useAppActions } from "../../lib/actions/actions-provider";
|
|
43
|
+
import {
|
|
44
|
+
foldForSearch,
|
|
45
|
+
LOOSE_MATCH_BELOW,
|
|
46
|
+
rankLabel,
|
|
47
|
+
rankWithKeywords,
|
|
48
|
+
} from "../../lib/actions/rank";
|
|
49
|
+
import {
|
|
50
|
+
APP_ACTIONS,
|
|
51
|
+
actionIcon,
|
|
52
|
+
actionTitle,
|
|
53
|
+
type ActionEnv,
|
|
54
|
+
type AppAction,
|
|
55
|
+
} from "../../lib/actions/registry";
|
|
56
|
+
import { cn } from "../../lib/utils";
|
|
57
|
+
import { DialogOverlay, DialogPortal } from "../../../ui/dialog";
|
|
58
|
+
import { formatRelativeTime } from "../../../ui/relative-time";
|
|
59
|
+
import { Keycaps } from "./keycaps";
|
|
60
|
+
|
|
61
|
+
type Item = {
|
|
62
|
+
key: string;
|
|
63
|
+
group: string;
|
|
64
|
+
icon: LucideIcon;
|
|
65
|
+
title: string;
|
|
66
|
+
/** Text to mark as matched in the title. */
|
|
67
|
+
highlight?: string | undefined;
|
|
68
|
+
/** Quiet text on the right (when, "Archived"). */
|
|
69
|
+
meta?: string | undefined;
|
|
70
|
+
chord?: Chord | undefined;
|
|
71
|
+
/** Present on chat rows: Tab opens their actions, chat chords act on them. */
|
|
72
|
+
chat?: ChatRecord | undefined;
|
|
73
|
+
run(options: { newTab: boolean }): void;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
type Group = { label: string; items: Item[]; best: number };
|
|
77
|
+
|
|
78
|
+
const RECENT_LIMIT = 6;
|
|
79
|
+
const CHAT_RESULT_LIMIT = 8;
|
|
80
|
+
const ACTION_RESULT_LIMIT = 6;
|
|
81
|
+
const SERVER_DEBOUNCE_MS = 120;
|
|
82
|
+
|
|
83
|
+
function relativeMeta(record: ChatRecord, now: number): string | undefined {
|
|
84
|
+
if (record.archived) return "Archived";
|
|
85
|
+
if (!record.updatedAt) return undefined;
|
|
86
|
+
return formatRelativeTime(record.updatedAt, { now });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function chatIcon(record: ChatRecord): LucideIcon {
|
|
90
|
+
if (record.archived) return ArchiveIcon;
|
|
91
|
+
if (record.pinned) return PinIcon;
|
|
92
|
+
return MessageSquareIcon;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Rows the menu may list: top-level chats only (subagent chats live under their parent). */
|
|
96
|
+
function listable(record: ChatRecord): boolean {
|
|
97
|
+
return !record.row || record.row.parentSessionId === null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Marks the query's words in a title, case- and accent-insensitively. */
|
|
101
|
+
function Highlighted(props: { text: string; query: string | undefined }) {
|
|
102
|
+
const { text, query } = props;
|
|
103
|
+
const words = query ? foldForSearch(query).split(" ").filter(Boolean) : [];
|
|
104
|
+
if (words.length === 0) return <>{text}</>;
|
|
105
|
+
// Fold per character so positions in the folded text map back to the title.
|
|
106
|
+
const folded = Array.from(text, (character) => foldForSearch(character) || " ");
|
|
107
|
+
const joined = folded.join("");
|
|
108
|
+
const marked = new Array<boolean>(folded.length).fill(false);
|
|
109
|
+
const offsets: number[] = [];
|
|
110
|
+
let offset = 0;
|
|
111
|
+
for (const piece of folded) {
|
|
112
|
+
offsets.push(offset);
|
|
113
|
+
offset += piece.length;
|
|
114
|
+
}
|
|
115
|
+
const indexAt = (position: number) => {
|
|
116
|
+
let index = offsets.findIndex((start) => start > position);
|
|
117
|
+
index = index < 0 ? offsets.length - 1 : index - 1;
|
|
118
|
+
return index;
|
|
119
|
+
};
|
|
120
|
+
const phrase = words.join(" ");
|
|
121
|
+
const ranges: Array<[number, number]> = [];
|
|
122
|
+
const whole = joined.indexOf(phrase);
|
|
123
|
+
if (whole >= 0) ranges.push([whole, whole + phrase.length]);
|
|
124
|
+
else {
|
|
125
|
+
for (const word of words) {
|
|
126
|
+
const at = joined.indexOf(word);
|
|
127
|
+
if (at >= 0) ranges.push([at, at + word.length]);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
for (const [start, end] of ranges) {
|
|
131
|
+
for (let index = indexAt(start); index <= indexAt(end - 1); index++) marked[index] = true;
|
|
132
|
+
}
|
|
133
|
+
const characters = Array.from(text);
|
|
134
|
+
const parts: ReactNode[] = [];
|
|
135
|
+
let run = "";
|
|
136
|
+
let runMarked = false;
|
|
137
|
+
characters.forEach((character, index) => {
|
|
138
|
+
const isMarked = marked[index] ?? false;
|
|
139
|
+
if (index > 0 && isMarked !== runMarked) {
|
|
140
|
+
parts.push(
|
|
141
|
+
runMarked ? (
|
|
142
|
+
<mark key={parts.length} className="bg-transparent font-medium text-fg">
|
|
143
|
+
{run}
|
|
144
|
+
</mark>
|
|
145
|
+
) : (
|
|
146
|
+
run
|
|
147
|
+
),
|
|
148
|
+
);
|
|
149
|
+
run = "";
|
|
150
|
+
}
|
|
151
|
+
run += character;
|
|
152
|
+
runMarked = isMarked;
|
|
153
|
+
});
|
|
154
|
+
if (run) {
|
|
155
|
+
parts.push(
|
|
156
|
+
runMarked ? (
|
|
157
|
+
<mark key={parts.length} className="bg-transparent font-medium text-fg">
|
|
158
|
+
{run}
|
|
159
|
+
</mark>
|
|
160
|
+
) : (
|
|
161
|
+
run
|
|
162
|
+
),
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
return <>{parts}</>;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function useServerTitleSearch(
|
|
169
|
+
workspaceId: string,
|
|
170
|
+
subjectId: string,
|
|
171
|
+
query: string,
|
|
172
|
+
open: boolean,
|
|
173
|
+
) {
|
|
174
|
+
const { client } = useAppContext();
|
|
175
|
+
const [state, setState] = useState<{ query: string; rows: SessionListRow[]; loading: boolean }>({
|
|
176
|
+
query: "",
|
|
177
|
+
rows: [],
|
|
178
|
+
loading: false,
|
|
179
|
+
});
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
const trimmed = query.trim();
|
|
182
|
+
if (!open || !trimmed) {
|
|
183
|
+
setState({ query: "", rows: [], loading: false });
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
setState((current) => ({ ...current, loading: true }));
|
|
187
|
+
const controller = new AbortController();
|
|
188
|
+
const timer = window.setTimeout(() => {
|
|
189
|
+
client
|
|
190
|
+
.listSessionPage(workspaceId, {
|
|
191
|
+
search: trimmed,
|
|
192
|
+
archiveStatus: "all",
|
|
193
|
+
limit: 20,
|
|
194
|
+
signal: controller.signal,
|
|
195
|
+
})
|
|
196
|
+
.then((page) => {
|
|
197
|
+
const rows = [...(page.pinned ?? []), ...page.sessions];
|
|
198
|
+
rememberChats(subjectId, workspaceId, rows);
|
|
199
|
+
setState({ query: trimmed, rows, loading: false });
|
|
200
|
+
})
|
|
201
|
+
.catch(() => {
|
|
202
|
+
// Local results still show; the server search is an addition.
|
|
203
|
+
if (!controller.signal.aborted) setState({ query: trimmed, rows: [], loading: false });
|
|
204
|
+
});
|
|
205
|
+
}, SERVER_DEBOUNCE_MS);
|
|
206
|
+
return () => {
|
|
207
|
+
window.clearTimeout(timer);
|
|
208
|
+
controller.abort();
|
|
209
|
+
};
|
|
210
|
+
}, [client, workspaceId, subjectId, query, open]);
|
|
211
|
+
return state;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export default function CommandMenu(props: {
|
|
215
|
+
open: boolean;
|
|
216
|
+
onOpenChange: (open: boolean) => void;
|
|
217
|
+
/** Where focus goes back to after a plain close. */
|
|
218
|
+
returnFocus: RefObject<HTMLElement | null>;
|
|
219
|
+
}) {
|
|
220
|
+
const actions = useAppActions();
|
|
221
|
+
if (!actions) return null;
|
|
222
|
+
return (
|
|
223
|
+
<CommandMenuDialog
|
|
224
|
+
{...props}
|
|
225
|
+
env={actions.env}
|
|
226
|
+
run={actions.run}
|
|
227
|
+
chordsFor={actions.chordsFor}
|
|
228
|
+
/>
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function CommandMenuDialog(props: {
|
|
233
|
+
open: boolean;
|
|
234
|
+
onOpenChange: (open: boolean) => void;
|
|
235
|
+
returnFocus: RefObject<HTMLElement | null>;
|
|
236
|
+
env: ActionEnv;
|
|
237
|
+
run(action: AppAction, chat?: SessionListRow | null, chord?: Chord): void;
|
|
238
|
+
chordsFor(action: AppAction): Chord[];
|
|
239
|
+
}) {
|
|
240
|
+
const { env, run, chordsFor, onOpenChange } = props;
|
|
241
|
+
const { workspaceId, subjectId, platform, surface } = env;
|
|
242
|
+
const directoryVersion = useChatDirectoryVersion(subjectId, workspaceId);
|
|
243
|
+
const [query, setQuery] = useState("");
|
|
244
|
+
const [focusChat, setFocusChat] = useState<ChatRecord | null>(null);
|
|
245
|
+
const [active, setActive] = useState(0);
|
|
246
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
247
|
+
const listRef = useRef<HTMLDivElement>(null);
|
|
248
|
+
const ranAction = useRef(false);
|
|
249
|
+
/** Runs right after the menu has returned focus (see `AppAction.opensDialog`). */
|
|
250
|
+
const afterClose = useRef<(() => void) | null>(null);
|
|
251
|
+
const listId = useId();
|
|
252
|
+
const server = useServerTitleSearch(workspaceId, subjectId, focusChat ? "" : query, props.open);
|
|
253
|
+
|
|
254
|
+
// Every open starts fresh.
|
|
255
|
+
useEffect(() => {
|
|
256
|
+
if (!props.open) return;
|
|
257
|
+
setQuery("");
|
|
258
|
+
setFocusChat(null);
|
|
259
|
+
setActive(0);
|
|
260
|
+
ranAction.current = false;
|
|
261
|
+
afterClose.current = null;
|
|
262
|
+
}, [props.open]);
|
|
263
|
+
|
|
264
|
+
const close = useCallback(() => onOpenChange(false), [onOpenChange]);
|
|
265
|
+
|
|
266
|
+
const runAction = useCallback(
|
|
267
|
+
(action: AppAction, chat: SessionListRow | null, chord?: Chord) => {
|
|
268
|
+
if (action.opensDialog) {
|
|
269
|
+
afterClose.current = () => run(action, action.forChat ? chat : undefined, chord);
|
|
270
|
+
close();
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
ranAction.current = true;
|
|
274
|
+
close();
|
|
275
|
+
run(action, action.forChat ? chat : undefined, chord);
|
|
276
|
+
},
|
|
277
|
+
[close, run],
|
|
278
|
+
);
|
|
279
|
+
|
|
280
|
+
const openChat = useCallback(
|
|
281
|
+
(record: ChatRecord, newTab: boolean) => {
|
|
282
|
+
ranAction.current = true;
|
|
283
|
+
close();
|
|
284
|
+
if (newTab && surface === "web") {
|
|
285
|
+
window.open(env.ops.linkTo(record), "_blank", "noopener");
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
env.openChat(record.id);
|
|
289
|
+
},
|
|
290
|
+
[close, env, surface],
|
|
291
|
+
);
|
|
292
|
+
|
|
293
|
+
const actionItem = useCallback(
|
|
294
|
+
(action: AppAction, chat: SessionListRow | null, group: string, highlight?: string): Item => ({
|
|
295
|
+
key: `action:${action.id}`,
|
|
296
|
+
group,
|
|
297
|
+
icon: actionIcon(action, chat),
|
|
298
|
+
title: actionTitle(action, env, chat),
|
|
299
|
+
highlight,
|
|
300
|
+
chord: chordsFor(action)[0],
|
|
301
|
+
run: () => runAction(action, chat),
|
|
302
|
+
}),
|
|
303
|
+
[chordsFor, env, runAction],
|
|
304
|
+
);
|
|
305
|
+
|
|
306
|
+
const groups = useMemo<Group[]>(() => {
|
|
307
|
+
void directoryVersion;
|
|
308
|
+
const now = Date.now();
|
|
309
|
+
const directory = readChatDirectory(subjectId, workspaceId);
|
|
310
|
+
const current = env.currentChat;
|
|
311
|
+
|
|
312
|
+
const chatItem = (record: ChatRecord, group: string, highlight?: string): Item => ({
|
|
313
|
+
key: `chat:${record.id}`,
|
|
314
|
+
group,
|
|
315
|
+
icon: chatIcon(record),
|
|
316
|
+
title: record.title,
|
|
317
|
+
highlight,
|
|
318
|
+
meta: current?.id === record.id ? "Open now" : relativeMeta(record, now),
|
|
319
|
+
chat: record,
|
|
320
|
+
run: ({ newTab }) => openChat(record, newTab),
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
// A chat's own actions (after Tab).
|
|
324
|
+
if (focusChat) {
|
|
325
|
+
const row = focusChat.row ?? (current?.id === focusChat.id ? current : null);
|
|
326
|
+
const items: Array<{ item: Item; rank: number }> = [];
|
|
327
|
+
const openRank = rankLabel("Open", query);
|
|
328
|
+
if (openRank !== null) {
|
|
329
|
+
items.push({
|
|
330
|
+
rank: openRank + 1,
|
|
331
|
+
item: {
|
|
332
|
+
key: "open",
|
|
333
|
+
group: focusChat.title,
|
|
334
|
+
icon: CornerDownLeftIcon,
|
|
335
|
+
title: "Open",
|
|
336
|
+
highlight: query,
|
|
337
|
+
run: () => openChat(focusChat, false),
|
|
338
|
+
},
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
if (surface === "web") {
|
|
342
|
+
const tabRank = rankLabel("Open in new tab", query);
|
|
343
|
+
if (tabRank !== null) {
|
|
344
|
+
items.push({
|
|
345
|
+
rank: tabRank,
|
|
346
|
+
item: {
|
|
347
|
+
key: "open-tab",
|
|
348
|
+
group: focusChat.title,
|
|
349
|
+
icon: ArrowUpRightIcon,
|
|
350
|
+
title: "Open in new tab",
|
|
351
|
+
highlight: query,
|
|
352
|
+
run: () => openChat(focusChat, true),
|
|
353
|
+
},
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
for (const action of APP_ACTIONS) {
|
|
358
|
+
if (!action.forChat || action.inCommandMenu === false) continue;
|
|
359
|
+
// Copy link needs only the id; the rest need the chat's row.
|
|
360
|
+
const target = row ?? (action.id === "chat.copyLink" ? pseudoRow(focusChat) : null);
|
|
361
|
+
if (!target || !action.available(env, target)) continue;
|
|
362
|
+
const rank = rankWithKeywords(actionTitle(action, env, target), action.keywords, query);
|
|
363
|
+
if (rank === null) continue;
|
|
364
|
+
items.push({ rank, item: actionItem(action, target, focusChat.title, query) });
|
|
365
|
+
}
|
|
366
|
+
if (query) items.sort((a, b) => b.rank - a.rank);
|
|
367
|
+
return [{ label: focusChat.title, items: items.map((entry) => entry.item), best: 0 }];
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
const trimmed = query.trim();
|
|
371
|
+
if (!trimmed) {
|
|
372
|
+
const result: Group[] = [];
|
|
373
|
+
// Chats opened recently come first; the top of the sidebar fills the
|
|
374
|
+
// rest, so a fresh window still offers somewhere to go.
|
|
375
|
+
const recentIds = [...new Set([...directory.recent, ...directory.sidebarOrder])].filter(
|
|
376
|
+
(id) => id !== current?.id,
|
|
377
|
+
);
|
|
378
|
+
const recent = recentIds
|
|
379
|
+
.map((id) => directory.rows.get(id))
|
|
380
|
+
.filter((record): record is ChatRecord =>
|
|
381
|
+
Boolean(record && listable(record) && !record.archived),
|
|
382
|
+
)
|
|
383
|
+
.slice(0, RECENT_LIMIT);
|
|
384
|
+
if (recent.length > 0) {
|
|
385
|
+
result.push({
|
|
386
|
+
label: "Recent chats",
|
|
387
|
+
items: recent.map((record) => chatItem(record, "Recent chats")),
|
|
388
|
+
best: 0,
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
if (current) {
|
|
392
|
+
const chatActions = APP_ACTIONS.filter(
|
|
393
|
+
(action) =>
|
|
394
|
+
action.forChat &&
|
|
395
|
+
action.inCommandMenu !== false &&
|
|
396
|
+
action.id !== "chat.find" &&
|
|
397
|
+
action.available(env, current),
|
|
398
|
+
);
|
|
399
|
+
if (chatActions.length > 0) {
|
|
400
|
+
result.push({
|
|
401
|
+
label: "This chat",
|
|
402
|
+
items: chatActions.map((action) => actionItem(action, current, "This chat")),
|
|
403
|
+
best: 0,
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
const general = APP_ACTIONS.filter(
|
|
408
|
+
(action) =>
|
|
409
|
+
!action.forChat &&
|
|
410
|
+
action.inCommandMenu !== false &&
|
|
411
|
+
action.id !== "commandMenu.open" &&
|
|
412
|
+
action.available(env, null),
|
|
413
|
+
);
|
|
414
|
+
if (general.length > 0) {
|
|
415
|
+
result.push({
|
|
416
|
+
label: "Go to",
|
|
417
|
+
items: general.map((action) => actionItem(action, null, "Go to")),
|
|
418
|
+
best: 0,
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
return result;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// Chats: everything the app knows, ranked by title, plus the server's matches.
|
|
425
|
+
const recentIndex = new Map(directory.recent.map((id, index) => [id, index]));
|
|
426
|
+
const serverIds = new Set(server.query === trimmed ? server.rows.map((row) => row.id) : []);
|
|
427
|
+
const scored: Array<{ record: ChatRecord; rank: number; loose: boolean }> = [];
|
|
428
|
+
for (const record of directory.rows.values()) {
|
|
429
|
+
if (!listable(record)) continue;
|
|
430
|
+
let rank = rankLabel(record.title, trimmed);
|
|
431
|
+
const loose = rank !== null && rank < LOOSE_MATCH_BELOW;
|
|
432
|
+
// The server matched every word in the title or first message.
|
|
433
|
+
if (rank === null && serverIds.has(record.id)) rank = 50;
|
|
434
|
+
if (rank === null) continue;
|
|
435
|
+
const visited = recentIndex.get(record.id);
|
|
436
|
+
if (visited !== undefined) rank += Math.max(0, 20 - visited);
|
|
437
|
+
if (record.pinned) rank += 5;
|
|
438
|
+
if (record.archived) rank -= 300;
|
|
439
|
+
scored.push({ record, rank, loose });
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
const actionScores: Array<{ item: Item; rank: number; loose: boolean }> = [];
|
|
443
|
+
for (const action of APP_ACTIONS) {
|
|
444
|
+
if (action.inCommandMenu === false) continue;
|
|
445
|
+
const target = action.forChat ? current : null;
|
|
446
|
+
if (action.forChat && !target) continue;
|
|
447
|
+
if (!action.available(env, target)) continue;
|
|
448
|
+
const rank = rankWithKeywords(actionTitle(action, env, target), action.keywords, trimmed);
|
|
449
|
+
if (rank === null) continue;
|
|
450
|
+
actionScores.push({
|
|
451
|
+
rank,
|
|
452
|
+
loose: rank < LOOSE_MATCH_BELOW,
|
|
453
|
+
item: actionItem(action, target, "Actions", trimmed),
|
|
454
|
+
});
|
|
455
|
+
}
|
|
456
|
+
// Letters-in-order guesses only help when nothing really matches; next to
|
|
457
|
+
// real matches they are noise ("pin" → "Postgres … investigation").
|
|
458
|
+
const hasRealMatch =
|
|
459
|
+
scored.some((entry) => !entry.loose) || actionScores.some((entry) => !entry.loose);
|
|
460
|
+
const chats = scored
|
|
461
|
+
.filter((entry) => !hasRealMatch || !entry.loose)
|
|
462
|
+
.sort((a, b) => b.rank - a.rank || b.record.updatedAt - a.record.updatedAt)
|
|
463
|
+
.slice(0, CHAT_RESULT_LIMIT);
|
|
464
|
+
const actionsFound = actionScores
|
|
465
|
+
.filter((entry) => !hasRealMatch || !entry.loose)
|
|
466
|
+
.sort((a, b) => b.rank - a.rank)
|
|
467
|
+
.slice(0, ACTION_RESULT_LIMIT);
|
|
468
|
+
|
|
469
|
+
const result: Group[] = [];
|
|
470
|
+
if (chats.length > 0) {
|
|
471
|
+
result.push({
|
|
472
|
+
label: "Chats",
|
|
473
|
+
items: chats.map((entry) => chatItem(entry.record, "Chats", trimmed)),
|
|
474
|
+
best: chats[0]!.rank,
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
if (actionsFound.length > 0) {
|
|
478
|
+
result.push({
|
|
479
|
+
label: "Actions",
|
|
480
|
+
items: actionsFound.map((entry) => entry.item),
|
|
481
|
+
best: actionsFound[0]!.rank,
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
// A clearly better action match ("new" → New chat) comes before chats.
|
|
485
|
+
result.sort((a, b) => b.best - a.best);
|
|
486
|
+
result.push({
|
|
487
|
+
label: "Messages",
|
|
488
|
+
best: -Infinity,
|
|
489
|
+
items: [
|
|
490
|
+
{
|
|
491
|
+
key: "search-messages",
|
|
492
|
+
group: "Messages",
|
|
493
|
+
icon: TextSearchIcon,
|
|
494
|
+
title: `Search messages for “${trimmed}”`,
|
|
495
|
+
run: () => {
|
|
496
|
+
afterClose.current = () => env.searchMessages(trimmed);
|
|
497
|
+
close();
|
|
498
|
+
},
|
|
499
|
+
},
|
|
500
|
+
],
|
|
501
|
+
});
|
|
502
|
+
return result;
|
|
503
|
+
}, [
|
|
504
|
+
actionItem,
|
|
505
|
+
close,
|
|
506
|
+
directoryVersion,
|
|
507
|
+
env,
|
|
508
|
+
focusChat,
|
|
509
|
+
openChat,
|
|
510
|
+
query,
|
|
511
|
+
server.query,
|
|
512
|
+
server.rows,
|
|
513
|
+
subjectId,
|
|
514
|
+
surface,
|
|
515
|
+
workspaceId,
|
|
516
|
+
]);
|
|
517
|
+
|
|
518
|
+
const items = useMemo(() => groups.flatMap((group) => group.items), [groups]);
|
|
519
|
+
const activeIndex = items.length === 0 ? -1 : Math.min(active, items.length - 1);
|
|
520
|
+
const activeItem = activeIndex >= 0 ? items[activeIndex] : undefined;
|
|
521
|
+
const searching = Boolean(query.trim()) && !focusChat && server.loading;
|
|
522
|
+
|
|
523
|
+
// Typing starts at the best match.
|
|
524
|
+
useEffect(() => setActive(0), [query, focusChat]);
|
|
525
|
+
|
|
526
|
+
// Keep the highlighted row in view without scrolling the page.
|
|
527
|
+
useLayoutEffect(() => {
|
|
528
|
+
if (!activeItem) return;
|
|
529
|
+
const element = listRef.current?.querySelector<HTMLElement>(
|
|
530
|
+
`[data-item-key="${CSS.escape(activeItem.key)}"]`,
|
|
531
|
+
);
|
|
532
|
+
element?.scrollIntoView({ block: "nearest" });
|
|
533
|
+
}, [activeItem]);
|
|
534
|
+
|
|
535
|
+
const enterChat = useCallback((record: ChatRecord) => {
|
|
536
|
+
setFocusChat(record);
|
|
537
|
+
setQuery("");
|
|
538
|
+
inputRef.current?.focus();
|
|
539
|
+
}, []);
|
|
540
|
+
const leaveChat = useCallback(() => {
|
|
541
|
+
setFocusChat(null);
|
|
542
|
+
setQuery("");
|
|
543
|
+
}, []);
|
|
544
|
+
|
|
545
|
+
const onKeyDown = useCallback(
|
|
546
|
+
(event: ReactKeyboardEvent<HTMLDivElement>) => {
|
|
547
|
+
if (event.nativeEvent.isComposing) return;
|
|
548
|
+
const count = items.length;
|
|
549
|
+
const mod = platform === "mac" ? event.metaKey : event.ctrlKey;
|
|
550
|
+
switch (event.key) {
|
|
551
|
+
case "ArrowDown":
|
|
552
|
+
case "ArrowUp": {
|
|
553
|
+
if (event.altKey || mod) break;
|
|
554
|
+
event.preventDefault();
|
|
555
|
+
if (count === 0) return;
|
|
556
|
+
const step = event.key === "ArrowDown" ? 1 : -1;
|
|
557
|
+
setActive((current) => (Math.min(current, count - 1) + step + count) % count);
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
case "PageDown":
|
|
561
|
+
case "PageUp": {
|
|
562
|
+
event.preventDefault();
|
|
563
|
+
if (count === 0) return;
|
|
564
|
+
const step = event.key === "PageDown" ? 5 : -5;
|
|
565
|
+
setActive((current) => Math.max(0, Math.min(count - 1, current + step)));
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
568
|
+
case "Home":
|
|
569
|
+
case "End": {
|
|
570
|
+
// Inside the field these move the caret, unless the field is empty.
|
|
571
|
+
if (query) break;
|
|
572
|
+
event.preventDefault();
|
|
573
|
+
setActive(event.key === "Home" ? 0 : Math.max(0, count - 1));
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
case "Enter": {
|
|
577
|
+
event.preventDefault();
|
|
578
|
+
activeItem?.run({ newTab: mod });
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
case "Tab": {
|
|
582
|
+
event.preventDefault();
|
|
583
|
+
if (event.shiftKey) {
|
|
584
|
+
if (focusChat) leaveChat();
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
if (!focusChat && activeItem?.chat) enterChat(activeItem.chat);
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
case "Backspace": {
|
|
591
|
+
if (focusChat && !query) {
|
|
592
|
+
event.preventDefault();
|
|
593
|
+
leaveChat();
|
|
594
|
+
}
|
|
595
|
+
return;
|
|
596
|
+
}
|
|
597
|
+
default:
|
|
598
|
+
break;
|
|
599
|
+
}
|
|
600
|
+
// A chat action's chord acts on the highlighted chat, as in Linear.
|
|
601
|
+
const chatRecord = focusChat ?? activeItem?.chat;
|
|
602
|
+
if (!chatRecord) return;
|
|
603
|
+
for (const action of APP_ACTIONS) {
|
|
604
|
+
if (!action.forChat) continue;
|
|
605
|
+
const chord = chordsFor(action).find((candidate) =>
|
|
606
|
+
matchesChord(event.nativeEvent, candidate, platform),
|
|
607
|
+
);
|
|
608
|
+
if (!chord) continue;
|
|
609
|
+
const row =
|
|
610
|
+
chatRecord.row ??
|
|
611
|
+
(env.currentChat?.id === chatRecord.id ? env.currentChat : null) ??
|
|
612
|
+
(action.id === "chat.copyLink" ? pseudoRow(chatRecord) : null);
|
|
613
|
+
event.preventDefault();
|
|
614
|
+
event.stopPropagation();
|
|
615
|
+
if (row && action.available(env, row)) runAction(action, row, chord);
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
[
|
|
620
|
+
activeItem,
|
|
621
|
+
chordsFor,
|
|
622
|
+
enterChat,
|
|
623
|
+
env,
|
|
624
|
+
focusChat,
|
|
625
|
+
items.length,
|
|
626
|
+
leaveChat,
|
|
627
|
+
platform,
|
|
628
|
+
query,
|
|
629
|
+
runAction,
|
|
630
|
+
],
|
|
631
|
+
);
|
|
632
|
+
|
|
633
|
+
const placeholder = focusChat ? "Search actions…" : "Search chats or run an action…";
|
|
634
|
+
const optionId = (item: Item) => `${listId}-${item.key.replace(/[^a-zA-Z0-9_-]/g, "_")}`;
|
|
635
|
+
|
|
636
|
+
return (
|
|
637
|
+
<DialogPrimitive.Root open={props.open} onOpenChange={onOpenChange}>
|
|
638
|
+
<DialogPortal>
|
|
639
|
+
<DialogOverlay className="bg-black/25 dark:bg-black/45" />
|
|
640
|
+
<DialogPrimitive.Content
|
|
641
|
+
data-og-command-menu=""
|
|
642
|
+
aria-label="Command menu"
|
|
643
|
+
aria-describedby={undefined}
|
|
644
|
+
onOpenAutoFocus={(event) => {
|
|
645
|
+
event.preventDefault();
|
|
646
|
+
inputRef.current?.focus();
|
|
647
|
+
}}
|
|
648
|
+
onCloseAutoFocus={(event) => {
|
|
649
|
+
// An action moves focus where it belongs (the new chat's composer,
|
|
650
|
+
// the title being renamed); only a plain close returns focus.
|
|
651
|
+
if (ranAction.current) {
|
|
652
|
+
event.preventDefault();
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
const target = props.returnFocus.current;
|
|
656
|
+
if (target?.isConnected) {
|
|
657
|
+
event.preventDefault();
|
|
658
|
+
target.focus({ preventScroll: true });
|
|
659
|
+
}
|
|
660
|
+
const next = afterClose.current;
|
|
661
|
+
afterClose.current = null;
|
|
662
|
+
next?.();
|
|
663
|
+
}}
|
|
664
|
+
onEscapeKeyDown={(event) => {
|
|
665
|
+
// Esc steps back out of a chat's actions before it closes the menu.
|
|
666
|
+
if (!focusChat) return;
|
|
667
|
+
event.preventDefault();
|
|
668
|
+
leaveChat();
|
|
669
|
+
}}
|
|
670
|
+
onKeyDown={onKeyDown}
|
|
671
|
+
className={cn(
|
|
672
|
+
"fixed top-[12dvh] left-1/2 z-50 flex max-h-[min(560px,76dvh)] w-[calc(100vw-1.5rem)] max-w-[640px] -translate-x-1/2 flex-col overflow-hidden",
|
|
673
|
+
"rounded-2xl border border-border bg-surface text-fg shadow-og-lg outline-hidden",
|
|
674
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-98",
|
|
675
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-98",
|
|
676
|
+
"duration-[120ms] max-sm:top-3",
|
|
677
|
+
)}
|
|
678
|
+
>
|
|
679
|
+
<DialogPrimitive.Title className="sr-only">Command menu</DialogPrimitive.Title>
|
|
680
|
+
<div className="flex min-h-13 shrink-0 items-center gap-2.5 border-b border-border px-4">
|
|
681
|
+
<SearchIcon aria-hidden="true" className="size-4 shrink-0 text-fg-muted" />
|
|
682
|
+
{focusChat ? (
|
|
683
|
+
<button
|
|
684
|
+
type="button"
|
|
685
|
+
onClick={leaveChat}
|
|
686
|
+
title="Back to all results"
|
|
687
|
+
className="inline-flex max-w-[45%] shrink-0 items-center gap-1 rounded-full bg-hover py-0.5 pr-1.5 pl-2.5 text-xs font-medium text-fg outline-hidden hover:bg-selection focus-visible:outline-2 focus-visible:outline-ring/55"
|
|
688
|
+
>
|
|
689
|
+
<span className="truncate">{focusChat.title}</span>
|
|
690
|
+
<ChevronRightIcon aria-hidden="true" className="size-3.5 text-fg-muted" />
|
|
691
|
+
</button>
|
|
692
|
+
) : null}
|
|
693
|
+
<input
|
|
694
|
+
ref={inputRef}
|
|
695
|
+
role="combobox"
|
|
696
|
+
aria-expanded="true"
|
|
697
|
+
aria-controls={listId}
|
|
698
|
+
aria-autocomplete="list"
|
|
699
|
+
aria-activedescendant={activeItem ? optionId(activeItem) : undefined}
|
|
700
|
+
aria-label={focusChat ? `Actions for ${focusChat.title}` : "Search chats and actions"}
|
|
701
|
+
autoComplete="off"
|
|
702
|
+
autoCorrect="off"
|
|
703
|
+
spellCheck={false}
|
|
704
|
+
enterKeyHint="go"
|
|
705
|
+
value={query}
|
|
706
|
+
maxLength={200}
|
|
707
|
+
placeholder={placeholder}
|
|
708
|
+
onChange={(event) => setQuery(event.target.value)}
|
|
709
|
+
// The whole menu is the focus context; a ring on the field adds noise.
|
|
710
|
+
style={{ outline: "none" }}
|
|
711
|
+
className="h-13 min-w-0 flex-1 bg-transparent text-[15px] text-fg outline-hidden placeholder:text-fg-subtle"
|
|
712
|
+
/>
|
|
713
|
+
{searching ? (
|
|
714
|
+
<span
|
|
715
|
+
aria-hidden="true"
|
|
716
|
+
className="size-3.5 shrink-0 animate-spin rounded-full border-[1.5px] border-fg-subtle/40 border-t-fg-muted"
|
|
717
|
+
/>
|
|
718
|
+
) : null}
|
|
719
|
+
</div>
|
|
720
|
+
<div
|
|
721
|
+
ref={listRef}
|
|
722
|
+
id={listId}
|
|
723
|
+
role="listbox"
|
|
724
|
+
aria-label={focusChat ? "Chat actions" : "Results"}
|
|
725
|
+
className="min-h-0 flex-1 overflow-y-auto overscroll-contain p-1.5"
|
|
726
|
+
>
|
|
727
|
+
{items.length === 0 ? (
|
|
728
|
+
<p className="px-2.5 py-6 text-center text-sm text-fg-muted">
|
|
729
|
+
{searching ? "Searching…" : "No matches"}
|
|
730
|
+
</p>
|
|
731
|
+
) : (
|
|
732
|
+
groups.map((group) =>
|
|
733
|
+
group.items.length === 0 ? null : (
|
|
734
|
+
<div key={group.label} role="group" aria-label={group.label}>
|
|
735
|
+
{groups.length > 1 || !focusChat ? (
|
|
736
|
+
<div className="truncate px-2.5 pt-2 pb-1 text-xs leading-4.5 font-medium text-fg-muted">
|
|
737
|
+
{group.label}
|
|
738
|
+
</div>
|
|
739
|
+
) : null}
|
|
740
|
+
{group.items.map((item) => {
|
|
741
|
+
const index = items.indexOf(item);
|
|
742
|
+
const selected = index === activeIndex;
|
|
743
|
+
const Icon = item.icon;
|
|
744
|
+
return (
|
|
745
|
+
<div
|
|
746
|
+
key={item.key}
|
|
747
|
+
id={optionId(item)}
|
|
748
|
+
data-item-key={item.key}
|
|
749
|
+
role="option"
|
|
750
|
+
aria-selected={selected}
|
|
751
|
+
onPointerMove={() => {
|
|
752
|
+
if (!selected) setActive(index);
|
|
753
|
+
}}
|
|
754
|
+
onPointerDown={(event) => event.preventDefault()}
|
|
755
|
+
onClick={(event) =>
|
|
756
|
+
item.run({ newTab: platform === "mac" ? event.metaKey : event.ctrlKey })
|
|
757
|
+
}
|
|
758
|
+
className={cn(
|
|
759
|
+
"relative flex min-h-9 w-full min-w-0 cursor-default items-center gap-2.5 rounded-[10px] px-2.5 py-1.5 text-sm text-fg-label select-none pointer-coarse:min-h-11",
|
|
760
|
+
selected ? "bg-hover text-fg" : null,
|
|
761
|
+
)}
|
|
762
|
+
>
|
|
763
|
+
<Icon
|
|
764
|
+
aria-hidden="true"
|
|
765
|
+
className={cn(
|
|
766
|
+
"size-4 shrink-0",
|
|
767
|
+
selected ? "text-fg" : "text-fg-muted",
|
|
768
|
+
)}
|
|
769
|
+
/>
|
|
770
|
+
<span className="min-w-0 flex-1 truncate">
|
|
771
|
+
<Highlighted text={item.title} query={item.highlight} />
|
|
772
|
+
</span>
|
|
773
|
+
{item.meta ? (
|
|
774
|
+
<span className="shrink-0 text-xs text-fg-muted tabular-nums">
|
|
775
|
+
{item.meta}
|
|
776
|
+
</span>
|
|
777
|
+
) : null}
|
|
778
|
+
{item.chord ? (
|
|
779
|
+
// Touch screens have no keys to press.
|
|
780
|
+
<Keycaps
|
|
781
|
+
chord={item.chord}
|
|
782
|
+
platform={platform}
|
|
783
|
+
className="pointer-coarse:hidden"
|
|
784
|
+
/>
|
|
785
|
+
) : null}
|
|
786
|
+
</div>
|
|
787
|
+
);
|
|
788
|
+
})}
|
|
789
|
+
</div>
|
|
790
|
+
),
|
|
791
|
+
)
|
|
792
|
+
)}
|
|
793
|
+
</div>
|
|
794
|
+
<div className="hidden shrink-0 items-center gap-4 border-t border-border px-4 py-2 text-xs text-fg-muted pointer-fine:flex">
|
|
795
|
+
<FooterHint
|
|
796
|
+
keys={[{ code: "ArrowUp" }, { code: "ArrowDown" }]}
|
|
797
|
+
label="Move"
|
|
798
|
+
platform={platform}
|
|
799
|
+
/>
|
|
800
|
+
<FooterHint keys={[{ code: "Enter" }]} label="Open" platform={platform} />
|
|
801
|
+
{focusChat ? (
|
|
802
|
+
<FooterHint keys={[{ code: "Escape" }]} label="Back" platform={platform} />
|
|
803
|
+
) : (
|
|
804
|
+
<FooterHint keys={[{ code: "Tab" }]} label="Chat actions" platform={platform} />
|
|
805
|
+
)}
|
|
806
|
+
{surface === "web" && !focusChat ? (
|
|
807
|
+
<FooterHint
|
|
808
|
+
keys={[{ code: "Enter", mod: true }]}
|
|
809
|
+
label="New tab"
|
|
810
|
+
platform={platform}
|
|
811
|
+
/>
|
|
812
|
+
) : null}
|
|
813
|
+
<span className="ml-auto inline-flex items-center gap-1.5">
|
|
814
|
+
<Keycaps chord={{ code: "Slash", mod: true }} platform={platform} />
|
|
815
|
+
All shortcuts
|
|
816
|
+
</span>
|
|
817
|
+
</div>
|
|
818
|
+
</DialogPrimitive.Content>
|
|
819
|
+
</DialogPortal>
|
|
820
|
+
</DialogPrimitive.Root>
|
|
821
|
+
);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
function FooterHint(props: { keys: Chord[]; label: string; platform: ActionEnv["platform"] }) {
|
|
825
|
+
return (
|
|
826
|
+
<span className="inline-flex items-center gap-1.5">
|
|
827
|
+
<span className="inline-flex items-center gap-0.5">
|
|
828
|
+
{props.keys.map((chord) => (
|
|
829
|
+
<Keycaps key={chord.code} chord={chord} platform={props.platform} />
|
|
830
|
+
))}
|
|
831
|
+
</span>
|
|
832
|
+
{props.label}
|
|
833
|
+
</span>
|
|
834
|
+
);
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/** Enough of a chat row to copy its link when only a recent-chats record is known. */
|
|
838
|
+
function pseudoRow(record: ChatRecord): SessionListRow {
|
|
839
|
+
return { id: record.id, workspaceId: record.workspaceId } as SessionListRow;
|
|
840
|
+
}
|