@opengeni/react 4.0.2 → 4.0.5-canary.39118806767001
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/README.md +787 -26
- package/dist/accounts.js +2 -0
- package/dist/accounts.js.map +1 -1
- package/dist/approvals.d.ts +2 -1
- package/dist/artifacts-document.js +6 -3
- package/dist/artifacts-presentation.js +6 -3
- package/dist/artifacts-spreadsheet.d.ts +1 -1
- package/dist/artifacts-spreadsheet.js +6 -3
- package/dist/artifacts.d.ts +5 -1
- package/dist/artifacts.js +542 -278
- package/dist/artifacts.js.map +1 -1
- package/dist/browser-viewer-GEHX3KYE.js +20 -0
- package/dist/capability-catalog-row.d.ts +20 -0
- package/dist/capability-logo-fallback.d.ts +3 -0
- package/dist/chat-interactive-block-5V3BGLXT.js +15 -0
- package/dist/chunk-2DDJ6YH6.js +41 -0
- package/dist/chunk-2DDJ6YH6.js.map +1 -0
- package/dist/chunk-2EGXXUG4.js +1161 -0
- package/dist/chunk-2EGXXUG4.js.map +1 -0
- package/dist/chunk-2XKRY4GF.js +302 -0
- package/dist/chunk-2XKRY4GF.js.map +1 -0
- package/dist/chunk-2ZUUIMBY.js +343 -0
- package/dist/chunk-2ZUUIMBY.js.map +1 -0
- package/dist/chunk-4F4FGCH2.js +34 -0
- package/dist/chunk-4F4FGCH2.js.map +1 -0
- package/dist/{chunk-Z7WBDB4E.js → chunk-4M2MJLY3.js} +848 -867
- package/dist/chunk-4M2MJLY3.js.map +1 -0
- package/dist/chunk-4U7SHFQ2.js +193 -0
- package/dist/chunk-4U7SHFQ2.js.map +1 -0
- package/dist/chunk-5I4VRWBB.js +56 -0
- package/dist/chunk-5I4VRWBB.js.map +1 -0
- package/dist/{chunk-24M4YBCL.js → chunk-62XZ3IX3.js} +1751 -845
- package/dist/chunk-62XZ3IX3.js.map +1 -0
- package/dist/chunk-77THWHSU.js +308 -0
- package/dist/chunk-77THWHSU.js.map +1 -0
- package/dist/chunk-7CZLTFXF.js +466 -0
- package/dist/chunk-7CZLTFXF.js.map +1 -0
- package/dist/chunk-7N5AD2TC.js +327 -0
- package/dist/chunk-7N5AD2TC.js.map +1 -0
- package/dist/chunk-7SZ7MMCY.js +325 -0
- package/dist/chunk-7SZ7MMCY.js.map +1 -0
- package/dist/chunk-7TG6KTR2.js +3153 -0
- package/dist/chunk-7TG6KTR2.js.map +1 -0
- package/dist/chunk-AIX25FIQ.js +409 -0
- package/dist/chunk-AIX25FIQ.js.map +1 -0
- package/dist/chunk-AT2HD6RQ.js +1936 -0
- package/dist/chunk-AT2HD6RQ.js.map +1 -0
- package/dist/chunk-B27E3V37.js +29 -0
- package/dist/chunk-B27E3V37.js.map +1 -0
- package/dist/{chunk-5M6VTFJ5.js → chunk-B4EDAXMC.js} +37 -13
- package/dist/chunk-B4EDAXMC.js.map +1 -0
- package/dist/chunk-BOG2FED3.js +35 -0
- package/dist/chunk-BOG2FED3.js.map +1 -0
- package/dist/chunk-BQYQU5QW.js +109 -0
- package/dist/chunk-BQYQU5QW.js.map +1 -0
- package/dist/{chunk-PAJU5KKL.js → chunk-BRIOXCLH.js} +68 -25
- package/dist/chunk-BRIOXCLH.js.map +1 -0
- package/dist/chunk-CM7LVUKC.js +35 -0
- package/dist/chunk-CM7LVUKC.js.map +1 -0
- package/dist/{chunk-KCGXPP5V.js → chunk-CXIGFHVL.js} +35 -23
- package/dist/chunk-CXIGFHVL.js.map +1 -0
- package/dist/chunk-DHXKEJBH.js +71 -0
- package/dist/chunk-DHXKEJBH.js.map +1 -0
- package/dist/{chunk-NOSYBS2D.js → chunk-DN3TKURW.js} +12 -9
- package/dist/chunk-DN3TKURW.js.map +1 -0
- package/dist/chunk-DNJ23AWQ.js +35 -0
- package/dist/chunk-DNJ23AWQ.js.map +1 -0
- package/dist/chunk-ESAMXNBZ.js +3237 -0
- package/dist/chunk-ESAMXNBZ.js.map +1 -0
- package/dist/{chunk-4MDLEHXL.js → chunk-EWATYP5L.js} +64 -44
- package/dist/chunk-EWATYP5L.js.map +1 -0
- package/dist/{chunk-YBM6CQRU.js → chunk-FQ5CXNUG.js} +65 -42
- package/dist/chunk-FQ5CXNUG.js.map +1 -0
- package/dist/chunk-HEVQKE27.js +150 -0
- package/dist/chunk-HEVQKE27.js.map +1 -0
- package/dist/chunk-HZ47S3DP.js +1086 -0
- package/dist/chunk-HZ47S3DP.js.map +1 -0
- package/dist/chunk-I5BJ7ENY.js +174 -0
- package/dist/chunk-I5BJ7ENY.js.map +1 -0
- package/dist/chunk-IGFZFLI2.js +1390 -0
- package/dist/chunk-IGFZFLI2.js.map +1 -0
- package/dist/chunk-IGVL3ELX.js +46 -0
- package/dist/chunk-IGVL3ELX.js.map +1 -0
- package/dist/chunk-IOD24LGR.js +384 -0
- package/dist/chunk-IOD24LGR.js.map +1 -0
- package/dist/chunk-IOYHDEP3.js +38 -0
- package/dist/chunk-IOYHDEP3.js.map +1 -0
- package/dist/chunk-IQL77TMM.js +803 -0
- package/dist/chunk-IQL77TMM.js.map +1 -0
- package/dist/chunk-IZV5FTJC.js +55 -0
- package/dist/chunk-IZV5FTJC.js.map +1 -0
- package/dist/{chunk-H5YGYNXS.js → chunk-JAYYFOOB.js} +75 -28
- package/dist/chunk-JAYYFOOB.js.map +1 -0
- package/dist/chunk-KN2MYSCC.js +409 -0
- package/dist/chunk-KN2MYSCC.js.map +1 -0
- package/dist/{chunk-PEI6RANI.js → chunk-KYVJMTXL.js} +434 -145
- package/dist/chunk-KYVJMTXL.js.map +1 -0
- package/dist/{chunk-ZYRGEKWS.js → chunk-LJUMYUBO.js} +3 -1
- package/dist/{chunk-ZYRGEKWS.js.map → chunk-LJUMYUBO.js.map} +1 -1
- package/dist/{chunk-ICA6R6TW.js → chunk-LNUD3JNI.js} +1532 -395
- package/dist/chunk-LNUD3JNI.js.map +1 -0
- package/dist/chunk-M357MHH3.js +2 -0
- package/dist/{chunk-BV5A4OTE.js → chunk-MEL6PH2I.js} +1218 -537
- package/dist/chunk-MEL6PH2I.js.map +1 -0
- package/dist/chunk-MF6WS2XF.js +386 -0
- package/dist/chunk-MF6WS2XF.js.map +1 -0
- package/dist/chunk-MK2TQO4Y.js +24 -0
- package/dist/chunk-MK2TQO4Y.js.map +1 -0
- package/dist/chunk-N7S72EXK.js +25 -0
- package/dist/chunk-N7S72EXK.js.map +1 -0
- package/dist/{chunk-KZ73RL76.js → chunk-NAWXARTY.js} +58 -9
- package/dist/chunk-NAWXARTY.js.map +1 -0
- package/dist/chunk-NX4ADH73.js +14 -0
- package/dist/chunk-NX4ADH73.js.map +1 -0
- package/dist/chunk-OYQQJL3J.js +16 -0
- package/dist/chunk-OYQQJL3J.js.map +1 -0
- package/dist/chunk-P4MKPCTC.js +51 -0
- package/dist/chunk-P4MKPCTC.js.map +1 -0
- package/dist/{chunk-JVYQRRC4.js → chunk-PEHTX3V7.js} +21 -1
- package/dist/chunk-PEHTX3V7.js.map +1 -0
- package/dist/chunk-PMV53IMM.js +26 -0
- package/dist/chunk-PMV53IMM.js.map +1 -0
- package/dist/chunk-PYSEGV5X.js +14396 -0
- package/dist/chunk-PYSEGV5X.js.map +1 -0
- package/dist/{chunk-HUIKIDM5.js → chunk-QOEWDOFW.js} +295 -156
- package/dist/chunk-QOEWDOFW.js.map +1 -0
- package/dist/chunk-QV3DJVRZ.js +11 -0
- package/dist/chunk-QV3DJVRZ.js.map +1 -0
- package/dist/{chunk-HUMIRRYI.js → chunk-QYUYVSNG.js} +1103 -1699
- package/dist/chunk-QYUYVSNG.js.map +1 -0
- package/dist/{chunk-6J56T3MG.js → chunk-RRAQ5FV5.js} +186 -60
- package/dist/chunk-RRAQ5FV5.js.map +1 -0
- package/dist/{chunk-5YK2ZDIG.js → chunk-TNEZNMSN.js} +4 -10
- package/dist/chunk-TNEZNMSN.js.map +1 -0
- package/dist/{chunk-22KP6LR5.js → chunk-TXS65BB2.js} +3 -1
- package/dist/{chunk-22KP6LR5.js.map → chunk-TXS65BB2.js.map} +1 -1
- package/dist/chunk-UIWIOB4U.js +2215 -0
- package/dist/chunk-UIWIOB4U.js.map +1 -0
- package/dist/chunk-UNJPZGNK.js +63 -0
- package/dist/chunk-UNJPZGNK.js.map +1 -0
- package/dist/chunk-V7UGCQHQ.js +86 -0
- package/dist/chunk-V7UGCQHQ.js.map +1 -0
- package/dist/chunk-VU4QUISJ.js +3405 -0
- package/dist/chunk-VU4QUISJ.js.map +1 -0
- package/dist/chunk-WEY5J52U.js +467 -0
- package/dist/chunk-WEY5J52U.js.map +1 -0
- package/dist/chunk-WH2CBESG.js +409 -0
- package/dist/chunk-WH2CBESG.js.map +1 -0
- package/dist/{chunk-VZTQ73XT.js → chunk-XEA5BCMA.js} +3 -1
- package/dist/{chunk-VZTQ73XT.js.map → chunk-XEA5BCMA.js.map} +1 -1
- package/dist/{chunk-NLTS7JHI.js → chunk-XEIHS3RN.js} +834 -403
- package/dist/chunk-XEIHS3RN.js.map +1 -0
- package/dist/chunk-YNXZRE3F.js +408 -0
- package/dist/chunk-YNXZRE3F.js.map +1 -0
- package/dist/chunk-YSRBFJMQ.js +43 -0
- package/dist/chunk-YSRBFJMQ.js.map +1 -0
- package/dist/{chunk-NEXLLTP4.js → chunk-ZGFU4LVW.js} +6 -5
- package/dist/chunk-ZGFU4LVW.js.map +1 -0
- package/dist/chunk-ZO35BAMO.js +172 -0
- package/dist/chunk-ZO35BAMO.js.map +1 -0
- package/dist/chunk-ZUWF4NF7.js +13 -0
- package/dist/chunk-ZUWF4NF7.js.map +1 -0
- package/dist/client.d.ts +15 -6
- package/dist/clipboard.js +3 -1
- package/dist/commands/registry.d.ts +2 -1
- package/dist/commands/types.d.ts +2 -0
- package/dist/components/anthropic-mark.d.ts +3 -0
- package/dist/components/approval-surface.d.ts +21 -7
- package/dist/components/artifacts/artifact-chrome.d.ts +121 -0
- package/dist/components/artifacts/artifact-sandbox.d.ts +30 -0
- package/dist/components/artifacts/artifact-surface.d.ts +4 -2
- package/dist/components/artifacts/chat-interactive-block.d.ts +29 -0
- package/dist/components/artifacts/deferred-chat-media.d.ts +15 -0
- package/dist/components/artifacts/document-editor.d.ts +4 -2
- package/dist/components/artifacts/editable-artifact-ui.d.ts +4 -2
- package/dist/components/artifacts/editable-artifact-view.d.ts +48 -0
- package/dist/components/artifacts/editable-document.d.ts +3 -2
- package/dist/components/artifacts/editable-presentation.d.ts +4 -3
- package/dist/components/artifacts/editable-spreadsheet.d.ts +8 -3
- package/dist/components/artifacts/index.d.ts +8 -1
- package/dist/components/artifacts/inline-html-document.d.ts +2 -0
- package/dist/components/artifacts/latest-task-runner.d.ts +15 -0
- package/dist/components/artifacts/presentation-editor.d.ts +6 -2
- package/dist/components/artifacts/published-html-artifact-frame.d.ts +17 -40
- package/dist/components/artifacts/session-artifact-viewer.d.ts +39 -0
- package/dist/components/artifacts/site-view.d.ts +26 -0
- package/dist/components/artifacts/spreadsheet-command-queue.d.ts +20 -0
- package/dist/components/artifacts/spreadsheet-download.d.ts +7 -0
- package/dist/components/artifacts/spreadsheet-general-display.d.ts +24 -0
- package/dist/components/artifacts/spreadsheet-grid.d.ts +11 -4
- package/dist/components/artifacts/spreadsheet-resize.d.ts +50 -0
- package/dist/components/artifacts/spreadsheet-submissions.d.ts +9 -0
- package/dist/components/artifacts/visualization-assets.gen.d.ts +2 -0
- package/dist/components/browser-select-control.d.ts +16 -0
- package/dist/components/browser-viewer.d.ts +11 -2
- package/dist/components/chat-composer.d.ts +21 -3
- package/dist/components/child-session-link.d.ts +5 -1
- package/dist/components/claude-mark.d.ts +3 -0
- package/dist/components/code-editor.d.ts +1 -4
- package/dist/components/command-palette.d.ts +1 -1
- package/dist/components/composer-transcription-control.d.ts +7 -0
- package/dist/components/composer.d.ts +30 -67
- package/dist/components/computer-viewer.d.ts +1 -1
- package/dist/components/copy-button.d.ts +3 -1
- package/dist/components/desktop-viewer.d.ts +1 -1
- package/dist/components/generated-video-player.d.ts +1 -1
- package/dist/components/grok-mark.d.ts +26 -0
- package/dist/components/human-input-form.d.ts +26 -32
- package/dist/components/human-input-surface.d.ts +5 -1
- package/dist/components/linkified-text.d.ts +18 -0
- package/dist/components/machine-input-display.d.ts +25 -3
- package/dist/components/machine-status-pill.d.ts +3 -2
- package/dist/components/machines/agent-status-icon.d.ts +6 -0
- package/dist/components/machines/health.d.ts +2 -1
- package/dist/components/machines/machine-detail.d.ts +7 -1
- package/dist/components/machines/machine-status.d.ts +49 -0
- package/dist/components/machines/metric-history-chart.d.ts +1 -1
- package/dist/components/machines/series.d.ts +3 -2
- package/dist/components/markdown-table-layout.d.ts +11 -2
- package/dist/components/markdown.d.ts +37 -4
- package/dist/components/message-timeline.d.ts +79 -7
- package/dist/components/model-mark.d.ts +29 -0
- package/dist/components/model-picker.d.ts +1 -1
- package/dist/components/model-policy-picker.d.ts +31 -22
- package/dist/components/new-conversation.d.ts +32 -0
- package/dist/components/open-geni-chat.d.ts +73 -0
- package/dist/components/open-geni-links.d.ts +69 -0
- package/dist/components/openrouter-mark.d.ts +6 -0
- package/dist/components/opper-mark.d.ts +7 -0
- package/dist/components/preview-loading.d.ts +2 -0
- package/dist/components/provider-recovery-notice.d.ts +17 -0
- package/dist/components/queue-item-content.d.ts +10 -0
- package/dist/components/rehype-secret-refs.d.ts +23 -0
- package/dist/components/remark-soft-line-breaks.d.ts +38 -0
- package/dist/components/sandbox-workspace.d.ts +18 -0
- package/dist/components/secret-question-field.d.ts +31 -0
- package/dist/components/secret-ref-chip.d.ts +35 -0
- package/dist/components/session-capability-frame.d.ts +37 -0
- package/dist/components/session-chrome.d.ts +20 -7
- package/dist/components/session-commands.d.ts +6 -0
- package/dist/components/session-connection-request.d.ts +8 -0
- package/dist/components/session-conversation.d.ts +147 -6
- package/dist/components/session-list.d.ts +39 -0
- package/dist/components/session-mcp-capability-card.d.ts +41 -0
- package/dist/components/session-proxy-scope.d.ts +35 -0
- package/dist/components/session-status.d.ts +6 -2
- package/dist/components/session-usage-limit-notice.d.ts +39 -0
- package/dist/components/this-computer/illustrations.d.ts +38 -0
- package/dist/components/this-computer/labels.d.ts +111 -0
- package/dist/components/this-computer/this-computer-card.d.ts +40 -0
- package/dist/components/this-computer/this-computer-setup.d.ts +35 -0
- package/dist/components/this-computer/this-computer-status.d.ts +42 -0
- package/dist/components/this-computer/use-this-computer.d.ts +29 -0
- package/dist/components/timeline-anchor.d.ts +3 -0
- package/dist/components/timeline-annotation-shared.d.ts +3 -2
- package/dist/components/timeline-annotations-dialog.d.ts +2 -1
- package/dist/components/timeline-annotations.d.ts +5 -1
- package/dist/components/timeline-reading-progress.d.ts +11 -0
- package/dist/components/timeline-search.d.ts +34 -0
- package/dist/components/timeline-settlement.d.ts +16 -0
- package/dist/components/tool-action-review.d.ts +48 -0
- package/dist/components/tool-review-history.d.ts +25 -0
- package/dist/components/usage-limit-notice.d.ts +50 -0
- package/dist/components/usage-member-list.d.ts +92 -0
- package/dist/components/usage-meter.d.ts +74 -0
- package/dist/components/use-viewer-menu-dismiss.d.ts +2 -0
- package/dist/components/user-message-body.d.ts +10 -1
- package/dist/components/workbench-changes.d.ts +2 -1
- package/dist/composer-messages.d.ts +75 -0
- package/dist/composer-messages.js +9 -0
- package/dist/composer-messages.js.map +1 -0
- package/dist/composer-voice-events.d.ts +8 -0
- package/dist/composer.d.ts +3 -3
- package/dist/composer.js +25 -12
- package/dist/computer-viewer-VOIOZGVZ.js +21 -0
- package/dist/computer-viewer-VOIOZGVZ.js.map +1 -0
- package/dist/connect-account-identity.d.ts +8 -0
- package/dist/connect-accounts.d.ts +15 -0
- package/dist/connect-chooser.d.ts +18 -0
- package/dist/connect-panel.d.ts +18 -0
- package/dist/connect-setup.d.ts +18 -0
- package/dist/connect.d.ts +21 -0
- package/dist/connect.js +2216 -0
- package/dist/connect.js.map +1 -0
- package/dist/connection-catalog.d.ts +38 -0
- package/dist/connection-discovery.d.ts +12 -0
- package/dist/connection-installed.d.ts +17 -0
- package/dist/connection-logo.d.ts +9 -0
- package/dist/connection-service-logo.d.ts +8 -0
- package/dist/connection-service-presentation.d.ts +13 -0
- package/dist/connection-skeleton.d.ts +5 -0
- package/dist/connection-type-picker.d.ts +6 -0
- package/dist/conversation-timeline.d.ts +1 -1
- package/dist/desktop.d.ts +7 -0
- package/dist/desktop.js +28 -0
- package/dist/desktop.js.map +1 -0
- package/dist/device-authorization.d.ts +23 -0
- package/dist/diffs.d.ts +8 -0
- package/dist/diffs.js +15 -0
- package/dist/diffs.js.map +1 -0
- package/dist/discovery-cache.d.ts +5 -0
- package/dist/editor.d.ts +7 -0
- package/dist/editor.js +23 -0
- package/dist/editor.js.map +1 -0
- package/dist/embedded-new-voice-KPLC5UJZ.js +19 -0
- package/dist/embedded-new-voice-KPLC5UJZ.js.map +1 -0
- package/dist/embedded-voice-V2RFSLIU.js +19 -0
- package/dist/embedded-voice-V2RFSLIU.js.map +1 -0
- package/dist/fleet-decision-row-FE73NSQ6.js +361 -0
- package/dist/fleet-decision-row-FE73NSQ6.js.map +1 -0
- package/dist/hooks/internal.d.ts +27 -2
- package/dist/hooks/latest-question.d.ts +26 -0
- package/dist/hooks/session-view-cache.d.ts +38 -0
- package/dist/hooks/shared-machines-list.d.ts +4 -0
- package/dist/hooks/shared-query.d.ts +123 -0
- package/dist/hooks/use-attached-browsers.d.ts +1 -1
- package/dist/hooks/use-auth-runs.d.ts +1 -4
- package/dist/hooks/use-available-models.d.ts +8 -3
- package/dist/hooks/use-browser-frame-stream.d.ts +1 -1
- package/dist/hooks/use-browser-session.d.ts +12 -1
- package/dist/hooks/use-client-config-flags.d.ts +49 -0
- package/dist/hooks/use-codex-accounts.d.ts +48 -9
- package/dist/hooks/use-composer.d.ts +24 -3
- package/dist/hooks/use-computer-frame-stream.d.ts +1 -1
- package/dist/hooks/use-computer-input-posture.d.ts +13 -0
- package/dist/hooks/use-computer-session.d.ts +5 -0
- package/dist/hooks/use-connect.d.ts +23 -0
- package/dist/hooks/use-desktop-stream.d.ts +1 -1
- package/dist/hooks/use-file-attachments.d.ts +4 -0
- package/dist/hooks/use-goal.d.ts +2 -1
- package/dist/hooks/use-last-started-turn-policy.d.ts +5 -1
- package/dist/hooks/use-machine-chip.d.ts +3 -2
- package/dist/hooks/use-new-conversation.d.ts +56 -0
- package/dist/hooks/use-new-session-draft.d.ts +74 -0
- package/dist/hooks/use-realtime-voice-models.d.ts +7 -0
- package/dist/hooks/use-sandbox-files.d.ts +3 -2
- package/dist/hooks/use-session-conversation.d.ts +49 -0
- package/dist/hooks/use-session-events.d.ts +21 -2
- package/dist/hooks/use-session-mcp-approval-policy.d.ts +2 -2
- package/dist/hooks/use-session-model-account.d.ts +48 -0
- package/dist/hooks/use-supergrok-accounts.d.ts +7 -1
- package/dist/hooks/use-terminal-stream.d.ts +11 -5
- package/dist/hooks/use-transcription.d.ts +2 -1
- package/dist/hooks/use-usage.d.ts +40 -0
- package/dist/hooks/use-vaults.d.ts +53 -0
- package/dist/hooks/use-voice-input.d.ts +8 -1
- package/dist/hooks/use-workspace-sessions.d.ts +24 -5
- package/dist/human-input-model.d.ts +123 -0
- package/dist/identity-link-accounts.d.ts +11 -0
- package/dist/identity-link-consent.d.ts +18 -0
- package/dist/index.d.ts +83 -18
- package/dist/index.js +2317 -6453
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +1 -1
- package/dist/interaction.js +20 -29
- package/dist/interaction.js.map +1 -1
- package/dist/latest-question-SXBXROBT.js +118 -0
- package/dist/latest-question-SXBXROBT.js.map +1 -0
- package/dist/lib/client-config-read.d.ts +31 -0
- package/dist/lib/clipboard.d.ts +7 -0
- package/dist/lib/error-message.d.ts +7 -0
- package/dist/lib/format.d.ts +59 -9
- package/dist/lib/host-theme.d.ts +77 -0
- package/dist/lib/interaction-errors.d.ts +3 -0
- package/dist/lib/menu-styles.d.ts +22 -0
- package/dist/lib/notify-observer.d.ts +2 -0
- package/dist/lib/pierre-diffs-loader.d.ts +20 -0
- package/dist/lib/provider-recovery.d.ts +56 -0
- package/dist/lib/scrollbars.d.ts +11 -0
- package/dist/lib/terminal-input-readiness.d.ts +11 -0
- package/dist/lib/transient-retry.d.ts +26 -0
- package/dist/lib/workbench-peers.d.ts +36 -0
- package/dist/lib/xterm-theme.d.ts +7 -5
- package/dist/machines.js +12 -6
- package/dist/{markdown-table-layout-3Z3AWBY7.js → markdown-table-layout-3PV2UAAH.js} +51 -9
- package/dist/markdown-table-layout-3PV2UAAH.js.map +1 -0
- package/dist/mcp-connection-status.d.ts +15 -0
- package/dist/messages/en.d.ts +3328 -0
- package/dist/messages/runtime.d.ts +69 -0
- package/dist/messages.d.ts +3 -0
- package/dist/messages.js +16 -0
- package/dist/messages.js.map +1 -0
- package/dist/model-mark-paths.d.ts +34 -0
- package/dist/model-mark-paths.js +16 -0
- package/dist/model-mark-paths.js.map +1 -0
- package/dist/model-picker-model.d.ts +112 -0
- package/dist/model-picker-model.js +25 -0
- package/dist/model-picker-model.js.map +1 -0
- package/dist/model-policy-picker-menu-NWIETWSR.js +18 -0
- package/dist/model-policy-picker-menu-NWIETWSR.js.map +1 -0
- package/dist/model-policy.d.ts +35 -10
- package/dist/model-policy.js +12 -1
- package/dist/native-previews.d.ts +29 -0
- package/dist/native-previews.js +82 -0
- package/dist/native-previews.js.map +1 -0
- package/dist/new-session-draft.d.ts +7 -0
- package/dist/new-session-draft.js +639 -0
- package/dist/new-session-draft.js.map +1 -0
- package/dist/notification-text.d.ts +27 -0
- package/dist/{noto-sans-arabic-loader-IA2T4X2A.js → noto-sans-arabic-loader-XSH2KYWJ.js} +3 -1
- package/dist/{noto-sans-arabic-loader-IA2T4X2A.js.map → noto-sans-arabic-loader-XSH2KYWJ.js.map} +1 -1
- package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js → noto-sans-jp-loader.generated-MR5L6V7K.js} +3 -1
- package/dist/{noto-sans-jp-loader.generated-HFGLYBR3.js.map → noto-sans-jp-loader.generated-MR5L6V7K.js.map} +1 -1
- package/dist/organization-model.d.ts +33 -0
- package/dist/organization-model.js +65 -0
- package/dist/organization-model.js.map +1 -0
- package/dist/platform-activity-row-VSQ2FZ5T.js +119 -0
- package/dist/platform-activity-row-VSQ2FZ5T.js.map +1 -0
- package/dist/plugin-details.d.ts +14 -0
- package/dist/plugin-discovery.d.ts +25 -0
- package/dist/preview-loading-paint.d.ts +20 -0
- package/dist/provider.d.ts +37 -2
- package/dist/queue-presentation-model.d.ts +73 -0
- package/dist/queue-presentation-model.js +38 -0
- package/dist/queue-presentation-model.js.map +1 -0
- package/dist/{queue-surface-implementation-LK3S4BIW.js → queue-surface-implementation-MEKXXWGR.js} +189 -343
- package/dist/queue-surface-implementation-MEKXXWGR.js.map +1 -0
- package/dist/realtime/embedded-new-voice.d.ts +1 -0
- package/dist/realtime/embedded-voice.d.ts +1 -0
- package/dist/realtime/realtime-control.d.ts +4 -65
- package/dist/realtime/session-realtime.d.ts +79 -0
- package/dist/realtime.js +26 -1333
- package/dist/realtime.js.map +1 -1
- package/dist/sandbox-files-5NRC2QUT.js +24 -0
- package/dist/sandbox-files-5NRC2QUT.js.map +1 -0
- package/dist/sandbox-label-model.d.ts +31 -0
- package/dist/sandbox-label-model.js +20 -0
- package/dist/sandbox-label-model.js.map +1 -0
- package/dist/scrollbars.d.ts +1 -0
- package/dist/scrollbars.js +10 -0
- package/dist/scrollbars.js.map +1 -0
- package/dist/secret-reference-label.d.ts +15 -0
- package/dist/secrets-ui.d.ts +57 -0
- package/dist/session-agents-model.d.ts +11 -0
- package/dist/session-agents-model.js +25 -0
- package/dist/session-agents-model.js.map +1 -0
- package/dist/session-attention-model.d.ts +8 -0
- package/dist/session-attention-model.js +47 -0
- package/dist/session-attention-model.js.map +1 -0
- package/dist/session-auth-recommendation.d.ts +6 -0
- package/dist/session-capability-policy.d.ts +32 -0
- package/dist/session-context.d.ts +9 -1
- package/dist/session-feedback-model.d.ts +21 -0
- package/dist/session-feedback-model.js +56 -0
- package/dist/session-feedback-model.js.map +1 -0
- package/dist/session-list-model.d.ts +139 -0
- package/dist/session-list-model.js +274 -0
- package/dist/session-list-model.js.map +1 -0
- package/dist/session-realtime-OZCE6IKP.js +22 -0
- package/dist/session-realtime-OZCE6IKP.js.map +1 -0
- package/dist/session-realtime.d.ts +7 -0
- package/dist/session-realtime.js +20 -0
- package/dist/session-realtime.js.map +1 -0
- package/dist/session-status-model.d.ts +37 -0
- package/dist/session-ui.d.ts +40 -3
- package/dist/session-ui.js +127 -21
- package/dist/session-ui.js.map +1 -1
- package/dist/session.d.ts +10 -2
- package/dist/session.js +44 -20
- package/dist/site-snapshot.d.ts +14 -0
- package/dist/sites-ui.d.ts +24 -0
- package/dist/sites.d.ts +3 -0
- package/dist/sites.js +15 -0
- package/dist/sites.js.map +1 -0
- package/dist/skill-discovery.d.ts +47 -0
- package/dist/terminal.d.ts +8 -0
- package/dist/terminal.js +33 -0
- package/dist/terminal.js.map +1 -0
- package/dist/testing/session-scenarios.d.ts +10 -0
- package/dist/testing/session-scenarios.js +367 -0
- package/dist/testing/session-scenarios.js.map +1 -0
- package/dist/this-computer.d.ts +8 -0
- package/dist/this-computer.js +1042 -0
- package/dist/this-computer.js.map +1 -0
- package/dist/timeline/activity-rail.d.ts +12 -2
- package/dist/timeline/agent-identity.d.ts +30 -0
- package/dist/timeline/agent-row.d.ts +31 -0
- package/dist/timeline/allowance-exhausted-row.d.ts +24 -0
- package/dist/timeline/compaction-copy.d.ts +47 -0
- package/dist/timeline/focus-sequence.d.ts +9 -0
- package/dist/timeline/genie-copy.d.ts +4 -0
- package/dist/timeline/genie-loading.d.ts +48 -0
- package/dist/timeline/index.d.ts +12 -5
- package/dist/timeline/invoked-tool.d.ts +6 -0
- package/dist/timeline/knowledge-receipt.d.ts +17 -0
- package/dist/timeline/learning-refusal-copy.d.ts +23 -0
- package/dist/timeline/learning-refusal-row.d.ts +19 -0
- package/dist/timeline/message-sender.d.ts +19 -0
- package/dist/timeline/notice-presentation.d.ts +14 -0
- package/dist/timeline/parsers.d.ts +11 -0
- package/dist/timeline/patch-apply-command.d.ts +19 -0
- package/dist/timeline/platform-activity-presentation.d.ts +26 -0
- package/dist/timeline/platform-activity-row.d.ts +1 -2
- package/dist/timeline/presented-image.d.ts +11 -0
- package/dist/timeline/projection.d.ts +32 -2
- package/dist/timeline/provider-logo.d.ts +15 -0
- package/dist/timeline/question-nav-model.d.ts +23 -0
- package/dist/timeline/registry.d.ts +10 -1
- package/dist/timeline/retained-image.d.ts +18 -0
- package/dist/timeline/retained-loaders.d.ts +27 -0
- package/dist/timeline/rolling-activity.d.ts +11 -0
- package/dist/timeline/screenshot-lightbox.d.ts +23 -1
- package/dist/timeline/session-usage-limit-row.d.ts +11 -0
- package/dist/timeline/shared.d.ts +8 -3
- package/dist/timeline/startup-dispatch-details.d.ts +5 -0
- package/dist/timeline/startup-preference.d.ts +3 -0
- package/dist/timeline/startup-timings.d.ts +4 -0
- package/dist/timeline/tool-display-name.d.ts +6 -2
- package/dist/timeline/tool-presentation.d.ts +185 -0
- package/dist/timeline/turn-summary-model.d.ts +102 -0
- package/dist/timeline/turn-summary.d.ts +20 -54
- package/dist/timeline/types.d.ts +184 -7
- package/dist/timeline/work-presentation.d.ts +61 -0
- package/dist/{timeline-annotation-markers-DRSTLEM6.js → timeline-annotation-markers-HYLRTT6S.js} +11 -6
- package/dist/timeline-annotation-markers-HYLRTT6S.js.map +1 -0
- package/dist/{timeline-annotation-selection-IHLUGVND.js → timeline-annotation-selection-LBKW5GHA.js} +15 -5
- package/dist/timeline-annotation-selection-LBKW5GHA.js.map +1 -0
- package/dist/{timeline-annotations-dialog-6Q53N5FG.js → timeline-annotations-dialog-JKVINC42.js} +34 -19
- package/dist/timeline-annotations-dialog-JKVINC42.js.map +1 -0
- package/dist/timeline-model.d.ts +29 -0
- package/dist/timeline-model.js +254 -0
- package/dist/timeline-model.js.map +1 -0
- package/dist/usage/allowance-copy.d.ts +26 -0
- package/dist/usage/session-usage-limit.d.ts +89 -0
- package/dist/usage/summary.d.ts +35 -0
- package/dist/usage.d.ts +17 -0
- package/dist/usage.js +1201 -0
- package/dist/usage.js.map +1 -0
- package/dist/voice-recording-owner.d.ts +7 -0
- package/package.json +119 -7
- package/src/approvals.ts +8 -1
- package/src/artifacts-spreadsheet.ts +1 -0
- package/src/artifacts.ts +41 -0
- package/src/assets/README.md +8 -0
- package/src/assets/gmail.ico +0 -0
- package/src/assets/outlook.ico +0 -0
- package/src/capability-catalog-row.tsx +96 -0
- package/src/capability-logo-fallback.ts +22 -0
- package/src/client.ts +18 -30
- package/src/commands/registry.ts +46 -36
- package/src/commands/types.ts +2 -0
- package/src/components/anthropic-mark.tsx +10 -0
- package/src/components/approval-surface.tsx +407 -142
- package/src/components/artifacts/artifact-chrome.tsx +425 -0
- package/src/components/artifacts/artifact-sandbox.tsx +193 -0
- package/src/components/artifacts/artifact-surface.tsx +48 -26
- package/src/components/artifacts/chat-interactive-block.tsx +260 -0
- package/src/components/artifacts/deferred-chat-media.tsx +72 -0
- package/src/components/artifacts/document-editor.tsx +193 -45
- package/src/components/artifacts/editable-artifact-ui.tsx +23 -11
- package/src/components/artifacts/editable-artifact-view.tsx +199 -0
- package/src/components/artifacts/editable-artifact-workbench.tsx +8 -3
- package/src/components/artifacts/editable-document.tsx +76 -54
- package/src/components/artifacts/editable-presentation.tsx +86 -40
- package/src/components/artifacts/editable-spreadsheet.tsx +581 -121
- package/src/components/artifacts/index.ts +42 -0
- package/src/components/artifacts/inline-html-document.ts +24 -0
- package/src/components/artifacts/latest-task-runner.ts +49 -0
- package/src/components/artifacts/presentation-editor.tsx +422 -122
- package/src/components/artifacts/published-html-artifact-frame.tsx +79 -265
- package/src/components/artifacts/session-artifact-viewer.tsx +381 -0
- package/src/components/artifacts/site-view.tsx +129 -0
- package/src/components/artifacts/spreadsheet-canvas.ts +5 -10
- package/src/components/artifacts/spreadsheet-command-queue.ts +190 -0
- package/src/components/artifacts/spreadsheet-download.tsx +117 -0
- package/src/components/artifacts/spreadsheet-general-display.ts +43 -0
- package/src/components/artifacts/spreadsheet-grid.tsx +390 -172
- package/src/components/artifacts/spreadsheet-resize.tsx +432 -0
- package/src/components/artifacts/spreadsheet-submissions.tsx +46 -0
- package/src/components/artifacts/visualization-assets/base.css +1015 -0
- package/src/components/artifacts/visualization-assets/helpers.html +349 -0
- package/src/components/artifacts/visualization-assets.gen.ts +3 -0
- package/src/components/browser-select-control.tsx +320 -0
- package/src/components/browser-viewer.tsx +1102 -505
- package/src/components/chat-composer.tsx +42 -3
- package/src/components/child-session-link.tsx +16 -5
- package/src/components/claude-mark.tsx +11 -0
- package/src/components/code-editor.tsx +38 -27
- package/src/components/command-palette.tsx +4 -1
- package/src/components/composer-transcription-control.tsx +151 -50
- package/src/components/composer.tsx +281 -176
- package/src/components/computer-viewer.tsx +1013 -341
- package/src/components/copy-button.tsx +17 -7
- package/src/components/desktop-viewer.tsx +42 -33
- package/src/components/diff-view.tsx +3 -1
- package/src/components/enrollment-consent.tsx +39 -34
- package/src/components/enrollment-device-flow.tsx +31 -19
- package/src/components/file-browser.tsx +47 -35
- package/src/components/fleet-tile.tsx +8 -4
- package/src/components/generated-video-player.tsx +10 -5
- package/src/components/grok-mark.tsx +34 -0
- package/src/components/human-input-form.tsx +438 -251
- package/src/components/human-input-surface.tsx +8 -0
- package/src/components/interaction-intervention-banner.tsx +15 -13
- package/src/components/linkified-text.tsx +79 -0
- package/src/components/machine-card.tsx +56 -89
- package/src/components/machine-dock-bar.tsx +10 -4
- package/src/components/machine-health-pill.tsx +4 -2
- package/src/components/machine-input-display.ts +309 -34
- package/src/components/machine-metrics.tsx +10 -7
- package/src/components/machine-status-pill.tsx +23 -15
- package/src/components/machines/agent-status-icon.tsx +31 -0
- package/src/components/machines/health.ts +53 -10
- package/src/components/machines/machine-detail.tsx +230 -42
- package/src/components/machines/machine-operation-policy.tsx +36 -29
- package/src/components/machines/machine-status.ts +264 -0
- package/src/components/machines/metric-history-chart.tsx +8 -2
- package/src/components/machines/series.ts +12 -11
- package/src/components/machines-dashboard.tsx +16 -9
- package/src/components/markdown-table-layout.ts +67 -9
- package/src/components/markdown.tsx +470 -133
- package/src/components/message-timeline.tsx +2290 -752
- package/src/components/model-mark.tsx +102 -0
- package/src/components/model-picker.tsx +27 -9
- package/src/components/model-policy-picker-menu.tsx +204 -100
- package/src/components/model-policy-picker.tsx +215 -152
- package/src/components/new-conversation.tsx +223 -0
- package/src/components/open-geni-chat.tsx +311 -0
- package/src/components/open-geni-links.tsx +183 -0
- package/src/components/openrouter-mark.tsx +13 -0
- package/src/components/opper-mark.tsx +18 -0
- package/src/components/pierre-diff.tsx +47 -19
- package/src/components/pierre-file.tsx +38 -11
- package/src/components/preview-loading.tsx +111 -0
- package/src/components/provider-recovery-notice.tsx +51 -0
- package/src/components/queue-item-content.ts +16 -0
- package/src/components/queue-surface-implementation.tsx +185 -420
- package/src/components/queue-surface-state.tsx +13 -8
- package/src/components/queue-surface.tsx +3 -1
- package/src/components/rehype-secret-refs.ts +98 -0
- package/src/components/remark-soft-line-breaks.ts +166 -0
- package/src/components/sandbox-files.tsx +75 -44
- package/src/components/sandbox-terminal.tsx +103 -22
- package/src/components/sandbox-workspace.tsx +168 -78
- package/src/components/secret-question-field.tsx +326 -0
- package/src/components/secret-ref-chip.tsx +187 -0
- package/src/components/session-capability-frame.tsx +203 -0
- package/src/components/session-chrome.tsx +559 -328
- package/src/components/session-commands-panel.tsx +34 -17
- package/src/components/session-commands.tsx +18 -0
- package/src/components/session-connection-request.tsx +99 -0
- package/src/components/session-conversation.tsx +853 -118
- package/src/components/session-list.tsx +259 -0
- package/src/components/session-mcp-capability-card.tsx +681 -0
- package/src/components/session-proxy-scope.tsx +160 -0
- package/src/components/session-status.tsx +35 -21
- package/src/components/session-usage-limit-notice.tsx +176 -0
- package/src/components/this-computer/illustrations.tsx +164 -0
- package/src/components/this-computer/labels.ts +234 -0
- package/src/components/this-computer/this-computer-card.tsx +203 -0
- package/src/components/this-computer/this-computer-setup.tsx +433 -0
- package/src/components/this-computer/this-computer-status.tsx +329 -0
- package/src/components/this-computer/use-this-computer.ts +183 -0
- package/src/components/timeline-anchor.tsx +43 -15
- package/src/components/timeline-annotation-chrome.tsx +33 -9
- package/src/components/timeline-annotation-markers.tsx +4 -2
- package/src/components/timeline-annotation-selection.tsx +11 -2
- package/src/components/timeline-annotation-shared.ts +9 -8
- package/src/components/timeline-annotations-dialog.tsx +30 -9
- package/src/components/timeline-annotations.tsx +24 -7
- package/src/components/timeline-reading-progress.ts +80 -0
- package/src/components/timeline-search.tsx +168 -0
- package/src/components/timeline-settlement.ts +60 -0
- package/src/components/tool-action-review.tsx +670 -0
- package/src/components/tool-review-history.tsx +88 -0
- package/src/components/usage-limit-notice.tsx +183 -0
- package/src/components/usage-member-list.tsx +797 -0
- package/src/components/usage-meter.tsx +386 -0
- package/src/components/use-viewer-menu-dismiss.ts +33 -0
- package/src/components/user-message-body.tsx +33 -2
- package/src/components/workbench-changes.tsx +28 -16
- package/src/components/workspace-dock.tsx +45 -13
- package/src/composer-messages.ts +153 -0
- package/src/composer-voice-events.ts +12 -0
- package/src/composer.ts +4 -0
- package/src/connect-account-identity.tsx +38 -0
- package/src/connect-accounts.tsx +233 -0
- package/src/connect-chooser.tsx +339 -0
- package/src/connect-panel.tsx +104 -0
- package/src/connect-setup.tsx +354 -0
- package/src/connect.ts +60 -0
- package/src/connection-assets.d.ts +4 -0
- package/src/connection-catalog.tsx +175 -0
- package/src/connection-discovery.tsx +251 -0
- package/src/connection-installed.tsx +56 -0
- package/src/connection-logo.tsx +37 -0
- package/src/connection-service-logo.tsx +55 -0
- package/src/connection-service-presentation.ts +46 -0
- package/src/connection-skeleton.tsx +16 -0
- package/src/connection-type-picker.tsx +38 -0
- package/src/conversation-timeline.ts +11 -2
- package/src/desktop.ts +24 -0
- package/src/device-authorization.tsx +111 -0
- package/src/diffs.ts +16 -0
- package/src/discovery-cache.ts +42 -0
- package/src/editor.ts +13 -0
- package/src/hooks/internal.ts +93 -10
- package/src/hooks/latest-question.ts +168 -0
- package/src/hooks/session-view-cache.ts +167 -0
- package/src/hooks/shared-machines-list.ts +34 -1
- package/src/hooks/shared-query.ts +744 -0
- package/src/hooks/use-attached-browsers.ts +1 -1
- package/src/hooks/use-auth-runs.ts +0 -27
- package/src/hooks/use-available-models.ts +20 -10
- package/src/hooks/use-browser-frame-stream.ts +23 -4
- package/src/hooks/use-browser-session.ts +684 -206
- package/src/hooks/use-browser-sessions.ts +32 -1
- package/src/hooks/use-client-config-flags.ts +102 -0
- package/src/hooks/use-codex-accounts.ts +216 -43
- package/src/hooks/use-composer.ts +240 -59
- package/src/hooks/use-computer-frame-stream.ts +29 -9
- package/src/hooks/use-computer-input-posture.ts +96 -0
- package/src/hooks/use-computer-session.ts +419 -100
- package/src/hooks/use-connect.ts +23 -0
- package/src/hooks/use-desktop-stream.ts +19 -28
- package/src/hooks/use-file-attachments.ts +19 -3
- package/src/hooks/use-goal.ts +172 -21
- package/src/hooks/use-human-input.ts +16 -2
- package/src/hooks/use-last-started-turn-policy.ts +37 -11
- package/src/hooks/use-machine-chip.ts +13 -8
- package/src/hooks/use-machines.ts +24 -10
- package/src/hooks/use-new-conversation.ts +377 -0
- package/src/hooks/use-new-session-draft.ts +813 -0
- package/src/hooks/use-realtime-voice-models.ts +46 -0
- package/src/hooks/use-sandbox-files.ts +22 -16
- package/src/hooks/use-session-background-commands.ts +2 -2
- package/src/hooks/use-session-capabilities.ts +3 -2
- package/src/hooks/use-session-conversation.ts +150 -0
- package/src/hooks/use-session-events.ts +403 -64
- package/src/hooks/use-session-lineage.ts +47 -9
- package/src/hooks/use-session-mcp-approval-policy.ts +13 -5
- package/src/hooks/use-session-model-account.ts +174 -0
- package/src/hooks/use-session.ts +19 -3
- package/src/hooks/use-slash-commands.ts +6 -11
- package/src/hooks/use-supergrok-accounts.ts +22 -8
- package/src/hooks/use-terminal-stream.ts +153 -27
- package/src/hooks/use-transcription.ts +45 -19
- package/src/hooks/use-turn-queue.ts +25 -5
- package/src/hooks/use-usage.ts +100 -0
- package/src/hooks/use-vaults.ts +153 -0
- package/src/hooks/use-video-artifact-playback.ts +1 -1
- package/src/hooks/use-voice-input.ts +127 -19
- package/src/hooks/use-workspace-capture.ts +3 -2
- package/src/hooks/use-workspace-sessions.ts +74 -7
- package/src/human-input-model.ts +374 -0
- package/src/identity-link-accounts.tsx +149 -0
- package/src/identity-link-consent.tsx +193 -0
- package/src/index.ts +282 -16
- package/src/interaction.ts +1 -0
- package/src/lib/client-config-read.ts +76 -0
- package/src/lib/clipboard.ts +29 -0
- package/src/lib/error-message.ts +37 -0
- package/src/lib/format.ts +231 -36
- package/src/lib/host-theme.ts +529 -0
- package/src/lib/interaction-errors.ts +15 -0
- package/src/lib/menu-styles.ts +44 -0
- package/src/lib/notify-observer.ts +15 -0
- package/src/lib/pierre-diffs-loader.ts +53 -0
- package/src/lib/provider-recovery.ts +255 -0
- package/src/lib/scrollbars.ts +30 -0
- package/src/lib/terminal-input-readiness.ts +51 -0
- package/src/lib/transient-retry.ts +101 -0
- package/src/lib/workbench-peers.ts +62 -0
- package/src/lib/xterm-theme.ts +23 -21
- package/src/mcp-connection-status.ts +39 -0
- package/src/messages/en.ts +3810 -0
- package/src/messages/runtime.tsx +175 -0
- package/src/messages.ts +19 -0
- package/src/model-mark-paths.ts +53 -0
- package/src/model-picker-model.ts +343 -0
- package/src/model-policy.ts +301 -79
- package/src/native-previews.ts +104 -0
- package/src/new-session-draft.ts +22 -0
- package/src/notification-text.ts +81 -0
- package/src/organization-model.ts +123 -0
- package/src/plugin-details.tsx +192 -0
- package/src/plugin-discovery.tsx +209 -0
- package/src/preview-loading-paint.ts +68 -0
- package/src/provider.tsx +105 -21
- package/src/queue-presentation-model.ts +475 -0
- package/src/realtime/dropdown-menu.tsx +19 -12
- package/src/realtime/embedded-new-voice.tsx +1 -0
- package/src/realtime/embedded-voice.tsx +3 -0
- package/src/realtime/realtime-control.tsx +240 -609
- package/src/realtime/session-realtime.ts +582 -0
- package/src/sandbox-label-model.ts +56 -0
- package/src/scrollbars.ts +3 -0
- package/src/secret-reference-label.ts +47 -0
- package/src/secrets-ui.tsx +59 -0
- package/src/session-agents-model.ts +40 -0
- package/src/session-attention-model.ts +62 -0
- package/src/session-auth-recommendation.ts +50 -0
- package/src/session-capability-policy.ts +200 -0
- package/src/session-context.ts +13 -5
- package/src/session-feedback-model.ts +101 -0
- package/src/session-list-model.ts +437 -0
- package/src/session-realtime.ts +18 -0
- package/src/session-status-model.ts +99 -0
- package/src/session-ui.ts +102 -3
- package/src/session.ts +19 -1
- package/src/site-snapshot.ts +74 -0
- package/src/sites-ui.tsx +350 -0
- package/src/sites.ts +3 -0
- package/src/skill-discovery.tsx +221 -0
- package/src/terminal.ts +26 -0
- package/src/testing/session-scenarios.ts +404 -0
- package/src/this-computer.ts +62 -0
- package/src/timeline/activity-rail.tsx +289 -119
- package/src/timeline/agent-identity.tsx +84 -0
- package/src/timeline/agent-row.tsx +235 -0
- package/src/timeline/allowance-exhausted-row.tsx +90 -0
- package/src/timeline/compaction-copy.ts +125 -0
- package/src/timeline/fleet-decision-row.tsx +120 -101
- package/src/timeline/focus-sequence.ts +44 -0
- package/src/timeline/genie-copy.ts +22 -0
- package/src/timeline/genie-loading.tsx +158 -0
- package/src/timeline/index.ts +37 -2
- package/src/timeline/invoked-tool.ts +15 -0
- package/src/timeline/knowledge-receipt.tsx +104 -0
- package/src/timeline/learning-refusal-copy.ts +67 -0
- package/src/timeline/learning-refusal-row.tsx +70 -0
- package/src/timeline/message-sender.tsx +71 -0
- package/src/timeline/notice-presentation.ts +67 -0
- package/src/timeline/parsers.ts +42 -2
- package/src/timeline/patch-apply-command.tsx +139 -0
- package/src/timeline/platform-activity-presentation.ts +219 -0
- package/src/timeline/platform-activity-row.tsx +34 -98
- package/src/timeline/presented-image.ts +63 -0
- package/src/timeline/projection.ts +1556 -71
- package/src/timeline/provider-logo.tsx +53 -0
- package/src/timeline/question-nav-model.ts +28 -0
- package/src/timeline/registry.ts +11 -1
- package/src/timeline/retained-image.ts +102 -0
- package/src/timeline/retained-loaders.ts +91 -0
- package/src/timeline/rolling-activity.tsx +84 -0
- package/src/timeline/screenshot-lightbox.tsx +250 -10
- package/src/timeline/session-usage-limit-row.tsx +44 -0
- package/src/timeline/shared.tsx +76 -29
- package/src/timeline/startup-dispatch-details.tsx +43 -0
- package/src/timeline/startup-preference.ts +33 -0
- package/src/timeline/startup-timings.tsx +164 -0
- package/src/timeline/tool-diff.tsx +3 -1
- package/src/timeline/tool-display-name.ts +38 -6
- package/src/timeline/tool-presentation.ts +1552 -0
- package/src/timeline/tool-renderers.tsx +1023 -1265
- package/src/timeline/turn-summary-model.ts +363 -0
- package/src/timeline/turn-summary.tsx +288 -367
- package/src/timeline/types.ts +191 -7
- package/src/timeline/work-presentation.ts +196 -0
- package/src/timeline-model.ts +143 -0
- package/src/usage/allowance-copy.ts +70 -0
- package/src/usage/session-usage-limit.ts +270 -0
- package/src/usage/summary.ts +93 -0
- package/src/usage.ts +70 -0
- package/src/voice-recording-owner.ts +22 -0
- package/styles/compiled.css +2010 -651
- package/styles/connect.css +290 -0
- package/styles/connect.d.ts +1 -0
- package/styles/effective-tokens.css +1 -0
- package/styles/index.css +286 -9
- package/styles/responsive.css +98 -6
- package/styles/session-capability.css +44 -0
- package/styles/this-computer.css +1042 -0
- package/styles/this-computer.d.ts +1 -0
- package/styles/tokens.css +132 -64
- package/dist/browser-viewer-NTD6UIPR.js +0 -14
- package/dist/chunk-24M4YBCL.js.map +0 -1
- package/dist/chunk-4MDLEHXL.js.map +0 -1
- package/dist/chunk-5M6VTFJ5.js.map +0 -1
- package/dist/chunk-5PQJOCX5.js +0 -902
- package/dist/chunk-5PQJOCX5.js.map +0 -1
- package/dist/chunk-5YK2ZDIG.js.map +0 -1
- package/dist/chunk-6J56T3MG.js.map +0 -1
- package/dist/chunk-BV5A4OTE.js.map +0 -1
- package/dist/chunk-CQG7YUJB.js +0 -10883
- package/dist/chunk-CQG7YUJB.js.map +0 -1
- package/dist/chunk-H5YGYNXS.js.map +0 -1
- package/dist/chunk-HUIKIDM5.js.map +0 -1
- package/dist/chunk-HUMIRRYI.js.map +0 -1
- package/dist/chunk-ICA6R6TW.js.map +0 -1
- package/dist/chunk-JVYQRRC4.js.map +0 -1
- package/dist/chunk-KCGXPP5V.js.map +0 -1
- package/dist/chunk-KZ73RL76.js.map +0 -1
- package/dist/chunk-NEXLLTP4.js.map +0 -1
- package/dist/chunk-NLTS7JHI.js.map +0 -1
- package/dist/chunk-NOSYBS2D.js.map +0 -1
- package/dist/chunk-PAJU5KKL.js.map +0 -1
- package/dist/chunk-PEI6RANI.js.map +0 -1
- package/dist/chunk-PLYRL5ER.js +0 -164
- package/dist/chunk-PLYRL5ER.js.map +0 -1
- package/dist/chunk-R4KRSFGA.js +0 -290
- package/dist/chunk-R4KRSFGA.js.map +0 -1
- package/dist/chunk-UMECRJRV.js +0 -223
- package/dist/chunk-UMECRJRV.js.map +0 -1
- package/dist/chunk-VRBL3F5E.js +0 -241
- package/dist/chunk-VRBL3F5E.js.map +0 -1
- package/dist/chunk-YBM6CQRU.js.map +0 -1
- package/dist/chunk-Z7WBDB4E.js.map +0 -1
- package/dist/computer-viewer-7TEZC6Y2.js +0 -16
- package/dist/fleet-decision-row-YZ3ZKWMM.js +0 -352
- package/dist/fleet-decision-row-YZ3ZKWMM.js.map +0 -1
- package/dist/hooks/use-environments.d.ts +0 -41
- package/dist/hooks/use-packs.d.ts +0 -32
- package/dist/markdown-table-layout-3Z3AWBY7.js.map +0 -1
- package/dist/model-policy-picker-menu-3R336DP2.js +0 -13
- package/dist/platform-activity-row-27LKAWZD.js +0 -169
- package/dist/platform-activity-row-27LKAWZD.js.map +0 -1
- package/dist/queue-surface-implementation-LK3S4BIW.js.map +0 -1
- package/dist/timeline-annotation-markers-DRSTLEM6.js.map +0 -1
- package/dist/timeline-annotation-selection-IHLUGVND.js.map +0 -1
- package/dist/timeline-annotations-dialog-6Q53N5FG.js.map +0 -1
- package/src/hooks/use-environments.ts +0 -182
- package/src/hooks/use-packs.ts +0 -157
- /package/dist/{browser-viewer-NTD6UIPR.js.map → browser-viewer-GEHX3KYE.js.map} +0 -0
- /package/dist/{computer-viewer-7TEZC6Y2.js.map → chat-interactive-block-5V3BGLXT.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-3R336DP2.js.map → chunk-M357MHH3.js.map} +0 -0
|
@@ -2,6 +2,7 @@ import type {
|
|
|
2
2
|
AttachedBrowserBridge,
|
|
3
3
|
AttachedBrowserDevice,
|
|
4
4
|
BrowserAction,
|
|
5
|
+
BrowserActionBatch,
|
|
5
6
|
BrowserActionReceipt,
|
|
6
7
|
BrowserDiagnosticBatch,
|
|
7
8
|
BrowserDownload,
|
|
@@ -22,6 +23,8 @@ import { interactionControlFailureFromError } from "@opengeni/sdk/interaction";
|
|
|
22
23
|
import {
|
|
23
24
|
BugIcon,
|
|
24
25
|
ArchiveIcon,
|
|
26
|
+
ArrowLeftIcon,
|
|
27
|
+
ArrowRightIcon,
|
|
25
28
|
CheckIcon,
|
|
26
29
|
ChevronDownIcon,
|
|
27
30
|
CircleAlertIcon,
|
|
@@ -50,6 +53,7 @@ import {
|
|
|
50
53
|
useCallback,
|
|
51
54
|
useEffect,
|
|
52
55
|
useId,
|
|
56
|
+
useLayoutEffect,
|
|
53
57
|
useMemo,
|
|
54
58
|
useRef,
|
|
55
59
|
useState,
|
|
@@ -61,17 +65,39 @@ import {
|
|
|
61
65
|
import { useAttachedBrowsers } from "../hooks/use-attached-browsers";
|
|
62
66
|
import { useBrowserIdentities } from "../hooks/use-browser-identities";
|
|
63
67
|
import { useBrowserDownloads } from "../hooks/use-browser-downloads";
|
|
64
|
-
import { useBrowserSession } from "../hooks/use-browser-session";
|
|
68
|
+
import { useBrowserSession, type BrowserFrameInputFence } from "../hooks/use-browser-session";
|
|
65
69
|
import { useBrowserSessions } from "../hooks/use-browser-sessions";
|
|
66
70
|
import { useInteractionInterventions } from "../hooks/use-interaction-interventions";
|
|
67
71
|
import { useSiteAuthConnections } from "../hooks/use-site-auth-connections";
|
|
68
72
|
import { cn } from "../lib/cn";
|
|
69
73
|
import { copyTextToClipboard } from "../lib/clipboard";
|
|
70
74
|
import { formatBytes } from "../lib/format";
|
|
71
|
-
import {
|
|
75
|
+
import {
|
|
76
|
+
isInteractionControlUnavailable,
|
|
77
|
+
isSourcePlacementChangedError,
|
|
78
|
+
} from "../lib/interaction-errors";
|
|
72
79
|
import type { EmbeddedBrowserInteractionClientOverride } from "../session-context";
|
|
73
80
|
import { browserKey, HUMAN_BROWSER_HOME_URL, normalizeBrowserAddress } from "./browser-input";
|
|
74
81
|
import { InteractionInterventionBanner } from "./interaction-intervention-banner";
|
|
82
|
+
import { BrowserSelectControl } from "./browser-select-control";
|
|
83
|
+
import { useViewerMenuDismiss } from "./use-viewer-menu-dismiss";
|
|
84
|
+
import { useOpenGeniText, type OpenGeniText } from "../messages/runtime";
|
|
85
|
+
|
|
86
|
+
/** Auto-ending a lost attached-device browser: bounded retries for transient failures only. */
|
|
87
|
+
const STALE_BROWSER_END_MAX_ATTEMPTS = 3;
|
|
88
|
+
const STALE_BROWSER_END_RETRY_BASE_MS = 5_000;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Delay before retrying an automatic end of a lost attached-device browser, or null to stop.
|
|
92
|
+
* A refusal (4xx, e.g. 409 when the server will not end it) is never retried: re-sending it on
|
|
93
|
+
* every registry refresh looped about one request per second on prod.
|
|
94
|
+
*/
|
|
95
|
+
export function staleBrowserEndRetryDelayMs(cause: unknown, failedAttempts: number): number | null {
|
|
96
|
+
const status = (cause as { status?: unknown } | null)?.status;
|
|
97
|
+
if (typeof status === "number" && status >= 400 && status < 500) return null;
|
|
98
|
+
if (failedAttempts >= STALE_BROWSER_END_MAX_ATTEMPTS) return null;
|
|
99
|
+
return STALE_BROWSER_END_RETRY_BASE_MS * 2 ** (failedAttempts - 1);
|
|
100
|
+
}
|
|
75
101
|
|
|
76
102
|
export type BrowserViewerNotification = {
|
|
77
103
|
kind: "error" | "info";
|
|
@@ -79,9 +105,12 @@ export type BrowserViewerNotification = {
|
|
|
79
105
|
};
|
|
80
106
|
|
|
81
107
|
export type BrowserViewerProps = EmbeddedBrowserInteractionClientOverride & {
|
|
82
|
-
/** The selected
|
|
108
|
+
/** The selected Opengeni agent/session. Peer BrowserSessions stay discoverable. */
|
|
83
109
|
sessionId: string;
|
|
84
110
|
enabled?: boolean | undefined;
|
|
111
|
+
/** Whether the Browser tab is selected. Keeps the mounted media stream warm
|
|
112
|
+
* while pausing semantic reads behind other dock tabs. */
|
|
113
|
+
active?: boolean | undefined;
|
|
85
114
|
className?: string | undefined;
|
|
86
115
|
onNotify?: ((notification: BrowserViewerNotification) => void) | undefined;
|
|
87
116
|
/** Tests/demos only. Production uses the browser's native WebSocket. */
|
|
@@ -111,11 +140,15 @@ type BrowserLaunchChoice =
|
|
|
111
140
|
| { kind: "clean" }
|
|
112
141
|
| { kind: "profile"; identityId: string; baseRevisionId?: string }
|
|
113
142
|
| { kind: "attached"; device: AttachedBrowserDevice };
|
|
143
|
+
// ArrayBuffer is opaque to React development prop diagnostics; a Uint8Array
|
|
144
|
+
// exposes every image byte as an enumerable property retained in timing entries.
|
|
145
|
+
type BrowserViewportFrame = Omit<BrowserFrame, "data"> & { data: ArrayBuffer };
|
|
146
|
+
|
|
114
147
|
type PointerStart = {
|
|
115
148
|
x: number;
|
|
116
149
|
y: number;
|
|
117
150
|
pointerId: number;
|
|
118
|
-
frame:
|
|
151
|
+
frame: BrowserViewportFrame;
|
|
119
152
|
};
|
|
120
153
|
type BrowserResumeAttempt = {
|
|
121
154
|
operationId: string;
|
|
@@ -139,6 +172,7 @@ type BrowserDiagnosticsView = {
|
|
|
139
172
|
export function BrowserViewer({
|
|
140
173
|
sessionId,
|
|
141
174
|
enabled = true,
|
|
175
|
+
active = true,
|
|
142
176
|
className,
|
|
143
177
|
onNotify,
|
|
144
178
|
webSocketFactory,
|
|
@@ -150,6 +184,7 @@ export function BrowserViewer({
|
|
|
150
184
|
browserExtensionSetupUrl,
|
|
151
185
|
...override
|
|
152
186
|
}: BrowserViewerProps) {
|
|
187
|
+
const t = useOpenGeniText();
|
|
153
188
|
const registry = useBrowserSessions({ ...override, sessionId, enabled });
|
|
154
189
|
const attached = useAttachedBrowsers({ ...override, enabled });
|
|
155
190
|
const onlineAttachedBridges = useMemo(
|
|
@@ -173,6 +208,7 @@ export function BrowserViewer({
|
|
|
173
208
|
[registry.sessions],
|
|
174
209
|
);
|
|
175
210
|
const endedGenerationLossRef = useRef(new Set<string>());
|
|
211
|
+
const endStaleBrowserAttemptsRef = useRef(new Map<string, number>());
|
|
176
212
|
const endStaleBrowser = registry.end;
|
|
177
213
|
useEffect(() => {
|
|
178
214
|
if (!enabled) return;
|
|
@@ -186,21 +222,24 @@ export function BrowserViewer({
|
|
|
186
222
|
}
|
|
187
223
|
if (endedGenerationLossRef.current.has(session.id)) continue;
|
|
188
224
|
endedGenerationLossRef.current.add(session.id);
|
|
189
|
-
void endStaleBrowser(session.id).catch(() => {
|
|
190
|
-
|
|
225
|
+
void endStaleBrowser(session.id).catch((cause: unknown) => {
|
|
226
|
+
const attempts = (endStaleBrowserAttemptsRef.current.get(session.id) ?? 0) + 1;
|
|
227
|
+
endStaleBrowserAttemptsRef.current.set(session.id, attempts);
|
|
228
|
+
const delay = staleBrowserEndRetryDelayMs(cause, attempts);
|
|
229
|
+
if (delay === null) return;
|
|
230
|
+
setTimeout(() => endedGenerationLossRef.current.delete(session.id), delay);
|
|
191
231
|
});
|
|
192
232
|
}
|
|
193
233
|
}, [enabled, endStaleBrowser, registry.sessions]);
|
|
194
|
-
const replacementChromeDevice = useMemo(() => {
|
|
195
|
-
if (!attachedGenerationLoss) return null;
|
|
196
|
-
return (
|
|
197
|
-
attached.devices.find((candidate) => candidate.id === attachedGenerationLoss.deviceId) ?? null
|
|
198
|
-
);
|
|
199
|
-
}, [attached.devices, attachedGenerationLoss]);
|
|
200
234
|
const relevant = useMemo(
|
|
201
235
|
() => registry.relevantSessions.filter((session) => isLiveBrowser(session)),
|
|
202
236
|
[registry.relevantSessions],
|
|
203
237
|
);
|
|
238
|
+
const latestRelevantBrowser = registry.relevantSessions[0];
|
|
239
|
+
const unavailableBrowser =
|
|
240
|
+
latestRelevantBrowser?.lifecycle === "lost" || latestRelevantBrowser?.lifecycle === "failed"
|
|
241
|
+
? latestRelevantBrowser
|
|
242
|
+
: undefined;
|
|
204
243
|
const [selection, setSelection] = useState<BrowserSelection>(() =>
|
|
205
244
|
initialBrowserSessionId ? { sessionId: initialBrowserSessionId, pinned: true } : null,
|
|
206
245
|
);
|
|
@@ -232,6 +271,7 @@ export function BrowserViewer({
|
|
|
232
271
|
const previousSessionIdRef = useRef(sessionId);
|
|
233
272
|
const seenInterventionIdsRef = useRef(new Set<string>());
|
|
234
273
|
const diagnosticRequestRef = useRef(0);
|
|
274
|
+
const viewportFocusHandoffRef = useRef<string | null>(null);
|
|
235
275
|
const [diagnosticsView, setDiagnosticsView] = useState<BrowserDiagnosticsView | null>(null);
|
|
236
276
|
|
|
237
277
|
const notifyError = useCallback(
|
|
@@ -287,6 +327,7 @@ export function BrowserViewer({
|
|
|
287
327
|
);
|
|
288
328
|
const controllerReady = selectedRegistrySession?.lifecycle === "active";
|
|
289
329
|
const resumeSession = registry.resume;
|
|
330
|
+
const [hasLiveFrame, setHasLiveFrame] = useState(false);
|
|
290
331
|
|
|
291
332
|
const wakeBrowser = useCallback(
|
|
292
333
|
async (session: BrowserSession, retry = false): Promise<void> => {
|
|
@@ -305,7 +346,9 @@ export function BrowserViewer({
|
|
|
305
346
|
const response = await resumeSession(session.id, operationId);
|
|
306
347
|
if (response.operation.state !== "completed") {
|
|
307
348
|
throw Object.assign(
|
|
308
|
-
new Error(
|
|
349
|
+
new Error(
|
|
350
|
+
response.operation.error?.message ?? t("browserViewer.browserCouldNotReopen2"),
|
|
351
|
+
),
|
|
309
352
|
{ terminal: true },
|
|
310
353
|
);
|
|
311
354
|
}
|
|
@@ -324,10 +367,10 @@ export function BrowserViewer({
|
|
|
324
367
|
};
|
|
325
368
|
resumeAttemptsRef.current.set(session.id, failed);
|
|
326
369
|
setResumeAttempt({ sessionId: session.id, attempt: failed });
|
|
327
|
-
notifyError(error, "
|
|
370
|
+
notifyError(error, t("browserViewer.couldNotReopenThisBrowser"));
|
|
328
371
|
}
|
|
329
372
|
},
|
|
330
|
-
[notifyError, resumeSession],
|
|
373
|
+
[notifyError, resumeSession, t],
|
|
331
374
|
);
|
|
332
375
|
|
|
333
376
|
useEffect(() => {
|
|
@@ -337,17 +380,14 @@ export function BrowserViewer({
|
|
|
337
380
|
setResumeAttempt((visible) =>
|
|
338
381
|
visible?.sessionId === selectedRegistrySession.id ? null : visible,
|
|
339
382
|
);
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
if (selectedRegistrySession.lifecycle === "suspended") {
|
|
343
|
-
void wakeBrowser(selectedRegistrySession);
|
|
344
383
|
}
|
|
345
|
-
}, [selectedRegistrySession
|
|
384
|
+
}, [selectedRegistrySession]);
|
|
346
385
|
|
|
347
386
|
const browser = useBrowserSession({
|
|
348
387
|
...override,
|
|
349
388
|
browserSessionId: selection?.sessionId ?? null,
|
|
350
389
|
enabled: enabled && selection !== null && controllerReady,
|
|
390
|
+
semanticObservationEnabled: active && !hasLiveFrame,
|
|
351
391
|
});
|
|
352
392
|
useEffect(() => {
|
|
353
393
|
if (!isSourcePlacementChangedError(browser.error, "browser_session")) return;
|
|
@@ -370,10 +410,10 @@ export function BrowserViewer({
|
|
|
370
410
|
seenInterventionIdsRef.current.add(intervention.id);
|
|
371
411
|
onNotify?.({
|
|
372
412
|
kind: "info",
|
|
373
|
-
message: `${interventionTitle(intervention)}: ${intervention.reason}`,
|
|
413
|
+
message: `${interventionTitle(t, intervention)}: ${intervention.reason}`,
|
|
374
414
|
});
|
|
375
415
|
}
|
|
376
|
-
}, [interventions.interventions, onNotify]);
|
|
416
|
+
}, [interventions.interventions, onNotify, t]);
|
|
377
417
|
|
|
378
418
|
const resolveIntervention = useCallback(
|
|
379
419
|
(intervention: InteractionIntervention, outcome: "completed" | "dismissed") => {
|
|
@@ -386,12 +426,14 @@ export function BrowserViewer({
|
|
|
386
426
|
onNotify?.({
|
|
387
427
|
kind: "info",
|
|
388
428
|
message:
|
|
389
|
-
outcome === "completed"
|
|
429
|
+
outcome === "completed"
|
|
430
|
+
? t("browserViewer.agentNotifiedContinuingWork")
|
|
431
|
+
: t("browserViewer.requestCancelled"),
|
|
390
432
|
});
|
|
391
433
|
})
|
|
392
|
-
.catch((cause) => notifyError(cause, "
|
|
434
|
+
.catch((cause) => notifyError(cause, t("browserViewer.couldNotUpdateTheBrowser")));
|
|
393
435
|
},
|
|
394
|
-
[interventions, notifyError, onNotify],
|
|
436
|
+
[interventions, notifyError, onNotify, t],
|
|
395
437
|
);
|
|
396
438
|
const frames = useBrowserFrameStream({
|
|
397
439
|
...override,
|
|
@@ -406,19 +448,47 @@ export function BrowserViewer({
|
|
|
406
448
|
stream: { format: "jpeg", quality: 76, maxWidth: 1_920, maxHeight: 1_200 },
|
|
407
449
|
...(webSocketFactory ? { webSocketFactory } : {}),
|
|
408
450
|
});
|
|
409
|
-
const
|
|
451
|
+
const receivedFrame = frameMatchesSelectedTarget(
|
|
410
452
|
frames.frame,
|
|
411
453
|
browser.session,
|
|
412
454
|
browser.selectedTarget,
|
|
413
455
|
)
|
|
414
456
|
? frames.frame
|
|
415
457
|
: null;
|
|
416
|
-
const
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
458
|
+
const displayedFrame = useMemo<BrowserViewportFrame | null>(
|
|
459
|
+
() => (receivedFrame ? { ...receivedFrame, data: receivedFrame.data.slice().buffer } : null),
|
|
460
|
+
[receivedFrame],
|
|
461
|
+
);
|
|
462
|
+
const frameIsLive = frames.state === "live" && displayedFrame !== null;
|
|
463
|
+
useEffect(() => {
|
|
464
|
+
setHasLiveFrame(frameIsLive);
|
|
465
|
+
}, [frameIsLive]);
|
|
466
|
+
const supportsLiveFrames =
|
|
467
|
+
(browser.session ?? selectedRegistrySession)?.capabilities.liveFrames === true;
|
|
468
|
+
const controlUnavailable = isInteractionControlUnavailable(browser.error);
|
|
469
|
+
const connectionError = controlUnavailable ? browser.error : (frames.error ?? browser.error);
|
|
470
|
+
// A managed controller can reject a stale attachment while the same browser
|
|
471
|
+
// remains healthy. Only extension-attached Chrome requires a new browser on
|
|
472
|
+
// connection-generation loss; an unrelated lost Chrome must not poison the
|
|
473
|
+
// selected managed browser's recovery UI.
|
|
474
|
+
const selectedPlacement = (browser.session ?? selectedRegistrySession)?.placement;
|
|
475
|
+
const selectedChromeGenerationLoss =
|
|
476
|
+
selectedPlacement?.kind === "attached_device" &&
|
|
477
|
+
isAttachedChromeGenerationLossError(connectionError);
|
|
478
|
+
const replacementChromeDevice =
|
|
479
|
+
selectedChromeGenerationLoss && selectedPlacement.kind === "attached_device"
|
|
480
|
+
? attached.devices.find((candidate) => candidate.id === selectedPlacement.deviceId)
|
|
481
|
+
: null;
|
|
482
|
+
const displayConnectionState =
|
|
483
|
+
connectionError && (!frameIsLive || controlUnavailable)
|
|
484
|
+
? "error"
|
|
485
|
+
: !browser.session
|
|
486
|
+
? "connecting"
|
|
487
|
+
: supportsLiveFrames
|
|
488
|
+
? frames.state === "live" && !displayedFrame
|
|
489
|
+
? "connecting"
|
|
490
|
+
: frames.state
|
|
491
|
+
: "semantic";
|
|
422
492
|
const selectedProfile = useMemo(
|
|
423
493
|
() =>
|
|
424
494
|
profiles.identities.find(
|
|
@@ -494,11 +564,14 @@ export function BrowserViewer({
|
|
|
494
564
|
const response = await downloads.saveToWorkspace(downloadId, destinationPath, { overwrite });
|
|
495
565
|
onNotify?.({
|
|
496
566
|
kind: "info",
|
|
497
|
-
message:
|
|
567
|
+
message: t("browserViewer.filenameSavedToDestinationpath", {
|
|
568
|
+
filename: response.download.filename,
|
|
569
|
+
destinationPath: response.destinationPath,
|
|
570
|
+
}),
|
|
498
571
|
});
|
|
499
572
|
return response;
|
|
500
573
|
},
|
|
501
|
-
[downloads, onNotify],
|
|
574
|
+
[downloads, onNotify, t],
|
|
502
575
|
);
|
|
503
576
|
|
|
504
577
|
useEffect(() => {
|
|
@@ -547,13 +620,15 @@ export function BrowserViewer({
|
|
|
547
620
|
if (choice.kind === "profile" && (!identity || identity.status !== "active")) {
|
|
548
621
|
onNotify?.({
|
|
549
622
|
kind: "error",
|
|
550
|
-
message: "
|
|
623
|
+
message: t("browserViewer.thisBrowserProfileIsNo"),
|
|
551
624
|
});
|
|
552
625
|
return;
|
|
553
626
|
}
|
|
554
627
|
const device = choice.kind === "attached" ? choice.device : null;
|
|
555
628
|
const browserName =
|
|
556
|
-
device?.profileLabel ??
|
|
629
|
+
device?.profileLabel ??
|
|
630
|
+
device?.name ??
|
|
631
|
+
(identity ? `${identity.name} browser` : t("browserViewer.browser"));
|
|
557
632
|
setCreating(true);
|
|
558
633
|
void (async () => {
|
|
559
634
|
let linkedComputer: Pick<ComputerSession, "id" | "placement"> | null = null;
|
|
@@ -607,11 +682,11 @@ export function BrowserViewer({
|
|
|
607
682
|
if (computerViewUnavailable) {
|
|
608
683
|
onNotify?.({
|
|
609
684
|
kind: "info",
|
|
610
|
-
message: "
|
|
685
|
+
message: t("browserViewer.browserOpenedDesktopViewIs"),
|
|
611
686
|
});
|
|
612
687
|
}
|
|
613
688
|
})()
|
|
614
|
-
.catch((cause) => notifyError(cause, "
|
|
689
|
+
.catch((cause) => notifyError(cause, t("browserViewer.couldNotOpenABrowser")))
|
|
615
690
|
.finally(() => setCreating(false));
|
|
616
691
|
},
|
|
617
692
|
[
|
|
@@ -623,6 +698,7 @@ export function BrowserViewer({
|
|
|
623
698
|
selectBrowserSession,
|
|
624
699
|
profiles.identities,
|
|
625
700
|
sessionId,
|
|
701
|
+
t,
|
|
626
702
|
],
|
|
627
703
|
);
|
|
628
704
|
|
|
@@ -670,18 +746,24 @@ export function BrowserViewer({
|
|
|
670
746
|
kind: "info",
|
|
671
747
|
message:
|
|
672
748
|
response.outcome === "saved_as_default"
|
|
673
|
-
?
|
|
674
|
-
|
|
749
|
+
? t("browserViewer.nameVersionOrdinalSavedFor", {
|
|
750
|
+
name: response.identity.name,
|
|
751
|
+
ordinal: response.revision.ordinal,
|
|
752
|
+
})
|
|
753
|
+
: t("browserViewer.nameVersionOrdinalSavedAnother", {
|
|
754
|
+
name: response.identity.name,
|
|
755
|
+
ordinal: response.revision.ordinal,
|
|
756
|
+
}),
|
|
675
757
|
});
|
|
676
758
|
return true;
|
|
677
759
|
} catch (cause) {
|
|
678
|
-
notifyError(cause, "
|
|
760
|
+
notifyError(cause, t("browserViewer.couldNotSaveThisBrowser"));
|
|
679
761
|
return false;
|
|
680
762
|
} finally {
|
|
681
763
|
setSavingProfile(false);
|
|
682
764
|
}
|
|
683
765
|
},
|
|
684
|
-
[browser, notifyError, onNotify, profiles, registry, savingProfile, selectedProfile],
|
|
766
|
+
[browser, notifyError, onNotify, profiles, registry, savingProfile, selectedProfile, t],
|
|
685
767
|
);
|
|
686
768
|
|
|
687
769
|
const updateProfile = useCallback(
|
|
@@ -702,26 +784,31 @@ export function BrowserViewer({
|
|
|
702
784
|
)?.ordinal;
|
|
703
785
|
onNotify?.({
|
|
704
786
|
kind: "info",
|
|
705
|
-
message:
|
|
787
|
+
message: ordinal
|
|
788
|
+
? t("browserViewer.nameVersionOpensByDefault", {
|
|
789
|
+
name: response.identity.name,
|
|
790
|
+
ordinal,
|
|
791
|
+
})
|
|
792
|
+
: t("browserViewer.nameOpensByDefault", { name: response.identity.name }),
|
|
706
793
|
});
|
|
707
794
|
} else if (update.status === "archived") {
|
|
708
795
|
onNotify?.({
|
|
709
796
|
kind: "info",
|
|
710
|
-
message:
|
|
797
|
+
message: t("browserViewer.nameHiddenFromNewBrowsers", { name: response.identity.name }),
|
|
711
798
|
});
|
|
712
799
|
} else if (update.status === "active") {
|
|
713
800
|
onNotify?.({ kind: "info", message: `${response.identity.name} restored.` });
|
|
714
801
|
}
|
|
715
802
|
return true;
|
|
716
803
|
} catch (cause) {
|
|
717
|
-
notifyError(cause, "
|
|
804
|
+
notifyError(cause, t("browserViewer.couldNotUpdateThisBrowser"));
|
|
718
805
|
await profiles.refresh().catch(() => undefined);
|
|
719
806
|
return false;
|
|
720
807
|
} finally {
|
|
721
808
|
setSavingProfile(false);
|
|
722
809
|
}
|
|
723
810
|
},
|
|
724
|
-
[notifyError, onNotify, profileHistory?.revisions, profiles, savingProfile],
|
|
811
|
+
[notifyError, onNotify, profileHistory?.revisions, profiles, savingProfile, t],
|
|
725
812
|
);
|
|
726
813
|
|
|
727
814
|
if (!enabled) return null;
|
|
@@ -729,31 +816,38 @@ export function BrowserViewer({
|
|
|
729
816
|
return (
|
|
730
817
|
<BrowserNotice
|
|
731
818
|
icon={<LoaderCircleIcon className="animate-spin" />}
|
|
732
|
-
text="
|
|
819
|
+
text={t("browserViewer.findingBrowsers")}
|
|
733
820
|
{...(className ? { className } : {})}
|
|
734
821
|
/>
|
|
735
822
|
);
|
|
736
823
|
}
|
|
737
824
|
if (liveSessions.length === 0) {
|
|
738
|
-
if (renderEmpty
|
|
825
|
+
if (renderEmpty && !unavailableBrowser)
|
|
826
|
+
return <>{renderEmpty(() => createBrowser(), creating)}</>;
|
|
739
827
|
return (
|
|
740
828
|
<div
|
|
741
829
|
className={cn("flex h-full min-h-0 items-center justify-center bg-og-bg p-6", className)}
|
|
742
830
|
>
|
|
743
831
|
<div className="max-w-sm text-center">
|
|
744
|
-
<span className="mx-auto grid size-10 place-items-center rounded-og-md border border-og-border bg-og-surface-1 text-og-muted">
|
|
832
|
+
<span className="mx-auto grid size-10 place-items-center rounded-og-md border border-og-border bg-og-surface-1 text-og-fg-muted">
|
|
745
833
|
<Globe2Icon className="size-4.5" />
|
|
746
834
|
</span>
|
|
747
|
-
|
|
748
|
-
{
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
835
|
+
{unavailableBrowser && !attachedGenerationLoss ? (
|
|
836
|
+
<BrowserUnavailableNotice session={unavailableBrowser} />
|
|
837
|
+
) : (
|
|
838
|
+
<>
|
|
839
|
+
<p className="mt-3 text-og-menu font-medium text-og-fg">
|
|
840
|
+
{attachedGenerationLoss
|
|
841
|
+
? t("browserViewer.chromeReconnectedOpenAFresh")
|
|
842
|
+
: t("browserViewer.noBrowserOpen")}
|
|
843
|
+
</p>
|
|
844
|
+
<p className="mt-1 text-og-control leading-5 text-og-fg-muted">
|
|
845
|
+
{attachedGenerationLoss
|
|
846
|
+
? t("browserViewer.thisChromeProfileIsLive")
|
|
847
|
+
: t("browserViewer.aBrowserAppearsHereWhen")}
|
|
848
|
+
</p>
|
|
849
|
+
</>
|
|
850
|
+
)}
|
|
757
851
|
<BrowserLaunchMenu
|
|
758
852
|
attachedBridges={onlineAttachedBridges}
|
|
759
853
|
attachedDevices={attached.devices}
|
|
@@ -766,7 +860,7 @@ export function BrowserViewer({
|
|
|
766
860
|
prominent
|
|
767
861
|
/>
|
|
768
862
|
{registry.error ? (
|
|
769
|
-
<p className="mt-3 text-og-control text-og-
|
|
863
|
+
<p className="mt-3 text-og-control text-og-danger">{registry.error.message}</p>
|
|
770
864
|
) : null}
|
|
771
865
|
</div>
|
|
772
866
|
</div>
|
|
@@ -815,12 +909,13 @@ export function BrowserViewer({
|
|
|
815
909
|
onOpen={(intervention) =>
|
|
816
910
|
void browser
|
|
817
911
|
.selectTarget(intervention.targetId)
|
|
818
|
-
.catch((cause) => notifyError(cause, "
|
|
912
|
+
.catch((cause) => notifyError(cause, t("browserViewer.couldNotOpenTheRequested")))
|
|
819
913
|
}
|
|
820
914
|
onResolve={resolveIntervention}
|
|
821
915
|
/>
|
|
822
916
|
{!selectedRegistrySession ? (
|
|
823
917
|
<BrowserUnselectedPanel
|
|
918
|
+
unavailableBrowser={unavailableBrowser}
|
|
824
919
|
peerCount={liveSessions.length}
|
|
825
920
|
creating={creating}
|
|
826
921
|
onCreate={() => createBrowser()}
|
|
@@ -843,17 +938,17 @@ export function BrowserViewer({
|
|
|
843
938
|
onSelect={(targetId) =>
|
|
844
939
|
void browser
|
|
845
940
|
.selectTarget(targetId)
|
|
846
|
-
.catch((cause) => notifyError(cause, "
|
|
941
|
+
.catch((cause) => notifyError(cause, t("browserViewer.couldNotSwitchTabs")))
|
|
847
942
|
}
|
|
848
943
|
onClose={(targetId) =>
|
|
849
944
|
void browser
|
|
850
945
|
.closeTarget(targetId)
|
|
851
|
-
.catch((cause) => notifyError(cause, "
|
|
946
|
+
.catch((cause) => notifyError(cause, t("browserViewer.couldNotCloseTheTab")))
|
|
852
947
|
}
|
|
853
948
|
onOpen={() =>
|
|
854
949
|
void browser
|
|
855
950
|
.openTarget(HUMAN_BROWSER_HOME_URL)
|
|
856
|
-
.catch((cause) => notifyError(cause, "
|
|
951
|
+
.catch((cause) => notifyError(cause, t("browserViewer.couldNotOpenATab")))
|
|
857
952
|
}
|
|
858
953
|
/>
|
|
859
954
|
<BrowserAddressBar
|
|
@@ -862,62 +957,167 @@ export function BrowserViewer({
|
|
|
862
957
|
onNavigate={(url) =>
|
|
863
958
|
void browser
|
|
864
959
|
.act({ type: "navigate", url })
|
|
865
|
-
.catch((cause) => notifyError(cause, "
|
|
960
|
+
.catch((cause) => notifyError(cause, t("browserViewer.couldNotNavigate")))
|
|
866
961
|
}
|
|
962
|
+
onHistory={async (direction) => {
|
|
963
|
+
try {
|
|
964
|
+
const action = { type: "history", direction } as const;
|
|
965
|
+
if (receivedFrame) await browser.actFromFrame(action, receivedFrame);
|
|
966
|
+
else {
|
|
967
|
+
if (!browser.observation)
|
|
968
|
+
throw new Error("The browser page is not ready for input.");
|
|
969
|
+
await browser.actFromObservation(action, browser.observation);
|
|
970
|
+
}
|
|
971
|
+
} catch (cause) {
|
|
972
|
+
notifyError(
|
|
973
|
+
cause,
|
|
974
|
+
direction === "back"
|
|
975
|
+
? t("browserViewer.couldNotGoBack")
|
|
976
|
+
: t("browserViewer.couldNotGoForward"),
|
|
977
|
+
);
|
|
978
|
+
}
|
|
979
|
+
}}
|
|
867
980
|
onReload={() => {
|
|
868
981
|
const url = browser.selectedTarget?.url;
|
|
869
982
|
if (url)
|
|
870
983
|
void browser
|
|
871
984
|
.act({ type: "navigate", url })
|
|
872
|
-
.catch((cause) => notifyError(cause, "
|
|
985
|
+
.catch((cause) => notifyError(cause, t("browserViewer.couldNotReload")));
|
|
873
986
|
}}
|
|
874
987
|
/>
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
988
|
+
{browser.inputFailure ? (
|
|
989
|
+
<div
|
|
990
|
+
role="alert"
|
|
991
|
+
aria-label={t("browserViewer.browserInputStatus")}
|
|
992
|
+
className="flex shrink-0 items-center gap-2 border-t border-og-border bg-og-surface-1 px-3 py-2 text-og-xs"
|
|
993
|
+
>
|
|
994
|
+
<CircleAlertIcon className="size-4 shrink-0 text-og-status-failed" />
|
|
995
|
+
<div className="min-w-0 flex-1">
|
|
996
|
+
<span className="font-medium">
|
|
997
|
+
{browser.inputFailure.state === "failed"
|
|
998
|
+
? t("browserViewer.browserInputFailed")
|
|
999
|
+
: t("browserViewer.inputResultUnknown")}
|
|
1000
|
+
</span>
|
|
1001
|
+
<p className="text-og-fg-subtle">
|
|
1002
|
+
{browser.inputFailure.error?.message ??
|
|
1003
|
+
t("browserViewer.inspectThePageBeforeContinuing")}
|
|
1004
|
+
</p>
|
|
1005
|
+
</div>
|
|
1006
|
+
<button
|
|
1007
|
+
type="button"
|
|
1008
|
+
onClick={() => void browser.refresh()}
|
|
1009
|
+
className="shrink-0 rounded border border-og-border px-2 py-1 transition hover:bg-og-surface-2"
|
|
1010
|
+
>
|
|
1011
|
+
{t("browserViewer.checkBrowser")}
|
|
1012
|
+
</button>
|
|
1013
|
+
</div>
|
|
1014
|
+
) : null}
|
|
1015
|
+
<div className="relative flex min-h-0 min-w-0 flex-1 overflow-hidden">
|
|
1016
|
+
<BrowserViewport
|
|
1017
|
+
// A new control scope must discard every buffered gesture and queued action.
|
|
1018
|
+
key={JSON.stringify([
|
|
1019
|
+
selection?.sessionId,
|
|
1020
|
+
browser.selectedTarget?.id,
|
|
1021
|
+
browser.selectedTarget?.targetGeneration,
|
|
1022
|
+
browser.selectedTarget?.documentGeneration,
|
|
1023
|
+
frames.attachment?.controllerGeneration,
|
|
1024
|
+
])}
|
|
1025
|
+
focusHandoffRef={viewportFocusHandoffRef}
|
|
1026
|
+
focusScope={JSON.stringify([
|
|
1027
|
+
selection?.sessionId,
|
|
1028
|
+
browser.selectedTarget?.id,
|
|
1029
|
+
browser.selectedTarget?.targetGeneration,
|
|
1030
|
+
])}
|
|
1031
|
+
frame={displayedFrame}
|
|
1032
|
+
connectionState={displayConnectionState}
|
|
1033
|
+
supportsLiveFrames={supportsLiveFrames}
|
|
1034
|
+
connectionError={connectionError}
|
|
1035
|
+
controlUnavailable={controlUnavailable}
|
|
1036
|
+
observation={browser.observation}
|
|
1037
|
+
mutating={browser.mutating || savingProfile}
|
|
1038
|
+
activityLabel={savingProfile ? t("browserViewer.savingBrowserVersion") : undefined}
|
|
1039
|
+
clipboardEnabled={browser.session?.capabilities.clipboard === true}
|
|
1040
|
+
inputBatchAttachment={frames.attachment}
|
|
1041
|
+
onAction={async (action, frame) => {
|
|
1042
|
+
const focusedInput =
|
|
1043
|
+
frame &&
|
|
1044
|
+
action.type === "pointer" &&
|
|
1045
|
+
action.action === "click" &&
|
|
1046
|
+
(action.button === undefined || action.button === "left") &&
|
|
1047
|
+
frames.attachment?.focusedInputObservations === true &&
|
|
1048
|
+
frames.attachment.browserSessionId === frame.browserSessionId &&
|
|
1049
|
+
frames.attachment.controllerGeneration === frame.controllerGeneration &&
|
|
1050
|
+
frames.attachment.targetId === frame.targetId &&
|
|
1051
|
+
Date.parse(frames.attachment.expiresAt) > Date.now();
|
|
1052
|
+
const receipt = frame
|
|
1053
|
+
? await browser.actFromFrame(
|
|
1054
|
+
action,
|
|
1055
|
+
frame,
|
|
1056
|
+
undefined,
|
|
1057
|
+
focusedInput ? "input" : "none",
|
|
1058
|
+
)
|
|
1059
|
+
: await browser.act(action);
|
|
1060
|
+
if (receipt.state !== "completed") {
|
|
1061
|
+
throw new Error(
|
|
1062
|
+
receipt.error?.message ?? t("browserViewer.browserInputDidNotComplete"),
|
|
1063
|
+
);
|
|
1064
|
+
}
|
|
1065
|
+
return receipt;
|
|
1066
|
+
}}
|
|
1067
|
+
onReadClipboard={browser.readClipboard}
|
|
1068
|
+
onObserveForInput={browser.observeForInput}
|
|
1069
|
+
onSelectFromObservation={browser.actFromObservation}
|
|
1070
|
+
onReconnect={
|
|
1071
|
+
selectedChromeGenerationLoss
|
|
1072
|
+
? () => {
|
|
1073
|
+
if (replacementChromeDevice) {
|
|
1074
|
+
createBrowser({ kind: "attached", device: replacementChromeDevice });
|
|
1075
|
+
}
|
|
899
1076
|
}
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
1077
|
+
: () => {
|
|
1078
|
+
void browser.refresh();
|
|
1079
|
+
frames.reconnect();
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
reconnectLabel={
|
|
1083
|
+
selectedChromeGenerationLoss && replacementChromeDevice
|
|
1084
|
+
? t("browserViewer.openAFreshConnectedChrome")
|
|
1085
|
+
: undefined
|
|
1086
|
+
}
|
|
1087
|
+
reconnectMessage={
|
|
1088
|
+
selectedChromeGenerationLoss
|
|
1089
|
+
? t("browserViewer.chromeReconnectedOpenAFresh")
|
|
1090
|
+
: undefined
|
|
1091
|
+
}
|
|
1092
|
+
onError={(cause) => notifyError(cause, t("browserViewer.browserInputFailed2"))}
|
|
1093
|
+
/>
|
|
1094
|
+
{diagnosticsView ? (
|
|
1095
|
+
<BrowserDiagnosticsDrawer
|
|
1096
|
+
session={browser.session}
|
|
1097
|
+
profile={selectedProfile}
|
|
1098
|
+
target={browser.selectedTarget}
|
|
1099
|
+
observation={browser.observation}
|
|
1100
|
+
baseRevisionOrdinal={baseRevisionOrdinal}
|
|
1101
|
+
state={diagnosticsView}
|
|
1102
|
+
downloads={downloads.downloads}
|
|
1103
|
+
downloadsEnabled={browser.session?.capabilities.downloads === true}
|
|
1104
|
+
downloadsLoading={downloads.loading}
|
|
1105
|
+
downloadsRefreshing={downloads.refreshing}
|
|
1106
|
+
downloadsError={downloads.error}
|
|
1107
|
+
savingDownloadIds={downloads.savingDownloadIds}
|
|
1108
|
+
onSaveDownload={saveDownload}
|
|
1109
|
+
onRefreshDownloads={() => void downloads.refresh()}
|
|
1110
|
+
onRefresh={refreshDiagnostics}
|
|
1111
|
+
onClose={closeDiagnostics}
|
|
1112
|
+
/>
|
|
1113
|
+
) : null}
|
|
1114
|
+
</div>
|
|
916
1115
|
<BrowserStatusBar
|
|
917
1116
|
session={browser.session}
|
|
918
1117
|
profile={selectedProfile}
|
|
919
1118
|
target={browser.selectedTarget}
|
|
920
1119
|
observation={browser.observation}
|
|
1120
|
+
inputFailure={browser.inputFailure}
|
|
921
1121
|
connectionState={displayConnectionState}
|
|
922
1122
|
refreshing={registry.refreshing}
|
|
923
1123
|
diagnosticsOpen={diagnosticsView !== null}
|
|
@@ -933,26 +1133,6 @@ export function BrowserViewer({
|
|
|
933
1133
|
/>
|
|
934
1134
|
</>
|
|
935
1135
|
)}
|
|
936
|
-
{diagnosticsView ? (
|
|
937
|
-
<BrowserDiagnosticsDrawer
|
|
938
|
-
session={browser.session}
|
|
939
|
-
profile={selectedProfile}
|
|
940
|
-
target={browser.selectedTarget}
|
|
941
|
-
observation={browser.observation}
|
|
942
|
-
baseRevisionOrdinal={baseRevisionOrdinal}
|
|
943
|
-
state={diagnosticsView}
|
|
944
|
-
downloads={downloads.downloads}
|
|
945
|
-
downloadsEnabled={browser.session?.capabilities.downloads === true}
|
|
946
|
-
downloadsLoading={downloads.loading}
|
|
947
|
-
downloadsRefreshing={downloads.refreshing}
|
|
948
|
-
downloadsError={downloads.error}
|
|
949
|
-
savingDownloadIds={downloads.savingDownloadIds}
|
|
950
|
-
onSaveDownload={saveDownload}
|
|
951
|
-
onRefreshDownloads={() => void downloads.refresh()}
|
|
952
|
-
onRefresh={refreshDiagnostics}
|
|
953
|
-
onClose={closeDiagnostics}
|
|
954
|
-
/>
|
|
955
|
-
) : null}
|
|
956
1136
|
</div>
|
|
957
1137
|
);
|
|
958
1138
|
}
|
|
@@ -962,40 +1142,41 @@ function BrowserLifecyclePanel(props: {
|
|
|
962
1142
|
attempt: BrowserResumeAttempt | null;
|
|
963
1143
|
onResume: () => void;
|
|
964
1144
|
}) {
|
|
1145
|
+
const t = useOpenGeniText();
|
|
965
1146
|
const failed = props.attempt?.error ?? null;
|
|
966
1147
|
const label = failed
|
|
967
|
-
? "
|
|
1148
|
+
? t("browserViewer.browserCouldNotReopen")
|
|
968
1149
|
: props.session.lifecycle === "suspending"
|
|
969
|
-
? "
|
|
1150
|
+
? t("browserViewer.savingBrowserState")
|
|
970
1151
|
: props.session.lifecycle === "restoring" || props.attempt?.running
|
|
971
|
-
? "
|
|
1152
|
+
? t("browserViewer.openingBrowser")
|
|
972
1153
|
: props.session.lifecycle === "starting"
|
|
973
|
-
? "
|
|
974
|
-
: "
|
|
1154
|
+
? t("browserViewer.startingBrowser")
|
|
1155
|
+
: t("browserViewer.browserIsSleeping");
|
|
975
1156
|
const detail = failed
|
|
976
1157
|
? failed.message
|
|
977
1158
|
: props.session.lifecycle === "suspended"
|
|
978
|
-
? "
|
|
979
|
-
: "
|
|
1159
|
+
? t("browserViewer.itsPrivateStateIsSaved")
|
|
1160
|
+
: t("browserViewer.theBrowserWillReconnectHere");
|
|
980
1161
|
return (
|
|
981
1162
|
<div className="grid min-h-0 flex-1 place-items-center bg-og-bg p-6 text-center">
|
|
982
1163
|
<div className="max-w-sm">
|
|
983
|
-
<span className="mx-auto grid size-10 place-items-center rounded-og-md border border-og-border bg-og-surface-1 text-og-muted">
|
|
1164
|
+
<span className="mx-auto grid size-10 place-items-center rounded-og-md border border-og-border bg-og-surface-1 text-og-fg-muted">
|
|
984
1165
|
{failed ? (
|
|
985
|
-
<CircleAlertIcon className="size-4.5 text-og-
|
|
1166
|
+
<CircleAlertIcon className="size-4.5 text-og-danger" />
|
|
986
1167
|
) : (
|
|
987
1168
|
<LoaderCircleIcon className="size-4.5 animate-spin" />
|
|
988
1169
|
)}
|
|
989
1170
|
</span>
|
|
990
1171
|
<p className="mt-3 text-og-menu font-medium text-og-fg">{label}</p>
|
|
991
|
-
<p className="mt-1 text-og-control leading-5 text-og-muted">{detail}</p>
|
|
1172
|
+
<p className="mt-1 text-og-control leading-5 text-og-fg-muted">{detail}</p>
|
|
992
1173
|
{failed || (props.session.lifecycle === "suspended" && !props.attempt?.running) ? (
|
|
993
1174
|
<button
|
|
994
1175
|
type="button"
|
|
995
1176
|
onClick={props.onResume}
|
|
996
|
-
className="mt-4 inline-flex h-8 items-center rounded-og-sm border border-og-border bg-og-
|
|
1177
|
+
className="mt-4 inline-flex h-8 items-center rounded-og-sm border border-og-primary-border bg-og-primary px-3 text-og-control font-medium text-og-primary-fg transition hover:bg-og-primary-hover"
|
|
997
1178
|
>
|
|
998
|
-
|
|
1179
|
+
{t("browserViewer.openBrowser")}
|
|
999
1180
|
</button>
|
|
1000
1181
|
) : null}
|
|
1001
1182
|
</div>
|
|
@@ -1030,7 +1211,8 @@ function BrowserToolbar(props: {
|
|
|
1030
1211
|
onRefresh: () => void;
|
|
1031
1212
|
setupUrl?: string | undefined;
|
|
1032
1213
|
}) {
|
|
1033
|
-
const
|
|
1214
|
+
const t = useOpenGeniText();
|
|
1215
|
+
const detailsRef = useViewerMenuDismiss();
|
|
1034
1216
|
const selected = props.sessions.find((session) => session.id === props.selectedSessionId);
|
|
1035
1217
|
const current = props.sessions.filter((session) => props.relevantSessionIds.has(session.id));
|
|
1036
1218
|
const others = props.sessions.filter((session) => !props.relevantSessionIds.has(session.id));
|
|
@@ -1039,45 +1221,49 @@ function BrowserToolbar(props: {
|
|
|
1039
1221
|
detailsRef.current?.removeAttribute("open");
|
|
1040
1222
|
};
|
|
1041
1223
|
return (
|
|
1042
|
-
<div className="flex h-10 shrink-0 items-center gap-1.5 border-b border-og-border bg-og-surface-
|
|
1043
|
-
<details ref={detailsRef} className="
|
|
1224
|
+
<div className="flex h-10 shrink-0 items-center gap-1.5 border-b border-og-border bg-og-surface-1 px-2">
|
|
1225
|
+
<details ref={detailsRef} className="min-w-0">
|
|
1044
1226
|
<summary className="flex h-7 max-w-52 cursor-pointer list-none items-center gap-2 rounded-og-sm px-2 text-og-control text-og-fg transition hover:bg-og-surface-2 [&::-webkit-details-marker]:hidden">
|
|
1045
|
-
<Globe2Icon className="size-3.5 shrink-0 text-og-muted" />
|
|
1046
|
-
<span className="truncate font-medium">
|
|
1227
|
+
<Globe2Icon className="size-3.5 shrink-0 text-og-fg-muted" />
|
|
1228
|
+
<span className="truncate font-medium">
|
|
1229
|
+
{selected?.name ?? t("browserViewer.browser")}
|
|
1230
|
+
</span>
|
|
1047
1231
|
{(props.interventionCounts.get(selected?.id ?? "") ?? 0) > 0 ? (
|
|
1048
1232
|
<span className="size-1.5 shrink-0 rounded-full bg-og-status-waiting" />
|
|
1049
1233
|
) : null}
|
|
1050
|
-
<ChevronDownIcon className="size-3 shrink-0 text-og-subtle" />
|
|
1234
|
+
<ChevronDownIcon className="size-3 shrink-0 text-og-fg-subtle" />
|
|
1051
1235
|
</summary>
|
|
1052
|
-
<div className="absolute left-
|
|
1053
|
-
<
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1236
|
+
<div className="absolute left-2 top-10 z-30 flex max-h-[calc(100%-3rem)] w-72 max-w-[calc(100%-1rem)] flex-col overflow-hidden rounded-og-md border border-og-border bg-og-surface-1 p-1 shadow-xl">
|
|
1237
|
+
<div className="min-h-0 max-h-96 overflow-y-auto overscroll-contain">
|
|
1238
|
+
<BrowserSessionGroup
|
|
1239
|
+
label={t("browserViewer.currentAgent")}
|
|
1240
|
+
sessions={current}
|
|
1241
|
+
identities={props.identities}
|
|
1242
|
+
selectedId={props.selectedSessionId}
|
|
1243
|
+
interventionCounts={props.interventionCounts}
|
|
1244
|
+
onSelect={choose}
|
|
1245
|
+
/>
|
|
1246
|
+
<BrowserSessionGroup
|
|
1247
|
+
label={t("browserViewer.workspaceBrowsers")}
|
|
1248
|
+
sessions={others}
|
|
1249
|
+
identities={props.identities}
|
|
1250
|
+
selectedId={props.selectedSessionId}
|
|
1251
|
+
interventionCounts={props.interventionCounts}
|
|
1252
|
+
onSelect={choose}
|
|
1253
|
+
/>
|
|
1254
|
+
</div>
|
|
1255
|
+
<div className="mt-1 flex shrink-0 gap-1 border-t border-og-border pt-1">
|
|
1070
1256
|
{current.length > 0 ? (
|
|
1071
|
-
<MenuButton onClick={props.onFollow}>
|
|
1257
|
+
<MenuButton onClick={props.onFollow}>{t("browserViewer.followAgent")}</MenuButton>
|
|
1072
1258
|
) : null}
|
|
1073
1259
|
<MenuButton onClick={() => props.onCreate()} disabled={props.creating}>
|
|
1074
|
-
<PlusIcon className="size-3.5" />
|
|
1260
|
+
<PlusIcon className="size-3.5" /> {t("browserViewer.newBrowser")}
|
|
1075
1261
|
</MenuButton>
|
|
1076
1262
|
</div>
|
|
1077
1263
|
</div>
|
|
1078
1264
|
</details>
|
|
1079
|
-
<span className="min-w-0 flex-1 truncate text-og-xs text-og-subtle">
|
|
1080
|
-
{placementLabel(selected)}
|
|
1265
|
+
<span className="min-w-0 flex-1 truncate text-og-xs text-og-fg-subtle">
|
|
1266
|
+
{placementLabel(t, selected)}
|
|
1081
1267
|
</span>
|
|
1082
1268
|
<BrowserProfileMenu
|
|
1083
1269
|
session={selected ?? null}
|
|
@@ -1093,8 +1279,8 @@ function BrowserToolbar(props: {
|
|
|
1093
1279
|
<button
|
|
1094
1280
|
type="button"
|
|
1095
1281
|
onClick={props.onRefresh}
|
|
1096
|
-
className="grid size-7 place-items-center rounded-og-sm text-og-muted transition hover:bg-og-surface-2 hover:text-og-fg"
|
|
1097
|
-
aria-label="
|
|
1282
|
+
className="grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted transition hover:bg-og-surface-2 hover:text-og-fg"
|
|
1283
|
+
aria-label={t("browserViewer.refreshBrowsers")}
|
|
1098
1284
|
>
|
|
1099
1285
|
<RefreshCwIcon className={cn("size-3.5", props.refreshing && "animate-spin")} />
|
|
1100
1286
|
</button>
|
|
@@ -1113,36 +1299,70 @@ function BrowserToolbar(props: {
|
|
|
1113
1299
|
}
|
|
1114
1300
|
|
|
1115
1301
|
function BrowserUnselectedPanel(props: {
|
|
1302
|
+
unavailableBrowser: BrowserSession | undefined;
|
|
1116
1303
|
peerCount: number;
|
|
1117
1304
|
creating: boolean;
|
|
1118
1305
|
onCreate: () => void;
|
|
1119
1306
|
}) {
|
|
1307
|
+
const t = useOpenGeniText();
|
|
1120
1308
|
return (
|
|
1121
1309
|
<div className="grid min-h-0 flex-1 place-items-center bg-og-bg p-6 text-center">
|
|
1122
1310
|
<div className="max-w-sm">
|
|
1123
|
-
<span className="mx-auto grid size-10 place-items-center rounded-og-md border border-og-border bg-og-surface-1 text-og-muted">
|
|
1311
|
+
<span className="mx-auto grid size-10 place-items-center rounded-og-md border border-og-border bg-og-surface-1 text-og-fg-muted">
|
|
1124
1312
|
<Globe2Icon className="size-4.5" />
|
|
1125
1313
|
</span>
|
|
1126
|
-
|
|
1127
|
-
|
|
1314
|
+
{props.unavailableBrowser ? (
|
|
1315
|
+
<BrowserUnavailableNotice session={props.unavailableBrowser} />
|
|
1316
|
+
) : (
|
|
1317
|
+
<p className="mt-3 text-og-menu font-medium text-og-fg">
|
|
1318
|
+
{t("browserViewer.noBrowserForThisAgent")}
|
|
1319
|
+
</p>
|
|
1320
|
+
)}
|
|
1321
|
+
<p className="mt-1 text-og-control leading-5 text-og-fg-muted">
|
|
1128
1322
|
{props.peerCount === 1
|
|
1129
|
-
? "
|
|
1130
|
-
:
|
|
1323
|
+
? t("browserViewer.oneWorkspaceBrowserIsAvailable")
|
|
1324
|
+
: t("browserViewer.peercountWorkspaceBrowsersAreAvailable", {
|
|
1325
|
+
peerCount: props.peerCount,
|
|
1326
|
+
})}
|
|
1131
1327
|
</p>
|
|
1132
1328
|
<button
|
|
1133
1329
|
type="button"
|
|
1134
1330
|
disabled={props.creating}
|
|
1135
1331
|
onClick={props.onCreate}
|
|
1136
|
-
className="mt-4 inline-flex h-8 items-center gap-1.5 rounded-og-sm border border-og-border bg-og-
|
|
1332
|
+
className="mt-4 inline-flex h-8 items-center gap-1.5 rounded-og-sm border border-og-primary-border bg-og-primary px-3 text-og-control font-medium text-og-primary-fg transition hover:bg-og-primary-hover disabled:cursor-not-allowed disabled:opacity-50"
|
|
1137
1333
|
>
|
|
1138
1334
|
<PlusIcon className="size-3.5" />
|
|
1139
|
-
{props.creating ? "
|
|
1335
|
+
{props.creating ? t("browserViewer.opening") : t("browserViewer.newBrowser")}
|
|
1140
1336
|
</button>
|
|
1141
1337
|
</div>
|
|
1142
1338
|
</div>
|
|
1143
1339
|
);
|
|
1144
1340
|
}
|
|
1145
1341
|
|
|
1342
|
+
function BrowserUnavailableNotice({ session }: { session: BrowserSession }) {
|
|
1343
|
+
const t = useOpenGeniText();
|
|
1344
|
+
const reason =
|
|
1345
|
+
session.failureCode === "provider_deadline_rotation"
|
|
1346
|
+
? t("browserViewer.theComputerRunningItReached")
|
|
1347
|
+
: session.failureCode === "source_placement_changed"
|
|
1348
|
+
? t("browserViewer.thisChatMovedToAnother")
|
|
1349
|
+
: session.failureCode === "idle_released"
|
|
1350
|
+
? t("browserViewer.itStoppedAfterItWent")
|
|
1351
|
+
: session.lifecycle === "failed"
|
|
1352
|
+
? t("browserViewer.itStoppedUnexpectedly")
|
|
1353
|
+
: t("browserViewer.theConnectionToItWas");
|
|
1354
|
+
return (
|
|
1355
|
+
<div role="status">
|
|
1356
|
+
<p className="mt-3 text-og-menu font-medium text-og-fg">
|
|
1357
|
+
{t("browserViewer.browserUnavailable")}
|
|
1358
|
+
</p>
|
|
1359
|
+
<p className="mt-1 break-words text-og-control leading-5 text-og-fg-muted">
|
|
1360
|
+
{t("browserViewer.nameReasonOpenANew", { name: session.name, reason })}
|
|
1361
|
+
</p>
|
|
1362
|
+
</div>
|
|
1363
|
+
);
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1146
1366
|
function BrowserSessionGroup(props: {
|
|
1147
1367
|
label: string;
|
|
1148
1368
|
sessions: BrowserSession[];
|
|
@@ -1151,10 +1371,11 @@ function BrowserSessionGroup(props: {
|
|
|
1151
1371
|
interventionCounts: Map<string, number>;
|
|
1152
1372
|
onSelect: (id: string) => void;
|
|
1153
1373
|
}) {
|
|
1374
|
+
const t = useOpenGeniText();
|
|
1154
1375
|
if (props.sessions.length === 0) return null;
|
|
1155
1376
|
return (
|
|
1156
1377
|
<div className="py-1">
|
|
1157
|
-
<p className="px-2 pb-1 text-[10px] font-medium uppercase tracking-[0.12em] text-og-subtle">
|
|
1378
|
+
<p className="px-2 pb-1 text-[10px] font-medium uppercase tracking-[0.12em] text-og-fg-subtle">
|
|
1158
1379
|
{props.label}
|
|
1159
1380
|
</p>
|
|
1160
1381
|
{props.sessions.map((session) => {
|
|
@@ -1164,6 +1385,8 @@ function BrowserSessionGroup(props: {
|
|
|
1164
1385
|
<button
|
|
1165
1386
|
key={session.id}
|
|
1166
1387
|
type="button"
|
|
1388
|
+
aria-label={`${session.name}${identity ? ` · ${identity.name}` : ""} · ${placementLabel(t, session)}`}
|
|
1389
|
+
aria-pressed={session.id === props.selectedId}
|
|
1167
1390
|
onClick={() => props.onSelect(session.id)}
|
|
1168
1391
|
className={cn(
|
|
1169
1392
|
"flex w-full items-center gap-2 rounded-og-sm px-2 py-1.5 text-left transition hover:bg-og-surface-2",
|
|
@@ -1178,9 +1401,9 @@ function BrowserSessionGroup(props: {
|
|
|
1178
1401
|
/>
|
|
1179
1402
|
<span className="min-w-0 flex-1">
|
|
1180
1403
|
<span className="block truncate text-og-control text-og-fg">{session.name}</span>
|
|
1181
|
-
<span className="block truncate text-og-xs text-og-subtle">
|
|
1404
|
+
<span className="block truncate text-og-xs text-og-fg-subtle">
|
|
1182
1405
|
{identity ? `${identity.name} · ` : ""}
|
|
1183
|
-
{placementLabel(session)}
|
|
1406
|
+
{placementLabel(t, session)}
|
|
1184
1407
|
</span>
|
|
1185
1408
|
</span>
|
|
1186
1409
|
{interventionCount > 0 ? (
|
|
@@ -1206,7 +1429,8 @@ function BrowserLaunchMenu(props: {
|
|
|
1206
1429
|
setupUrl?: string | undefined;
|
|
1207
1430
|
prominent?: boolean;
|
|
1208
1431
|
}) {
|
|
1209
|
-
const
|
|
1432
|
+
const t = useOpenGeniText();
|
|
1433
|
+
const detailsRef = useViewerMenuDismiss();
|
|
1210
1434
|
const choose = (choice?: BrowserLaunchChoice) => {
|
|
1211
1435
|
detailsRef.current?.removeAttribute("open");
|
|
1212
1436
|
props.onCreate(choice);
|
|
@@ -1218,38 +1442,38 @@ function BrowserLaunchMenu(props: {
|
|
|
1218
1442
|
const activeIdentities = props.identities.filter((identity) => identity.status === "active");
|
|
1219
1443
|
const archivedIdentities = props.identities.filter((identity) => identity.status === "archived");
|
|
1220
1444
|
return (
|
|
1221
|
-
<details ref={detailsRef} className={cn(
|
|
1445
|
+
<details ref={detailsRef} className={cn(props.prominent && "mt-4 inline-block")}>
|
|
1222
1446
|
<summary
|
|
1223
1447
|
onClick={(event) => {
|
|
1224
1448
|
if (busy) event.preventDefault();
|
|
1225
1449
|
}}
|
|
1226
1450
|
className={cn(
|
|
1227
|
-
"cursor-pointer list-none items-center justify-center gap-1.5 text-og-muted transition hover:bg-og-surface-2 hover:text-og-fg [&::-webkit-details-marker]:hidden",
|
|
1451
|
+
"cursor-pointer list-none items-center justify-center gap-1.5 text-og-fg-muted transition hover:bg-og-surface-2 hover:text-og-fg [&::-webkit-details-marker]:hidden",
|
|
1228
1452
|
props.prominent
|
|
1229
1453
|
? "inline-flex h-8 rounded-og-sm border border-og-border bg-og-surface-1 px-3 text-og-control font-medium text-og-fg"
|
|
1230
1454
|
: "grid size-7 place-items-center rounded-og-sm",
|
|
1231
1455
|
busy && "pointer-events-none opacity-50",
|
|
1232
1456
|
)}
|
|
1233
|
-
aria-label="
|
|
1457
|
+
aria-label={t("browserViewer.newBrowser")}
|
|
1234
1458
|
>
|
|
1235
1459
|
{busy ? (
|
|
1236
1460
|
<LoaderCircleIcon className="size-3.5 animate-spin" />
|
|
1237
1461
|
) : (
|
|
1238
1462
|
<PlusIcon className="size-3.5" />
|
|
1239
1463
|
)}
|
|
1240
|
-
{props.prominent ? "
|
|
1464
|
+
{props.prominent ? t("browserViewer.newBrowser") : null}
|
|
1241
1465
|
{props.prominent ? <ChevronDownIcon className="size-3" /> : null}
|
|
1242
1466
|
</summary>
|
|
1243
1467
|
<div
|
|
1244
1468
|
className={cn(
|
|
1245
|
-
"absolute z-40 w-72 overflow-
|
|
1246
|
-
props.prominent ? "left-1/2 top-
|
|
1469
|
+
"absolute z-40 max-h-[calc(100%-3rem)] w-72 max-w-[calc(100%-1rem)] overflow-y-auto rounded-og-md border border-og-border bg-og-surface-1 p-1 text-left shadow-xl",
|
|
1470
|
+
props.prominent ? "left-1/2 top-2 -translate-x-1/2" : "right-2 top-10",
|
|
1247
1471
|
)}
|
|
1248
1472
|
>
|
|
1249
1473
|
{props.attachedDevices.length > 0 || props.attachedBridges.length > 0 ? (
|
|
1250
1474
|
<div className="pb-1">
|
|
1251
|
-
<p className="px-2 pb-1 pt-1 text-[10px] font-medium uppercase tracking-[0.12em] text-og-subtle">
|
|
1252
|
-
|
|
1475
|
+
<p className="px-2 pb-1 pt-1 text-[10px] font-medium uppercase tracking-[0.12em] text-og-fg-subtle">
|
|
1476
|
+
{t("browserViewer.connectedChrome")}
|
|
1253
1477
|
</p>
|
|
1254
1478
|
{props.attachedDevices.map((device) => (
|
|
1255
1479
|
<button
|
|
@@ -1258,14 +1482,16 @@ function BrowserLaunchMenu(props: {
|
|
|
1258
1482
|
onClick={() => choose({ kind: "attached", device })}
|
|
1259
1483
|
className="flex w-full items-center gap-2 rounded-og-sm px-2 py-2 text-left transition hover:bg-og-surface-2"
|
|
1260
1484
|
>
|
|
1261
|
-
<MonitorIcon className="size-3.5 shrink-0 text-og-muted" />
|
|
1485
|
+
<MonitorIcon className="size-3.5 shrink-0 text-og-fg-muted" />
|
|
1262
1486
|
<span className="min-w-0 flex-1">
|
|
1263
1487
|
<span className="block truncate text-og-control text-og-fg">
|
|
1264
1488
|
{device.profileLabel ?? device.name}
|
|
1265
1489
|
</span>
|
|
1266
|
-
<span className="block truncate text-og-xs text-og-subtle">
|
|
1267
|
-
{
|
|
1268
|
-
|
|
1490
|
+
<span className="block truncate text-og-xs text-og-fg-subtle">
|
|
1491
|
+
{t("browserViewer.openTabs", {
|
|
1492
|
+
browserName: device.browserName,
|
|
1493
|
+
count: device.tabCount,
|
|
1494
|
+
})}
|
|
1269
1495
|
</span>
|
|
1270
1496
|
</span>
|
|
1271
1497
|
<span className="size-1.5 shrink-0 rounded-full bg-og-status-running" />
|
|
@@ -1280,27 +1506,27 @@ function BrowserLaunchMenu(props: {
|
|
|
1280
1506
|
onClick={() => detailsRef.current?.removeAttribute("open")}
|
|
1281
1507
|
className="flex w-full items-center gap-2 rounded-og-sm px-2 py-2 text-left transition hover:bg-og-surface-2"
|
|
1282
1508
|
>
|
|
1283
|
-
<PlusIcon className="size-3.5 shrink-0 text-og-muted" />
|
|
1509
|
+
<PlusIcon className="size-3.5 shrink-0 text-og-fg-muted" />
|
|
1284
1510
|
<span className="min-w-0 flex-1">
|
|
1285
1511
|
<span className="block truncate text-og-control text-og-fg">
|
|
1286
1512
|
{props.attachedDevices.length > 0
|
|
1287
|
-
? "
|
|
1288
|
-
: "
|
|
1513
|
+
? t("browserViewer.connectAnotherChromeProfile")
|
|
1514
|
+
: t("browserViewer.connectThisChromeProfile")}
|
|
1289
1515
|
</span>
|
|
1290
|
-
<span className="block truncate text-og-xs text-og-subtle">
|
|
1291
|
-
|
|
1516
|
+
<span className="block truncate text-og-xs text-og-fg-subtle">
|
|
1517
|
+
{t("browserViewer.machineConnectedChromeExtensionMissing")}
|
|
1292
1518
|
</span>
|
|
1293
1519
|
</span>
|
|
1294
1520
|
</a>
|
|
1295
1521
|
) : (
|
|
1296
1522
|
<div className="flex w-full items-center gap-2 px-2 py-2 text-left">
|
|
1297
|
-
<MonitorIcon className="size-3.5 shrink-0 text-og-muted" />
|
|
1523
|
+
<MonitorIcon className="size-3.5 shrink-0 text-og-fg-muted" />
|
|
1298
1524
|
<span className="min-w-0 flex-1">
|
|
1299
1525
|
<span className="block truncate text-og-control text-og-fg">
|
|
1300
|
-
|
|
1526
|
+
{t("browserViewer.chromeConnectionReady")}
|
|
1301
1527
|
</span>
|
|
1302
|
-
<span className="block text-og-xs leading-4 text-og-subtle">
|
|
1303
|
-
|
|
1528
|
+
<span className="block text-og-xs leading-4 text-og-fg-subtle">
|
|
1529
|
+
{t("browserViewer.installTheOpengeniBrowserExtension")}
|
|
1304
1530
|
</span>
|
|
1305
1531
|
</span>
|
|
1306
1532
|
</div>
|
|
@@ -1310,22 +1536,26 @@ function BrowserLaunchMenu(props: {
|
|
|
1310
1536
|
) : null}
|
|
1311
1537
|
<p
|
|
1312
1538
|
className={cn(
|
|
1313
|
-
"px-2 pb-1 pt-1 text-[10px] font-medium uppercase tracking-[0.12em] text-og-subtle",
|
|
1539
|
+
"px-2 pb-1 pt-1 text-[10px] font-medium uppercase tracking-[0.12em] text-og-fg-subtle",
|
|
1314
1540
|
(props.attachedDevices.length > 0 || props.attachedBridges.length > 0) &&
|
|
1315
1541
|
"border-t border-og-border",
|
|
1316
1542
|
)}
|
|
1317
1543
|
>
|
|
1318
|
-
|
|
1544
|
+
{t("browserViewer.openIsolatedBrowser")}
|
|
1319
1545
|
</p>
|
|
1320
1546
|
<button
|
|
1321
1547
|
type="button"
|
|
1322
1548
|
onClick={() => choose({ kind: "clean" })}
|
|
1323
1549
|
className="flex w-full items-center gap-2 rounded-og-sm px-2 py-2 text-left transition hover:bg-og-surface-2"
|
|
1324
1550
|
>
|
|
1325
|
-
<Globe2Icon className="size-3.5 text-og-muted" />
|
|
1551
|
+
<Globe2Icon className="size-3.5 text-og-fg-muted" />
|
|
1326
1552
|
<span>
|
|
1327
|
-
<span className="block text-og-control text-og-fg">
|
|
1328
|
-
|
|
1553
|
+
<span className="block text-og-control text-og-fg">
|
|
1554
|
+
{t("browserViewer.freshBrowser")}
|
|
1555
|
+
</span>
|
|
1556
|
+
<span className="block text-og-xs text-og-fg-subtle">
|
|
1557
|
+
{t("browserViewer.visualBrowserNoSavedState")}
|
|
1558
|
+
</span>
|
|
1329
1559
|
</span>
|
|
1330
1560
|
</button>
|
|
1331
1561
|
{activeIdentities.length > 0 ? (
|
|
@@ -1337,13 +1567,13 @@ function BrowserLaunchMenu(props: {
|
|
|
1337
1567
|
onClick={() => choose({ kind: "profile", identityId: identity.id })}
|
|
1338
1568
|
className="flex w-full items-center gap-2 rounded-og-sm px-2 py-2 text-left transition hover:bg-og-surface-2"
|
|
1339
1569
|
>
|
|
1340
|
-
<UserRoundIcon className="size-3.5 text-og-muted" />
|
|
1570
|
+
<UserRoundIcon className="size-3.5 text-og-fg-muted" />
|
|
1341
1571
|
<span className="min-w-0">
|
|
1342
1572
|
<span className="block truncate text-og-control text-og-fg">{identity.name}</span>
|
|
1343
|
-
<span className="block text-og-xs text-og-subtle">
|
|
1573
|
+
<span className="block text-og-xs text-og-fg-subtle">
|
|
1344
1574
|
{identity.defaultRevisionId
|
|
1345
|
-
?
|
|
1346
|
-
: "
|
|
1575
|
+
? t("browserViewer.savedVersions", { count: identity.revisionCount })
|
|
1576
|
+
: t("browserViewer.readyForFirstSignIn")}
|
|
1347
1577
|
</span>
|
|
1348
1578
|
</span>
|
|
1349
1579
|
</button>
|
|
@@ -1352,8 +1582,9 @@ function BrowserLaunchMenu(props: {
|
|
|
1352
1582
|
) : null}
|
|
1353
1583
|
{archivedIdentities.length > 0 ? (
|
|
1354
1584
|
<details className="mt-1 border-t border-og-border pt-1">
|
|
1355
|
-
<summary className="flex cursor-pointer list-none items-center gap-1.5 rounded-og-sm px-2 py-1.5 text-og-xs text-og-subtle transition hover:bg-og-surface-2 hover:text-og-fg [&::-webkit-details-marker]:hidden">
|
|
1356
|
-
<ArchiveIcon className="size-3" />
|
|
1585
|
+
<summary className="flex cursor-pointer list-none items-center gap-1.5 rounded-og-sm px-2 py-1.5 text-og-xs text-og-fg-subtle transition hover:bg-og-surface-2 hover:text-og-fg [&::-webkit-details-marker]:hidden">
|
|
1586
|
+
<ArchiveIcon className="size-3" />{" "}
|
|
1587
|
+
{t("browserViewer.hiddenProfilesLength", { length: archivedIdentities.length })}
|
|
1357
1588
|
<ChevronDownIcon className="ml-auto size-3" />
|
|
1358
1589
|
</summary>
|
|
1359
1590
|
{archivedIdentities.map((identity) => (
|
|
@@ -1364,9 +1595,9 @@ function BrowserLaunchMenu(props: {
|
|
|
1364
1595
|
onClick={() => void restore(identity)}
|
|
1365
1596
|
className="flex w-full items-center gap-2 rounded-og-sm px-2 py-2 text-left transition hover:bg-og-surface-2 disabled:opacity-50"
|
|
1366
1597
|
>
|
|
1367
|
-
<RotateCcwIcon className="size-3.5 text-og-muted" />
|
|
1598
|
+
<RotateCcwIcon className="size-3.5 text-og-fg-muted" />
|
|
1368
1599
|
<span className="min-w-0 flex-1 truncate text-og-control text-og-fg">
|
|
1369
|
-
|
|
1600
|
+
{t("browserViewer.restoreName", { name: identity.name })}
|
|
1370
1601
|
</span>
|
|
1371
1602
|
</button>
|
|
1372
1603
|
))}
|
|
@@ -1391,7 +1622,8 @@ function BrowserProfileMenu(props: {
|
|
|
1391
1622
|
) => Promise<boolean>;
|
|
1392
1623
|
onOpenVersion: (identityId: string, baseRevisionId: string) => void;
|
|
1393
1624
|
}) {
|
|
1394
|
-
const
|
|
1625
|
+
const t = useOpenGeniText();
|
|
1626
|
+
const detailsRef = useViewerMenuDismiss();
|
|
1395
1627
|
const nameInputId = useId();
|
|
1396
1628
|
const [name, setName] = useState("");
|
|
1397
1629
|
const attached = props.session?.placement.kind === "attached_device";
|
|
@@ -1422,8 +1654,8 @@ function BrowserProfileMenu(props: {
|
|
|
1422
1654
|
: "unsaved"
|
|
1423
1655
|
: "temporary";
|
|
1424
1656
|
return (
|
|
1425
|
-
<details ref={detailsRef} className="
|
|
1426
|
-
<summary className="flex h-7 max-w-40 cursor-pointer list-none items-center gap-1.5 rounded-og-sm px-2 text-og-xs text-og-muted transition hover:bg-og-surface-2 hover:text-og-fg [&::-webkit-details-marker]:hidden">
|
|
1657
|
+
<details ref={detailsRef} className="min-w-0">
|
|
1658
|
+
<summary className="flex h-7 max-w-40 cursor-pointer list-none items-center gap-1.5 rounded-og-sm px-2 text-og-xs text-og-fg-muted transition hover:bg-og-surface-2 hover:text-og-fg [&::-webkit-details-marker]:hidden">
|
|
1427
1659
|
{props.saving ? (
|
|
1428
1660
|
<LoaderCircleIcon className="size-3 animate-spin" />
|
|
1429
1661
|
) : attached ? (
|
|
@@ -1432,16 +1664,16 @@ function BrowserProfileMenu(props: {
|
|
|
1432
1664
|
<UserRoundIcon className="size-3" />
|
|
1433
1665
|
)}
|
|
1434
1666
|
<span className="truncate">
|
|
1435
|
-
{attached ? props.session?.name : (props.identity?.name ?? "
|
|
1667
|
+
{attached ? props.session?.name : (props.identity?.name ?? t("browserViewer.temporary"))}
|
|
1436
1668
|
</span>
|
|
1437
1669
|
{attached || props.identity ? (
|
|
1438
|
-
<span className="shrink-0 text-og-subtle">· {versionLabel}</span>
|
|
1670
|
+
<span className="shrink-0 text-og-fg-subtle">· {versionLabel}</span>
|
|
1439
1671
|
) : null}
|
|
1440
|
-
<ChevronDownIcon className="size-3 shrink-0 text-og-subtle" />
|
|
1672
|
+
<ChevronDownIcon className="size-3 shrink-0 text-og-fg-subtle" />
|
|
1441
1673
|
</summary>
|
|
1442
|
-
<div className="absolute right-
|
|
1674
|
+
<div className="absolute right-2 top-10 z-40 max-h-[calc(100%-3rem)] w-72 max-w-[calc(100%-1rem)] overflow-y-auto rounded-og-md border border-og-border bg-og-surface-1 p-3 shadow-xl">
|
|
1443
1675
|
<div className="flex items-start gap-2">
|
|
1444
|
-
<span className="grid size-7 shrink-0 place-items-center rounded-og-sm bg-og-surface-2 text-og-muted">
|
|
1676
|
+
<span className="grid size-7 shrink-0 place-items-center rounded-og-sm bg-og-surface-2 text-og-fg-muted">
|
|
1445
1677
|
{attached ? (
|
|
1446
1678
|
<MonitorIcon className="size-3.5" />
|
|
1447
1679
|
) : (
|
|
@@ -1450,31 +1682,35 @@ function BrowserProfileMenu(props: {
|
|
|
1450
1682
|
</span>
|
|
1451
1683
|
<div className="min-w-0">
|
|
1452
1684
|
<p className="truncate text-og-control font-medium text-og-fg">
|
|
1453
|
-
{attached
|
|
1685
|
+
{attached
|
|
1686
|
+
? props.session?.name
|
|
1687
|
+
: (props.identity?.name ?? t("browserViewer.temporaryBrowser"))}
|
|
1454
1688
|
</p>
|
|
1455
|
-
<p className="mt-0.5 text-og-xs leading-4 text-og-subtle">
|
|
1689
|
+
<p className="mt-0.5 text-og-xs leading-4 text-og-fg-subtle">
|
|
1456
1690
|
{attached
|
|
1457
|
-
? "
|
|
1691
|
+
? t("browserViewer.thisSessionDrivesTheExisting")
|
|
1458
1692
|
: props.identity?.status === "archived"
|
|
1459
|
-
? "
|
|
1693
|
+
? t("browserViewer.hiddenFromNewBrowsersThis")
|
|
1460
1694
|
: props.identity
|
|
1461
1695
|
? props.baseRevisionOrdinal
|
|
1462
|
-
?
|
|
1463
|
-
|
|
1464
|
-
|
|
1696
|
+
? t("browserViewer.startedFromVersionBaserevisionordinal", {
|
|
1697
|
+
baseRevisionOrdinal: props.baseRevisionOrdinal,
|
|
1698
|
+
})
|
|
1699
|
+
: t("browserViewer.notSavedYet")
|
|
1700
|
+
: t("browserViewer.thisBrowserIsNotReusable")}
|
|
1465
1701
|
</p>
|
|
1466
1702
|
</div>
|
|
1467
1703
|
</div>
|
|
1468
1704
|
{props.identity && revisions.length > 0 ? (
|
|
1469
1705
|
<div className="mt-3 border-t border-og-border pt-2">
|
|
1470
|
-
<p className="px-1 text-[10px] font-medium uppercase tracking-[0.12em] text-og-subtle">
|
|
1471
|
-
|
|
1706
|
+
<p className="px-1 text-[10px] font-medium uppercase tracking-[0.12em] text-og-fg-subtle">
|
|
1707
|
+
{t("browserViewer.savedVersions2")}
|
|
1472
1708
|
</p>
|
|
1473
1709
|
<div className="mt-1 max-h-40 overflow-y-auto">
|
|
1474
1710
|
{revisions.map((revision) => {
|
|
1475
1711
|
const isDefault = revision.id === props.identity?.defaultRevisionId;
|
|
1476
1712
|
const isCurrent = revision.ordinal === props.baseRevisionOrdinal;
|
|
1477
|
-
const materialization = revisionMaterializationSummary(revision);
|
|
1713
|
+
const materialization = revisionMaterializationSummary(t, revision);
|
|
1478
1714
|
return (
|
|
1479
1715
|
<div
|
|
1480
1716
|
key={revision.id}
|
|
@@ -1483,23 +1719,28 @@ function BrowserProfileMenu(props: {
|
|
|
1483
1719
|
<button
|
|
1484
1720
|
type="button"
|
|
1485
1721
|
disabled={props.saving || props.identity?.status === "archived"}
|
|
1486
|
-
aria-label={
|
|
1722
|
+
aria-label={t("browserViewer.openNameVersionOrdinal", {
|
|
1723
|
+
name: props.identity!.name,
|
|
1724
|
+
ordinal: revision.ordinal,
|
|
1725
|
+
})}
|
|
1487
1726
|
onClick={() => openVersion(props.identity!.id, revision.id)}
|
|
1488
1727
|
className="flex min-w-0 flex-1 items-center gap-2 px-2 py-1.5 text-left disabled:opacity-50"
|
|
1489
1728
|
>
|
|
1490
|
-
<span className="grid size-4 place-items-center text-og-muted">
|
|
1729
|
+
<span className="grid size-4 place-items-center text-og-fg-muted">
|
|
1491
1730
|
{isCurrent ? <CheckIcon className="size-3.5 text-og-accent" /> : null}
|
|
1492
1731
|
</span>
|
|
1493
1732
|
<span className="min-w-0 flex-1">
|
|
1494
1733
|
<span className="block text-og-control text-og-fg">
|
|
1495
|
-
|
|
1734
|
+
{t("browserViewer.versionOrdinal", { ordinal: revision.ordinal })}
|
|
1496
1735
|
</span>
|
|
1497
|
-
<span className="block truncate text-[10px] text-og-subtle">
|
|
1736
|
+
<span className="block truncate text-[10px] text-og-fg-subtle">
|
|
1498
1737
|
{materialization.label}
|
|
1499
1738
|
</span>
|
|
1500
1739
|
</span>
|
|
1501
1740
|
{isCurrent ? (
|
|
1502
|
-
<span className="text-[10px] text-og-subtle">
|
|
1741
|
+
<span className="text-[10px] text-og-fg-subtle">
|
|
1742
|
+
{t("browserViewer.current")}
|
|
1743
|
+
</span>
|
|
1503
1744
|
) : null}
|
|
1504
1745
|
</button>
|
|
1505
1746
|
<button
|
|
@@ -1507,41 +1748,51 @@ function BrowserProfileMenu(props: {
|
|
|
1507
1748
|
disabled={isDefault || props.saving || props.identity?.status === "archived"}
|
|
1508
1749
|
aria-label={
|
|
1509
1750
|
isDefault
|
|
1510
|
-
?
|
|
1511
|
-
|
|
1751
|
+
? t("browserViewer.nameVersionOrdinalIsThe", {
|
|
1752
|
+
name: props.identity!.name,
|
|
1753
|
+
ordinal: revision.ordinal,
|
|
1754
|
+
})
|
|
1755
|
+
: t("browserViewer.useNameVersionOrdinalBy", {
|
|
1756
|
+
name: props.identity!.name,
|
|
1757
|
+
ordinal: revision.ordinal,
|
|
1758
|
+
})
|
|
1759
|
+
}
|
|
1760
|
+
title={
|
|
1761
|
+
isDefault
|
|
1762
|
+
? t("browserViewer.defaultVersion")
|
|
1763
|
+
: t("browserViewer.useByDefault")
|
|
1512
1764
|
}
|
|
1513
|
-
title={isDefault ? "Default version" : "Use by default"}
|
|
1514
1765
|
onClick={() =>
|
|
1515
1766
|
void props.onUpdate(props.identity!, { defaultRevisionId: revision.id })
|
|
1516
1767
|
}
|
|
1517
|
-
className="mr-1 shrink-0 rounded-og-sm px-2 py-1 text-[10px] text-og-subtle transition hover:bg-og-surface-3 hover:text-og-fg disabled:cursor-default disabled:opacity-70"
|
|
1768
|
+
className="mr-1 shrink-0 rounded-og-sm px-2 py-1 text-[10px] text-og-fg-subtle transition hover:bg-og-surface-3 hover:text-og-fg disabled:cursor-default disabled:opacity-70"
|
|
1518
1769
|
>
|
|
1519
|
-
{isDefault ? "
|
|
1770
|
+
{isDefault ? t("browserViewer.default") : t("browserViewer.makeDefault")}
|
|
1520
1771
|
</button>
|
|
1521
1772
|
</div>
|
|
1522
1773
|
);
|
|
1523
1774
|
})}
|
|
1524
1775
|
</div>
|
|
1525
|
-
<p className="mt-1 px-2 text-[10px] leading-4 text-og-subtle">
|
|
1526
|
-
|
|
1527
|
-
copied; a website may still expire or re-verify its own session.
|
|
1776
|
+
<p className="mt-1 px-2 text-[10px] leading-4 text-og-fg-subtle">
|
|
1777
|
+
{t("browserViewer.changingTheDefaultAffectsOnly")}
|
|
1528
1778
|
</p>
|
|
1529
1779
|
</div>
|
|
1530
1780
|
) : props.identity &&
|
|
1531
1781
|
props.history?.identityId === props.identity.id &&
|
|
1532
1782
|
props.history.loading ? (
|
|
1533
|
-
<p className="mt-3 flex items-center gap-1.5 border-t border-og-border px-2 pt-2 text-og-xs text-og-subtle">
|
|
1534
|
-
<LoaderCircleIcon className="size-3 animate-spin" />
|
|
1783
|
+
<p className="mt-3 flex items-center gap-1.5 border-t border-og-border px-2 pt-2 text-og-xs text-og-fg-subtle">
|
|
1784
|
+
<LoaderCircleIcon className="size-3 animate-spin" />{" "}
|
|
1785
|
+
{t("browserViewer.loadingSavedVersions")}
|
|
1535
1786
|
</p>
|
|
1536
1787
|
) : null}
|
|
1537
1788
|
{props.identity && props.authConnections.length > 0 ? (
|
|
1538
1789
|
<div className="mt-3 border-t border-og-border pt-2">
|
|
1539
|
-
<p className="px-1 text-[10px] font-medium uppercase tracking-[0.12em] text-og-subtle">
|
|
1540
|
-
|
|
1790
|
+
<p className="px-1 text-[10px] font-medium uppercase tracking-[0.12em] text-og-fg-subtle">
|
|
1791
|
+
{t("browserViewer.loginHealth")}
|
|
1541
1792
|
</p>
|
|
1542
1793
|
<div className="mt-1 space-y-1">
|
|
1543
1794
|
{props.authConnections.map((connection) => {
|
|
1544
|
-
const health = siteAuthHealth(connection);
|
|
1795
|
+
const health = siteAuthHealth(t, connection);
|
|
1545
1796
|
return (
|
|
1546
1797
|
<div
|
|
1547
1798
|
key={connection.id}
|
|
@@ -1552,7 +1803,7 @@ function BrowserProfileMenu(props: {
|
|
|
1552
1803
|
<span className="block truncate text-og-control text-og-fg">
|
|
1553
1804
|
{connection.name}
|
|
1554
1805
|
</span>
|
|
1555
|
-
<span className="block truncate text-[10px] text-og-subtle">
|
|
1806
|
+
<span className="block truncate text-[10px] text-og-fg-subtle">
|
|
1556
1807
|
{connection.accountLabel} · {health.label}
|
|
1557
1808
|
</span>
|
|
1558
1809
|
</span>
|
|
@@ -1575,7 +1826,9 @@ function BrowserProfileMenu(props: {
|
|
|
1575
1826
|
) : (
|
|
1576
1827
|
<SaveIcon className="size-3.5" />
|
|
1577
1828
|
)}
|
|
1578
|
-
{props.saving
|
|
1829
|
+
{props.saving
|
|
1830
|
+
? t("browserViewer.savingBrowserVersion")
|
|
1831
|
+
: t("browserViewer.saveNewVersion")}
|
|
1579
1832
|
</button>
|
|
1580
1833
|
) : (
|
|
1581
1834
|
<form
|
|
@@ -1585,8 +1838,8 @@ function BrowserProfileMenu(props: {
|
|
|
1585
1838
|
if (name.trim()) void save(name);
|
|
1586
1839
|
}}
|
|
1587
1840
|
>
|
|
1588
|
-
<label className="text-og-xs font-medium text-og-muted" htmlFor={nameInputId}>
|
|
1589
|
-
|
|
1841
|
+
<label className="text-og-xs font-medium text-og-fg-muted" htmlFor={nameInputId}>
|
|
1842
|
+
{t("browserViewer.profileName")}
|
|
1590
1843
|
</label>
|
|
1591
1844
|
<div className="mt-1 flex gap-1.5">
|
|
1592
1845
|
<input
|
|
@@ -1594,31 +1847,31 @@ function BrowserProfileMenu(props: {
|
|
|
1594
1847
|
value={name}
|
|
1595
1848
|
onInput={(event) => setName(event.currentTarget.value)}
|
|
1596
1849
|
maxLength={200}
|
|
1597
|
-
placeholder="
|
|
1598
|
-
className="h-8 min-w-0 flex-1 rounded-og-sm border border-og-border bg-og-bg px-2 text-og-control text-og-fg placeholder:text-og-subtle focus:border-og-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent"
|
|
1850
|
+
placeholder={t("browserViewer.work")}
|
|
1851
|
+
className="h-8 min-w-0 flex-1 rounded-og-sm border border-og-border bg-og-bg px-2 text-og-control text-og-fg placeholder:text-og-fg-subtle focus:border-og-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent"
|
|
1599
1852
|
/>
|
|
1600
1853
|
<button
|
|
1601
1854
|
type="submit"
|
|
1602
1855
|
disabled={!name.trim() || props.saving}
|
|
1603
|
-
className="inline-flex h-8 items-center gap-1 rounded-og-sm bg-og-
|
|
1856
|
+
className="inline-flex h-8 items-center gap-1 rounded-og-sm border border-og-primary-border bg-og-primary text-og-primary-fg px-2.5 text-og-control font-medium transition hover:bg-og-primary-hover disabled:opacity-50"
|
|
1604
1857
|
>
|
|
1605
1858
|
{props.saving ? (
|
|
1606
1859
|
<LoaderCircleIcon className="size-3.5 animate-spin" />
|
|
1607
1860
|
) : (
|
|
1608
1861
|
<SaveIcon className="size-3.5" />
|
|
1609
1862
|
)}
|
|
1610
|
-
|
|
1863
|
+
{t("browserViewer.save")}
|
|
1611
1864
|
</button>
|
|
1612
1865
|
</div>
|
|
1613
1866
|
</form>
|
|
1614
1867
|
)
|
|
1615
1868
|
) : (
|
|
1616
|
-
<p className="mt-3 rounded-og-sm bg-og-surface-2 px-2.5 py-2 text-og-xs text-og-subtle">
|
|
1869
|
+
<p className="mt-3 rounded-og-sm bg-og-surface-2 px-2.5 py-2 text-og-xs text-og-fg-subtle">
|
|
1617
1870
|
{attached
|
|
1618
|
-
? "
|
|
1871
|
+
? t("browserViewer.chromeKeepsThisProfileS")
|
|
1619
1872
|
: props.identity?.status === "archived"
|
|
1620
|
-
? "
|
|
1621
|
-
: "
|
|
1873
|
+
? t("browserViewer.restoreThisProfileBeforeSaving")
|
|
1874
|
+
: t("browserViewer.thisBrowserCannotSaveReusable")}
|
|
1622
1875
|
</p>
|
|
1623
1876
|
)}
|
|
1624
1877
|
{!attached && props.identity ? (
|
|
@@ -1630,19 +1883,21 @@ function BrowserProfileMenu(props: {
|
|
|
1630
1883
|
status: props.identity!.status === "active" ? "archived" : "active",
|
|
1631
1884
|
})
|
|
1632
1885
|
}
|
|
1633
|
-
className="mt-2 flex h-8 w-full items-center justify-center gap-1.5 rounded-og-sm px-3 text-og-control text-og-muted transition hover:bg-og-surface-2 hover:text-og-fg disabled:opacity-50"
|
|
1886
|
+
className="mt-2 flex h-8 w-full items-center justify-center gap-1.5 rounded-og-sm px-3 text-og-control text-og-fg-muted transition hover:bg-og-surface-2 hover:text-og-fg disabled:opacity-50"
|
|
1634
1887
|
>
|
|
1635
1888
|
{props.identity.status === "active" ? (
|
|
1636
1889
|
<ArchiveIcon className="size-3.5" />
|
|
1637
1890
|
) : (
|
|
1638
1891
|
<RotateCcwIcon className="size-3.5" />
|
|
1639
1892
|
)}
|
|
1640
|
-
{props.identity.status === "active"
|
|
1893
|
+
{props.identity.status === "active"
|
|
1894
|
+
? t("browserViewer.hideFromNewBrowsers")
|
|
1895
|
+
: t("browserViewer.restoreProfile")}
|
|
1641
1896
|
</button>
|
|
1642
1897
|
) : null}
|
|
1643
1898
|
{canSave ? (
|
|
1644
|
-
<p className="mt-2 text-[10px] leading-4 text-og-subtle">
|
|
1645
|
-
|
|
1899
|
+
<p className="mt-2 text-[10px] leading-4 text-og-fg-subtle">
|
|
1900
|
+
{t("browserViewer.savingRestartsThisBrowserSave")}
|
|
1646
1901
|
</p>
|
|
1647
1902
|
) : null}
|
|
1648
1903
|
</div>
|
|
@@ -1650,7 +1905,10 @@ function BrowserProfileMenu(props: {
|
|
|
1650
1905
|
);
|
|
1651
1906
|
}
|
|
1652
1907
|
|
|
1653
|
-
function revisionMaterializationSummary(
|
|
1908
|
+
function revisionMaterializationSummary(
|
|
1909
|
+
t: OpenGeniText,
|
|
1910
|
+
revision: BrowserRevision,
|
|
1911
|
+
): { label: string } {
|
|
1654
1912
|
const materializations = revision.components.map((component) => component.materialization);
|
|
1655
1913
|
const placementBound = materializations.find(
|
|
1656
1914
|
(materialization) => materialization.portability === "placement_bound",
|
|
@@ -1658,8 +1916,8 @@ function revisionMaterializationSummary(revision: BrowserRevision): { label: str
|
|
|
1658
1916
|
if (placementBound) {
|
|
1659
1917
|
return {
|
|
1660
1918
|
label: placementBound.reason
|
|
1661
|
-
?
|
|
1662
|
-
: "
|
|
1919
|
+
? t("browserViewer.thisMachineOnlyReason", { reason: placementBound.reason })
|
|
1920
|
+
: t("browserViewer.thisMachineOnly"),
|
|
1663
1921
|
};
|
|
1664
1922
|
}
|
|
1665
1923
|
const providerBound = materializations.find(
|
|
@@ -1667,25 +1925,30 @@ function revisionMaterializationSummary(revision: BrowserRevision): { label: str
|
|
|
1667
1925
|
);
|
|
1668
1926
|
if (providerBound) {
|
|
1669
1927
|
return {
|
|
1670
|
-
label: providerBound.reason
|
|
1928
|
+
label: providerBound.reason
|
|
1929
|
+
? t("browserViewer.providerBoundReason", { reason: providerBound.reason })
|
|
1930
|
+
: t("browserViewer.providerBound"),
|
|
1671
1931
|
};
|
|
1672
1932
|
}
|
|
1673
|
-
return { label: "
|
|
1933
|
+
return { label: t("browserViewer.portableBrowserData") };
|
|
1674
1934
|
}
|
|
1675
1935
|
|
|
1676
|
-
function siteAuthHealth(
|
|
1936
|
+
function siteAuthHealth(
|
|
1937
|
+
t: OpenGeniText,
|
|
1938
|
+
connection: SiteAuthConnection,
|
|
1939
|
+
): {
|
|
1677
1940
|
label: string;
|
|
1678
1941
|
dotClass: string;
|
|
1679
1942
|
} {
|
|
1680
1943
|
switch (connection.verificationState) {
|
|
1681
1944
|
case "verified":
|
|
1682
|
-
return { label: "
|
|
1945
|
+
return { label: t("browserViewer.verified"), dotClass: "bg-og-status-running" };
|
|
1683
1946
|
case "needs_repair":
|
|
1684
|
-
return { label: "
|
|
1947
|
+
return { label: t("browserViewer.signInNeedsAttention"), dotClass: "bg-og-status-waiting" };
|
|
1685
1948
|
case "failed":
|
|
1686
|
-
return { label: "
|
|
1949
|
+
return { label: t("browserViewer.verificationFailed"), dotClass: "bg-og-status-error" };
|
|
1687
1950
|
case "unknown":
|
|
1688
|
-
return { label: "
|
|
1951
|
+
return { label: t("browserViewer.notCheckedYet"), dotClass: "bg-og-muted" };
|
|
1689
1952
|
}
|
|
1690
1953
|
}
|
|
1691
1954
|
|
|
@@ -1695,7 +1958,7 @@ function MenuButton(props: { children: ReactNode; onClick: () => void; disabled?
|
|
|
1695
1958
|
type="button"
|
|
1696
1959
|
onClick={props.onClick}
|
|
1697
1960
|
disabled={props.disabled}
|
|
1698
|
-
className="flex h-7 flex-1 items-center justify-center gap-1 rounded-og-sm px-2 text-og-control text-og-muted transition hover:bg-og-surface-2 hover:text-og-fg disabled:opacity-50"
|
|
1961
|
+
className="flex h-7 flex-1 items-center justify-center gap-1 rounded-og-sm px-2 text-og-control text-og-fg-muted transition hover:bg-og-surface-2 hover:text-og-fg disabled:opacity-50"
|
|
1699
1962
|
>
|
|
1700
1963
|
{props.children}
|
|
1701
1964
|
</button>
|
|
@@ -1711,9 +1974,10 @@ function BrowserTabs(props: {
|
|
|
1711
1974
|
onClose: (id: string) => void;
|
|
1712
1975
|
onOpen: () => void;
|
|
1713
1976
|
}) {
|
|
1977
|
+
const t = useOpenGeniText();
|
|
1714
1978
|
const pages = props.targets.filter((target) => target.kind === "page" || target.kind === "popup");
|
|
1715
1979
|
return (
|
|
1716
|
-
<div className="flex h-9 shrink-0 items-end gap-px overflow-x-auto border-b border-og-border bg-og-surface-
|
|
1980
|
+
<div className="flex h-9 shrink-0 items-end gap-px overflow-x-auto border-b border-og-border bg-og-surface-1 px-1 pt-1">
|
|
1717
1981
|
{pages.map((target) => (
|
|
1718
1982
|
<div
|
|
1719
1983
|
key={target.id}
|
|
@@ -1721,7 +1985,7 @@ function BrowserTabs(props: {
|
|
|
1721
1985
|
"group flex h-8 min-w-24 max-w-48 items-center rounded-t-og-sm border border-b-0 border-transparent px-2",
|
|
1722
1986
|
target.id === props.selectedTargetId
|
|
1723
1987
|
? "border-og-border bg-og-bg text-og-fg"
|
|
1724
|
-
: "text-og-muted hover:bg-og-surface-1",
|
|
1988
|
+
: "text-og-fg-muted hover:bg-og-surface-1",
|
|
1725
1989
|
)}
|
|
1726
1990
|
>
|
|
1727
1991
|
<button
|
|
@@ -1737,7 +2001,7 @@ function BrowserTabs(props: {
|
|
|
1737
2001
|
onClick={() => props.onClose(target.id)}
|
|
1738
2002
|
disabled={props.mutating}
|
|
1739
2003
|
className="ml-1 grid size-4 shrink-0 place-items-center rounded opacity-0 transition hover:bg-og-surface-3 group-hover:opacity-100 focus:opacity-100 disabled:opacity-30"
|
|
1740
|
-
aria-label={
|
|
2004
|
+
aria-label={t("browserViewer.closeTitle", { title: target.title || "tab" })}
|
|
1741
2005
|
>
|
|
1742
2006
|
<XIcon className="size-3" />
|
|
1743
2007
|
</button>
|
|
@@ -1749,8 +2013,8 @@ function BrowserTabs(props: {
|
|
|
1749
2013
|
type="button"
|
|
1750
2014
|
onClick={props.onOpen}
|
|
1751
2015
|
disabled={props.mutating}
|
|
1752
|
-
className="mb-1 grid size-6 shrink-0 place-items-center rounded-og-sm text-og-muted transition hover:bg-og-surface-2 hover:text-og-fg disabled:opacity-40"
|
|
1753
|
-
aria-label="
|
|
2016
|
+
className="mb-1 grid size-6 shrink-0 place-items-center rounded-og-sm text-og-fg-muted transition hover:bg-og-surface-2 hover:text-og-fg disabled:opacity-40"
|
|
2017
|
+
aria-label={t("browserViewer.newTab")}
|
|
1754
2018
|
>
|
|
1755
2019
|
<PlusIcon className="size-3.5" />
|
|
1756
2020
|
</button>
|
|
@@ -1763,34 +2027,74 @@ function BrowserAddressBar(props: {
|
|
|
1763
2027
|
target: BrowserTarget | null;
|
|
1764
2028
|
loading: boolean;
|
|
1765
2029
|
onNavigate: (url: string) => void;
|
|
2030
|
+
onHistory: (direction: "back" | "forward") => Promise<void>;
|
|
1766
2031
|
onReload: () => void;
|
|
1767
2032
|
}) {
|
|
2033
|
+
const t = useOpenGeniText();
|
|
1768
2034
|
const [draft, setDraft] = useState(props.target?.url ?? "");
|
|
1769
2035
|
const focusedRef = useRef(false);
|
|
2036
|
+
const historyPendingRef = useRef(false);
|
|
2037
|
+
const [historyPending, setHistoryPending] = useState(false);
|
|
1770
2038
|
useEffect(() => {
|
|
1771
2039
|
if (!focusedRef.current) setDraft(props.target?.url ?? "");
|
|
1772
2040
|
}, [props.target?.id, props.target?.url]);
|
|
1773
2041
|
const submit = (event: FormEvent) => {
|
|
1774
2042
|
event.preventDefault();
|
|
2043
|
+
if (historyPendingRef.current) return;
|
|
1775
2044
|
const normalized = normalizeBrowserAddress(draft);
|
|
1776
2045
|
if (normalized) props.onNavigate(normalized);
|
|
1777
2046
|
};
|
|
2047
|
+
const navigateHistory = async (direction: "back" | "forward") => {
|
|
2048
|
+
if (!props.target || props.loading || historyPendingRef.current) return;
|
|
2049
|
+
historyPendingRef.current = true;
|
|
2050
|
+
setHistoryPending(true);
|
|
2051
|
+
try {
|
|
2052
|
+
await props.onHistory(direction);
|
|
2053
|
+
} finally {
|
|
2054
|
+
historyPendingRef.current = false;
|
|
2055
|
+
setHistoryPending(false);
|
|
2056
|
+
}
|
|
2057
|
+
};
|
|
1778
2058
|
return (
|
|
1779
2059
|
<form
|
|
1780
2060
|
onSubmit={submit}
|
|
2061
|
+
aria-busy={historyPending || undefined}
|
|
1781
2062
|
className="flex h-10 shrink-0 items-center gap-1.5 border-b border-og-border bg-og-bg px-2"
|
|
1782
2063
|
>
|
|
2064
|
+
{(["back", "forward"] as const).map((direction) => (
|
|
2065
|
+
<button
|
|
2066
|
+
key={direction}
|
|
2067
|
+
type="button"
|
|
2068
|
+
onClick={() => void navigateHistory(direction)}
|
|
2069
|
+
disabled={!props.target || props.loading}
|
|
2070
|
+
aria-disabled={historyPending || undefined}
|
|
2071
|
+
className={cn(
|
|
2072
|
+
"grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted transition hover:bg-og-surface-2 hover:text-og-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent disabled:opacity-35",
|
|
2073
|
+
historyPending && "opacity-50",
|
|
2074
|
+
)}
|
|
2075
|
+
aria-label={direction === "back" ? t("browserViewer.back") : t("browserViewer.forward")}
|
|
2076
|
+
title={direction === "back" ? t("browserViewer.back") : t("browserViewer.forward")}
|
|
2077
|
+
>
|
|
2078
|
+
{direction === "back" ? (
|
|
2079
|
+
<ArrowLeftIcon className="size-3.5" />
|
|
2080
|
+
) : (
|
|
2081
|
+
<ArrowRightIcon className="size-3.5" />
|
|
2082
|
+
)}
|
|
2083
|
+
</button>
|
|
2084
|
+
))}
|
|
1783
2085
|
<button
|
|
1784
2086
|
type="button"
|
|
1785
2087
|
onClick={props.onReload}
|
|
1786
|
-
disabled={!props.target || props.loading}
|
|
1787
|
-
className="grid size-7 place-items-center rounded-og-sm text-og-muted transition hover:bg-og-surface-2 hover:text-og-fg disabled:opacity-35"
|
|
1788
|
-
aria-label="
|
|
2088
|
+
disabled={!props.target || props.loading || historyPending}
|
|
2089
|
+
className="grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted transition hover:bg-og-surface-2 hover:text-og-fg disabled:opacity-35"
|
|
2090
|
+
aria-label={t("browserViewer.reload")}
|
|
1789
2091
|
>
|
|
1790
|
-
<RefreshCwIcon
|
|
2092
|
+
<RefreshCwIcon
|
|
2093
|
+
className={cn("size-3.5", (props.loading || historyPending) && "animate-spin")}
|
|
2094
|
+
/>
|
|
1791
2095
|
</button>
|
|
1792
|
-
<div className="flex h-7 min-w-0 flex-1 items-center gap-2 rounded-og-sm border border-og-border bg-og-surface-
|
|
1793
|
-
<Globe2Icon className="size-3 shrink-0 text-og-subtle" />
|
|
2096
|
+
<div className="flex h-7 min-w-0 flex-1 items-center gap-2 rounded-og-sm border border-og-border bg-og-surface-1 px-2 focus-within:border-og-accent/60">
|
|
2097
|
+
<Globe2Icon className="size-3 shrink-0 text-og-fg-subtle" />
|
|
1794
2098
|
<input
|
|
1795
2099
|
value={draft}
|
|
1796
2100
|
onChange={(event) => setDraft(event.target.value)}
|
|
@@ -1803,14 +2107,15 @@ function BrowserAddressBar(props: {
|
|
|
1803
2107
|
onKeyDown={(event) => {
|
|
1804
2108
|
if (event.key !== "Enter") return;
|
|
1805
2109
|
event.preventDefault();
|
|
2110
|
+
if (historyPendingRef.current) return;
|
|
1806
2111
|
const normalized = normalizeBrowserAddress(draft);
|
|
1807
2112
|
if (normalized) props.onNavigate(normalized);
|
|
1808
2113
|
}}
|
|
1809
2114
|
disabled={!props.target}
|
|
1810
|
-
className="min-w-0 flex-1 bg-transparent text-og-control text-og-fg placeholder:text-og-subtle focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent disabled:opacity-50"
|
|
1811
|
-
aria-label="
|
|
2115
|
+
className="min-w-0 flex-1 bg-transparent text-og-control text-og-fg placeholder:text-og-fg-subtle focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent disabled:opacity-50"
|
|
2116
|
+
aria-label={t("browserViewer.address")}
|
|
1812
2117
|
spellCheck={false}
|
|
1813
|
-
placeholder="
|
|
2118
|
+
placeholder={t("browserViewer.searchOrEnterAddress")}
|
|
1814
2119
|
/>
|
|
1815
2120
|
</div>
|
|
1816
2121
|
</form>
|
|
@@ -1818,56 +2123,108 @@ function BrowserAddressBar(props: {
|
|
|
1818
2123
|
}
|
|
1819
2124
|
|
|
1820
2125
|
function BrowserViewport(props: {
|
|
1821
|
-
|
|
2126
|
+
focusHandoffRef: { current: string | null };
|
|
2127
|
+
focusScope: string;
|
|
2128
|
+
frame: BrowserViewportFrame | null;
|
|
1822
2129
|
connectionState: string;
|
|
1823
2130
|
supportsLiveFrames: boolean;
|
|
1824
2131
|
connectionError: Error | null;
|
|
2132
|
+
controlUnavailable: boolean;
|
|
1825
2133
|
observation: ReturnType<typeof useBrowserSession>["observation"];
|
|
1826
2134
|
mutating: boolean;
|
|
1827
2135
|
clipboardEnabled: boolean;
|
|
2136
|
+
inputBatchAttachment?: {
|
|
2137
|
+
browserSessionId: string;
|
|
2138
|
+
controllerGeneration: string;
|
|
2139
|
+
targetId: string;
|
|
2140
|
+
fencedInputBatches?: true | undefined;
|
|
2141
|
+
focusedInputObservations?: true | undefined;
|
|
2142
|
+
expiresAt: string;
|
|
2143
|
+
} | null;
|
|
1828
2144
|
activityLabel?: string | undefined;
|
|
1829
|
-
onAction: (
|
|
2145
|
+
onAction: (
|
|
2146
|
+
action: BrowserAction | BrowserActionBatch,
|
|
2147
|
+
frame: BrowserFrameInputFence | null,
|
|
2148
|
+
) => Promise<BrowserActionReceipt>;
|
|
1830
2149
|
onReadClipboard: () => Promise<{ text: string }>;
|
|
2150
|
+
onObserveForInput: () => Promise<BrowserObservation>;
|
|
2151
|
+
onSelectFromObservation: (
|
|
2152
|
+
action: BrowserAction,
|
|
2153
|
+
observation: BrowserObservation,
|
|
2154
|
+
) => Promise<BrowserActionReceipt>;
|
|
1831
2155
|
onReconnect: () => void;
|
|
1832
2156
|
reconnectLabel?: string | undefined;
|
|
1833
2157
|
reconnectMessage?: string | undefined;
|
|
1834
2158
|
onError: (cause: unknown) => void;
|
|
1835
2159
|
}) {
|
|
2160
|
+
const t = useOpenGeniText();
|
|
1836
2161
|
const canvasRef = useRef<HTMLCanvasElement | null>(null);
|
|
1837
2162
|
const inputRef = useRef<HTMLTextAreaElement | null>(null);
|
|
2163
|
+
const [selectPopup, setSelectPopup] = useState<{
|
|
2164
|
+
observation: BrowserObservation | null;
|
|
2165
|
+
anchor: { x: number; y: number } | null;
|
|
2166
|
+
} | null>(null);
|
|
2167
|
+
const inputSequenceRef = useRef(0);
|
|
2168
|
+
const dismissSelectPopup = useCallback(() => {
|
|
2169
|
+
inputSequenceRef.current += 1;
|
|
2170
|
+
setSelectPopup({ observation: null, anchor: null });
|
|
2171
|
+
}, []);
|
|
1838
2172
|
const composingRef = useRef(false);
|
|
1839
2173
|
const pointerStartRef = useRef<PointerStart | null>(null);
|
|
1840
2174
|
const lastClickRef = useRef<{
|
|
1841
2175
|
at: number;
|
|
1842
2176
|
x: number;
|
|
1843
2177
|
y: number;
|
|
1844
|
-
frame:
|
|
2178
|
+
frame: BrowserViewportFrame;
|
|
1845
2179
|
} | null>(null);
|
|
1846
2180
|
const wheelRef = useRef<{
|
|
1847
2181
|
x: number;
|
|
1848
2182
|
y: number;
|
|
1849
2183
|
deltaX: number;
|
|
1850
2184
|
deltaY: number;
|
|
1851
|
-
frame:
|
|
2185
|
+
frame: BrowserViewportFrame;
|
|
1852
2186
|
timer: ReturnType<typeof setTimeout> | null;
|
|
1853
2187
|
} | null>(null);
|
|
1854
2188
|
const pendingTextRef = useRef<{
|
|
1855
2189
|
text: string;
|
|
1856
|
-
frame:
|
|
2190
|
+
frame: BrowserViewportFrame | null;
|
|
1857
2191
|
timer: ReturnType<typeof setTimeout>;
|
|
1858
2192
|
} | null>(null);
|
|
1859
2193
|
const actionRef = useRef(props.onAction);
|
|
1860
2194
|
const readClipboardRef = useRef(props.onReadClipboard);
|
|
2195
|
+
const observeInputRef = useRef(props.onObserveForInput);
|
|
1861
2196
|
const errorRef = useRef(props.onError);
|
|
1862
2197
|
const actionTailRef = useRef<Promise<void>>(Promise.resolve());
|
|
1863
2198
|
const actionQueueEpochRef = useRef(0);
|
|
1864
|
-
const
|
|
2199
|
+
const queuedTypingRef = useRef<{
|
|
2200
|
+
actions: BrowserAction[];
|
|
2201
|
+
frame: BrowserFrameInputFence;
|
|
2202
|
+
epoch: number;
|
|
2203
|
+
} | null>(null);
|
|
2204
|
+
const queuedFrameRef = useRef<BrowserViewportFrame | null>(null);
|
|
2205
|
+
const currentFrameRef = useRef<BrowserViewportFrame | null>(props.frame);
|
|
2206
|
+
const paintedFrameRef = useRef<BrowserViewportFrame | null>(null);
|
|
2207
|
+
const [paintedFrame, setPaintedFrame] = useState<BrowserViewportFrame | null>(null);
|
|
1865
2208
|
const decodingFrameRef = useRef(false);
|
|
1866
2209
|
const mountedRef = useRef(true);
|
|
1867
2210
|
actionRef.current = props.onAction;
|
|
1868
2211
|
readClipboardRef.current = props.onReadClipboard;
|
|
2212
|
+
observeInputRef.current = props.onObserveForInput;
|
|
1869
2213
|
errorRef.current = props.onError;
|
|
1870
2214
|
|
|
2215
|
+
const clearBufferedInput = useCallback(() => {
|
|
2216
|
+
dismissSelectPopup();
|
|
2217
|
+
if (wheelRef.current?.timer) clearTimeout(wheelRef.current.timer);
|
|
2218
|
+
if (pendingTextRef.current?.timer) clearTimeout(pendingTextRef.current.timer);
|
|
2219
|
+
wheelRef.current = null;
|
|
2220
|
+
pendingTextRef.current = null;
|
|
2221
|
+
queuedTypingRef.current = null;
|
|
2222
|
+
pointerStartRef.current = null;
|
|
2223
|
+
lastClickRef.current = null;
|
|
2224
|
+
composingRef.current = false;
|
|
2225
|
+
if (inputRef.current) inputRef.current.value = "";
|
|
2226
|
+
}, [dismissSelectPopup]);
|
|
2227
|
+
|
|
1871
2228
|
const paintQueuedFrames = useCallback(() => {
|
|
1872
2229
|
if (decodingFrameRef.current) return;
|
|
1873
2230
|
decodingFrameRef.current = true;
|
|
@@ -1880,15 +2237,22 @@ function BrowserViewport(props: {
|
|
|
1880
2237
|
|
|
1881
2238
|
let objectUrl: string | null = null;
|
|
1882
2239
|
try {
|
|
1883
|
-
const blob = new Blob([frame.data
|
|
2240
|
+
const blob = new Blob([frame.data], {
|
|
1884
2241
|
type: frame.mediaType,
|
|
1885
2242
|
});
|
|
1886
2243
|
if (typeof createImageBitmap === "function") {
|
|
1887
2244
|
const bitmap = await createImageBitmap(blob);
|
|
1888
2245
|
try {
|
|
1889
2246
|
const canvas = canvasRef.current;
|
|
1890
|
-
if (
|
|
2247
|
+
if (
|
|
2248
|
+
mountedRef.current &&
|
|
2249
|
+
canvas &&
|
|
2250
|
+
currentFrameRef.current &&
|
|
2251
|
+
sameBrowserDocument(frame, currentFrameRef.current)
|
|
2252
|
+
) {
|
|
1891
2253
|
paintCanvas(canvas, bitmap, frame.width, frame.height);
|
|
2254
|
+
paintedFrameRef.current = frame;
|
|
2255
|
+
setPaintedFrame(frame);
|
|
1892
2256
|
}
|
|
1893
2257
|
} finally {
|
|
1894
2258
|
bitmap.close();
|
|
@@ -1898,11 +2262,23 @@ function BrowserViewport(props: {
|
|
|
1898
2262
|
objectUrl = URL.createObjectURL(blob);
|
|
1899
2263
|
const image = await loadImage(objectUrl);
|
|
1900
2264
|
const canvas = canvasRef.current;
|
|
1901
|
-
if (
|
|
2265
|
+
if (
|
|
2266
|
+
mountedRef.current &&
|
|
2267
|
+
canvas &&
|
|
2268
|
+
currentFrameRef.current &&
|
|
2269
|
+
sameBrowserDocument(frame, currentFrameRef.current)
|
|
2270
|
+
) {
|
|
1902
2271
|
paintCanvas(canvas, image, frame.width, frame.height);
|
|
2272
|
+
paintedFrameRef.current = frame;
|
|
2273
|
+
setPaintedFrame(frame);
|
|
1903
2274
|
}
|
|
1904
2275
|
} catch (cause) {
|
|
1905
|
-
if (
|
|
2276
|
+
if (
|
|
2277
|
+
mountedRef.current &&
|
|
2278
|
+
currentFrameRef.current &&
|
|
2279
|
+
sameBrowserDocument(frame, currentFrameRef.current)
|
|
2280
|
+
)
|
|
2281
|
+
errorRef.current(cause);
|
|
1906
2282
|
} finally {
|
|
1907
2283
|
if (objectUrl) URL.revokeObjectURL(objectUrl);
|
|
1908
2284
|
}
|
|
@@ -1914,53 +2290,135 @@ function BrowserViewport(props: {
|
|
|
1914
2290
|
})();
|
|
1915
2291
|
}, []);
|
|
1916
2292
|
|
|
1917
|
-
|
|
2293
|
+
useLayoutEffect(() => {
|
|
2294
|
+
const keyboardInput = inputRef.current;
|
|
2295
|
+
const focusHandoff = props.focusHandoffRef;
|
|
1918
2296
|
mountedRef.current = true;
|
|
2297
|
+
if (focusHandoff.current === props.focusScope) {
|
|
2298
|
+
keyboardInput?.focus({ preventScroll: true });
|
|
2299
|
+
}
|
|
2300
|
+
focusHandoff.current = null;
|
|
1919
2301
|
return () => {
|
|
2302
|
+
// Only a same-target replacement may inherit focus the keyboard sink owned.
|
|
2303
|
+
if (document.activeElement === keyboardInput) {
|
|
2304
|
+
focusHandoff.current = props.focusScope;
|
|
2305
|
+
}
|
|
1920
2306
|
mountedRef.current = false;
|
|
2307
|
+
actionQueueEpochRef.current += 1;
|
|
1921
2308
|
queuedFrameRef.current = null;
|
|
2309
|
+
clearBufferedInput();
|
|
1922
2310
|
};
|
|
1923
|
-
}, []);
|
|
2311
|
+
}, [clearBufferedInput, props.focusHandoffRef, props.focusScope]);
|
|
1924
2312
|
|
|
1925
|
-
|
|
1926
|
-
if (!props.frame)
|
|
2313
|
+
useLayoutEffect(() => {
|
|
2314
|
+
if (currentFrameRef.current && !props.frame) {
|
|
2315
|
+
actionQueueEpochRef.current += 1;
|
|
2316
|
+
clearBufferedInput();
|
|
2317
|
+
}
|
|
2318
|
+
currentFrameRef.current = props.frame;
|
|
2319
|
+
if (!props.frame) {
|
|
2320
|
+
queuedFrameRef.current = null;
|
|
2321
|
+
paintedFrameRef.current = null;
|
|
2322
|
+
setPaintedFrame(null);
|
|
2323
|
+
return;
|
|
2324
|
+
}
|
|
1927
2325
|
queuedFrameRef.current = props.frame;
|
|
1928
2326
|
paintQueuedFrames();
|
|
1929
|
-
}, [paintQueuedFrames, props.frame]);
|
|
1930
|
-
|
|
1931
|
-
useEffect(
|
|
1932
|
-
() => () => {
|
|
1933
|
-
if (wheelRef.current?.timer) clearTimeout(wheelRef.current.timer);
|
|
1934
|
-
if (pendingTextRef.current?.timer) clearTimeout(pendingTextRef.current.timer);
|
|
1935
|
-
},
|
|
1936
|
-
[],
|
|
1937
|
-
);
|
|
2327
|
+
}, [clearBufferedInput, paintQueuedFrames, props.frame]);
|
|
1938
2328
|
|
|
1939
2329
|
const enqueue = useCallback(
|
|
1940
2330
|
(
|
|
1941
2331
|
action: BrowserAction,
|
|
1942
|
-
frame:
|
|
2332
|
+
frame: BrowserFrameInputFence | null,
|
|
1943
2333
|
after?: (receipt: BrowserActionReceipt) => Promise<void>,
|
|
2334
|
+
selectAnchor?: { x: number; y: number },
|
|
1944
2335
|
) => {
|
|
2336
|
+
const inputSequence = ++inputSequenceRef.current;
|
|
2337
|
+
setSelectPopup({ observation: null, anchor: null });
|
|
2338
|
+
// Detach image bytes even when the caller supplied a complete painted frame.
|
|
2339
|
+
frame = frame
|
|
2340
|
+
? {
|
|
2341
|
+
browserSessionId: frame.browserSessionId,
|
|
2342
|
+
controllerGeneration: frame.controllerGeneration,
|
|
2343
|
+
targetId: frame.targetId,
|
|
2344
|
+
targetGeneration: frame.targetGeneration,
|
|
2345
|
+
documentGeneration: frame.documentGeneration,
|
|
2346
|
+
frameId: frame.frameId,
|
|
2347
|
+
}
|
|
2348
|
+
: null;
|
|
1945
2349
|
const epoch = actionQueueEpochRef.current;
|
|
2350
|
+
const attachment = props.inputBatchAttachment;
|
|
2351
|
+
const canBatchTyping =
|
|
2352
|
+
action.type === "type" &&
|
|
2353
|
+
!after &&
|
|
2354
|
+
frame &&
|
|
2355
|
+
attachment?.fencedInputBatches === true &&
|
|
2356
|
+
attachment.browserSessionId === frame.browserSessionId &&
|
|
2357
|
+
attachment.controllerGeneration === frame.controllerGeneration &&
|
|
2358
|
+
attachment.targetId === frame.targetId &&
|
|
2359
|
+
Date.parse(attachment.expiresAt) > Date.now();
|
|
2360
|
+
const previous = queuedTypingRef.current;
|
|
2361
|
+
if (
|
|
2362
|
+
canBatchTyping &&
|
|
2363
|
+
frame &&
|
|
2364
|
+
previous &&
|
|
2365
|
+
previous.epoch === epoch &&
|
|
2366
|
+
sameFrameFence(previous.frame, frame) &&
|
|
2367
|
+
previous.actions.length < 16
|
|
2368
|
+
) {
|
|
2369
|
+
// Keep every existing text/input event boundary. Only share transport.
|
|
2370
|
+
previous.actions.push(action);
|
|
2371
|
+
return;
|
|
2372
|
+
}
|
|
2373
|
+
const typing = canBatchTyping && frame ? { actions: [action], frame, epoch } : null;
|
|
2374
|
+
// Every non-typing action is an ordering barrier, including keys and paste.
|
|
2375
|
+
queuedTypingRef.current = typing;
|
|
1946
2376
|
actionTailRef.current = actionTailRef.current
|
|
1947
2377
|
.catch(() => undefined)
|
|
1948
2378
|
.then(async () => {
|
|
1949
|
-
if (epoch !== actionQueueEpochRef.current) return;
|
|
1950
|
-
|
|
2379
|
+
if (!mountedRef.current || epoch !== actionQueueEpochRef.current) return;
|
|
2380
|
+
if (queuedTypingRef.current === typing) queuedTypingRef.current = null;
|
|
2381
|
+
const dispatchedAction =
|
|
2382
|
+
typing && typing.actions.length > 1
|
|
2383
|
+
? { type: "batch" as const, actions: typing.actions, fenceEachAction: true as const }
|
|
2384
|
+
: action;
|
|
2385
|
+
// Read after the epoch guard: a queued render callback can retain every
|
|
2386
|
+
// frame from that render even when its input fence contains no bytes.
|
|
2387
|
+
const receipt = await actionRef.current(dispatchedAction, frame);
|
|
2388
|
+
if (!mountedRef.current || epoch !== actionQueueEpochRef.current) return;
|
|
2389
|
+
// Alt+Down explicitly opens a native dropdown from the keyboard.
|
|
2390
|
+
// Existing controllers return focused-input metadata for clicks only,
|
|
2391
|
+
// so use the ordinary authorized read for this explicit gesture.
|
|
2392
|
+
const keyboardSelect =
|
|
2393
|
+
dispatchedAction.type === "press" && dispatchedAction.key === "Alt+ArrowDown";
|
|
2394
|
+
if ((selectAnchor || keyboardSelect) && inputSequence === inputSequenceRef.current) {
|
|
2395
|
+
const observation = keyboardSelect
|
|
2396
|
+
? await observeInputRef.current()
|
|
2397
|
+
: receipt.observation;
|
|
2398
|
+
if (
|
|
2399
|
+
mountedRef.current &&
|
|
2400
|
+
epoch === actionQueueEpochRef.current &&
|
|
2401
|
+
inputSequence === inputSequenceRef.current &&
|
|
2402
|
+
observation
|
|
2403
|
+
) {
|
|
2404
|
+
setSelectPopup({ observation, anchor: selectAnchor ?? null });
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
1951
2407
|
await after?.(receipt);
|
|
1952
2408
|
})
|
|
1953
2409
|
.catch((cause) => {
|
|
2410
|
+
if (!mountedRef.current || epoch !== actionQueueEpochRef.current) return;
|
|
1954
2411
|
// Do not replay or continue input collected behind a failed request.
|
|
1955
2412
|
actionQueueEpochRef.current += 1;
|
|
2413
|
+
clearBufferedInput();
|
|
1956
2414
|
errorRef.current(cause);
|
|
1957
2415
|
});
|
|
1958
2416
|
},
|
|
1959
|
-
[],
|
|
2417
|
+
[clearBufferedInput, props.inputBatchAttachment],
|
|
1960
2418
|
);
|
|
1961
2419
|
|
|
1962
2420
|
const point = useCallback(
|
|
1963
|
-
(frame:
|
|
2421
|
+
(frame: BrowserViewportFrame, clientX: number, clientY: number) =>
|
|
1964
2422
|
browserPoint(canvasRef.current, frame, clientX, clientY),
|
|
1965
2423
|
[],
|
|
1966
2424
|
);
|
|
@@ -1977,19 +2435,40 @@ function BrowserViewport(props: {
|
|
|
1977
2435
|
lastClickRef.current = null;
|
|
1978
2436
|
}, []);
|
|
1979
2437
|
|
|
2438
|
+
const flushPendingWheel = useCallback(() => {
|
|
2439
|
+
const batch = wheelRef.current;
|
|
2440
|
+
if (!batch) return;
|
|
2441
|
+
if (batch.timer) clearTimeout(batch.timer);
|
|
2442
|
+
wheelRef.current = null;
|
|
2443
|
+
enqueue(
|
|
2444
|
+
{
|
|
2445
|
+
type: "pointer",
|
|
2446
|
+
action: "scroll",
|
|
2447
|
+
x: batch.x,
|
|
2448
|
+
y: batch.y,
|
|
2449
|
+
deltaX: batch.deltaX,
|
|
2450
|
+
deltaY: batch.deltaY,
|
|
2451
|
+
},
|
|
2452
|
+
batch.frame,
|
|
2453
|
+
);
|
|
2454
|
+
}, [enqueue]);
|
|
2455
|
+
|
|
1980
2456
|
const pointerDown = (event: PointerEvent<HTMLCanvasElement>) => {
|
|
1981
|
-
|
|
2457
|
+
const frame = paintedFrameRef.current;
|
|
2458
|
+
if (!frame || event.button !== 0) return;
|
|
1982
2459
|
// Keep the hidden keyboard sink focused after the browser performs the
|
|
1983
2460
|
// pointerdown default action for the canvas. Without preventing that
|
|
1984
2461
|
// default, Chrome immediately moves focus back to the document and all
|
|
1985
2462
|
// subsequent typing/paste is silently lost.
|
|
1986
2463
|
event.preventDefault();
|
|
2464
|
+
dismissSelectPopup();
|
|
2465
|
+
flushPendingWheel();
|
|
1987
2466
|
flushPendingText();
|
|
1988
2467
|
pointerStartRef.current = {
|
|
1989
2468
|
x: event.clientX,
|
|
1990
2469
|
y: event.clientY,
|
|
1991
2470
|
pointerId: event.pointerId,
|
|
1992
|
-
frame
|
|
2471
|
+
frame,
|
|
1993
2472
|
};
|
|
1994
2473
|
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
1995
2474
|
inputRef.current?.focus({ preventScroll: true });
|
|
@@ -2033,13 +2512,22 @@ function BrowserViewport(props: {
|
|
|
2033
2512
|
return;
|
|
2034
2513
|
}
|
|
2035
2514
|
lastClickRef.current = { at: now, x: to.x, y: to.y, frame: start.frame };
|
|
2036
|
-
|
|
2515
|
+
const viewportBounds = canvasRef.current?.parentElement?.getBoundingClientRect();
|
|
2516
|
+
enqueue(
|
|
2517
|
+
{ type: "pointer", action: "click", x: to.x, y: to.y },
|
|
2518
|
+
start.frame,
|
|
2519
|
+
undefined,
|
|
2520
|
+
viewportBounds
|
|
2521
|
+
? { x: event.clientX - viewportBounds.left, y: event.clientY - viewportBounds.top + 8 }
|
|
2522
|
+
: undefined,
|
|
2523
|
+
);
|
|
2037
2524
|
};
|
|
2038
2525
|
|
|
2039
2526
|
const contextMenu = (event: MouseEvent<HTMLCanvasElement>) => {
|
|
2040
2527
|
event.preventDefault();
|
|
2041
|
-
const frame =
|
|
2528
|
+
const frame = paintedFrameRef.current;
|
|
2042
2529
|
if (!frame) return;
|
|
2530
|
+
flushPendingWheel();
|
|
2043
2531
|
flushPendingText();
|
|
2044
2532
|
flushPendingClick();
|
|
2045
2533
|
const at = point(frame, event.clientX, event.clientY);
|
|
@@ -2047,41 +2535,47 @@ function BrowserViewport(props: {
|
|
|
2047
2535
|
};
|
|
2048
2536
|
|
|
2049
2537
|
const wheel = (event: WheelEvent<HTMLCanvasElement>) => {
|
|
2050
|
-
|
|
2538
|
+
dismissSelectPopup();
|
|
2539
|
+
const frame = paintedFrameRef.current;
|
|
2051
2540
|
if (!frame) return;
|
|
2052
2541
|
const at = point(frame, event.clientX, event.clientY);
|
|
2053
2542
|
if (!at) return;
|
|
2054
2543
|
flushPendingText();
|
|
2055
2544
|
flushPendingClick();
|
|
2056
2545
|
event.preventDefault();
|
|
2057
|
-
|
|
2058
|
-
if (
|
|
2546
|
+
let pending = wheelRef.current;
|
|
2547
|
+
if (
|
|
2548
|
+
pending &&
|
|
2549
|
+
(!sameBrowserDocument(pending.frame, frame) ||
|
|
2550
|
+
Math.hypot(pending.x - at.x, pending.y - at.y) > 6)
|
|
2551
|
+
) {
|
|
2552
|
+
flushPendingWheel();
|
|
2553
|
+
pending = null;
|
|
2554
|
+
}
|
|
2059
2555
|
wheelRef.current = {
|
|
2060
2556
|
x: at.x,
|
|
2061
2557
|
y: at.y,
|
|
2062
|
-
deltaX: (pending
|
|
2063
|
-
deltaY: (pending
|
|
2558
|
+
deltaX: (pending?.deltaX ?? 0) + event.deltaX,
|
|
2559
|
+
deltaY: (pending?.deltaY ?? 0) + event.deltaY,
|
|
2064
2560
|
frame,
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
wheelRef.current = null;
|
|
2068
|
-
if (batch)
|
|
2069
|
-
enqueue(
|
|
2070
|
-
{
|
|
2071
|
-
type: "pointer",
|
|
2072
|
-
action: "scroll",
|
|
2073
|
-
x: batch.x,
|
|
2074
|
-
y: batch.y,
|
|
2075
|
-
deltaX: batch.deltaX,
|
|
2076
|
-
deltaY: batch.deltaY,
|
|
2077
|
-
},
|
|
2078
|
-
batch.frame,
|
|
2079
|
-
);
|
|
2080
|
-
}, 45),
|
|
2561
|
+
// Retain the first event's deadline so a continuous gesture keeps moving.
|
|
2562
|
+
timer: pending?.timer ?? setTimeout(flushPendingWheel, 45),
|
|
2081
2563
|
};
|
|
2082
2564
|
};
|
|
2083
2565
|
|
|
2084
2566
|
const keyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {
|
|
2567
|
+
// Candidate selection/editing belongs to the local IME. Forward only the
|
|
2568
|
+
// committed text; Enter must not submit the remote page during composition.
|
|
2569
|
+
// Safari can end composition before keydown while retaining keyCode 229.
|
|
2570
|
+
if (
|
|
2571
|
+
composingRef.current ||
|
|
2572
|
+
event.nativeEvent.isComposing ||
|
|
2573
|
+
event.nativeEvent.keyCode === 229
|
|
2574
|
+
) {
|
|
2575
|
+
return;
|
|
2576
|
+
}
|
|
2577
|
+
dismissSelectPopup();
|
|
2578
|
+
flushPendingWheel();
|
|
2085
2579
|
const command = event.metaKey || event.ctrlKey;
|
|
2086
2580
|
if (
|
|
2087
2581
|
props.clipboardEnabled &&
|
|
@@ -2097,26 +2591,31 @@ function BrowserViewport(props: {
|
|
|
2097
2591
|
event.preventDefault();
|
|
2098
2592
|
flushPendingText();
|
|
2099
2593
|
flushPendingClick();
|
|
2100
|
-
enqueue({ type: "press", key },
|
|
2594
|
+
enqueue({ type: "press", key }, paintedFrameRef.current);
|
|
2101
2595
|
};
|
|
2102
2596
|
|
|
2597
|
+
const finishCopy = useCallback(async () => {
|
|
2598
|
+
const clipboard = await readClipboardRef.current();
|
|
2599
|
+
if (!mountedRef.current) return;
|
|
2600
|
+
if (clipboard.text.length === 0) return;
|
|
2601
|
+
if (!(await copyTextToClipboard(clipboard.text))) {
|
|
2602
|
+
throw new Error(t("browserViewer.browserTextCouldNotBe"));
|
|
2603
|
+
}
|
|
2604
|
+
}, [t]);
|
|
2605
|
+
|
|
2103
2606
|
const copy = (event: ClipboardEvent<HTMLTextAreaElement>) => {
|
|
2104
2607
|
if (!props.clipboardEnabled) return;
|
|
2105
2608
|
event.preventDefault();
|
|
2609
|
+
flushPendingWheel();
|
|
2106
2610
|
flushPendingText();
|
|
2107
2611
|
flushPendingClick();
|
|
2108
|
-
enqueue({ type: "clipboard", operation: "copy" },
|
|
2109
|
-
const clipboard = await readClipboardRef.current();
|
|
2110
|
-
if (clipboard.text.length === 0) return;
|
|
2111
|
-
if (!(await copyTextToClipboard(clipboard.text))) {
|
|
2112
|
-
throw new Error("Browser text could not be copied to the local clipboard");
|
|
2113
|
-
}
|
|
2114
|
-
});
|
|
2612
|
+
enqueue({ type: "clipboard", operation: "copy" }, paintedFrameRef.current, finishCopy);
|
|
2115
2613
|
};
|
|
2116
2614
|
|
|
2117
2615
|
const paste = (event: ClipboardEvent<HTMLTextAreaElement>) => {
|
|
2118
2616
|
if (!props.clipboardEnabled) return;
|
|
2119
2617
|
event.preventDefault();
|
|
2618
|
+
flushPendingWheel();
|
|
2120
2619
|
flushPendingText();
|
|
2121
2620
|
flushPendingClick();
|
|
2122
2621
|
enqueue(
|
|
@@ -2125,16 +2624,18 @@ function BrowserViewport(props: {
|
|
|
2125
2624
|
operation: "paste",
|
|
2126
2625
|
text: event.clipboardData.getData("text/plain"),
|
|
2127
2626
|
},
|
|
2128
|
-
|
|
2627
|
+
paintedFrameRef.current,
|
|
2129
2628
|
);
|
|
2130
2629
|
};
|
|
2131
2630
|
|
|
2132
2631
|
const input = (value: string, nativeComposing = false) => {
|
|
2632
|
+
dismissSelectPopup();
|
|
2133
2633
|
if (composingRef.current || nativeComposing) return;
|
|
2134
2634
|
if (!value) return;
|
|
2635
|
+
flushPendingWheel();
|
|
2135
2636
|
flushPendingClick();
|
|
2136
2637
|
const pending = pendingTextRef.current;
|
|
2137
|
-
if (pending && sameOptionalBrowserFrame(pending.frame,
|
|
2638
|
+
if (pending && sameOptionalBrowserFrame(pending.frame, paintedFrameRef.current)) {
|
|
2138
2639
|
clearTimeout(pending.timer);
|
|
2139
2640
|
pending.text += value;
|
|
2140
2641
|
pending.timer = setTimeout(flushPendingText, 16);
|
|
@@ -2142,7 +2643,7 @@ function BrowserViewport(props: {
|
|
|
2142
2643
|
flushPendingText();
|
|
2143
2644
|
pendingTextRef.current = {
|
|
2144
2645
|
text: value,
|
|
2145
|
-
frame:
|
|
2646
|
+
frame: paintedFrameRef.current,
|
|
2146
2647
|
timer: setTimeout(flushPendingText, 16),
|
|
2147
2648
|
};
|
|
2148
2649
|
}
|
|
@@ -2158,7 +2659,11 @@ function BrowserViewport(props: {
|
|
|
2158
2659
|
input(event.currentTarget.value || event.data);
|
|
2159
2660
|
};
|
|
2160
2661
|
|
|
2161
|
-
const showCanvas =
|
|
2662
|
+
const showCanvas =
|
|
2663
|
+
!props.controlUnavailable &&
|
|
2664
|
+
props.frame !== null &&
|
|
2665
|
+
paintedFrame !== null &&
|
|
2666
|
+
sameBrowserDocument(props.frame, paintedFrame);
|
|
2162
2667
|
return (
|
|
2163
2668
|
<div className="relative min-h-0 flex-1 overflow-hidden bg-black">
|
|
2164
2669
|
<canvas
|
|
@@ -2174,10 +2679,11 @@ function BrowserViewport(props: {
|
|
|
2174
2679
|
}}
|
|
2175
2680
|
onContextMenu={contextMenu}
|
|
2176
2681
|
onWheel={wheel}
|
|
2177
|
-
aria-label="
|
|
2682
|
+
aria-label={t("browserViewer.interactiveBrowserPage")}
|
|
2178
2683
|
/>
|
|
2179
2684
|
<textarea
|
|
2180
2685
|
ref={inputRef}
|
|
2686
|
+
disabled={props.controlUnavailable}
|
|
2181
2687
|
defaultValue=""
|
|
2182
2688
|
onInput={(event) =>
|
|
2183
2689
|
input(event.currentTarget.value, (event.nativeEvent as InputEvent).isComposing)
|
|
@@ -2188,7 +2694,8 @@ function BrowserViewport(props: {
|
|
|
2188
2694
|
onCopy={copy}
|
|
2189
2695
|
onPaste={paste}
|
|
2190
2696
|
className="pointer-events-none absolute left-1/2 top-1/2 size-px resize-none overflow-hidden opacity-0"
|
|
2191
|
-
aria-label="
|
|
2697
|
+
aria-label={t("browserViewer.browserKeyboardInput")}
|
|
2698
|
+
aria-keyshortcuts="Alt+ArrowDown"
|
|
2192
2699
|
autoCapitalize="off"
|
|
2193
2700
|
autoCorrect="off"
|
|
2194
2701
|
spellCheck={false}
|
|
@@ -2199,15 +2706,32 @@ function BrowserViewport(props: {
|
|
|
2199
2706
|
connectionState={props.connectionState}
|
|
2200
2707
|
supportsLiveFrames={props.supportsLiveFrames}
|
|
2201
2708
|
error={props.connectionError}
|
|
2709
|
+
controlUnavailable={props.controlUnavailable}
|
|
2202
2710
|
onAction={(action) => enqueue(action, null)}
|
|
2203
2711
|
onReconnect={props.onReconnect}
|
|
2204
2712
|
reconnectLabel={props.reconnectLabel}
|
|
2205
2713
|
reconnectMessage={props.reconnectMessage}
|
|
2206
2714
|
/>
|
|
2207
2715
|
) : null}
|
|
2716
|
+
{showCanvas ? (
|
|
2717
|
+
<BrowserSelectControl
|
|
2718
|
+
manualFallback={props.inputBatchAttachment?.focusedInputObservations !== true}
|
|
2719
|
+
activation={selectPopup}
|
|
2720
|
+
onDismiss={() => inputRef.current?.focus({ preventScroll: true })}
|
|
2721
|
+
observe={async () => {
|
|
2722
|
+
flushPendingText();
|
|
2723
|
+
flushPendingWheel();
|
|
2724
|
+
await actionTailRef.current;
|
|
2725
|
+
if (!mountedRef.current) throw new Error(t("browserViewer.theBrowserPageChanged"));
|
|
2726
|
+
return await props.onObserveForInput();
|
|
2727
|
+
}}
|
|
2728
|
+
act={props.onSelectFromObservation}
|
|
2729
|
+
/>
|
|
2730
|
+
) : null}
|
|
2208
2731
|
{props.mutating ? (
|
|
2209
2732
|
<div className="pointer-events-none absolute right-3 top-3 flex items-center gap-1.5 rounded-full border border-white/10 bg-black/65 px-2.5 py-1 text-[11px] text-white/80 backdrop-blur">
|
|
2210
|
-
<LoaderCircleIcon className="size-3 animate-spin" />
|
|
2733
|
+
<LoaderCircleIcon className="size-3 animate-spin" />{" "}
|
|
2734
|
+
{props.activityLabel ?? t("browserViewer.acting")}
|
|
2211
2735
|
</div>
|
|
2212
2736
|
) : null}
|
|
2213
2737
|
</div>
|
|
@@ -2219,50 +2743,56 @@ function SemanticBrowserFallback(props: {
|
|
|
2219
2743
|
connectionState: string;
|
|
2220
2744
|
supportsLiveFrames: boolean;
|
|
2221
2745
|
error: Error | null;
|
|
2746
|
+
controlUnavailable: boolean;
|
|
2222
2747
|
onAction: (action: BrowserAction) => void;
|
|
2223
2748
|
onReconnect: () => void;
|
|
2224
2749
|
reconnectLabel?: string | undefined;
|
|
2225
2750
|
reconnectMessage?: string | undefined;
|
|
2226
2751
|
}) {
|
|
2752
|
+
const t = useOpenGeniText();
|
|
2227
2753
|
const controlFailure = interactionControlFailureFromError(props.error);
|
|
2228
|
-
const
|
|
2229
|
-
|
|
2754
|
+
const { controlUnavailable } = props;
|
|
2755
|
+
const generationLoss = Boolean(props.reconnectMessage);
|
|
2230
2756
|
const nodes = semanticNodes(
|
|
2231
2757
|
props.observation?.semantic?.kind === "snapshot" ? props.observation.semantic.roots : [],
|
|
2232
2758
|
);
|
|
2233
2759
|
const interactive = nodes.filter((node) => node.actions.includes("click")).slice(0, 8);
|
|
2234
2760
|
return (
|
|
2235
2761
|
<div className="absolute inset-0 grid place-items-center bg-og-bg p-6">
|
|
2236
|
-
<div className="w-full max-w-md rounded-og-lg border border-og-border bg-og-surface-
|
|
2762
|
+
<div className="w-full max-w-md rounded-og-lg border border-og-border bg-og-surface-1 p-4 shadow-lg">
|
|
2237
2763
|
<div className="flex items-center gap-2">
|
|
2238
2764
|
{props.error ? (
|
|
2239
|
-
<CircleAlertIcon className="size-4 text-og-
|
|
2240
|
-
) :
|
|
2241
|
-
<ZapIcon className="size-4 text-og-muted" />
|
|
2765
|
+
<CircleAlertIcon className="size-4 text-og-danger" />
|
|
2766
|
+
) : props.connectionState === "semantic" ? (
|
|
2767
|
+
<ZapIcon className="size-4 text-og-fg-muted" />
|
|
2242
2768
|
) : (
|
|
2243
|
-
<LoaderCircleIcon className="size-4 animate-spin text-og-muted" />
|
|
2769
|
+
<LoaderCircleIcon className="size-4 animate-spin text-og-fg-muted" />
|
|
2244
2770
|
)}
|
|
2245
2771
|
<p className="text-og-menu font-medium text-og-fg">
|
|
2246
2772
|
{generationLoss
|
|
2247
|
-
? "
|
|
2248
|
-
:
|
|
2249
|
-
? "
|
|
2250
|
-
: props.
|
|
2251
|
-
?
|
|
2252
|
-
|
|
2773
|
+
? t("browserViewer.chromeReconnectedOpenAFresh")
|
|
2774
|
+
: controlUnavailable
|
|
2775
|
+
? t("browserViewer.browserControlsUnavailable")
|
|
2776
|
+
: props.error
|
|
2777
|
+
? props.supportsLiveFrames
|
|
2778
|
+
? t("browserViewer.liveViewDisconnected")
|
|
2779
|
+
: t("browserViewer.browserUnavailable")
|
|
2780
|
+
: props.connectionState === "semantic"
|
|
2781
|
+
? t("browserViewer.semanticBrowser")
|
|
2782
|
+
: browserConnectionLabel(t, props.connectionState)}
|
|
2253
2783
|
</p>
|
|
2254
2784
|
</div>
|
|
2255
2785
|
{props.error || props.reconnectMessage ? (
|
|
2256
|
-
<p className="mt-2 text-og-control leading-5 text-og-muted">
|
|
2786
|
+
<p className="mt-2 text-og-control leading-5 text-og-fg-muted">
|
|
2257
2787
|
{props.reconnectMessage ?? controlFailure?.message ?? props.error?.message}
|
|
2258
2788
|
</p>
|
|
2259
2789
|
) : null}
|
|
2260
|
-
{interactive.length > 0 ? (
|
|
2790
|
+
{interactive.length > 0 && !controlUnavailable ? (
|
|
2261
2791
|
<div className="mt-3 border-t border-og-border pt-3">
|
|
2262
|
-
<p className="mb-2 text-og-xs text-og-subtle">
|
|
2792
|
+
<p className="mb-2 text-og-xs text-og-fg-subtle">
|
|
2263
2793
|
{props.supportsLiveFrames
|
|
2264
|
-
? "
|
|
2265
|
-
: "
|
|
2794
|
+
? t("browserViewer.pageControlsRemainAvailable")
|
|
2795
|
+
: t("browserViewer.availablePageControls")}
|
|
2266
2796
|
</p>
|
|
2267
2797
|
<div className="flex flex-wrap gap-1.5">
|
|
2268
2798
|
{interactive.map((node) => (
|
|
@@ -2283,14 +2813,16 @@ function SemanticBrowserFallback(props: {
|
|
|
2283
2813
|
</div>
|
|
2284
2814
|
</div>
|
|
2285
2815
|
) : null}
|
|
2286
|
-
{props.error &&
|
|
2816
|
+
{props.error && (!generationLoss || props.reconnectLabel) ? (
|
|
2287
2817
|
<button
|
|
2288
2818
|
type="button"
|
|
2289
2819
|
onClick={props.onReconnect}
|
|
2290
|
-
className="mt-3 text-og-control font-medium
|
|
2820
|
+
className="mt-3 text-og-control font-medium og-link"
|
|
2291
2821
|
>
|
|
2292
2822
|
{props.reconnectLabel ??
|
|
2293
|
-
(controlFailure?.retryable === false
|
|
2823
|
+
(controlFailure?.retryable === false
|
|
2824
|
+
? t("browserViewer.tryAgain")
|
|
2825
|
+
: t("browserViewer.reconnect"))}
|
|
2294
2826
|
</button>
|
|
2295
2827
|
) : null}
|
|
2296
2828
|
</div>
|
|
@@ -2303,18 +2835,20 @@ function BrowserStatusBar(props: {
|
|
|
2303
2835
|
profile: BrowserIdentity | null;
|
|
2304
2836
|
target: BrowserTarget | null;
|
|
2305
2837
|
observation: ReturnType<typeof useBrowserSession>["observation"];
|
|
2838
|
+
inputFailure: ReturnType<typeof useBrowserSession>["inputFailure"];
|
|
2306
2839
|
connectionState: string;
|
|
2307
2840
|
refreshing: boolean;
|
|
2308
2841
|
diagnosticsOpen: boolean;
|
|
2309
2842
|
onOpenComputer?: (() => void) | undefined;
|
|
2310
2843
|
onDiagnostics: () => void;
|
|
2311
2844
|
}) {
|
|
2845
|
+
const t = useOpenGeniText();
|
|
2312
2846
|
const errors =
|
|
2313
2847
|
(props.observation?.diagnostics.consoleErrorCount ?? 0) +
|
|
2314
2848
|
(props.observation?.diagnostics.pageErrorCount ?? 0);
|
|
2315
2849
|
const failed = props.observation?.diagnostics.failedRequestCount ?? 0;
|
|
2316
2850
|
return (
|
|
2317
|
-
<div className="flex h-7 shrink-0 items-center gap-2 border-t border-og-border bg-og-surface-
|
|
2851
|
+
<div className="flex h-7 shrink-0 items-center gap-2 border-t border-og-border bg-og-surface-1 px-2 text-og-xs text-og-fg-subtle">
|
|
2318
2852
|
<span
|
|
2319
2853
|
className={cn(
|
|
2320
2854
|
"size-1.5 rounded-full",
|
|
@@ -2325,12 +2859,19 @@ function BrowserStatusBar(props: {
|
|
|
2325
2859
|
/>
|
|
2326
2860
|
<span>
|
|
2327
2861
|
{props.connectionState === "live"
|
|
2328
|
-
? "
|
|
2862
|
+
? t("browserViewer.live")
|
|
2329
2863
|
: props.connectionState === "semantic"
|
|
2330
|
-
? "
|
|
2331
|
-
: browserConnectionLabel(props.connectionState)}
|
|
2864
|
+
? t("browserViewer.semantic")
|
|
2865
|
+
: browserConnectionLabel(t, props.connectionState)}
|
|
2332
2866
|
</span>
|
|
2333
|
-
|
|
2867
|
+
{props.inputFailure ? (
|
|
2868
|
+
<span className="text-og-status-failed">
|
|
2869
|
+
{props.inputFailure.state === "failed"
|
|
2870
|
+
? t("browserViewer.inputFailed")
|
|
2871
|
+
: t("browserViewer.inputResultUnknown")}
|
|
2872
|
+
</span>
|
|
2873
|
+
) : null}
|
|
2874
|
+
<span>{props.profile?.name ?? t("browserViewer.temporaryBrowser")}</span>
|
|
2334
2875
|
<span className="min-w-0 flex-1 truncate">{props.target?.title}</span>
|
|
2335
2876
|
{props.refreshing ? <LoaderCircleIcon className="size-3 animate-spin" /> : null}
|
|
2336
2877
|
{props.onOpenComputer ? (
|
|
@@ -2338,10 +2879,10 @@ function BrowserStatusBar(props: {
|
|
|
2338
2879
|
type="button"
|
|
2339
2880
|
onClick={props.onOpenComputer}
|
|
2340
2881
|
className="flex items-center gap-1 rounded px-1.5 py-0.5 transition hover:bg-og-surface-2 hover:text-og-fg"
|
|
2341
|
-
aria-label="
|
|
2882
|
+
aria-label={t("browserViewer.openThisBrowserWindowIn")}
|
|
2342
2883
|
>
|
|
2343
2884
|
<MonitorIcon className="size-3" />
|
|
2344
|
-
|
|
2885
|
+
{t("browserViewer.desktop")}
|
|
2345
2886
|
</button>
|
|
2346
2887
|
) : null}
|
|
2347
2888
|
<button
|
|
@@ -2355,7 +2896,7 @@ function BrowserStatusBar(props: {
|
|
|
2355
2896
|
)}
|
|
2356
2897
|
>
|
|
2357
2898
|
<BugIcon className="size-3" />
|
|
2358
|
-
{errors + failed > 0 ? errors + failed : "
|
|
2899
|
+
{errors + failed > 0 ? errors + failed : t("browserViewer.debug")}
|
|
2359
2900
|
</button>
|
|
2360
2901
|
</div>
|
|
2361
2902
|
);
|
|
@@ -2383,42 +2924,47 @@ function BrowserDiagnosticsDrawer(props: {
|
|
|
2383
2924
|
onRefresh: () => void;
|
|
2384
2925
|
onClose: () => void;
|
|
2385
2926
|
}) {
|
|
2927
|
+
const t = useOpenGeniText();
|
|
2386
2928
|
const session = props.session;
|
|
2387
2929
|
const diagnostics = props.observation?.diagnostics;
|
|
2388
2930
|
const semanticMode = props.observation?.semantic
|
|
2389
|
-
? "
|
|
2931
|
+
? t("browserViewer.semanticPageStructureAvailable")
|
|
2390
2932
|
: props.observation?.screenshot
|
|
2391
|
-
? "
|
|
2392
|
-
: "
|
|
2933
|
+
? t("browserViewer.visualFallbackInUse")
|
|
2934
|
+
: t("browserViewer.waitingForPageObservation");
|
|
2393
2935
|
return (
|
|
2394
2936
|
<aside
|
|
2395
2937
|
id="browser-diagnostics-drawer"
|
|
2396
2938
|
role="region"
|
|
2397
|
-
aria-label="
|
|
2398
|
-
className="absolute
|
|
2939
|
+
aria-label={t("browserViewer.browserDiagnostics")}
|
|
2940
|
+
className="absolute inset-y-0 right-0 z-40 flex min-h-0 w-full max-w-md flex-col border-l border-og-border bg-og-surface-1 shadow-2xl"
|
|
2399
2941
|
>
|
|
2400
|
-
<div className="flex h-11 shrink-0 items-center gap-2 border-b border-og-border px-3">
|
|
2401
|
-
<BugIcon className="size-4 text-og-muted" />
|
|
2942
|
+
<div className="flex min-h-11 shrink-0 items-center gap-2 border-b border-og-border px-3 py-2">
|
|
2943
|
+
<BugIcon className="size-4 shrink-0 text-og-fg-muted" />
|
|
2402
2944
|
<div className="min-w-0 flex-1">
|
|
2403
|
-
<p className="text-og-control font-semibold text-og-fg">
|
|
2404
|
-
|
|
2405
|
-
|
|
2945
|
+
<p className="text-og-control font-semibold text-og-fg">
|
|
2946
|
+
{t("browserViewer.browserDiagnostics")}
|
|
2947
|
+
</p>
|
|
2948
|
+
<p className="truncate text-og-xs text-og-fg-subtle">
|
|
2949
|
+
{props.target?.title ||
|
|
2950
|
+
shortUrl(props.target?.url ?? "") ||
|
|
2951
|
+
t("browserViewer.currentTab")}
|
|
2406
2952
|
</p>
|
|
2407
2953
|
</div>
|
|
2408
2954
|
<button
|
|
2409
2955
|
type="button"
|
|
2410
2956
|
onClick={props.onRefresh}
|
|
2411
2957
|
disabled={props.state.loading}
|
|
2412
|
-
className="grid size-7 place-items-center rounded-og-sm text-og-muted transition hover:bg-og-surface-2 hover:text-og-fg disabled:opacity-40"
|
|
2413
|
-
aria-label="
|
|
2958
|
+
className="grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted transition hover:bg-og-surface-2 hover:text-og-fg disabled:opacity-40"
|
|
2959
|
+
aria-label={t("browserViewer.refreshBrowserDiagnostics")}
|
|
2414
2960
|
>
|
|
2415
2961
|
<RefreshCwIcon className={cn("size-3.5", props.state.loading && "animate-spin")} />
|
|
2416
2962
|
</button>
|
|
2417
2963
|
<button
|
|
2418
2964
|
type="button"
|
|
2419
2965
|
onClick={props.onClose}
|
|
2420
|
-
className="grid size-7 place-items-center rounded-og-sm text-og-muted transition hover:bg-og-surface-2 hover:text-og-fg"
|
|
2421
|
-
aria-label="
|
|
2966
|
+
className="grid size-7 shrink-0 place-items-center rounded-og-sm text-og-fg-muted transition hover:bg-og-surface-2 hover:text-og-fg"
|
|
2967
|
+
aria-label={t("browserViewer.closeBrowserDiagnostics")}
|
|
2422
2968
|
>
|
|
2423
2969
|
<XIcon className="size-3.5" />
|
|
2424
2970
|
</button>
|
|
@@ -2428,50 +2974,78 @@ function BrowserDiagnosticsDrawer(props: {
|
|
|
2428
2974
|
<section className="border-b border-og-border p-3" aria-labelledby="browser-runtime-title">
|
|
2429
2975
|
<h3
|
|
2430
2976
|
id="browser-runtime-title"
|
|
2431
|
-
className="text-[10px] font-semibold uppercase tracking-[0.14em] text-og-subtle"
|
|
2977
|
+
className="text-[10px] font-semibold uppercase tracking-[0.14em] text-og-fg-subtle"
|
|
2432
2978
|
>
|
|
2433
|
-
|
|
2979
|
+
{t("browserViewer.runtime")}
|
|
2434
2980
|
</h3>
|
|
2435
2981
|
<dl className="mt-2 grid grid-cols-[7rem_minmax(0,1fr)] gap-x-3 gap-y-1.5 text-og-xs">
|
|
2436
|
-
<DiagnosticFact label="Engine" value={browserEngineLabel(session)} />
|
|
2437
|
-
<DiagnosticFact label="Driver" value={session?.driverId ?? "Unavailable"} />
|
|
2438
|
-
<DiagnosticFact label="Placement" value={placementLabel(session ?? undefined)} />
|
|
2439
2982
|
<DiagnosticFact
|
|
2440
|
-
label="
|
|
2983
|
+
label={t("browserViewer.engine")}
|
|
2984
|
+
value={browserEngineLabel(t, session)}
|
|
2985
|
+
/>
|
|
2986
|
+
<DiagnosticFact
|
|
2987
|
+
label={t("browserViewer.driver")}
|
|
2988
|
+
value={session?.driverId ?? t("browserViewer.unavailable")}
|
|
2989
|
+
/>
|
|
2990
|
+
<DiagnosticFact
|
|
2991
|
+
label={t("browserViewer.placement")}
|
|
2992
|
+
value={placementLabel(t, session ?? undefined)}
|
|
2993
|
+
/>
|
|
2994
|
+
<DiagnosticFact
|
|
2995
|
+
label={t("browserViewer.profile")}
|
|
2441
2996
|
value={
|
|
2442
2997
|
props.profile
|
|
2443
2998
|
? `${props.profile.name}${props.baseRevisionOrdinal ? ` · v${props.baseRevisionOrdinal}` : ""}`
|
|
2444
|
-
: "
|
|
2999
|
+
: t("browserViewer.temporary")
|
|
2445
3000
|
}
|
|
2446
3001
|
/>
|
|
2447
3002
|
<DiagnosticFact
|
|
2448
|
-
label="
|
|
2449
|
-
value={shortGeneration(session?.controller?.controllerGeneration)}
|
|
3003
|
+
label={t("browserViewer.controller")}
|
|
3004
|
+
value={shortGeneration(t, session?.controller?.controllerGeneration)}
|
|
2450
3005
|
/>
|
|
2451
3006
|
<DiagnosticFact
|
|
2452
|
-
label="
|
|
2453
|
-
value={
|
|
3007
|
+
label={t("browserViewer.network")}
|
|
3008
|
+
value={
|
|
3009
|
+
session?.networkRouteId
|
|
3010
|
+
? t("browserViewer.customRoute")
|
|
3011
|
+
: t("browserViewer.placementDefault")
|
|
3012
|
+
}
|
|
2454
3013
|
/>
|
|
2455
|
-
<DiagnosticFact label="
|
|
3014
|
+
<DiagnosticFact label={t("browserViewer.observation")} value={semanticMode} />
|
|
2456
3015
|
</dl>
|
|
2457
3016
|
</section>
|
|
2458
3017
|
|
|
2459
3018
|
<section className="border-b border-og-border p-3" aria-labelledby="browser-page-title">
|
|
2460
3019
|
<h3
|
|
2461
3020
|
id="browser-page-title"
|
|
2462
|
-
className="text-[10px] font-semibold uppercase tracking-[0.14em] text-og-subtle"
|
|
3021
|
+
className="text-[10px] font-semibold uppercase tracking-[0.14em] text-og-fg-subtle"
|
|
2463
3022
|
>
|
|
2464
|
-
|
|
3023
|
+
{t("browserViewer.tabDiagnostics")}
|
|
2465
3024
|
</h3>
|
|
3025
|
+
<p className="mt-1 text-og-xs text-og-fg-subtle">
|
|
3026
|
+
{t("browserViewer.includesEarlierPagesInThis")}
|
|
3027
|
+
</p>
|
|
2466
3028
|
<dl className="mt-2 grid grid-cols-2 gap-2">
|
|
2467
|
-
<DiagnosticCount
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
3029
|
+
<DiagnosticCount
|
|
3030
|
+
label={t("browserViewer.consoleErrors")}
|
|
3031
|
+
value={diagnostics?.consoleErrorCount}
|
|
3032
|
+
/>
|
|
3033
|
+
<DiagnosticCount
|
|
3034
|
+
label={t("browserViewer.pageErrors")}
|
|
3035
|
+
value={diagnostics?.pageErrorCount}
|
|
3036
|
+
/>
|
|
3037
|
+
<DiagnosticCount
|
|
3038
|
+
label={t("browserViewer.failedRequests")}
|
|
3039
|
+
value={diagnostics?.failedRequestCount}
|
|
3040
|
+
/>
|
|
3041
|
+
<DiagnosticCount
|
|
3042
|
+
label={t("browserViewer.downloads")}
|
|
3043
|
+
value={diagnostics?.downloadCount}
|
|
3044
|
+
/>
|
|
2471
3045
|
</dl>
|
|
2472
3046
|
{session?.failureCode ? (
|
|
2473
|
-
<p className="mt-2 rounded-og-sm border border-og-status-error/30 bg-og-status-error/5 px-2.5 py-2 text-og-xs text-og-
|
|
2474
|
-
|
|
3047
|
+
<p className="mt-2 rounded-og-sm border border-og-status-error/30 bg-og-status-error/5 px-2.5 py-2 text-og-xs text-og-danger">
|
|
3048
|
+
{t("browserViewer.browserStateFailurecode", { failureCode: session.failureCode })}
|
|
2475
3049
|
</p>
|
|
2476
3050
|
) : null}
|
|
2477
3051
|
</section>
|
|
@@ -2492,27 +3066,28 @@ function BrowserDiagnosticsDrawer(props: {
|
|
|
2492
3066
|
<div className="flex items-center justify-between gap-2">
|
|
2493
3067
|
<h3
|
|
2494
3068
|
id="browser-events-title"
|
|
2495
|
-
className="text-[10px] font-semibold uppercase tracking-[0.14em] text-og-subtle"
|
|
3069
|
+
className="text-[10px] font-semibold uppercase tracking-[0.14em] text-og-fg-subtle"
|
|
2496
3070
|
>
|
|
2497
|
-
|
|
3071
|
+
{t("browserViewer.recentEvents")}
|
|
2498
3072
|
</h3>
|
|
2499
3073
|
{props.state.batch?.truncated ? (
|
|
2500
|
-
<span className="text-[10px] text-og-subtle">
|
|
3074
|
+
<span className="text-[10px] text-og-fg-subtle">{t("browserViewer.newest100")}</span>
|
|
2501
3075
|
) : null}
|
|
2502
3076
|
</div>
|
|
2503
3077
|
{props.state.loading && !props.state.batch ? (
|
|
2504
|
-
<div className="flex items-center gap-2 py-6 text-og-control text-og-muted">
|
|
2505
|
-
<LoaderCircleIcon className="size-3.5 animate-spin" />
|
|
3078
|
+
<div className="flex items-center gap-2 py-6 text-og-control text-og-fg-muted">
|
|
3079
|
+
<LoaderCircleIcon className="size-3.5 animate-spin" />{" "}
|
|
3080
|
+
{t("browserViewer.loadingDiagnostics")}
|
|
2506
3081
|
</div>
|
|
2507
3082
|
) : props.state.error ? (
|
|
2508
3083
|
<div className="py-5">
|
|
2509
|
-
<p className="text-og-control text-og-
|
|
3084
|
+
<p className="text-og-control text-og-danger">{props.state.error.message}</p>
|
|
2510
3085
|
<button
|
|
2511
3086
|
type="button"
|
|
2512
3087
|
onClick={props.onRefresh}
|
|
2513
|
-
className="mt-2 text-og-control font-medium
|
|
3088
|
+
className="mt-2 text-og-control font-medium og-link"
|
|
2514
3089
|
>
|
|
2515
|
-
|
|
3090
|
+
{t("browserViewer.tryAgain")}
|
|
2516
3091
|
</button>
|
|
2517
3092
|
</div>
|
|
2518
3093
|
) : props.state.batch?.entries.length ? (
|
|
@@ -2522,22 +3097,22 @@ function BrowserDiagnosticsDrawer(props: {
|
|
|
2522
3097
|
key={entry.sequence}
|
|
2523
3098
|
className="rounded-og-sm border border-og-border bg-og-bg p-2.5"
|
|
2524
3099
|
>
|
|
2525
|
-
<div className="flex items-center gap-2 text-[10px] text-og-subtle">
|
|
3100
|
+
<div className="flex items-center gap-2 text-[10px] text-og-fg-subtle">
|
|
2526
3101
|
<span
|
|
2527
3102
|
className={cn(
|
|
2528
3103
|
"font-semibold uppercase tracking-wide",
|
|
2529
3104
|
diagnosticTone(entry.level),
|
|
2530
3105
|
)}
|
|
2531
3106
|
>
|
|
2532
|
-
{diagnosticKindLabel(entry.kind)}
|
|
3107
|
+
{diagnosticKindLabel(t, entry.kind)}
|
|
2533
3108
|
</span>
|
|
2534
|
-
<span className="ml-auto">{formatDiagnosticTime(entry.occurredAt)}</span>
|
|
3109
|
+
<span className="ml-auto">{formatDiagnosticTime(t, entry.occurredAt)}</span>
|
|
2535
3110
|
</div>
|
|
2536
3111
|
<p className="mt-1 whitespace-pre-wrap break-words text-og-xs leading-5 text-og-fg">
|
|
2537
3112
|
{entry.message}
|
|
2538
3113
|
</p>
|
|
2539
3114
|
{entry.url || entry.filename || entry.method || entry.status ? (
|
|
2540
|
-
<p className="mt-1 truncate font-og-mono text-[10px] text-og-subtle">
|
|
3115
|
+
<p className="mt-1 truncate font-og-mono text-[10px] text-og-fg-subtle">
|
|
2541
3116
|
{[entry.method, entry.status, entry.filename, entry.url]
|
|
2542
3117
|
.filter((value) => value !== null)
|
|
2543
3118
|
.join(" · ")}
|
|
@@ -2547,7 +3122,9 @@ function BrowserDiagnosticsDrawer(props: {
|
|
|
2547
3122
|
))}
|
|
2548
3123
|
</ol>
|
|
2549
3124
|
) : (
|
|
2550
|
-
<p className="py-6 text-og-control text-og-muted">
|
|
3125
|
+
<p className="py-6 text-og-control text-og-fg-muted">
|
|
3126
|
+
{t("browserViewer.noDiagnosticsForThisTab")}
|
|
3127
|
+
</p>
|
|
2551
3128
|
)}
|
|
2552
3129
|
</section>
|
|
2553
3130
|
</div>
|
|
@@ -2568,6 +3145,7 @@ function BrowserDownloadsPanel(props: {
|
|
|
2568
3145
|
) => Promise<BrowserDownloadSaveResponse>;
|
|
2569
3146
|
onRefresh: () => void;
|
|
2570
3147
|
}) {
|
|
3148
|
+
const t = useOpenGeniText();
|
|
2571
3149
|
const [paths, setPaths] = useState<Record<string, string>>({});
|
|
2572
3150
|
const [overwrite, setOverwrite] = useState<Record<string, boolean>>({});
|
|
2573
3151
|
const [savedPaths, setSavedPaths] = useState<Record<string, string>>({});
|
|
@@ -2586,7 +3164,8 @@ function BrowserDownloadsPanel(props: {
|
|
|
2586
3164
|
.catch((cause) => {
|
|
2587
3165
|
setErrors((current) => ({
|
|
2588
3166
|
...current,
|
|
2589
|
-
[download.id]:
|
|
3167
|
+
[download.id]:
|
|
3168
|
+
cause instanceof Error ? cause.message : t("browserViewer.couldNotSaveThisDownload"),
|
|
2590
3169
|
}));
|
|
2591
3170
|
});
|
|
2592
3171
|
};
|
|
@@ -2594,35 +3173,38 @@ function BrowserDownloadsPanel(props: {
|
|
|
2594
3173
|
return (
|
|
2595
3174
|
<section className="border-b border-og-border p-3" aria-labelledby="browser-downloads-title">
|
|
2596
3175
|
<div className="flex items-center gap-2">
|
|
2597
|
-
<DownloadIcon className="size-3.5 text-og-muted" />
|
|
3176
|
+
<DownloadIcon className="size-3.5 text-og-fg-muted" />
|
|
2598
3177
|
<h3
|
|
2599
3178
|
id="browser-downloads-title"
|
|
2600
|
-
className="text-[10px] font-semibold uppercase tracking-[0.14em] text-og-subtle"
|
|
3179
|
+
className="text-[10px] font-semibold uppercase tracking-[0.14em] text-og-fg-subtle"
|
|
2601
3180
|
>
|
|
2602
|
-
|
|
3181
|
+
{t("browserViewer.downloads")}
|
|
2603
3182
|
</h3>
|
|
2604
3183
|
{props.refreshing ? (
|
|
2605
|
-
<LoaderCircleIcon className="ml-auto size-3 animate-spin text-og-muted" />
|
|
3184
|
+
<LoaderCircleIcon className="ml-auto size-3 animate-spin text-og-fg-muted" />
|
|
2606
3185
|
) : null}
|
|
2607
3186
|
</div>
|
|
2608
3187
|
|
|
2609
3188
|
{props.loading ? (
|
|
2610
|
-
<div className="flex items-center gap-2 py-5 text-og-control text-og-muted">
|
|
2611
|
-
<LoaderCircleIcon className="size-3.5 animate-spin" />
|
|
3189
|
+
<div className="flex items-center gap-2 py-5 text-og-control text-og-fg-muted">
|
|
3190
|
+
<LoaderCircleIcon className="size-3.5 animate-spin" />{" "}
|
|
3191
|
+
{t("browserViewer.loadingDownloads")}
|
|
2612
3192
|
</div>
|
|
2613
3193
|
) : props.error ? (
|
|
2614
3194
|
<div className="py-4">
|
|
2615
|
-
<p className="text-og-control text-og-
|
|
3195
|
+
<p className="text-og-control text-og-danger">{props.error.message}</p>
|
|
2616
3196
|
<button
|
|
2617
3197
|
type="button"
|
|
2618
3198
|
onClick={props.onRefresh}
|
|
2619
|
-
className="mt-2 text-og-control font-medium
|
|
3199
|
+
className="mt-2 text-og-control font-medium og-link"
|
|
2620
3200
|
>
|
|
2621
|
-
|
|
3201
|
+
{t("browserViewer.tryAgain")}
|
|
2622
3202
|
</button>
|
|
2623
3203
|
</div>
|
|
2624
3204
|
) : props.downloads.length === 0 ? (
|
|
2625
|
-
<p className="py-4 text-og-control text-og-muted">
|
|
3205
|
+
<p className="py-4 text-og-control text-og-fg-muted">
|
|
3206
|
+
{t("browserViewer.noFilesDownloadedYet")}
|
|
3207
|
+
</p>
|
|
2626
3208
|
) : (
|
|
2627
3209
|
<ol className="mt-2 space-y-2">
|
|
2628
3210
|
{props.downloads.map((download) => {
|
|
@@ -2635,9 +3217,9 @@ function BrowserDownloadsPanel(props: {
|
|
|
2635
3217
|
className="rounded-og-sm border border-og-border bg-og-bg p-2.5"
|
|
2636
3218
|
>
|
|
2637
3219
|
<div className="flex min-w-0 items-start gap-2">
|
|
2638
|
-
<span className="mt-0.5 grid size-6 shrink-0 place-items-center rounded bg-og-surface-2 text-og-muted">
|
|
3220
|
+
<span className="mt-0.5 grid size-6 shrink-0 place-items-center rounded bg-og-surface-2 text-og-fg-muted">
|
|
2639
3221
|
{isSaved ? (
|
|
2640
|
-
<FileCheck2Icon className="size-3.5 text-og-status-
|
|
3222
|
+
<FileCheck2Icon className="size-3.5 text-og-status-idle" />
|
|
2641
3223
|
) : (
|
|
2642
3224
|
<DownloadIcon className="size-3.5" />
|
|
2643
3225
|
)}
|
|
@@ -2649,8 +3231,8 @@ function BrowserDownloadsPanel(props: {
|
|
|
2649
3231
|
>
|
|
2650
3232
|
{download.filename}
|
|
2651
3233
|
</p>
|
|
2652
|
-
<p className="mt-0.5 text-[10px] text-og-subtle">
|
|
2653
|
-
{downloadStatusLabel(download)}
|
|
3234
|
+
<p className="mt-0.5 text-[10px] text-og-fg-subtle">
|
|
3235
|
+
{downloadStatusLabel(t, download)}
|
|
2654
3236
|
</p>
|
|
2655
3237
|
</div>
|
|
2656
3238
|
</div>
|
|
@@ -2670,8 +3252,10 @@ function BrowserDownloadsPanel(props: {
|
|
|
2670
3252
|
if (event.key === "Enter") save(download);
|
|
2671
3253
|
}}
|
|
2672
3254
|
disabled={isSaving}
|
|
2673
|
-
aria-label={
|
|
2674
|
-
|
|
3255
|
+
aria-label={t("browserViewer.workspacePathForFilename", {
|
|
3256
|
+
filename: download.filename,
|
|
3257
|
+
})}
|
|
3258
|
+
className="h-7 min-w-0 flex-1 rounded-og-sm border border-og-border bg-og-surface-1 px-2 font-og-mono text-[10px] text-og-fg transition focus:border-og-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent disabled:opacity-50"
|
|
2675
3259
|
/>
|
|
2676
3260
|
<button
|
|
2677
3261
|
type="button"
|
|
@@ -2689,15 +3273,15 @@ function BrowserDownloadsPanel(props: {
|
|
|
2689
3273
|
<SaveIcon className="size-3" />
|
|
2690
3274
|
)}
|
|
2691
3275
|
{isSaving
|
|
2692
|
-
? "
|
|
3276
|
+
? t("browserViewer.saving")
|
|
2693
3277
|
: isSaved
|
|
2694
|
-
? "
|
|
3278
|
+
? t("browserViewer.saved")
|
|
2695
3279
|
: overwrite[download.id]
|
|
2696
|
-
? "
|
|
2697
|
-
: "
|
|
3280
|
+
? t("browserViewer.replace")
|
|
3281
|
+
: t("browserViewer.save")}
|
|
2698
3282
|
</button>
|
|
2699
3283
|
</div>
|
|
2700
|
-
<label className="mt-1.5 flex w-fit items-center gap-1.5 text-[10px] text-og-subtle">
|
|
3284
|
+
<label className="mt-1.5 flex w-fit items-center gap-1.5 text-[10px] text-og-fg-subtle">
|
|
2701
3285
|
<input
|
|
2702
3286
|
type="checkbox"
|
|
2703
3287
|
checked={overwrite[download.id] ?? false}
|
|
@@ -2711,10 +3295,10 @@ function BrowserDownloadsPanel(props: {
|
|
|
2711
3295
|
disabled={isSaving}
|
|
2712
3296
|
className="size-3 accent-og-accent"
|
|
2713
3297
|
/>
|
|
2714
|
-
|
|
3298
|
+
{t("browserViewer.replaceAnExistingWorkspaceFile")}
|
|
2715
3299
|
</label>
|
|
2716
3300
|
{errors[download.id] ? (
|
|
2717
|
-
<p className="mt-1.5 break-words text-[10px] text-og-
|
|
3301
|
+
<p className="mt-1.5 break-words text-[10px] text-og-danger">
|
|
2718
3302
|
{errors[download.id]}
|
|
2719
3303
|
</p>
|
|
2720
3304
|
) : null}
|
|
@@ -2729,17 +3313,20 @@ function BrowserDownloadsPanel(props: {
|
|
|
2729
3313
|
);
|
|
2730
3314
|
}
|
|
2731
3315
|
|
|
2732
|
-
function downloadStatusLabel(download: BrowserDownload): string {
|
|
3316
|
+
function downloadStatusLabel(t: OpenGeniText, download: BrowserDownload): string {
|
|
2733
3317
|
if (download.status === "completed") return formatBytes(download.receivedBytes);
|
|
2734
3318
|
if (download.status === "in_progress") {
|
|
2735
3319
|
const received = formatBytes(download.receivedBytes);
|
|
2736
3320
|
return download.totalBytes === null
|
|
2737
|
-
?
|
|
2738
|
-
:
|
|
3321
|
+
? t("browserViewer.downloadingReceived", { received })
|
|
3322
|
+
: t("browserViewer.downloadingReceivedOfBytes", {
|
|
3323
|
+
received,
|
|
3324
|
+
bytes: formatBytes(download.totalBytes),
|
|
3325
|
+
});
|
|
2739
3326
|
}
|
|
2740
|
-
if (download.status === "cancelled") return "
|
|
2741
|
-
if (download.status === "unavailable") return "
|
|
2742
|
-
return "
|
|
3327
|
+
if (download.status === "cancelled") return t("browserViewer.cancelled");
|
|
3328
|
+
if (download.status === "unavailable") return t("browserViewer.noLongerAvailable");
|
|
3329
|
+
return t("browserViewer.downloadFailed");
|
|
2743
3330
|
}
|
|
2744
3331
|
|
|
2745
3332
|
function defaultDownloadDestination(download: BrowserDownload): string {
|
|
@@ -2757,7 +3344,7 @@ function defaultDownloadDestination(download: BrowserDownload): string {
|
|
|
2757
3344
|
function DiagnosticFact(props: { label: string; value: string }) {
|
|
2758
3345
|
return (
|
|
2759
3346
|
<>
|
|
2760
|
-
<dt className="text-og-subtle">{props.label}</dt>
|
|
3347
|
+
<dt className="text-og-fg-subtle">{props.label}</dt>
|
|
2761
3348
|
<dd className="min-w-0 truncate text-og-fg" title={props.value}>
|
|
2762
3349
|
{props.value}
|
|
2763
3350
|
</dd>
|
|
@@ -2765,64 +3352,68 @@ function DiagnosticFact(props: { label: string; value: string }) {
|
|
|
2765
3352
|
);
|
|
2766
3353
|
}
|
|
2767
3354
|
|
|
2768
|
-
function DiagnosticCount(props: { label: string; value: number }) {
|
|
3355
|
+
function DiagnosticCount(props: { label: string; value: number | undefined }) {
|
|
3356
|
+
const t = useOpenGeniText();
|
|
2769
3357
|
return (
|
|
2770
3358
|
<div className="rounded-og-sm border border-og-border bg-og-bg px-2.5 py-2">
|
|
2771
|
-
<dt className="text-[10px] text-og-subtle">{props.label}</dt>
|
|
3359
|
+
<dt className="text-[10px] text-og-fg-subtle">{props.label}</dt>
|
|
2772
3360
|
<dd
|
|
2773
3361
|
className={cn(
|
|
2774
3362
|
"mt-0.5 text-og-sm font-semibold",
|
|
2775
|
-
props.value ? "text-og-fg" : "text-og-muted",
|
|
3363
|
+
props.value ? "text-og-fg" : "text-og-fg-muted",
|
|
2776
3364
|
)}
|
|
2777
3365
|
>
|
|
2778
|
-
{props.value}
|
|
3366
|
+
{props.value ?? t("browserViewer.unavailable")}
|
|
2779
3367
|
</dd>
|
|
2780
3368
|
</div>
|
|
2781
3369
|
);
|
|
2782
3370
|
}
|
|
2783
3371
|
|
|
2784
|
-
function browserEngineLabel(session: BrowserSession | null): string {
|
|
2785
|
-
if (!session) return "
|
|
3372
|
+
function browserEngineLabel(t: OpenGeniText, session: BrowserSession | null): string {
|
|
3373
|
+
if (!session) return t("browserViewer.unavailable");
|
|
2786
3374
|
const version = session.engineVersion ? ` ${session.engineVersion}` : "";
|
|
2787
3375
|
return `${session.engine}${version} · ${session.headless ? "headless" : "headed"}`;
|
|
2788
3376
|
}
|
|
2789
3377
|
|
|
2790
|
-
function shortGeneration(value: string | null | undefined): string {
|
|
2791
|
-
if (!value) return "
|
|
3378
|
+
function shortGeneration(t: OpenGeniText, value: string | null | undefined): string {
|
|
3379
|
+
if (!value) return t("browserViewer.unavailable");
|
|
2792
3380
|
return value.length > 16 ? `${value.slice(0, 8)}…${value.slice(-6)}` : value;
|
|
2793
3381
|
}
|
|
2794
3382
|
|
|
2795
|
-
function diagnosticKindLabel(
|
|
3383
|
+
function diagnosticKindLabel(
|
|
3384
|
+
t: OpenGeniText,
|
|
3385
|
+
kind: BrowserDiagnosticBatch["entries"][number]["kind"],
|
|
3386
|
+
): string {
|
|
2796
3387
|
switch (kind) {
|
|
2797
3388
|
case "console":
|
|
2798
|
-
return "
|
|
3389
|
+
return t("browserViewer.console");
|
|
2799
3390
|
case "page_error":
|
|
2800
|
-
return "
|
|
3391
|
+
return t("browserViewer.pageError");
|
|
2801
3392
|
case "failed_request":
|
|
2802
|
-
return "
|
|
3393
|
+
return t("browserViewer.request");
|
|
2803
3394
|
case "download":
|
|
2804
|
-
return "
|
|
3395
|
+
return t("browserViewer.download");
|
|
2805
3396
|
}
|
|
2806
3397
|
}
|
|
2807
3398
|
|
|
2808
3399
|
function diagnosticTone(level: BrowserDiagnosticBatch["entries"][number]["level"]): string {
|
|
2809
|
-
if (level === "error") return "text-og-
|
|
3400
|
+
if (level === "error") return "text-og-danger";
|
|
2810
3401
|
if (level === "warning") return "text-og-status-waiting";
|
|
2811
|
-
return "text-og-muted";
|
|
3402
|
+
return "text-og-fg-muted";
|
|
2812
3403
|
}
|
|
2813
3404
|
|
|
2814
|
-
function formatDiagnosticTime(value: string): string {
|
|
3405
|
+
function formatDiagnosticTime(t: OpenGeniText, value: string): string {
|
|
2815
3406
|
const date = new Date(value);
|
|
2816
3407
|
return Number.isNaN(date.getTime())
|
|
2817
3408
|
? ""
|
|
2818
|
-
: date.toLocaleTimeString(
|
|
3409
|
+
: date.toLocaleTimeString(t.locale, { hour: "2-digit", minute: "2-digit", second: "2-digit" });
|
|
2819
3410
|
}
|
|
2820
3411
|
|
|
2821
3412
|
function BrowserNotice(props: { icon: ReactNode; text: string; className?: string }) {
|
|
2822
3413
|
return (
|
|
2823
3414
|
<div
|
|
2824
3415
|
className={cn(
|
|
2825
|
-
"grid h-full place-items-center bg-og-bg text-og-control text-og-muted",
|
|
3416
|
+
"grid h-full place-items-center bg-og-bg text-og-control text-og-fg-muted",
|
|
2826
3417
|
props.className,
|
|
2827
3418
|
)}
|
|
2828
3419
|
>
|
|
@@ -2858,7 +3449,7 @@ function loadImage(url: string): Promise<HTMLImageElement> {
|
|
|
2858
3449
|
|
|
2859
3450
|
function browserPoint(
|
|
2860
3451
|
canvas: HTMLCanvasElement | null,
|
|
2861
|
-
frame:
|
|
3452
|
+
frame: BrowserViewportFrame | null,
|
|
2862
3453
|
clientX: number,
|
|
2863
3454
|
clientY: number,
|
|
2864
3455
|
): { x: number; y: number } | null {
|
|
@@ -2905,18 +3496,24 @@ function frameMatchesSelectedTarget(
|
|
|
2905
3496
|
);
|
|
2906
3497
|
}
|
|
2907
3498
|
|
|
2908
|
-
function sameFrameFence(left:
|
|
3499
|
+
function sameFrameFence(left: BrowserFrameInputFence, right: BrowserFrameInputFence): boolean {
|
|
3500
|
+
return sameBrowserDocument(left, right) && left.frameId === right.frameId;
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3503
|
+
function sameBrowserDocument(left: BrowserFrameInputFence, right: BrowserFrameInputFence): boolean {
|
|
2909
3504
|
return (
|
|
2910
3505
|
left.browserSessionId === right.browserSessionId &&
|
|
2911
3506
|
left.controllerGeneration === right.controllerGeneration &&
|
|
2912
3507
|
left.targetId === right.targetId &&
|
|
2913
3508
|
left.targetGeneration === right.targetGeneration &&
|
|
2914
|
-
left.documentGeneration === right.documentGeneration
|
|
2915
|
-
left.frameId === right.frameId
|
|
3509
|
+
left.documentGeneration === right.documentGeneration
|
|
2916
3510
|
);
|
|
2917
3511
|
}
|
|
2918
3512
|
|
|
2919
|
-
function sameOptionalBrowserFrame(
|
|
3513
|
+
function sameOptionalBrowserFrame(
|
|
3514
|
+
left: BrowserViewportFrame | null,
|
|
3515
|
+
right: BrowserViewportFrame | null,
|
|
3516
|
+
): boolean {
|
|
2920
3517
|
return left === null || right === null ? left === right : sameFrameFence(left, right);
|
|
2921
3518
|
}
|
|
2922
3519
|
|
|
@@ -2951,48 +3548,48 @@ function countInterventions(
|
|
|
2951
3548
|
return counts;
|
|
2952
3549
|
}
|
|
2953
3550
|
|
|
2954
|
-
function interventionTitle(intervention: InteractionIntervention): string {
|
|
3551
|
+
function interventionTitle(t: OpenGeniText, intervention: InteractionIntervention): string {
|
|
2955
3552
|
switch (intervention.kind) {
|
|
2956
3553
|
case "manual_login":
|
|
2957
|
-
return "
|
|
3554
|
+
return t("browserViewer.signInNeeded");
|
|
2958
3555
|
case "mfa":
|
|
2959
|
-
return "
|
|
3556
|
+
return t("browserViewer.verificationNeeded");
|
|
2960
3557
|
case "external_action":
|
|
2961
3558
|
case "confirmation":
|
|
2962
|
-
return "
|
|
3559
|
+
return t("browserViewer.actionNeeded");
|
|
2963
3560
|
case "other":
|
|
2964
|
-
return "
|
|
3561
|
+
return t("browserViewer.browserNeedsYourHelp");
|
|
2965
3562
|
}
|
|
2966
3563
|
}
|
|
2967
3564
|
|
|
2968
|
-
function placementLabel(session: BrowserSession | undefined): string {
|
|
3565
|
+
function placementLabel(t: OpenGeniText, session: BrowserSession | undefined): string {
|
|
2969
3566
|
if (!session) return "";
|
|
2970
3567
|
switch (session.placement.kind) {
|
|
2971
3568
|
case "sandbox_group":
|
|
2972
|
-
return "
|
|
3569
|
+
return t("browserViewer.agentSandbox");
|
|
2973
3570
|
case "connected_machine":
|
|
2974
|
-
return "
|
|
3571
|
+
return t("browserViewer.connectedMachine");
|
|
2975
3572
|
case "attached_device":
|
|
2976
|
-
return "
|
|
3573
|
+
return t("browserViewer.yourBrowser");
|
|
2977
3574
|
case "external_provider":
|
|
2978
|
-
return "
|
|
3575
|
+
return t("browserViewer.cloudBrowser");
|
|
2979
3576
|
}
|
|
2980
3577
|
}
|
|
2981
3578
|
|
|
2982
|
-
function browserConnectionLabel(state: string): string {
|
|
3579
|
+
function browserConnectionLabel(t: OpenGeniText, state: string): string {
|
|
2983
3580
|
switch (state) {
|
|
2984
3581
|
case "attaching":
|
|
2985
|
-
return "
|
|
3582
|
+
return t("browserViewer.openingBrowser");
|
|
2986
3583
|
case "connecting":
|
|
2987
|
-
return "
|
|
3584
|
+
return t("browserViewer.connecting");
|
|
2988
3585
|
case "reconnecting":
|
|
2989
|
-
return "
|
|
3586
|
+
return t("browserViewer.reconnecting");
|
|
2990
3587
|
case "error":
|
|
2991
|
-
return "
|
|
3588
|
+
return t("browserViewer.disconnected");
|
|
2992
3589
|
case "semantic":
|
|
2993
|
-
return "
|
|
3590
|
+
return t("browserViewer.semantic");
|
|
2994
3591
|
default:
|
|
2995
|
-
return "
|
|
3592
|
+
return t("browserViewer.waitingForBrowser");
|
|
2996
3593
|
}
|
|
2997
3594
|
}
|
|
2998
3595
|
|