@flamingo-stack/openframe-frontend-core 0.0.824 → 0.0.826
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/build/export-map.json +1 -1
- package/dist/{case-study-card-IZBMHA6R.cjs → case-study-card-O4IQCJAX.cjs} +5 -5
- package/dist/chat-protocol/events.d.ts +0 -3
- package/dist/chat-protocol/events.d.ts.map +1 -1
- package/dist/chat-protocol/frames.d.ts +10 -7
- package/dist/chat-protocol/frames.d.ts.map +1 -1
- package/dist/chat-protocol/index.cjs +238 -234
- package/dist/chat-protocol/leading-frames.d.ts.map +1 -1
- package/dist/chat-protocol/leading-frames.js +6 -3
- package/dist/chat-protocol/progress.d.ts +13 -20
- package/dist/chat-protocol/progress.d.ts.map +1 -1
- package/dist/chat-protocol/progress.js +13 -11
- package/dist/{chunk-QOAA7ZHB.cjs → chunk-2HQNXX2K.cjs} +2 -2
- package/dist/{chunk-TQ7TUEK2.cjs → chunk-2TQJSB62.cjs} +4879 -3563
- package/dist/{chunk-NONMZ5WJ.cjs → chunk-2VLPXUQK.cjs} +14 -83
- package/dist/{chunk-HDOU3AXV.cjs → chunk-37OYBX7W.cjs} +36 -36
- package/dist/{chunk-OBQ5WUNG.cjs → chunk-3B6ZE4EZ.cjs} +29 -29
- package/dist/{chunk-C3RAE7RO.cjs → chunk-5AQKXEMI.cjs} +979 -1357
- package/dist/{chunk-25HBH4J6.cjs → chunk-5BM7X4GA.cjs} +2 -2
- package/dist/{chunk-A3SR6HHX.cjs → chunk-63T2KKDZ.cjs} +86 -86
- package/dist/{chunk-MROW2JWE.cjs → chunk-6G4WRMEM.cjs} +3 -3
- package/dist/{chunk-WMTV6M5B.cjs → chunk-74GWFGH2.cjs} +28 -28
- package/dist/{chunk-467T3LCG.cjs → chunk-7PZQ7SHB.cjs} +49 -32
- package/dist/{chunk-SOSVC6HB.cjs → chunk-AJM4YZTW.cjs} +8 -8
- package/dist/{chunk-2XLPRW7V.cjs → chunk-BIG3O33P.cjs} +6 -2
- package/dist/chunk-BMQLM2NU.cjs +40 -0
- package/dist/{chunk-DVHSYPDB.cjs → chunk-DAKGX2WF.cjs} +2 -2
- package/dist/{chunk-2IWAHBCC.cjs → chunk-DRSFR5AC.cjs} +159 -159
- package/dist/{chunk-IJCSQFLD.cjs → chunk-DU6AF77X.cjs} +83 -121
- package/dist/{chunk-B2VRNRTY.cjs → chunk-EJNDTSKY.cjs} +91 -91
- package/dist/{chunk-SBFBNOKU.cjs → chunk-ENMPSEEQ.cjs} +4 -4
- package/dist/{chunk-ZECG6GU5.cjs → chunk-F2J5WN6U.cjs} +2 -2
- package/dist/{chunk-BOS7OIC4.cjs → chunk-GRHF5SWL.cjs} +5 -2
- package/dist/{chunk-Z7BLMJEI.cjs → chunk-GZAPOCKS.cjs} +54 -54
- package/dist/{chunk-M7EBCYKN.cjs → chunk-HJAPXKWK.cjs} +17 -17
- package/dist/{chunk-XUMZMIHR.cjs → chunk-HQ4FKHOO.cjs} +249 -108
- package/dist/{chunk-ZRDVFADQ.cjs → chunk-IBD2FPSX.cjs} +75 -9
- package/dist/{chunk-T266OITJ.cjs → chunk-IKWQW3YJ.cjs} +45 -45
- package/dist/{chunk-B7NSH7IK.cjs → chunk-IWQ2LJGW.cjs} +5 -5
- package/dist/{chunk-2IHGR57J.cjs → chunk-JDR72QFU.cjs} +12 -14
- package/dist/{chunk-EHANO6UE.cjs → chunk-K34TTZAE.cjs} +9 -129
- package/dist/{chunk-QDDBOCG3.cjs → chunk-KPGKTEEB.cjs} +2 -2
- package/dist/{chunk-WSBAIZXL.cjs → chunk-MDEOCOIE.cjs} +23 -23
- package/dist/chunk-OEP5KAT6.cjs +56 -0
- package/dist/chunk-OT6P57ZS.cjs +94 -0
- package/dist/{chunk-QQT23JJ7.cjs → chunk-PBHP3FHO.cjs} +4 -4
- package/dist/{chunk-J5U3XHFJ.cjs → chunk-PJY3SYCS.cjs} +29 -27
- package/dist/{chunk-5N26M6CK.cjs → chunk-PWAKRRRO.cjs} +1283 -268
- package/dist/{chunk-UEULXVW2.cjs → chunk-QS6AKUUL.cjs} +22 -22
- package/dist/{chunk-GXBIYPDM.cjs → chunk-QYJZDEG7.cjs} +6 -6
- package/dist/{chunk-NPNZAAOB.cjs → chunk-S6UJEW4G.cjs} +2 -2
- package/dist/{chunk-TTMTNG3U.cjs → chunk-TJG2BJ5J.cjs} +4 -4
- package/dist/{chunk-QOOMUGF2.cjs → chunk-TYJ73DHW.cjs} +15 -15
- package/dist/{chunk-A34UNP5V.cjs → chunk-W4VEDSAX.cjs} +80 -11
- package/dist/{chunk-2M4E2V25.cjs → chunk-WGMU45NV.cjs} +20 -20
- package/dist/{chunk-EZTCN43H.cjs → chunk-XDHQC4XH.cjs} +46 -46
- package/dist/{cloud-tenants-VYXMNISG.cjs → cloud-tenants-F67KQ5GC.cjs} +108 -106
- package/dist/components/case-studies/index.cjs +124 -122
- package/dist/components/chat/approval-batch-message.d.ts.map +1 -1
- package/dist/components/chat/approval-batch-message.js +2 -2
- package/dist/components/chat/chat-archive-page.d.ts +7 -0
- package/dist/components/chat/chat-archive-page.d.ts.map +1 -1
- package/dist/components/chat/chat-archive-page.js +9 -0
- package/dist/components/chat/chat-composer.d.ts +24 -4
- package/dist/components/chat/chat-composer.d.ts.map +1 -1
- package/dist/components/chat/chat-composer.js +90 -48
- package/dist/components/chat/chat-context-memory-bar.d.ts +4 -1
- package/dist/components/chat/chat-context-memory-bar.d.ts.map +1 -1
- package/dist/components/chat/chat-context-memory-bar.js +8 -5
- package/dist/components/chat/chat-context-picker.d.ts +8 -1
- package/dist/components/chat/chat-context-picker.d.ts.map +1 -1
- package/dist/components/chat/chat-context-picker.js +32 -9
- package/dist/components/chat/chat-header-rename-field.d.ts +18 -0
- package/dist/components/chat/chat-header-rename-field.d.ts.map +1 -0
- package/dist/components/chat/chat-header-rename-field.js +49 -0
- package/dist/components/chat/chat-input.d.ts.map +1 -1
- package/dist/components/chat/chat-input.js +5 -0
- package/dist/components/chat/composer-sheet.d.ts +44 -0
- package/dist/components/chat/composer-sheet.d.ts.map +1 -0
- package/dist/components/chat/composer-sheet.js +140 -0
- package/dist/components/chat/embeddable-chat.d.ts +114 -1
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.js +328 -218
- package/dist/components/chat/hooks/use-sse-chat-adapter.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-sse-chat-adapter.js +0 -2
- package/dist/components/chat/hooks/use-unified-chat.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-unified-chat.js +0 -1
- package/dist/components/chat/index.cjs +118 -103
- package/dist/components/chat/index.d.ts +6 -0
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +9 -0
- package/dist/components/chat/mingo-chat-day-groups.d.ts +18 -0
- package/dist/components/chat/mingo-chat-day-groups.d.ts.map +1 -0
- package/dist/components/chat/mingo-chat-day-groups.js +45 -0
- package/dist/components/chat/mingo-chat-header.d.ts +34 -6
- package/dist/components/chat/mingo-chat-header.d.ts.map +1 -1
- package/dist/components/chat/mingo-chat-header.js +44 -7
- package/dist/components/chat/mingo-chat-history-section.d.ts +30 -0
- package/dist/components/chat/mingo-chat-history-section.d.ts.map +1 -0
- package/dist/components/chat/mingo-chat-history-section.js +500 -0
- package/dist/components/chat/mingo-chat-history.d.ts +5 -2
- package/dist/components/chat/mingo-chat-history.d.ts.map +1 -1
- package/dist/components/chat/mingo-chat-history.js +26 -30
- package/dist/components/chat/mingo-chat-list-shared.d.ts +136 -0
- package/dist/components/chat/mingo-chat-list-shared.d.ts.map +1 -0
- package/dist/components/chat/mingo-chat-list-shared.js +76 -0
- package/dist/components/chat/mingo-chat-rail.d.ts +19 -51
- package/dist/components/chat/mingo-chat-rail.d.ts.map +1 -1
- package/dist/components/chat/mingo-chat-rail.js +23 -45
- package/dist/components/chat/mingo-edge-light.d.ts +13 -0
- package/dist/components/chat/mingo-edge-light.d.ts.map +1 -0
- package/dist/components/chat/mingo-edge-light.js +17 -0
- package/dist/components/chat/mingo-history-rail.d.ts +5 -4
- package/dist/components/chat/mingo-history-rail.d.ts.map +1 -1
- package/dist/components/chat/mingo-history-rail.js +5 -10
- package/dist/components/chat/mingo-quick-action-wall.d.ts +27 -0
- package/dist/components/chat/mingo-quick-action-wall.d.ts.map +1 -0
- package/dist/components/chat/mingo-quick-action-wall.js +41 -0
- package/dist/components/chat/mingo-welcome.d.ts.map +1 -1
- package/dist/components/chat/mingo-welcome.js +6 -20
- package/dist/components/chat/model-display.d.ts.map +1 -1
- package/dist/components/chat/model-display.js +38 -9
- package/dist/components/chat/stream/chat-dialog-store.d.ts.map +1 -1
- package/dist/components/chat/stream/chat-dialog-store.js +0 -1
- package/dist/components/chat/stream/chat-stream-reducer.d.ts +0 -4
- package/dist/components/chat/stream/chat-stream-reducer.d.ts.map +1 -1
- package/dist/components/chat/stream/chat-stream-reducer.js +6 -13
- package/dist/components/chat/tool-execution-display.d.ts.map +1 -1
- package/dist/components/chat/tool-execution-display.js +15 -1
- package/dist/components/chat/types/component.types.d.ts +13 -1
- package/dist/components/chat/types/component.types.d.ts.map +1 -1
- package/dist/components/chat/types/unified-chat-state.types.d.ts +0 -5
- package/dist/components/chat/types/unified-chat-state.types.d.ts.map +1 -1
- package/dist/components/chat/utils/chat-day-label.d.ts +8 -0
- package/dist/components/chat/utils/chat-day-label.d.ts.map +1 -0
- package/dist/components/chat/utils/chat-day-label.js +21 -0
- package/dist/components/contact/index.cjs +109 -107
- package/dist/components/docs/index.cjs +112 -110
- package/dist/components/embeds/index.cjs +109 -107
- package/dist/components/faq/index.cjs +110 -108
- package/dist/components/features/board/board-column.d.ts +3 -1
- package/dist/components/features/board/board-column.d.ts.map +1 -1
- package/dist/components/features/board/board-column.js +6 -2
- package/dist/components/features/board/board.d.ts +6 -0
- package/dist/components/features/board/board.d.ts.map +1 -1
- package/dist/components/features/board/board.js +14 -3
- package/dist/components/features/board/touch-board.d.ts +1 -1
- package/dist/components/features/board/touch-board.d.ts.map +1 -1
- package/dist/components/features/board/touch-board.js +3 -1
- package/dist/components/features/index.cjs +108 -106
- package/dist/components/features/notifications/approval-request-notification-tile.d.ts +7 -1
- package/dist/components/features/notifications/approval-request-notification-tile.d.ts.map +1 -1
- package/dist/components/features/notifications/approval-request-notification-tile.js +1 -1
- package/dist/components/features/notifications/notification-drawer.d.ts +6 -1
- package/dist/components/features/notifications/notification-drawer.d.ts.map +1 -1
- package/dist/components/features/notifications/notification-drawer.js +3 -2
- package/dist/components/features/notifications/notification-tile.d.ts +4 -1
- package/dist/components/features/notifications/notification-tile.d.ts.map +1 -1
- package/dist/components/features/notifications/notification-tile.js +9 -7
- package/dist/components/features/time-tracker/time-tracker-header-button.d.ts +18 -1
- package/dist/components/features/time-tracker/time-tracker-header-button.d.ts.map +1 -1
- package/dist/components/features/time-tracker/time-tracker-header-button.js +31 -7
- package/dist/components/help-center-pages/index.cjs +217 -215
- package/dist/components/icons-v2-generated/icon-loaders.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/icon-loaders.js +1 -0
- package/dist/components/icons-v2-generated/icon-names.js +1 -1
- package/dist/components/icons-v2-generated/index.cjs +90 -86
- package/dist/components/icons-v2-generated/loaders/dots-loader-icon.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/loaders/dots-loader-icon.js +21 -24
- package/dist/components/icons-v2-generated/logos/index.d.ts +1 -0
- package/dist/components/icons-v2-generated/logos/index.d.ts.map +1 -1
- package/dist/components/icons-v2-generated/logos/index.js +2 -0
- package/dist/components/icons-v2-generated/logos/mingo-logo-icon.d.ts +9 -0
- package/dist/components/icons-v2-generated/logos/mingo-logo-icon.d.ts.map +1 -0
- package/dist/components/icons-v2-generated/logos/mingo-logo-icon.js +36 -0
- package/dist/components/index.cjs +215 -182
- package/dist/components/meeting-scheduler/index.cjs +182 -180
- package/dist/components/navigation/account-popover.d.ts +62 -0
- package/dist/components/navigation/account-popover.d.ts.map +1 -0
- package/dist/components/navigation/account-popover.js +138 -0
- package/dist/components/navigation/app-header.d.ts +36 -2
- package/dist/components/navigation/app-header.d.ts.map +1 -1
- package/dist/components/navigation/app-header.js +28 -24
- package/dist/components/navigation/app-layout-context.d.ts +17 -0
- package/dist/components/navigation/app-layout-context.d.ts.map +1 -1
- package/dist/components/navigation/app-layout-context.js +9 -1
- package/dist/components/navigation/app-layout.d.ts +93 -1
- package/dist/components/navigation/app-layout.d.ts.map +1 -1
- package/dist/components/navigation/app-layout.js +149 -30
- package/dist/components/navigation/header-button.d.ts +11 -1
- package/dist/components/navigation/header-button.d.ts.map +1 -1
- package/dist/components/navigation/header-button.js +16 -5
- package/dist/components/navigation/header-mingo-button.d.ts.map +1 -1
- package/dist/components/navigation/header-mingo-button.js +6 -5
- package/dist/components/navigation/index.cjs +120 -109
- package/dist/components/navigation/index.d.ts +10 -1
- package/dist/components/navigation/index.d.ts.map +1 -1
- package/dist/components/navigation/index.js +8 -0
- package/dist/components/navigation/mingo-ai-button.d.ts.map +1 -1
- package/dist/components/navigation/mingo-ai-button.js +2 -1
- package/dist/components/navigation/mobile-burger-menu.d.ts.map +1 -1
- package/dist/components/navigation/mobile-burger-menu.js +155 -39
- package/dist/components/navigation/navigation-sidebar-grouped.d.ts +57 -0
- package/dist/components/navigation/navigation-sidebar-grouped.d.ts.map +1 -0
- package/dist/components/navigation/navigation-sidebar-grouped.js +365 -0
- package/dist/components/navigation/navigation-sidebar-match.d.ts +37 -0
- package/dist/components/navigation/navigation-sidebar-match.d.ts.map +1 -0
- package/dist/components/navigation/navigation-sidebar-match.js +85 -0
- package/dist/components/navigation/navigation-sidebar-slot.d.ts +7 -0
- package/dist/components/navigation/navigation-sidebar-slot.d.ts.map +1 -0
- package/dist/components/navigation/navigation-sidebar-slot.js +11 -0
- package/dist/components/navigation/navigation-sidebar-toggle.d.ts +7 -1
- package/dist/components/navigation/navigation-sidebar-toggle.d.ts.map +1 -1
- package/dist/components/navigation/navigation-sidebar-toggle.js +52 -23
- package/dist/components/navigation/navigation-sidebar.d.ts +13 -1
- package/dist/components/navigation/navigation-sidebar.d.ts.map +1 -1
- package/dist/components/navigation/navigation-sidebar.js +188 -52
- package/dist/components/navigation/notifications-bell-button.d.ts +28 -0
- package/dist/components/navigation/notifications-bell-button.d.ts.map +1 -0
- package/dist/components/navigation/notifications-bell-button.js +44 -0
- package/dist/components/navigation/ticket-alerts-button.d.ts +7 -1
- package/dist/components/navigation/ticket-alerts-button.d.ts.map +1 -1
- package/dist/components/navigation/ticket-alerts-button.js +3 -2
- package/dist/components/onboarding-guides/index.cjs +111 -109
- package/dist/components/product-demo/index.cjs +119 -117
- package/dist/components/related-content/index.cjs +13 -13
- package/dist/components/tickets/index.cjs +115 -113
- package/dist/components/ui/actions-menu.d.ts +6 -1
- package/dist/components/ui/actions-menu.d.ts.map +1 -1
- package/dist/components/ui/actions-menu.js +6 -2
- package/dist/components/ui/fade-preview.d.ts +8 -0
- package/dist/components/ui/fade-preview.d.ts.map +1 -1
- package/dist/components/ui/fade-preview.js +7 -5
- package/dist/components/ui/index.cjs +136 -111
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +1 -0
- package/dist/components/ui/mobile-action-bar.d.ts +14 -0
- package/dist/components/ui/mobile-action-bar.d.ts.map +1 -0
- package/dist/components/ui/mobile-action-bar.js +68 -0
- package/dist/components/ui/no-data/no-data-styles.d.ts +1 -1
- package/dist/components/ui/no-data/no-data-styles.d.ts.map +1 -1
- package/dist/components/ui/no-data/no-data-styles.js +1 -1
- package/dist/components/ui/page-actions.d.ts.map +1 -1
- package/dist/components/ui/page-actions.js +24 -8
- package/dist/components/ui/panel-resize-handle.d.ts +6 -2
- package/dist/components/ui/panel-resize-handle.d.ts.map +1 -1
- package/dist/components/ui/panel-resize-handle.js +6 -3
- package/dist/components/ui/square-avatar.d.ts.map +1 -1
- package/dist/components/ui/square-avatar.js +5 -2
- package/dist/{devices-NTYNZEGJ.cjs → devices-SJORCARH.cjs} +109 -107
- package/dist/dots-loader-icon-5JXWD6FB.cjs +7 -0
- package/dist/{embeddable-chat-JAUO4O2T.cjs → embeddable-chat-7Z4CEZJL.cjs} +512 -400
- package/dist/hooks/index.cjs +15 -16
- package/dist/hooks/ui/use-content-breakpoint.d.ts +4 -2
- package/dist/hooks/ui/use-content-breakpoint.d.ts.map +1 -1
- package/dist/{icon-loaders-OLGJZGRP.cjs → icon-loaders-SUPEKMBJ.cjs} +2 -1
- package/dist/index.cjs +154 -121
- package/dist/{knowledge-I2LW27EP.cjs → knowledge-QXILUVEM.cjs} +109 -107
- package/dist/{logs-KLZHXSOU.cjs → logs-E3KQQQD6.cjs} +118 -115
- package/dist/mingo-logo-icon-WGPBSDTF.cjs +7 -0
- package/dist/{policies-SMDAHDKL.cjs → policies-IOYQY6TF.cjs} +112 -110
- package/dist/{remote-session-BQMTIQTU.cjs → remote-session-QGFG5WAL.cjs} +99 -97
- package/dist/{scripts-OMBBPNTU.cjs → scripts-E5TWWUNP.cjs} +115 -113
- package/dist/{software-update-ZIJYNJIC.cjs → software-update-QZGYG4TD.cjs} +112 -110
- package/dist/{tickets-board-TRXOX77R.cjs → tickets-board-KCH6ITUV.cjs} +95 -94
- package/dist/types/navigation.d.ts +131 -0
- package/dist/types/navigation.d.ts.map +1 -1
- package/dist/utils/index.cjs +65 -25
- package/package.json +1 -1
- package/src/chat-protocol/events.ts +0 -3
- package/src/chat-protocol/frames.ts +12 -8
- package/src/chat-protocol/leading-frames.ts +7 -4
- package/src/chat-protocol/progress.ts +31 -28
- package/src/components/chat/approval-batch-message.tsx +3 -2
- package/src/components/chat/chat-archive-page.tsx +16 -0
- package/src/components/chat/chat-composer.tsx +131 -61
- package/src/components/chat/chat-context-memory-bar.tsx +27 -17
- package/src/components/chat/chat-context-picker.tsx +45 -11
- package/src/components/chat/chat-header-rename-field.tsx +68 -0
- package/src/components/chat/chat-input.tsx +9 -1
- package/src/components/chat/composer-sheet.tsx +196 -0
- package/src/components/chat/embeddable-chat.tsx +636 -324
- package/src/components/chat/hooks/use-sse-chat-adapter.ts +0 -2
- package/src/components/chat/hooks/use-unified-chat.ts +0 -1
- package/src/components/chat/index.ts +6 -0
- package/src/components/chat/mingo-chat-day-groups.ts +62 -0
- package/src/components/chat/mingo-chat-header.tsx +99 -23
- package/src/components/chat/mingo-chat-history-section.tsx +670 -0
- package/src/components/chat/mingo-chat-history.tsx +31 -45
- package/src/components/chat/mingo-chat-list-shared.tsx +244 -0
- package/src/components/chat/mingo-chat-rail.tsx +45 -97
- package/src/components/chat/mingo-edge-light.tsx +25 -0
- package/src/components/chat/mingo-history-rail.tsx +7 -17
- package/src/components/chat/mingo-quick-action-wall.tsx +64 -0
- package/src/components/chat/mingo-welcome.tsx +5 -19
- package/src/components/chat/model-display.tsx +66 -14
- package/src/components/chat/stream/chat-dialog-store.ts +0 -1
- package/src/components/chat/stream/chat-stream-reducer.ts +6 -17
- package/src/components/chat/tool-execution-display.tsx +9 -1
- package/src/components/chat/types/component.types.ts +13 -1
- package/src/components/chat/types/unified-chat-state.types.ts +0 -6
- package/src/components/chat/utils/chat-day-label.ts +24 -0
- package/src/components/features/board/board-column.tsx +8 -0
- package/src/components/features/board/board.tsx +16 -2
- package/src/components/features/board/touch-board.tsx +2 -0
- package/src/components/features/notifications/approval-request-notification-tile.tsx +8 -2
- package/src/components/features/notifications/notification-drawer.tsx +7 -1
- package/src/components/features/notifications/notification-tile.tsx +17 -9
- package/src/components/features/time-tracker/time-tracker-header-button.tsx +53 -6
- package/src/components/icons-v2/icon-colors.json +4 -0
- package/src/components/icons-v2-generated/icon-loaders.ts +1 -0
- package/src/components/icons-v2-generated/icon-names.ts +1 -1
- package/src/components/icons-v2-generated/loaders/dots-loader-icon.tsx +18 -27
- package/src/components/icons-v2-generated/logos/index.ts +1 -0
- package/src/components/icons-v2-generated/logos/mingo-logo-icon.tsx +35 -0
- package/src/components/navigation/account-popover.tsx +198 -0
- package/src/components/navigation/app-header.tsx +74 -33
- package/src/components/navigation/app-layout-context.ts +22 -0
- package/src/components/navigation/app-layout.tsx +290 -24
- package/src/components/navigation/header-button.tsx +27 -5
- package/src/components/navigation/header-mingo-button.tsx +6 -5
- package/src/components/navigation/index.ts +19 -0
- package/src/components/navigation/mingo-ai-button.tsx +2 -3
- package/src/components/navigation/mobile-burger-menu.tsx +219 -53
- package/src/components/navigation/navigation-sidebar-grouped.tsx +554 -0
- package/src/components/navigation/navigation-sidebar-match.ts +152 -0
- package/src/components/navigation/navigation-sidebar-slot.ts +12 -0
- package/src/components/navigation/navigation-sidebar-toggle.tsx +39 -6
- package/src/components/navigation/navigation-sidebar.tsx +278 -61
- package/src/components/navigation/notifications-bell-button.tsx +70 -0
- package/src/components/navigation/ticket-alerts-button.tsx +9 -2
- package/src/components/ui/actions-menu.tsx +19 -3
- package/src/components/ui/fade-preview.tsx +13 -6
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/mobile-action-bar.ts +87 -0
- package/src/components/ui/no-data/no-data-styles.ts +5 -2
- package/src/components/ui/page-actions.tsx +38 -11
- package/src/components/ui/panel-resize-handle.tsx +14 -5
- package/src/components/ui/square-avatar.tsx +5 -2
- package/src/hooks/ui/use-content-breakpoint.ts +4 -2
- package/src/styles/ods-interaction-states.css +68 -0
- package/src/types/navigation.ts +140 -0
- package/dist/chunk-C7GIHB3V.cjs +0 -59
- package/dist/dots-loader-icon-RBLX46X7.cjs +0 -7
- package/dist/{chunk-ZOZR3QI2.cjs → chunk-46547WQW.cjs} +0 -0
- package/dist/{video-file-player-IAMWBKEQ.cjs → video-file-player-IHO66P2Q.cjs} +1 -1
|
@@ -40,7 +40,7 @@ import { usePreventScroll } from '@react-aria/overlays';
|
|
|
40
40
|
import { isIOS } from '@react-aria/utils';
|
|
41
41
|
import { MessageSquare } from 'lucide-react';
|
|
42
42
|
import React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
43
|
-
import {
|
|
43
|
+
import { createPortal } from 'react-dom';
|
|
44
44
|
import { useRequiredChatRuntime } from '../../contexts/chat-runtime-context';
|
|
45
45
|
import { useIsHydrated } from '../../hooks/ui/use-is-hydrated';
|
|
46
46
|
import { cn } from '../../utils/cn';
|
|
@@ -93,9 +93,10 @@ import type { UseSseChatAdapterOptions } from './hooks/use-sse-chat-adapter';
|
|
|
93
93
|
import { useUnifiedChat, type ChatMode, type UseUnifiedChatModes } from './hooks/use-unified-chat';
|
|
94
94
|
import { awaitsDecision, useWhatToAsk, type WhatToAskContent } from './hooks/use-what-to-ask';
|
|
95
95
|
import { MingoArchiveList } from './mingo-archive-list';
|
|
96
|
-
import { MingoChatHeader } from './mingo-chat-header';
|
|
96
|
+
import { MingoChatHeader, type MingoChatHeaderAction } from './mingo-chat-header';
|
|
97
|
+
import type { MingoDialogStatus } from './mingo-chat-list-shared';
|
|
97
98
|
import { ChatDialogModals } from './mingo-chat-modals';
|
|
98
|
-
import { MingoChatRail
|
|
99
|
+
import { MingoChatRail } from './mingo-chat-rail';
|
|
99
100
|
import { MingoHistoryRail } from './mingo-history-rail';
|
|
100
101
|
import { MINGO_ONBOARDING_SKELETON_ROWS, MingoOnboardingCard } from './mingo-onboarding-card';
|
|
101
102
|
import { MingoWelcome, type MingoWelcomeProps } from './mingo-welcome';
|
|
@@ -113,6 +114,7 @@ import type {
|
|
|
113
114
|
} from './types/unified-chat-state.types';
|
|
114
115
|
import { ASK_AI_OPEN_EVENT, ASK_AI_OPEN_WITH_REF_EVENT, chatListensForAskAiOpens } from './utils/ask-ai-events';
|
|
115
116
|
import { formatChatAttachmentMarkdownForBubble } from './utils/chat-attachment-markdown';
|
|
117
|
+
import { chatDayLabel } from './utils/chat-day-label';
|
|
116
118
|
import { chatChipClass } from './utils/chip-styles';
|
|
117
119
|
import { FALLBACK_TOP_RETRIEVED, groupedRowLabels, splitCitedSources } from './utils/cited-sources';
|
|
118
120
|
import { flattenAssistantContent } from './utils/flatten-assistant-content';
|
|
@@ -522,6 +524,108 @@ export interface EmbeddableChatProps {
|
|
|
522
524
|
* every chat that is not archived, a new one included.
|
|
523
525
|
*/
|
|
524
526
|
chatMenuExtraItems?: ActionsMenuItem[];
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Who draws the chat list. `'auto'` (default): the panel does, from its own
|
|
530
|
+
* width — the rail beside the chat when it fits, the "Current Chats" screen
|
|
531
|
+
* when it does not. `'none'`: the host owns the list (e.g. in its main
|
|
532
|
+
* sidebar), so the panel never draws one at any width: no rail, no list
|
|
533
|
+
* screen, no list toggle or back-to-list control; with no conversation open
|
|
534
|
+
* it shows the new chat. Rename / archive from the panel still work.
|
|
535
|
+
*/
|
|
536
|
+
rail?: 'auto' | 'none';
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Splits the panel for a host that keeps ONE chat mounted for the session:
|
|
540
|
+
* the composer renders in place (a dock under every page) while the header
|
|
541
|
+
* and the thread go elsewhere.
|
|
542
|
+
* - `undefined` (default): everything in place, as before.
|
|
543
|
+
* - an element: the header and the thread (pending-approvals bar, jump to
|
|
544
|
+
* latest, load older, a new chat's welcome) render into it through a
|
|
545
|
+
* portal; the composer stays here.
|
|
546
|
+
* - `null`: no header and no thread at all — the composer alone.
|
|
547
|
+
* Either of the last two implies `rail="none"`, and the header is the page
|
|
548
|
+
* one (`MingoChatHeader variant="page"`): no close, collapse or list control.
|
|
549
|
+
* Its ⋯ is the chat's, Compact included. The composer never remounts
|
|
550
|
+
* when this changes, so the draft, staged context, picker and uploads
|
|
551
|
+
* survive it; the thread remounts in each new container and opens on the
|
|
552
|
+
* latest message (its data is the host's `mingoState`). Meant for
|
|
553
|
+
* `shell="inline"`; the host must not clip the composer's root — the
|
|
554
|
+
* context picker, `@` / slash menus and the memory popover open above it.
|
|
555
|
+
* The portalled thread paints no background: the host paints the area that
|
|
556
|
+
* holds the thread and the composer (`AppLayout`'s `pageSurface="mingo"`).
|
|
557
|
+
*/
|
|
558
|
+
threadContainer?: HTMLElement | null;
|
|
559
|
+
/**
|
|
560
|
+
* Icon cells at the end of the header portalled into `threadContainer`, after the
|
|
561
|
+
* chat's ⋯ — what the host that shows the thread there adds (a sheet's "Open as
|
|
562
|
+
* full chat" and "Back to page"). Split layout only.
|
|
563
|
+
*/
|
|
564
|
+
threadHeaderActions?: ReadonlyArray<MingoChatHeaderAction>;
|
|
565
|
+
/**
|
|
566
|
+
* The thread's column inside `threadContainer` — e.g. `mx-auto max-w-[760px]` to
|
|
567
|
+
* centre it at the composer's width on a wide chat page; the header stays full
|
|
568
|
+
* width. Omitted: the column fills the container (a narrow panel, a sheet).
|
|
569
|
+
* Split layout only.
|
|
570
|
+
*/
|
|
571
|
+
threadContentClassName?: string;
|
|
572
|
+
|
|
573
|
+
/** The model + token row under the composer. `false` hides it (e.g. a home
|
|
574
|
+
* page that has no chat yet). Default `true`. */
|
|
575
|
+
showModel?: boolean;
|
|
576
|
+
/** Makes the model name in that row a button (e.g. to the AI settings). */
|
|
577
|
+
onModelClick?: () => void;
|
|
578
|
+
/** Tooltip over the model name (e.g. "Change in Settings → AI Settings"). */
|
|
579
|
+
modelTooltip?: string;
|
|
580
|
+
/** The composer's own ⋯ menu, at the end of its input row (e.g. "Compact
|
|
581
|
+
* Chat Memory", disabled when there is nothing to compact). */
|
|
582
|
+
composerMenuItems?: ActionsMenuItem[];
|
|
583
|
+
/** Controls under the input, at the end of the model row (e.g. "Compact chat
|
|
584
|
+
* memory" as a button rather than in the composer's ⋯). */
|
|
585
|
+
composerFooterActions?: React.ReactNode;
|
|
586
|
+
/**
|
|
587
|
+
* A host control at the start of the composer's context strip — e.g. a chat
|
|
588
|
+
* minimised behind the page ("Continue <chat>"). The strip shows for it even
|
|
589
|
+
* with nothing remembered.
|
|
590
|
+
*/
|
|
591
|
+
composerContextLeading?: React.ReactNode;
|
|
592
|
+
/** The composer's prompt. Default: "Enter your Request..." (v2) /
|
|
593
|
+
* "Ask a question..." (classic). Uploads in flight still say so instead. */
|
|
594
|
+
composerPlaceholder?: string;
|
|
595
|
+
/** Mingo's AI edge light travelling around the composer's input card (the
|
|
596
|
+
* header launcher's, `MingoEdgeLight`). Default `false`. */
|
|
597
|
+
composerEdgeLight?: boolean;
|
|
598
|
+
/**
|
|
599
|
+
* How "Rename Chat" in the chat header's ⋯ renames. `'modal'` (default): the
|
|
600
|
+
* Rename Chat modal. `'inline'`: the title turns into a field with its text
|
|
601
|
+
* selected — Enter saves, Escape cancels, blur saves. Applies to the Mingo v2
|
|
602
|
+
* and page headers; chat-list rows and the classic headers keep the modal.
|
|
603
|
+
*/
|
|
604
|
+
renameMode?: 'modal' | 'inline';
|
|
605
|
+
/**
|
|
606
|
+
* Whether the composer clears the bottom safe-area inset (the iOS home bar)
|
|
607
|
+
* itself. Default `true`. Pass `false` when the composer sits in a layout
|
|
608
|
+
* that already owns that inset — a dock in a native shell whose root pads
|
|
609
|
+
* it — where the two would add up.
|
|
610
|
+
*/
|
|
611
|
+
safeAreaBottom?: boolean;
|
|
612
|
+
/**
|
|
613
|
+
* Called with the new dialog's id when a send from this panel created it:
|
|
614
|
+
* the id the panel lands on while the send that started from "no dialog"
|
|
615
|
+
* is in flight (the composer, a quick-action chip, a clarification card,
|
|
616
|
+
* the Guide launcher prompt). Fired once per dialog, after the commit that
|
|
617
|
+
* shows it. Opening an existing dialog never fires it, and neither does a
|
|
618
|
+
* dialog the host creates itself (outside this panel's sends).
|
|
619
|
+
*/
|
|
620
|
+
onDialogCreated?: (dialogId: string) => void;
|
|
621
|
+
/**
|
|
622
|
+
* Host-set ghost text in the composer: the same non-destructive preview a
|
|
623
|
+
* hovered quick-action chip shows (the prompt that clicking it would send),
|
|
624
|
+
* for chips the host draws itself (e.g. a home page beside a docked
|
|
625
|
+
* composer). `null` / omitted = none. The panel's own chip hover wins while
|
|
626
|
+
* it lasts.
|
|
627
|
+
*/
|
|
628
|
+
composerPreviewText?: string | null;
|
|
525
629
|
}
|
|
526
630
|
|
|
527
631
|
// =============================================================================
|
|
@@ -892,8 +996,8 @@ function SourceChips({
|
|
|
892
996
|
<span className="uppercase text-ods-text-muted text-h6">
|
|
893
997
|
<TextHold>Sources</TextHold>
|
|
894
998
|
</span>
|
|
895
|
-
{/* One row at every width: a chip that does not fit is cut, never wrapped (a strip's chips fit one
|
|
896
|
-
the answers measured, and a wrapped skeleton shrinks when the answer ends). */}
|
|
999
|
+
{/* One row at every width: a chip that does not fit is cut, never wrapped or hidden (a strip's chips fit one
|
|
1000
|
+
row in the answers measured, and a wrapped skeleton shrinks when the answer ends). */}
|
|
897
1001
|
<div className="flex flex-nowrap gap-1.5 overflow-hidden">
|
|
898
1002
|
<LoadingItems count={skeletonCount}>{() => <SourceChipSkeleton data-loading-item />}</LoadingItems>
|
|
899
1003
|
</div>
|
|
@@ -985,6 +1089,19 @@ export interface EmbeddableChatHandle {
|
|
|
985
1089
|
* from the `@` picker, and `text` follows them in the draft.
|
|
986
1090
|
*/
|
|
987
1091
|
prefillDraft: (draft: ChatPrefillDraft) => void;
|
|
1092
|
+
/**
|
|
1093
|
+
* Same as the v2 list's "What to ask Mingo?", for a host that draws its own entry
|
|
1094
|
+
* (a link beside its quick actions, an item in its own chat-history menu): the
|
|
1095
|
+
* host's `onWhatToAsk` when it has one, else the `whatToAsk` exchange in a new
|
|
1096
|
+
* chat, else a new chat. Leaves the archive.
|
|
1097
|
+
*/
|
|
1098
|
+
showWhatToAsk: () => void;
|
|
1099
|
+
/**
|
|
1100
|
+
* Opens the composer's context picker, as its `+` does, for a host that draws its
|
|
1101
|
+
* own entry ("+ Add context" in the composer's context strip). Nothing without a
|
|
1102
|
+
* `contextPicker`.
|
|
1103
|
+
*/
|
|
1104
|
+
openContextPicker: () => void;
|
|
988
1105
|
}
|
|
989
1106
|
|
|
990
1107
|
export const EmbeddableChat = React.forwardRef<EmbeddableChatHandle, EmbeddableChatProps>(
|
|
@@ -1038,6 +1155,22 @@ function EmbeddableChatInner({
|
|
|
1038
1155
|
onWhatToAsk,
|
|
1039
1156
|
whatToAsk: whatToAskContent,
|
|
1040
1157
|
chatMenuExtraItems,
|
|
1158
|
+
rail = 'auto',
|
|
1159
|
+
threadContainer,
|
|
1160
|
+
threadHeaderActions,
|
|
1161
|
+
threadContentClassName,
|
|
1162
|
+
showModel = true,
|
|
1163
|
+
onModelClick,
|
|
1164
|
+
modelTooltip,
|
|
1165
|
+
composerMenuItems,
|
|
1166
|
+
composerFooterActions,
|
|
1167
|
+
composerContextLeading,
|
|
1168
|
+
composerPlaceholder,
|
|
1169
|
+
composerEdgeLight = false,
|
|
1170
|
+
renameMode = 'modal',
|
|
1171
|
+
safeAreaBottom = true,
|
|
1172
|
+
onDialogCreated,
|
|
1173
|
+
composerPreviewText = null,
|
|
1041
1174
|
handleRef,
|
|
1042
1175
|
}: EmbeddableChatProps & { handleRef?: React.Ref<EmbeddableChatHandle> }) {
|
|
1043
1176
|
// `shell` 'none' / 'inline' means the consumer hosts us inside their own panel
|
|
@@ -1046,6 +1179,11 @@ function EmbeddableChatInner({
|
|
|
1046
1179
|
// we don't double-up with the host's behaviour.
|
|
1047
1180
|
const shellLess = shell !== 'drawer';
|
|
1048
1181
|
const isV2 = appearance === CHAT_APPEARANCE.V2;
|
|
1182
|
+
// Split: the composer renders here, the header + thread in the host's node
|
|
1183
|
+
// (or nowhere). See `threadContainer`.
|
|
1184
|
+
const splitMode = threadContainer !== undefined;
|
|
1185
|
+
// The host draws the chat list, so the panel never does (see `rail`).
|
|
1186
|
+
const hostOwnsList = rail === 'none' || splitMode;
|
|
1049
1187
|
const runtime = useRequiredChatRuntime();
|
|
1050
1188
|
// Optional on embedders (platform-agnostic); '' is a harmless sentinel for the
|
|
1051
1189
|
// `ask-ai:open-with-ref` event filter below. Deliberately NOT the hub's
|
|
@@ -1082,9 +1220,14 @@ function EmbeddableChatInner({
|
|
|
1082
1220
|
});
|
|
1083
1221
|
|
|
1084
1222
|
// Suppress chat input auto-focus on touch devices (avoids popping the
|
|
1085
|
-
// on-screen keyboard during the bottom-sheet open animation)
|
|
1223
|
+
// on-screen keyboard during the bottom-sheet open animation), and in an inline
|
|
1224
|
+
// host: a composer that is part of the layout mounts once, on whatever page the
|
|
1225
|
+
// session starts on, so focusing it there takes the page's focus for no reason —
|
|
1226
|
+
// and in WebKit a focused editor's caret alone keeps an idle page busy (about
|
|
1227
|
+
// 3x its idle CPU, measured 2026-10-21). Opening a drawer is a request to type;
|
|
1228
|
+
// a layout mounting is not.
|
|
1086
1229
|
const [autoFocusInput] = useState(() => {
|
|
1087
|
-
if (typeof window === 'undefined') return false;
|
|
1230
|
+
if (typeof window === 'undefined' || shell === 'inline') return false;
|
|
1088
1231
|
return !window.matchMedia('(pointer: coarse)').matches;
|
|
1089
1232
|
});
|
|
1090
1233
|
|
|
@@ -1278,7 +1421,6 @@ function EmbeddableChatInner({
|
|
|
1278
1421
|
const {
|
|
1279
1422
|
messages: rawMessages,
|
|
1280
1423
|
isLoading: chatLoading,
|
|
1281
|
-
streamingProgress,
|
|
1282
1424
|
sendMessage: sendMessageRaw,
|
|
1283
1425
|
discussRef,
|
|
1284
1426
|
stopMessage,
|
|
@@ -1442,11 +1584,16 @@ function EmbeddableChatInner({
|
|
|
1442
1584
|
const scopeDialogId = activeDialogId ?? null;
|
|
1443
1585
|
const [composerScope, setComposerScope] = useState({ dialogId: scopeDialogId, mode: activeMode });
|
|
1444
1586
|
const [composerKey, setComposerKey] = useState(0);
|
|
1587
|
+
// The dialog a send of this panel created (`onDialogCreated`) — exactly the
|
|
1588
|
+
// `named` transition below, kept for the effect that tells the host.
|
|
1589
|
+
const [createdDialogId, setCreatedDialogId] = useState<string | null>(null);
|
|
1445
1590
|
if (composerScope.dialogId !== scopeDialogId || composerScope.mode !== activeMode) {
|
|
1446
1591
|
const named =
|
|
1447
1592
|
namingNewChat && composerScope.dialogId == null && scopeDialogId != null && composerScope.mode === activeMode;
|
|
1448
1593
|
setComposerScope({ dialogId: scopeDialogId, mode: activeMode });
|
|
1449
|
-
if (
|
|
1594
|
+
if (named) {
|
|
1595
|
+
setCreatedDialogId(scopeDialogId);
|
|
1596
|
+
} else {
|
|
1450
1597
|
setComposerKey(k => k + 1);
|
|
1451
1598
|
setContextItems(NO_CONTEXT_ITEMS);
|
|
1452
1599
|
setContextPickerOpen(false);
|
|
@@ -1457,6 +1604,16 @@ function EmbeddableChatInner({
|
|
|
1457
1604
|
mentionKeysRef.current.clear();
|
|
1458
1605
|
clearAttachments();
|
|
1459
1606
|
}, [composerKey, clearAttachments]);
|
|
1607
|
+
// Told after the commit that shows the new dialog: the host typically
|
|
1608
|
+
// navigates on it, which must not happen while this panel renders. Keyed on
|
|
1609
|
+
// the id alone, so a host callback that changes identity is not re-told.
|
|
1610
|
+
const onDialogCreatedRef = useRef(onDialogCreated);
|
|
1611
|
+
useEffect(() => {
|
|
1612
|
+
onDialogCreatedRef.current = onDialogCreated;
|
|
1613
|
+
});
|
|
1614
|
+
useEffect(() => {
|
|
1615
|
+
if (createdDialogId != null) onDialogCreatedRef.current?.(createdDialogId);
|
|
1616
|
+
}, [createdDialogId]);
|
|
1460
1617
|
|
|
1461
1618
|
// Map each entity type to its backend mention marker (host-declared on the
|
|
1462
1619
|
// entity type). Drives the committed `@marker:id` token; missing markers fall
|
|
@@ -1594,6 +1751,8 @@ function EmbeddableChatInner({
|
|
|
1594
1751
|
// `sendPrompt` goes through a ref: what it sends with is declared further
|
|
1595
1752
|
// down (`sendPromptRef.current` is set next to `handleSend`).
|
|
1596
1753
|
const sendPromptRef = useRef<(text: string) => void>(() => {});
|
|
1754
|
+
// The "What to ask?" entry as of the last render, for the handle (`showWhatToAsk`).
|
|
1755
|
+
const whatToAskEntryRef = useRef<() => void>(() => {});
|
|
1597
1756
|
const chatPanelHandle = useMemo<ChatPanelHandle>(
|
|
1598
1757
|
() => ({
|
|
1599
1758
|
closeChat: handleNavigationClose,
|
|
@@ -2043,6 +2202,11 @@ function EmbeddableChatInner({
|
|
|
2043
2202
|
// detached from its card). `portalHost` can't serve here — it is
|
|
2044
2203
|
// `display: contents` and has no box to measure.
|
|
2045
2204
|
const [panelBoundary, setPanelBoundary] = useState<HTMLDivElement | null>(null);
|
|
2205
|
+
// The same pair for the thread when it renders into the host's node
|
|
2206
|
+
// (`threadContainer`): its menus portal and collide inside the thread, not
|
|
2207
|
+
// inside the composer's dock.
|
|
2208
|
+
const [threadPortalHost, setThreadPortalHost] = useState<HTMLDivElement | null>(null);
|
|
2209
|
+
const [threadBoundary, setThreadBoundary] = useState<HTMLDivElement | null>(null);
|
|
2046
2210
|
|
|
2047
2211
|
// ── Split (wide) Mingo layout ─────────────────────────────────────────────
|
|
2048
2212
|
// The panel measures its own width and, in Mingo mode, promotes the inline
|
|
@@ -2138,7 +2302,9 @@ function EmbeddableChatInner({
|
|
|
2138
2302
|
const splitEligible = historyListMode;
|
|
2139
2303
|
// Embedded previews (hero demo tabs) always use the compact single-column
|
|
2140
2304
|
// header, never the two-column split — so `previewMode` opts out of `wideMingo`.
|
|
2141
|
-
|
|
2305
|
+
// …and a host that owns the list (`rail="none"`) never gets either wide
|
|
2306
|
+
// layout: both exist to put the panel's own list beside the chat.
|
|
2307
|
+
const wideMingo = splitEligible && canSplit && !previewMode && !hostOwnsList;
|
|
2142
2308
|
const splitActive = wideMingo && !railCollapsed;
|
|
2143
2309
|
// Keep the "Current Chats" rail (header cell + list column) mounted through
|
|
2144
2310
|
// its width/opacity collapse so it eases away instead of hard-cutting; both
|
|
@@ -2183,8 +2349,10 @@ function EmbeddableChatInner({
|
|
|
2183
2349
|
dialogs.length === 0 &&
|
|
2184
2350
|
!dialogsInitialLoading &&
|
|
2185
2351
|
!mingoCaps.searchQuery;
|
|
2352
|
+
// Never with `rail="none"`: the list is the host's, so no conversation open
|
|
2353
|
+
// means the new chat, not a list screen.
|
|
2186
2354
|
const stackedListView =
|
|
2187
|
-
isMingoMode && !hasConversation && !archiveOpen && !wideMingo && !composeOpen && !emptyListSkipped;
|
|
2355
|
+
isMingoMode && !hasConversation && !archiveOpen && !wideMingo && !composeOpen && !emptyListSkipped && !hostOwnsList;
|
|
2188
2356
|
|
|
2189
2357
|
// Shared header derivations — consumed by the stacked `ChatPanelHeader`, its
|
|
2190
2358
|
// mobile fallback, and the desktop split header's right cell, so the title /
|
|
@@ -2397,8 +2565,12 @@ function EmbeddableChatInner({
|
|
|
2397
2565
|
mentionKeysRef.current.clear();
|
|
2398
2566
|
setPendingDraft({ text, mentions: mentions.slice(0, contextMaxItems) });
|
|
2399
2567
|
},
|
|
2568
|
+
showWhatToAsk: () => whatToAskEntryRef.current(),
|
|
2569
|
+
openContextPicker: () => {
|
|
2570
|
+
if (contextPicker) openContextPicker();
|
|
2571
|
+
},
|
|
2400
2572
|
}),
|
|
2401
|
-
[resetToNewChat, contextMaxItems],
|
|
2573
|
+
[resetToNewChat, contextMaxItems, contextPicker, openContextPicker],
|
|
2402
2574
|
);
|
|
2403
2575
|
|
|
2404
2576
|
// Desktop split header ⋯ menu (active, non-archived conversation only).
|
|
@@ -2409,6 +2581,35 @@ function EmbeddableChatInner({
|
|
|
2409
2581
|
onArchive: headerOnArchive,
|
|
2410
2582
|
});
|
|
2411
2583
|
|
|
2584
|
+
// Inline rename (`renameMode="inline"`) in the Mingo v2 / page header: the
|
|
2585
|
+
// title becomes a field. Held as the id of the chat being renamed, so opening
|
|
2586
|
+
// another chat drops the field without an effect.
|
|
2587
|
+
const [inlineRenameId, setInlineRenameId] = useState<string | null>(null);
|
|
2588
|
+
const inlineRenaming = inlineRenameId != null && inlineRenameId === activeDialogId;
|
|
2589
|
+
const mingoHeaderOnRename =
|
|
2590
|
+
renameMode === 'inline' && headerOnRename && activeDialogId
|
|
2591
|
+
? () => setInlineRenameId(activeDialogId)
|
|
2592
|
+
: headerOnRename;
|
|
2593
|
+
const submitInlineRename = (value: string) => {
|
|
2594
|
+
setInlineRenameId(null);
|
|
2595
|
+
const target = activeDialog;
|
|
2596
|
+
const next = value.trim();
|
|
2597
|
+
// Empty or unchanged: nothing to save, the title simply comes back.
|
|
2598
|
+
if (!target || !next || next === target.title) return;
|
|
2599
|
+
renameDialog(target.id, next).catch((err: unknown) => {
|
|
2600
|
+
console.error('[EmbeddableChat] inline rename failed:', err);
|
|
2601
|
+
});
|
|
2602
|
+
};
|
|
2603
|
+
const cancelInlineRename = () => setInlineRenameId(null);
|
|
2604
|
+
// The v2 header's ⋯, and the page header's (`threadContainer`): the split
|
|
2605
|
+
// header's, with the inline rename when asked.
|
|
2606
|
+
const mingoHeaderMenuItems = chatDialogMenuItems({
|
|
2607
|
+
onCopyLink: headerOnCopyLink,
|
|
2608
|
+
onRename: mingoHeaderOnRename,
|
|
2609
|
+
onCompact: headerOnCompact,
|
|
2610
|
+
onArchive: headerOnArchive,
|
|
2611
|
+
});
|
|
2612
|
+
|
|
2412
2613
|
// Narrow (single-column) header. The Mingo empty state splits into a "Current
|
|
2413
2614
|
// Chats" list header (search + archive, no back) and a "New Chat" compose
|
|
2414
2615
|
// header (back to the list); conversations + guide keep the shared header
|
|
@@ -2418,15 +2619,17 @@ function EmbeddableChatInner({
|
|
|
2418
2619
|
// would be half of the empty screen the skip exists to remove. The
|
|
2419
2620
|
// else-branch header keeps the assistant name and the archive entry point.
|
|
2420
2621
|
const narrowMingoEmpty = isMingoMode && !hasConversation && !archiveOpen && !emptyListSkipped;
|
|
2622
|
+
// With the list the host's (`rail="none"`) the empty state IS the new chat,
|
|
2623
|
+
// and there is no list to go back to.
|
|
2421
2624
|
const narrowHeaderProps: ChatPanelHeaderProps = narrowMingoEmpty
|
|
2422
|
-
? composeOpen
|
|
2625
|
+
? composeOpen || hostOwnsList
|
|
2423
2626
|
? {
|
|
2424
|
-
showBack:
|
|
2627
|
+
showBack: !hostOwnsList,
|
|
2425
2628
|
title: freshConversationTitle,
|
|
2426
2629
|
subtitle: headerUserName,
|
|
2427
2630
|
avatar: headerAvatar,
|
|
2428
2631
|
backAriaLabel: 'Back to chats',
|
|
2429
|
-
onBack: () => setComposeOpen(false),
|
|
2632
|
+
onBack: hostOwnsList ? undefined : () => setComposeOpen(false),
|
|
2430
2633
|
onClose: closeControl,
|
|
2431
2634
|
}
|
|
2432
2635
|
: {
|
|
@@ -2464,6 +2667,14 @@ function EmbeddableChatInner({
|
|
|
2464
2667
|
if (archiveOpen) closeArchive();
|
|
2465
2668
|
action();
|
|
2466
2669
|
};
|
|
2670
|
+
// The list's "What to ask Mingo?" entry, also the host's (`showWhatToAsk`): the
|
|
2671
|
+
// suggestions a new chat opens on, unless the host has a surface of its own.
|
|
2672
|
+
const openWhatToAsk = () => {
|
|
2673
|
+
leaveArchiveThen(onWhatToAsk ?? (whatToAskContent ? requestWhatToAsk : handleNewChat))();
|
|
2674
|
+
};
|
|
2675
|
+
useEffect(() => {
|
|
2676
|
+
whatToAskEntryRef.current = openWhatToAsk;
|
|
2677
|
+
});
|
|
2467
2678
|
const mingoRailProps = {
|
|
2468
2679
|
dialogs,
|
|
2469
2680
|
// The archive takes the chat column: the open chat stays selected (closing
|
|
@@ -2477,10 +2688,7 @@ function EmbeddableChatInner({
|
|
|
2477
2688
|
onNewChat: leaveArchiveThen(handleNewChat),
|
|
2478
2689
|
onOpenArchive: headerOnOpenArchive && (archiveOpen ? closeArchive : headerOnOpenArchive),
|
|
2479
2690
|
archiveActive: archiveOpen,
|
|
2480
|
-
|
|
2481
|
-
onWhatToAsk: () => {
|
|
2482
|
-
leaveArchiveThen(onWhatToAsk ?? (whatToAskContent ? requestWhatToAsk : handleNewChat))();
|
|
2483
|
-
},
|
|
2691
|
+
onWhatToAsk: openWhatToAsk,
|
|
2484
2692
|
statusOf: dialogStatusOf,
|
|
2485
2693
|
onRequestRename: mingoCaps.canRename ? setRenameTarget : undefined,
|
|
2486
2694
|
onRequestArchive: mingoCaps.canArchive ? setArchiveTarget : undefined,
|
|
@@ -2512,10 +2720,22 @@ function EmbeddableChatInner({
|
|
|
2512
2720
|
subtitle={archiveOpen ? undefined : headerPersonName}
|
|
2513
2721
|
avatar={archiveOpen ? undefined : headerAvatar}
|
|
2514
2722
|
// Wide: shows / hides the list beside the chat. Narrow: back to the
|
|
2515
|
-
// list, the only one of the two that fits.
|
|
2516
|
-
|
|
2723
|
+
// list, the only one of the two that fits. None when the list is the
|
|
2724
|
+
// host's (`rail="none"`).
|
|
2725
|
+
onToggleList={
|
|
2726
|
+
hostOwnsList
|
|
2727
|
+
? undefined
|
|
2728
|
+
: wideMingo
|
|
2729
|
+
? toggleRailCollapsed
|
|
2730
|
+
: headerShowBack
|
|
2731
|
+
? headerOnBack
|
|
2732
|
+
: () => setComposeOpen(false)
|
|
2733
|
+
}
|
|
2517
2734
|
listOpen={splitActive}
|
|
2518
|
-
menuItems={headerShowBack && !isViewingArchived && !archiveOpen ?
|
|
2735
|
+
menuItems={headerShowBack && !isViewingArchived && !archiveOpen ? mingoHeaderMenuItems : []}
|
|
2736
|
+
renaming={inlineRenaming && !archiveOpen}
|
|
2737
|
+
onRenameSubmit={submitInlineRename}
|
|
2738
|
+
onRenameCancel={cancelInlineRename}
|
|
2519
2739
|
extraMenuItems={isViewingArchived || archiveOpen ? undefined : chatMenuExtraItems}
|
|
2520
2740
|
onRestore={isViewingArchived && !archiveOpen ? headerOnRestore : undefined}
|
|
2521
2741
|
// Only while the list and the chat both fit: narrow, the toggle is
|
|
@@ -2535,12 +2755,323 @@ function EmbeddableChatInner({
|
|
|
2535
2755
|
</div>
|
|
2536
2756
|
) : null;
|
|
2537
2757
|
|
|
2758
|
+
// ── The parts both layouts render (see `threadContainer`) ─────────────────
|
|
2759
|
+
// v2: the archive opens in the chat column under the chat's header; the
|
|
2760
|
+
// list stays, and "Chat Archive" there toggles back.
|
|
2761
|
+
const archiveListNode = (
|
|
2762
|
+
<MingoArchiveList
|
|
2763
|
+
dialogs={archivedDialogs}
|
|
2764
|
+
onSelectDialog={handleArchivedSelect}
|
|
2765
|
+
isLoading={archivedLoading}
|
|
2766
|
+
hasMore={archivedCursor != null}
|
|
2767
|
+
isLoadingMore={archivedPending}
|
|
2768
|
+
onLoadMore={() => {
|
|
2769
|
+
void loadArchivedPage(archivedCursor ?? undefined);
|
|
2770
|
+
}}
|
|
2771
|
+
/>
|
|
2772
|
+
);
|
|
2773
|
+
|
|
2774
|
+
// The thread — or a new chat's welcome — scrolling above the composer.
|
|
2775
|
+
const threadArea = (
|
|
2776
|
+
<div
|
|
2777
|
+
ref={galleryPanelRef}
|
|
2778
|
+
data-testid="chat-content-panel"
|
|
2779
|
+
className={cn(
|
|
2780
|
+
'flex min-h-0 flex-1 flex-col p-[var(--spacing-system-m)]',
|
|
2781
|
+
// With a host block above the composer the thread keeps room
|
|
2782
|
+
// for a line and the working status: the block gives way
|
|
2783
|
+
// instead (below), so the status never lands on it.
|
|
2784
|
+
hasAboveComposer && 'min-h-32',
|
|
2785
|
+
)}
|
|
2786
|
+
>
|
|
2787
|
+
<div key={contentViewKey} className="flex min-h-0 flex-1 flex-col duration-200 animate-in fade-in-0">
|
|
2788
|
+
{hasConversation ? (
|
|
2789
|
+
<div className="flex min-h-0 flex-1 flex-col">
|
|
2790
|
+
{/* While the thread loads the list draws its own loading
|
|
2791
|
+
state, in the SAME box (`fullWidth`, the panel wrapper
|
|
2792
|
+
above already pads; in the split layout the host's column
|
|
2793
|
+
too). In `previewMode` the chat lives in a fixed-height host
|
|
2794
|
+
box (e.g. the Mingo hero demo): `fill` top-anchors and clips
|
|
2795
|
+
the loading rows so they read as "the whole panel is
|
|
2796
|
+
loading" and never scroll. */}
|
|
2797
|
+
<ChatMessageList
|
|
2798
|
+
messages={messages}
|
|
2799
|
+
isLoading={messagesInitialLoading}
|
|
2800
|
+
fill={previewMode}
|
|
2801
|
+
// v2 thread: names without the colon, 24px
|
|
2802
|
+
// faces, 16px between messages (shared with fae v2).
|
|
2803
|
+
appearance={appearance}
|
|
2804
|
+
isTyping={chatLoading}
|
|
2805
|
+
// Sticky footer for approvals the host lifted out of the
|
|
2806
|
+
// thread — see the prop's docblock.
|
|
2807
|
+
pendingApprovals={pendingApprovals}
|
|
2808
|
+
// Real drawer: the library's smart follow. Passive in-page
|
|
2809
|
+
// demo (previewMode): deterministic hard pin instead — a
|
|
2810
|
+
// scripted assistant-only stream from a cold mount never
|
|
2811
|
+
// satisfies the library's "at bottom" gate, so the reply
|
|
2812
|
+
// landed below the fold. `pinBottom` snaps to bottom on
|
|
2813
|
+
// every frame; identical mechanism to the Fae demo box, so
|
|
2814
|
+
// both surfaces behave 1:1.
|
|
2815
|
+
autoScroll={!previewMode}
|
|
2816
|
+
pinBottom={previewMode}
|
|
2817
|
+
// Passive in-page demos (previewMode) let the surrounding
|
|
2818
|
+
// page scroll over the thread; the real drawer keeps
|
|
2819
|
+
// containment (deck slide-scroll fix).
|
|
2820
|
+
overscrollContain={!previewMode}
|
|
2821
|
+
assistantType="mingo"
|
|
2822
|
+
assistantIcon={mingoAssistantIcon}
|
|
2823
|
+
renderEntityCard={renderEntityCard}
|
|
2824
|
+
resolveContextIcon={resolveContextIcon}
|
|
2825
|
+
renderContextItem={renderContextItem}
|
|
2826
|
+
renderMention={renderMention}
|
|
2827
|
+
renderAfterMessage={renderMessageSources}
|
|
2828
|
+
// Gated on `chatLoading` for the same reason the composer
|
|
2829
|
+
// is: no second send while a turn is in flight. Passive
|
|
2830
|
+
// demo hosts (previewMode) stay read-only.
|
|
2831
|
+
onAskSelect={chatLoading || previewMode ? undefined : handleAskSelect}
|
|
2832
|
+
NavLinkAnchor={NavLinkAnchorViaRuntime}
|
|
2833
|
+
// Real Mingo drawer: hide the message-list scrollbar
|
|
2834
|
+
// (scroll stays functional). Scoped here via `className`
|
|
2835
|
+
// instead of `ChatMessageList` itself, so other list
|
|
2836
|
+
// consumers (host chat, tickets) keep their thin bar.
|
|
2837
|
+
//
|
|
2838
|
+
// `previewMode` (the passive in-page demo) instead:
|
|
2839
|
+
// • KEEP the default thin scrollbar — the "elevator" —
|
|
2840
|
+
// so the Mingo demo's scroll controls match the Fae
|
|
2841
|
+
// demo box (which renders the default ChatMessageList
|
|
2842
|
+
// scrollbar) 1:1.
|
|
2843
|
+
// • Re-enable pointer events on the scroller: previewMode
|
|
2844
|
+
// puts `pointer-events-none` on the whole panel (line
|
|
2845
|
+
// ~1981) so the demo doesn't trap clicks, but that also
|
|
2846
|
+
// killed wheel/touch scroll on the thread (the Mingo
|
|
2847
|
+
// embed couldn't scroll while the Fae box could). Only
|
|
2848
|
+
// the scroller re-enables; composer + chrome stay inert.
|
|
2849
|
+
className={
|
|
2850
|
+
previewMode
|
|
2851
|
+
? 'pointer-events-auto flex-1'
|
|
2852
|
+
: 'flex-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden'
|
|
2853
|
+
}
|
|
2854
|
+
// No inner `px`/`pb`: the panel wrapper already pads with
|
|
2855
|
+
// `p-[var(--spacing-system-m)]`. The default content class
|
|
2856
|
+
// adds `px-[var(--spacing-system-m)]` + `pb-…xs`, which
|
|
2857
|
+
// double-inset the thread; `pb-0` overrides via twMerge.
|
|
2858
|
+
contentClassName={cn('max-w-none pb-0', splitMode && threadContentClassName)}
|
|
2859
|
+
fullWidth
|
|
2860
|
+
hasNextPage={hasMoreMessages}
|
|
2861
|
+
isFetchingNextPage={isMessagesLoading}
|
|
2862
|
+
onLoadMore={loadMoreMessages}
|
|
2863
|
+
/>
|
|
2864
|
+
</div>
|
|
2865
|
+
) : activeMode === 'mingo' ? (
|
|
2866
|
+
/* Figma node 7532:222444 — default (Mingo-mode) empty state:
|
|
2867
|
+
centred greeting + capability grid + Guide-chat promo +
|
|
2868
|
+
quick-action chips. Guide mode keeps the slash-command
|
|
2869
|
+
onboarding list below. */
|
|
2870
|
+
<MingoWelcome
|
|
2871
|
+
onStartGuideChat={effectiveModes.guide ? () => handleActiveModeChange('guide') : undefined}
|
|
2872
|
+
historyPageSize={historyPageSize}
|
|
2873
|
+
{...mingoWelcome}
|
|
2874
|
+
// History now lives in its own list view (the wide rail or
|
|
2875
|
+
// the narrow "Current Chats" list), so the welcome is always
|
|
2876
|
+
// the new-user compose surface: greeting + grid + promo +
|
|
2877
|
+
// primary Guide chip.
|
|
2878
|
+
hasExistingChats={false}
|
|
2879
|
+
// Hover/focus PREVIEWS the action's full prompt as ghost text
|
|
2880
|
+
// in the empty composer (see `quickActionPreview` /
|
|
2881
|
+
// `ChatInput.previewText`). Wired after the `{...mingoWelcome}`
|
|
2882
|
+
// spread so the host can't override it.
|
|
2883
|
+
onQuickActionHover={action => setQuickActionPreview(action.prompt ?? action.label)}
|
|
2884
|
+
onQuickActionHoverEnd={() => setQuickActionPreview(null)}
|
|
2885
|
+
// A built-in agent caps the quick-action wall at 2 rows;
|
|
2886
|
+
// this is the Mingo surface, so fall back to 'mingo'.
|
|
2887
|
+
agentSlug={activeAgentSlug ?? 'mingo'}
|
|
2888
|
+
/>
|
|
2889
|
+
) : (
|
|
2890
|
+
/* Figma node 7532:328214 — Guide-mode empty state: greeting
|
|
2891
|
+
+ slash-command onboarding list share one scroll region,
|
|
2892
|
+
with a pinned quick-action chip row above the composer. */
|
|
2893
|
+
<GuideWelcome
|
|
2894
|
+
// Admin/host greeting customises the guide subtitle; an
|
|
2895
|
+
// explicit `guideWelcome.subtitle` still wins (spread below).
|
|
2896
|
+
subtitle={effectiveGreeting ?? undefined}
|
|
2897
|
+
// While the admin greeting is still being fetched, render a
|
|
2898
|
+
// subtitle skeleton instead of flashing empty → text.
|
|
2899
|
+
subtitleLoading={emptyStateLoading}
|
|
2900
|
+
{...guideWelcome}
|
|
2901
|
+
// Agent identity (name → title, icon → empty-state glyph)
|
|
2902
|
+
// wins over the host `guideWelcome` spread + built-in
|
|
2903
|
+
// defaults; falls back to the host value when no agent is
|
|
2904
|
+
// active. Placed after the spread so resolution is
|
|
2905
|
+
// deterministic.
|
|
2906
|
+
title={effectiveAssistantName ?? guideWelcome?.title}
|
|
2907
|
+
icon={effectiveAssistantIcon ?? guideWelcome?.icon}
|
|
2908
|
+
// Admin "try-asking chips" → Guide quick-action chips.
|
|
2909
|
+
// Precedence: when an AGENT is active and its fetched chips
|
|
2910
|
+
// arrived, the agent's chips win — the host array is the
|
|
2911
|
+
// platform default, not the agent's. (`agentConfigUrl` is
|
|
2912
|
+
// the same derived value that drives the config fetch, so
|
|
2913
|
+
// this can never disagree with what was fetched; while the
|
|
2914
|
+
// fetch is in-flight the fetched list is [] and host chips
|
|
2915
|
+
// show.) Outside agent mode the host-provided
|
|
2916
|
+
// `guideWelcome.quickActions` wins as before.
|
|
2917
|
+
quickActions={
|
|
2918
|
+
agentConfigUrl && guideSuggestedActions.length > 0
|
|
2919
|
+
? guideSuggestedActions
|
|
2920
|
+
: (guideWelcome?.quickActions ?? guideSuggestedActions)
|
|
2921
|
+
}
|
|
2922
|
+
// Quick-action chips SEND the prompt immediately on click.
|
|
2923
|
+
onQuickAction={action => {
|
|
2924
|
+
setQuickActionPreview(null);
|
|
2925
|
+
handleSend(action.prompt ?? action.label);
|
|
2926
|
+
}}
|
|
2927
|
+
// Hover/focus PREVIEWS the action's full prompt as ghost text
|
|
2928
|
+
// in the empty composer (the chip label is short; this reveals
|
|
2929
|
+
// what will be sent). Declarative + non-destructive — see
|
|
2930
|
+
// `quickActionPreview` / `ChatInput.previewText`.
|
|
2931
|
+
onQuickActionHover={action => setQuickActionPreview(action.prompt ?? action.label)}
|
|
2932
|
+
onQuickActionHoverEnd={() => setQuickActionPreview(null)}
|
|
2933
|
+
// In agent mode a built-in agent (fae/mingo) caps the wall at
|
|
2934
|
+
// 2 rows; host/guide mode (no active agent) keeps the default.
|
|
2935
|
+
agentSlug={activeAgentSlug}
|
|
2936
|
+
>
|
|
2937
|
+
{/* Figma node 7363:205938 — single-column slash-command
|
|
2938
|
+
list. No own scroll (GuideWelcome's region scrolls); the
|
|
2939
|
+
rounded-md frame holds the cards on the dark surface. */}
|
|
2940
|
+
{(chipCommands.length > 0 || !commandsLoaded) && (
|
|
2941
|
+
<div className="shrink-0 overflow-hidden rounded-md border border-ods-border">
|
|
2942
|
+
{!commandsLoaded && chipCommands.length === 0 && (
|
|
2943
|
+
<LoadingItems count={MINGO_ONBOARDING_SKELETON_ROWS}>
|
|
2944
|
+
{i => <MingoOnboardingCard loading data-loading-item skeletonIndex={i} title="" />}
|
|
2945
|
+
</LoadingItems>
|
|
2946
|
+
)}
|
|
2947
|
+
{chipCommands.map(cmd => {
|
|
2948
|
+
const Icon = resolveIcon(cmd.iconName);
|
|
2949
|
+
const cmdId = cmd.id;
|
|
2950
|
+
const label = cmd.label ?? `/${cmdId}`;
|
|
2951
|
+
const cardActions = cmd.actions.map(action => ({
|
|
2952
|
+
id: action.id,
|
|
2953
|
+
label: action.label,
|
|
2954
|
+
onClick: () => dispatchSlashCommandAction(action.id, cmdId, chatInputRef),
|
|
2955
|
+
}));
|
|
2956
|
+
return (
|
|
2957
|
+
<MingoOnboardingCard
|
|
2958
|
+
key={cmdId}
|
|
2959
|
+
icon={<Icon size={16} />}
|
|
2960
|
+
title={label}
|
|
2961
|
+
slashCommand={`/${cmdId}`}
|
|
2962
|
+
description={cmd.description}
|
|
2963
|
+
actions={cardActions}
|
|
2964
|
+
data-loading-item
|
|
2965
|
+
/>
|
|
2966
|
+
);
|
|
2967
|
+
})}
|
|
2968
|
+
</div>
|
|
2969
|
+
)}
|
|
2970
|
+
</GuideWelcome>
|
|
2971
|
+
)}
|
|
2972
|
+
</div>
|
|
2973
|
+
</div>
|
|
2974
|
+
);
|
|
2975
|
+
|
|
2976
|
+
// Host block pinned above the composer (`aboveComposer`): the thread's own
|
|
2977
|
+
// bottom padding separates them, the composer's horizontal inset is repeated
|
|
2978
|
+
// so the two line up. It may shrink: in a short panel the block (which scrolls
|
|
2979
|
+
// its own content, `min-h-0`) yields height to the thread.
|
|
2980
|
+
const aboveComposerNode = hasAboveComposer ? (
|
|
2981
|
+
<div
|
|
2982
|
+
data-testid="chat-above-composer"
|
|
2983
|
+
className="flex min-h-0 shrink flex-col px-[var(--spacing-system-m)] pb-[var(--spacing-system-m)]"
|
|
2984
|
+
>
|
|
2985
|
+
{aboveComposer}
|
|
2986
|
+
</div>
|
|
2987
|
+
) : null;
|
|
2988
|
+
|
|
2989
|
+
const attachmentStrip = (
|
|
2990
|
+
<ChatAttachmentChipStrip attachments={stagedAttachments} onRemove={removeAttachment} disabled={chatLoading} />
|
|
2991
|
+
);
|
|
2992
|
+
|
|
2993
|
+
const composerNode = (
|
|
2994
|
+
<ChatComposer
|
|
2995
|
+
key={composerKey}
|
|
2996
|
+
archived={isViewingArchived}
|
|
2997
|
+
lock={composerLock}
|
|
2998
|
+
inputRef={chatInputRef}
|
|
2999
|
+
onSend={handleSend}
|
|
3000
|
+
onStop={stopMessage}
|
|
3001
|
+
sending={chatLoading || hasInflightUploads}
|
|
3002
|
+
placeholder={
|
|
3003
|
+
hasInflightUploads
|
|
3004
|
+
? 'Waiting for uploads to finish…'
|
|
3005
|
+
: (composerPlaceholder ?? (isV2 ? 'Enter your Request...' : 'Ask a question...'))
|
|
3006
|
+
}
|
|
3007
|
+
autoFocus={previewMode ? false : autoFocusInput}
|
|
3008
|
+
slashCommands={slashCommandsProp}
|
|
3009
|
+
previewText={quickActionPreview ?? composerPreviewText ?? undefined}
|
|
3010
|
+
safeAreaBottom={safeAreaBottom}
|
|
3011
|
+
edgeLight={composerEdgeLight}
|
|
3012
|
+
showAttachmentButton={attachmentsEnabled && activeMode === 'guide'}
|
|
3013
|
+
attachmentsCount={stagedAttachments.length}
|
|
3014
|
+
onAddFiles={addAttachmentFiles}
|
|
3015
|
+
attachmentsDisabled={chatLoading}
|
|
3016
|
+
contextPicker={contextPickerForMode}
|
|
3017
|
+
selectedContextItems={contextItems}
|
|
3018
|
+
onToggleContextItem={toggleContextItem}
|
|
3019
|
+
onRemoveContextItem={removeContextItem}
|
|
3020
|
+
contextMemoryItems={contextMemory?.items}
|
|
3021
|
+
contextLeading={composerContextLeading}
|
|
3022
|
+
onRemoveContextMemoryItem={contextMemory?.onRemove}
|
|
3023
|
+
contextMemoryPending={contextMemory?.pending}
|
|
3024
|
+
contextPickerOpen={contextPickerOpen}
|
|
3025
|
+
onOpenContextPicker={openContextPicker}
|
|
3026
|
+
onCloseContextPicker={closeContextPicker}
|
|
3027
|
+
mentionQuery={mentionQuery}
|
|
3028
|
+
onMentionQueryChange={handleMentionQueryChange}
|
|
3029
|
+
onValueChange={handleContextValueChange}
|
|
3030
|
+
menuItems={composerMenuItems}
|
|
3031
|
+
footerActions={composerFooterActions}
|
|
3032
|
+
model={
|
|
3033
|
+
showModel
|
|
3034
|
+
? {
|
|
3035
|
+
provider: currentProvider ?? 'anthropic',
|
|
3036
|
+
modelName: currentModelLabel ?? 'Claude',
|
|
3037
|
+
usedTokens:
|
|
3038
|
+
currentInputTokens != null ? (currentInputTokens ?? 0) + (currentOutputTokens ?? 0) : undefined,
|
|
3039
|
+
contextWindow: currentContextWindowMaxTokens ?? undefined,
|
|
3040
|
+
inputTokens: currentInputTokens ?? undefined,
|
|
3041
|
+
outputTokens: currentOutputTokens ?? undefined,
|
|
3042
|
+
hitRatePct: currentCacheHitRatePct ?? undefined,
|
|
3043
|
+
breakdown: currentUsageBreakdown ?? undefined,
|
|
3044
|
+
onModelClick,
|
|
3045
|
+
modelTooltip,
|
|
3046
|
+
}
|
|
3047
|
+
: undefined
|
|
3048
|
+
}
|
|
3049
|
+
/>
|
|
3050
|
+
);
|
|
3051
|
+
|
|
3052
|
+
// Rename / Archive / Unarchive chat modals (Figma 7592:225962, 7592:226181).
|
|
3053
|
+
// Triggered from the header ⋯ and the dialog-history rows; rendered inside the
|
|
3054
|
+
// panel so they overlay the chat.
|
|
3055
|
+
const dialogModals = (
|
|
3056
|
+
<ChatDialogModals
|
|
3057
|
+
renameTarget={renameTarget}
|
|
3058
|
+
setRenameTarget={setRenameTarget}
|
|
3059
|
+
onConfirmRename={handleConfirmRename}
|
|
3060
|
+
archiveTarget={archiveTarget}
|
|
3061
|
+
setArchiveTarget={setArchiveTarget}
|
|
3062
|
+
onConfirmArchive={handleConfirmArchive}
|
|
3063
|
+
restoreTarget={restoreTarget}
|
|
3064
|
+
setRestoreTarget={setRestoreTarget}
|
|
3065
|
+
onConfirmRestore={handleConfirmRestore}
|
|
3066
|
+
/>
|
|
3067
|
+
);
|
|
3068
|
+
|
|
2538
3069
|
// Chat body — defined once, then rendered inside whichever shell applies.
|
|
2539
3070
|
// Radix overlays (⋯ menus, tooltips) portal into `portalHost` — a node inside
|
|
2540
3071
|
// this panel — so they inherit the drawer's stacking context and need only a
|
|
2541
3072
|
// small, local z-index instead of escalating to beat the drawer at the
|
|
2542
3073
|
// document root. See `PortalContainerContext`.
|
|
2543
|
-
const
|
|
3074
|
+
const classicBody = (
|
|
2544
3075
|
// The whole panel reads the appearance (the composer's footer too), not
|
|
2545
3076
|
// only the thread `ChatMessageList` provides it to.
|
|
2546
3077
|
<ChatAppearanceContext.Provider value={appearance}>
|
|
@@ -2825,16 +3356,7 @@ function EmbeddableChatInner({
|
|
|
2825
3356
|
{isV2 && archiveOpen ? (
|
|
2826
3357
|
// v2: the archive opens in the chat column under the chat's
|
|
2827
3358
|
// header; the list stays, and "Chat Archive" there toggles back.
|
|
2828
|
-
|
|
2829
|
-
dialogs={archivedDialogs}
|
|
2830
|
-
onSelectDialog={handleArchivedSelect}
|
|
2831
|
-
isLoading={archivedLoading}
|
|
2832
|
-
hasMore={archivedCursor != null}
|
|
2833
|
-
isLoadingMore={archivedPending}
|
|
2834
|
-
onLoadMore={() => {
|
|
2835
|
-
void loadArchivedPage(archivedCursor ?? undefined);
|
|
2836
|
-
}}
|
|
2837
|
-
/>
|
|
3359
|
+
archiveListNode
|
|
2838
3360
|
) : stackedListView && isV2 ? (
|
|
2839
3361
|
<MingoChatRail
|
|
2840
3362
|
{...mingoRailProps}
|
|
@@ -2881,283 +3403,10 @@ function EmbeddableChatInner({
|
|
|
2881
3403
|
/>
|
|
2882
3404
|
) : (
|
|
2883
3405
|
<>
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
'flex min-h-0 flex-1 flex-col p-[var(--spacing-system-m)]',
|
|
2889
|
-
// With a host block above the composer the thread keeps room
|
|
2890
|
-
// for a line and the working status: the block gives way
|
|
2891
|
-
// instead (below), so the status never lands on it.
|
|
2892
|
-
hasAboveComposer && 'min-h-32',
|
|
2893
|
-
)}
|
|
2894
|
-
>
|
|
2895
|
-
<div
|
|
2896
|
-
key={contentViewKey}
|
|
2897
|
-
className="flex min-h-0 flex-1 flex-col duration-200 animate-in fade-in-0"
|
|
2898
|
-
>
|
|
2899
|
-
{hasConversation ? (
|
|
2900
|
-
<div className="flex min-h-0 flex-1 flex-col">
|
|
2901
|
-
{/* While the thread loads the list draws its own loading
|
|
2902
|
-
state, in the SAME box (`fullWidth`, the panel wrapper
|
|
2903
|
-
above already pads). In `previewMode` the chat lives in a
|
|
2904
|
-
fixed-height host box (e.g. the Mingo hero demo): `fill`
|
|
2905
|
-
top-anchors and clips the loading rows so they read as
|
|
2906
|
-
"the whole panel is loading" and never scroll. */}
|
|
2907
|
-
<ChatMessageList
|
|
2908
|
-
messages={messages}
|
|
2909
|
-
isLoading={messagesInitialLoading}
|
|
2910
|
-
fill={previewMode}
|
|
2911
|
-
// v2 thread: names without the colon, 24px
|
|
2912
|
-
// faces, 16px between messages (shared with fae v2).
|
|
2913
|
-
appearance={appearance}
|
|
2914
|
-
isTyping={chatLoading}
|
|
2915
|
-
// The stage the turn reports while the user waits
|
|
2916
|
-
// ("Searching 28 sources"); the generic phrase otherwise.
|
|
2917
|
-
typingMessage={streamingProgress ? chatProgressLabel(streamingProgress) : undefined}
|
|
2918
|
-
// Sticky footer for approvals the host lifted out of the
|
|
2919
|
-
// thread — see the prop's docblock.
|
|
2920
|
-
pendingApprovals={pendingApprovals}
|
|
2921
|
-
// Real drawer: the library's smart follow. Passive in-page
|
|
2922
|
-
// demo (previewMode): deterministic hard pin instead — a
|
|
2923
|
-
// scripted assistant-only stream from a cold mount never
|
|
2924
|
-
// satisfies the library's "at bottom" gate, so the reply
|
|
2925
|
-
// landed below the fold. `pinBottom` snaps to bottom on
|
|
2926
|
-
// every frame; identical mechanism to the Fae demo box, so
|
|
2927
|
-
// both surfaces behave 1:1.
|
|
2928
|
-
autoScroll={!previewMode}
|
|
2929
|
-
pinBottom={previewMode}
|
|
2930
|
-
// Passive in-page demos (previewMode) let the surrounding
|
|
2931
|
-
// page scroll over the thread; the real drawer keeps
|
|
2932
|
-
// containment (deck slide-scroll fix).
|
|
2933
|
-
overscrollContain={!previewMode}
|
|
2934
|
-
assistantType="mingo"
|
|
2935
|
-
assistantIcon={mingoAssistantIcon}
|
|
2936
|
-
renderEntityCard={renderEntityCard}
|
|
2937
|
-
resolveContextIcon={resolveContextIcon}
|
|
2938
|
-
renderContextItem={renderContextItem}
|
|
2939
|
-
renderMention={renderMention}
|
|
2940
|
-
renderAfterMessage={renderMessageSources}
|
|
2941
|
-
// Gated on `chatLoading` for the same reason the composer
|
|
2942
|
-
// is: no second send while a turn is in flight. Passive
|
|
2943
|
-
// demo hosts (previewMode) stay read-only.
|
|
2944
|
-
onAskSelect={chatLoading || previewMode ? undefined : handleAskSelect}
|
|
2945
|
-
NavLinkAnchor={NavLinkAnchorViaRuntime}
|
|
2946
|
-
// Real Mingo drawer: hide the message-list scrollbar
|
|
2947
|
-
// (scroll stays functional). Scoped here via `className`
|
|
2948
|
-
// instead of `ChatMessageList` itself, so other list
|
|
2949
|
-
// consumers (host chat, tickets) keep their thin bar.
|
|
2950
|
-
//
|
|
2951
|
-
// `previewMode` (the passive in-page demo) instead:
|
|
2952
|
-
// • KEEP the default thin scrollbar — the "elevator" —
|
|
2953
|
-
// so the Mingo demo's scroll controls match the Fae
|
|
2954
|
-
// demo box (which renders the default ChatMessageList
|
|
2955
|
-
// scrollbar) 1:1.
|
|
2956
|
-
// • Re-enable pointer events on the scroller: previewMode
|
|
2957
|
-
// puts `pointer-events-none` on the whole panel (line
|
|
2958
|
-
// ~1981) so the demo doesn't trap clicks, but that also
|
|
2959
|
-
// killed wheel/touch scroll on the thread (the Mingo
|
|
2960
|
-
// embed couldn't scroll while the Fae box could). Only
|
|
2961
|
-
// the scroller re-enables; composer + chrome stay inert.
|
|
2962
|
-
className={
|
|
2963
|
-
previewMode
|
|
2964
|
-
? 'pointer-events-auto flex-1'
|
|
2965
|
-
: 'flex-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden'
|
|
2966
|
-
}
|
|
2967
|
-
// No inner `px`/`pb`: the panel wrapper already pads with
|
|
2968
|
-
// `p-[var(--spacing-system-m)]`. The default content class
|
|
2969
|
-
// adds `px-[var(--spacing-system-m)]` + `pb-…xs`, which
|
|
2970
|
-
// double-inset the thread; `pb-0` overrides via twMerge.
|
|
2971
|
-
contentClassName="max-w-none pb-0"
|
|
2972
|
-
fullWidth
|
|
2973
|
-
hasNextPage={hasMoreMessages}
|
|
2974
|
-
isFetchingNextPage={isMessagesLoading}
|
|
2975
|
-
onLoadMore={loadMoreMessages}
|
|
2976
|
-
/>
|
|
2977
|
-
</div>
|
|
2978
|
-
) : activeMode === 'mingo' ? (
|
|
2979
|
-
/* Figma node 7532:222444 — default (Mingo-mode) empty state:
|
|
2980
|
-
centred greeting + capability grid + Guide-chat promo +
|
|
2981
|
-
quick-action chips. Guide mode keeps the slash-command
|
|
2982
|
-
onboarding list below. */
|
|
2983
|
-
<MingoWelcome
|
|
2984
|
-
onStartGuideChat={
|
|
2985
|
-
effectiveModes.guide ? () => handleActiveModeChange('guide') : undefined
|
|
2986
|
-
}
|
|
2987
|
-
historyPageSize={historyPageSize}
|
|
2988
|
-
{...mingoWelcome}
|
|
2989
|
-
// History now lives in its own list view (the wide rail or
|
|
2990
|
-
// the narrow "Current Chats" list), so the welcome is always
|
|
2991
|
-
// the new-user compose surface: greeting + grid + promo +
|
|
2992
|
-
// primary Guide chip.
|
|
2993
|
-
hasExistingChats={false}
|
|
2994
|
-
// Hover/focus PREVIEWS the action's full prompt as ghost text
|
|
2995
|
-
// in the empty composer (see `quickActionPreview` /
|
|
2996
|
-
// `ChatInput.previewText`). Wired after the `{...mingoWelcome}`
|
|
2997
|
-
// spread so the host can't override it.
|
|
2998
|
-
onQuickActionHover={action => setQuickActionPreview(action.prompt ?? action.label)}
|
|
2999
|
-
onQuickActionHoverEnd={() => setQuickActionPreview(null)}
|
|
3000
|
-
// A built-in agent caps the quick-action wall at 2 rows;
|
|
3001
|
-
// this is the Mingo surface, so fall back to 'mingo'.
|
|
3002
|
-
agentSlug={activeAgentSlug ?? 'mingo'}
|
|
3003
|
-
/>
|
|
3004
|
-
) : (
|
|
3005
|
-
/* Figma node 7532:328214 — Guide-mode empty state: greeting
|
|
3006
|
-
+ slash-command onboarding list share one scroll region,
|
|
3007
|
-
with a pinned quick-action chip row above the composer. */
|
|
3008
|
-
<GuideWelcome
|
|
3009
|
-
// Admin/host greeting customises the guide subtitle; an
|
|
3010
|
-
// explicit `guideWelcome.subtitle` still wins (spread below).
|
|
3011
|
-
subtitle={effectiveGreeting ?? undefined}
|
|
3012
|
-
// While the admin greeting is still being fetched, render a
|
|
3013
|
-
// subtitle skeleton instead of flashing empty → text.
|
|
3014
|
-
subtitleLoading={emptyStateLoading}
|
|
3015
|
-
{...guideWelcome}
|
|
3016
|
-
// Agent identity (name → title, icon → empty-state glyph)
|
|
3017
|
-
// wins over the host `guideWelcome` spread + built-in
|
|
3018
|
-
// defaults; falls back to the host value when no agent is
|
|
3019
|
-
// active. Placed after the spread so resolution is
|
|
3020
|
-
// deterministic.
|
|
3021
|
-
title={effectiveAssistantName ?? guideWelcome?.title}
|
|
3022
|
-
icon={effectiveAssistantIcon ?? guideWelcome?.icon}
|
|
3023
|
-
// Admin "try-asking chips" → Guide quick-action chips.
|
|
3024
|
-
// Precedence: when an AGENT is active and its fetched chips
|
|
3025
|
-
// arrived, the agent's chips win — the host array is the
|
|
3026
|
-
// platform default, not the agent's. (`agentConfigUrl` is
|
|
3027
|
-
// the same derived value that drives the config fetch, so
|
|
3028
|
-
// this can never disagree with what was fetched; while the
|
|
3029
|
-
// fetch is in-flight the fetched list is [] and host chips
|
|
3030
|
-
// show.) Outside agent mode the host-provided
|
|
3031
|
-
// `guideWelcome.quickActions` wins as before.
|
|
3032
|
-
quickActions={
|
|
3033
|
-
agentConfigUrl && guideSuggestedActions.length > 0
|
|
3034
|
-
? guideSuggestedActions
|
|
3035
|
-
: (guideWelcome?.quickActions ?? guideSuggestedActions)
|
|
3036
|
-
}
|
|
3037
|
-
// Quick-action chips SEND the prompt immediately on click.
|
|
3038
|
-
onQuickAction={action => {
|
|
3039
|
-
setQuickActionPreview(null);
|
|
3040
|
-
handleSend(action.prompt ?? action.label);
|
|
3041
|
-
}}
|
|
3042
|
-
// Hover/focus PREVIEWS the action's full prompt as ghost text
|
|
3043
|
-
// in the empty composer (the chip label is short; this reveals
|
|
3044
|
-
// what will be sent). Declarative + non-destructive — see
|
|
3045
|
-
// `quickActionPreview` / `ChatInput.previewText`.
|
|
3046
|
-
onQuickActionHover={action => setQuickActionPreview(action.prompt ?? action.label)}
|
|
3047
|
-
onQuickActionHoverEnd={() => setQuickActionPreview(null)}
|
|
3048
|
-
// In agent mode a built-in agent (fae/mingo) caps the wall at
|
|
3049
|
-
// 2 rows; host/guide mode (no active agent) keeps the default.
|
|
3050
|
-
agentSlug={activeAgentSlug}
|
|
3051
|
-
>
|
|
3052
|
-
{/* Figma node 7363:205938 — single-column slash-command
|
|
3053
|
-
list. No own scroll (GuideWelcome's region scrolls); the
|
|
3054
|
-
rounded-md frame holds the cards on the dark surface. */}
|
|
3055
|
-
{(chipCommands.length > 0 || !commandsLoaded) && (
|
|
3056
|
-
<div className="shrink-0 overflow-hidden rounded-md border border-ods-border">
|
|
3057
|
-
{!commandsLoaded && chipCommands.length === 0 && (
|
|
3058
|
-
<LoadingItems count={MINGO_ONBOARDING_SKELETON_ROWS}>
|
|
3059
|
-
{i => (
|
|
3060
|
-
<MingoOnboardingCard loading data-loading-item skeletonIndex={i} title="" />
|
|
3061
|
-
)}
|
|
3062
|
-
</LoadingItems>
|
|
3063
|
-
)}
|
|
3064
|
-
{chipCommands.map(cmd => {
|
|
3065
|
-
const Icon = resolveIcon(cmd.iconName);
|
|
3066
|
-
const cmdId = cmd.id;
|
|
3067
|
-
const label = cmd.label ?? `/${cmdId}`;
|
|
3068
|
-
const cardActions = cmd.actions.map(action => ({
|
|
3069
|
-
id: action.id,
|
|
3070
|
-
label: action.label,
|
|
3071
|
-
onClick: () => dispatchSlashCommandAction(action.id, cmdId, chatInputRef),
|
|
3072
|
-
}));
|
|
3073
|
-
return (
|
|
3074
|
-
<MingoOnboardingCard
|
|
3075
|
-
key={cmdId}
|
|
3076
|
-
icon={<Icon size={16} />}
|
|
3077
|
-
title={label}
|
|
3078
|
-
slashCommand={`/${cmdId}`}
|
|
3079
|
-
description={cmd.description}
|
|
3080
|
-
actions={cardActions}
|
|
3081
|
-
data-loading-item
|
|
3082
|
-
/>
|
|
3083
|
-
);
|
|
3084
|
-
})}
|
|
3085
|
-
</div>
|
|
3086
|
-
)}
|
|
3087
|
-
</GuideWelcome>
|
|
3088
|
-
)}
|
|
3089
|
-
</div>
|
|
3090
|
-
</div>
|
|
3091
|
-
|
|
3092
|
-
{/* Host block pinned above the composer (`aboveComposer`):
|
|
3093
|
-
the thread's own bottom padding separates them, the
|
|
3094
|
-
composer's horizontal inset is repeated so the two line up.
|
|
3095
|
-
It may shrink: in a short panel the block (which scrolls
|
|
3096
|
-
its own content, `min-h-0`) yields height to the thread. */}
|
|
3097
|
-
{hasAboveComposer && (
|
|
3098
|
-
<div
|
|
3099
|
-
data-testid="chat-above-composer"
|
|
3100
|
-
className="flex min-h-0 shrink flex-col px-[var(--spacing-system-m)] pb-[var(--spacing-system-m)]"
|
|
3101
|
-
>
|
|
3102
|
-
{aboveComposer}
|
|
3103
|
-
</div>
|
|
3104
|
-
)}
|
|
3105
|
-
|
|
3106
|
-
<ChatAttachmentChipStrip
|
|
3107
|
-
attachments={stagedAttachments}
|
|
3108
|
-
onRemove={removeAttachment}
|
|
3109
|
-
disabled={chatLoading}
|
|
3110
|
-
/>
|
|
3111
|
-
|
|
3112
|
-
<ChatComposer
|
|
3113
|
-
key={composerKey}
|
|
3114
|
-
archived={isViewingArchived}
|
|
3115
|
-
lock={composerLock}
|
|
3116
|
-
inputRef={chatInputRef}
|
|
3117
|
-
onSend={handleSend}
|
|
3118
|
-
onStop={stopMessage}
|
|
3119
|
-
sending={chatLoading || hasInflightUploads}
|
|
3120
|
-
placeholder={
|
|
3121
|
-
hasInflightUploads
|
|
3122
|
-
? 'Waiting for uploads to finish…'
|
|
3123
|
-
: isV2
|
|
3124
|
-
? 'Enter your Request...'
|
|
3125
|
-
: 'Ask a question...'
|
|
3126
|
-
}
|
|
3127
|
-
autoFocus={previewMode ? false : autoFocusInput}
|
|
3128
|
-
slashCommands={slashCommandsProp}
|
|
3129
|
-
previewText={quickActionPreview ?? undefined}
|
|
3130
|
-
showAttachmentButton={attachmentsEnabled && activeMode === 'guide'}
|
|
3131
|
-
attachmentsCount={stagedAttachments.length}
|
|
3132
|
-
onAddFiles={addAttachmentFiles}
|
|
3133
|
-
attachmentsDisabled={chatLoading}
|
|
3134
|
-
contextPicker={contextPickerForMode}
|
|
3135
|
-
selectedContextItems={contextItems}
|
|
3136
|
-
onToggleContextItem={toggleContextItem}
|
|
3137
|
-
onRemoveContextItem={removeContextItem}
|
|
3138
|
-
contextMemoryItems={contextMemory?.items}
|
|
3139
|
-
onRemoveContextMemoryItem={contextMemory?.onRemove}
|
|
3140
|
-
contextMemoryPending={contextMemory?.pending}
|
|
3141
|
-
contextPickerOpen={contextPickerOpen}
|
|
3142
|
-
onOpenContextPicker={openContextPicker}
|
|
3143
|
-
onCloseContextPicker={closeContextPicker}
|
|
3144
|
-
mentionQuery={mentionQuery}
|
|
3145
|
-
onMentionQueryChange={handleMentionQueryChange}
|
|
3146
|
-
onValueChange={handleContextValueChange}
|
|
3147
|
-
model={{
|
|
3148
|
-
provider: currentProvider ?? 'anthropic',
|
|
3149
|
-
modelName: currentModelLabel ?? 'Claude',
|
|
3150
|
-
usedTokens:
|
|
3151
|
-
currentInputTokens != null
|
|
3152
|
-
? (currentInputTokens ?? 0) + (currentOutputTokens ?? 0)
|
|
3153
|
-
: undefined,
|
|
3154
|
-
contextWindow: currentContextWindowMaxTokens ?? undefined,
|
|
3155
|
-
inputTokens: currentInputTokens ?? undefined,
|
|
3156
|
-
outputTokens: currentOutputTokens ?? undefined,
|
|
3157
|
-
hitRatePct: currentCacheHitRatePct ?? undefined,
|
|
3158
|
-
breakdown: currentUsageBreakdown ?? undefined,
|
|
3159
|
-
}}
|
|
3160
|
-
/>
|
|
3406
|
+
{threadArea}
|
|
3407
|
+
{aboveComposerNode}
|
|
3408
|
+
{attachmentStrip}
|
|
3409
|
+
{composerNode}
|
|
3161
3410
|
</>
|
|
3162
3411
|
)}
|
|
3163
3412
|
</div>
|
|
@@ -3167,20 +3416,7 @@ function EmbeddableChatInner({
|
|
|
3167
3416
|
</div>
|
|
3168
3417
|
{galleryModal}
|
|
3169
3418
|
|
|
3170
|
-
{
|
|
3171
|
-
7592:226181). Triggered from the header ⋯ and the dialog-history
|
|
3172
|
-
rows; rendered inside the panel so they overlay the chat. */}
|
|
3173
|
-
<ChatDialogModals
|
|
3174
|
-
renameTarget={renameTarget}
|
|
3175
|
-
setRenameTarget={setRenameTarget}
|
|
3176
|
-
onConfirmRename={handleConfirmRename}
|
|
3177
|
-
archiveTarget={archiveTarget}
|
|
3178
|
-
setArchiveTarget={setArchiveTarget}
|
|
3179
|
-
onConfirmArchive={handleConfirmArchive}
|
|
3180
|
-
restoreTarget={restoreTarget}
|
|
3181
|
-
setRestoreTarget={setRestoreTarget}
|
|
3182
|
-
onConfirmRestore={handleConfirmRestore}
|
|
3183
|
-
/>
|
|
3419
|
+
{dialogModals}
|
|
3184
3420
|
|
|
3185
3421
|
{/* Portal target for in-panel Radix overlays — `display: contents`
|
|
3186
3422
|
so it adds no box; content is positioned `fixed` by Radix. */}
|
|
@@ -3190,6 +3426,82 @@ function EmbeddableChatInner({
|
|
|
3190
3426
|
</ChatAppearanceContext.Provider>
|
|
3191
3427
|
);
|
|
3192
3428
|
|
|
3429
|
+
// ── Split layout (`threadContainer`) ───────────────────────────────────────
|
|
3430
|
+
// The header over a chat that IS the page: nothing closes, collapses or
|
|
3431
|
+
// toggles a list. The title, "· owner · day", and the chat's ⋯.
|
|
3432
|
+
const pageHeader = (
|
|
3433
|
+
<MingoChatHeader
|
|
3434
|
+
variant="page"
|
|
3435
|
+
// Over the archive the header is the archive's (see the v2 header).
|
|
3436
|
+
title={archiveOpen ? 'Chat Archive' : headerShowBack || isGuideEmpty ? headerTitle : freshConversationTitle}
|
|
3437
|
+
meta={archiveOpen || !hasConversation ? undefined : [headerPersonName, chatDayLabel(activeDialog?.timestamp)]}
|
|
3438
|
+
menuItems={headerShowBack && !isViewingArchived && !archiveOpen ? mingoHeaderMenuItems : []}
|
|
3439
|
+
extraMenuItems={isViewingArchived || archiveOpen ? undefined : chatMenuExtraItems}
|
|
3440
|
+
onRestore={isViewingArchived && !archiveOpen ? headerOnRestore : undefined}
|
|
3441
|
+
renaming={inlineRenaming && !archiveOpen}
|
|
3442
|
+
onRenameSubmit={submitInlineRename}
|
|
3443
|
+
onRenameCancel={cancelInlineRename}
|
|
3444
|
+
actions={threadHeaderActions}
|
|
3445
|
+
/>
|
|
3446
|
+
);
|
|
3447
|
+
|
|
3448
|
+
// The header + thread, portalled into the host's node. Its own portal host
|
|
3449
|
+
// and collision boundary keep its menus inside it. The modals live here too:
|
|
3450
|
+
// they only open from this header, and the page area is where a host's own
|
|
3451
|
+
// modals already render. It paints no surface of its own: the host paints
|
|
3452
|
+
// the one area that holds both the thread and the composer (`AppLayout`'s
|
|
3453
|
+
// `pageSurface`), so the background does not stop at the thread's edge.
|
|
3454
|
+
const threadRegion = (
|
|
3455
|
+
<div
|
|
3456
|
+
ref={setThreadBoundary}
|
|
3457
|
+
className={cn(
|
|
3458
|
+
'flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden',
|
|
3459
|
+
previewMode && 'pointer-events-none select-none',
|
|
3460
|
+
)}
|
|
3461
|
+
>
|
|
3462
|
+
<PortalContainerContext.Provider value={threadPortalHost}>
|
|
3463
|
+
<CollisionBoundaryContext.Provider value={threadBoundary}>
|
|
3464
|
+
{pageHeader}
|
|
3465
|
+
{activeMode === 'guide' && hasMingoMode && <GuideModeBanner className="duration-200 animate-in fade-in-0" />}
|
|
3466
|
+
<div className="flex min-h-0 min-w-0 flex-1 flex-col">{archiveOpen ? archiveListNode : threadArea}</div>
|
|
3467
|
+
{galleryModal}
|
|
3468
|
+
{dialogModals}
|
|
3469
|
+
<div ref={setThreadPortalHost} style={{ display: 'contents' }} />
|
|
3470
|
+
</CollisionBoundaryContext.Provider>
|
|
3471
|
+
</PortalContainerContext.Provider>
|
|
3472
|
+
</div>
|
|
3473
|
+
);
|
|
3474
|
+
|
|
3475
|
+
// The composer where the panel is mounted (the host's dock). The thread
|
|
3476
|
+
// portal holds the FIRST slot whether or not it renders, so the composer keeps
|
|
3477
|
+
// its place in the tree — and its draft — when the container comes and goes.
|
|
3478
|
+
// No `overflow-hidden` and no fixed height: the picker, the `@` / slash menus
|
|
3479
|
+
// and the memory popover open above the composer, outside this box. Its
|
|
3480
|
+
// overlays collide with whatever boundary the host provides (the viewport by
|
|
3481
|
+
// default), never with this short box.
|
|
3482
|
+
const body = splitMode ? (
|
|
3483
|
+
<ChatAppearanceContext.Provider value={appearance}>
|
|
3484
|
+
<PortalContainerContext.Provider value={portalHost}>
|
|
3485
|
+
<div
|
|
3486
|
+
ref={setPanelNode}
|
|
3487
|
+
data-surface={isV2 ? 'mingo' : undefined}
|
|
3488
|
+
className={cn('flex min-w-0 flex-col', previewMode && 'pointer-events-none select-none')}
|
|
3489
|
+
>
|
|
3490
|
+
{threadContainer ? createPortal(threadRegion, threadContainer) : null}
|
|
3491
|
+
{aboveComposerNode}
|
|
3492
|
+
{attachmentStrip}
|
|
3493
|
+
{composerNode}
|
|
3494
|
+
</div>
|
|
3495
|
+
{/* With no thread on screen nothing can open them; mounted anyway so
|
|
3496
|
+
a target set just before the thread left still resolves. */}
|
|
3497
|
+
{threadContainer ? null : dialogModals}
|
|
3498
|
+
<div ref={setPortalHost} style={{ display: 'contents' }} />
|
|
3499
|
+
</PortalContainerContext.Provider>
|
|
3500
|
+
</ChatAppearanceContext.Provider>
|
|
3501
|
+
) : (
|
|
3502
|
+
classicBody
|
|
3503
|
+
);
|
|
3504
|
+
|
|
3193
3505
|
// Conditional shell: inline (shell-less host, e.g. AppLayoutDrawer, which
|
|
3194
3506
|
// provides its own chrome/focus-trap/size) vs the body-level Radix Drawer
|
|
3195
3507
|
// (backdrop, iOS scroll-lock, drag-to-resize). Both render the same `body`.
|