@kabmo-labs/kabmo 0.11.1 → 0.12.0
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 +67 -421
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +426 -413
- package/dist/client/static/js/{index-amss8pge.js → index-0smc9gm2.js} +1123 -747
- package/dist/client/static/js/index-shexbk5f.css +1 -0
- package/marketplace/marketplace.json +13 -3
- package/marketplace/plugins/command-runner/package.json +4 -2
- package/marketplace/plugins/git-forge/README.md +219 -0
- package/marketplace/plugins/git-forge/icon.svg +20 -0
- package/marketplace/plugins/git-forge/package.json +56 -0
- package/marketplace/plugins/git-forge/src/app.tsx +82 -0
- package/marketplace/plugins/git-forge/src/command.test.ts +181 -0
- package/marketplace/plugins/git-forge/src/command.ts +119 -0
- package/marketplace/plugins/git-forge/src/header.tsx +87 -0
- package/marketplace/plugins/git-forge/src/panel/Badge.tsx +76 -0
- package/marketplace/plugins/git-forge/src/panel/Change.tsx +150 -0
- package/marketplace/plugins/git-forge/src/panel/CiBadge.tsx +51 -0
- package/marketplace/plugins/git-forge/src/panel/Credential.tsx +107 -0
- package/marketplace/plugins/git-forge/src/panel/Glyph.tsx +70 -0
- package/marketplace/plugins/git-forge/src/panel/Header.tsx +255 -0
- package/marketplace/plugins/git-forge/src/panel/ItemView.tsx +198 -0
- package/marketplace/plugins/git-forge/src/panel/List.tsx +89 -0
- package/marketplace/plugins/git-forge/src/panel/Row.tsx +68 -0
- package/marketplace/plugins/git-forge/src/panel/Sidebar.tsx +94 -0
- package/marketplace/plugins/git-forge/src/panel/Write.tsx +236 -0
- package/marketplace/plugins/git-forge/src/panel/format.ts +78 -0
- package/marketplace/plugins/git-forge/src/panel/index.test.tsx +344 -0
- package/marketplace/plugins/git-forge/src/panel/index.tsx +193 -0
- package/marketplace/plugins/git-forge/src/panel/use-forge.ts +250 -0
- package/marketplace/plugins/git-forge/src/panel/write.test.tsx +269 -0
- package/marketplace/plugins/git-forge/src/protocol.ts +308 -0
- package/marketplace/plugins/git-forge/src/server/adapters.test.ts +274 -0
- package/marketplace/plugins/git-forge/src/server/bitbucket.ts +307 -0
- package/marketplace/plugins/git-forge/src/server/capabilities.test.ts +116 -0
- package/marketplace/plugins/git-forge/src/server/capabilities.ts +105 -0
- package/marketplace/plugins/git-forge/src/server/ci.test.ts +88 -0
- package/marketplace/plugins/git-forge/src/server/ci.ts +118 -0
- package/marketplace/plugins/git-forge/src/server/context.ts +76 -0
- package/marketplace/plugins/git-forge/src/server/diff.test.ts +127 -0
- package/marketplace/plugins/git-forge/src/server/diff.ts +120 -0
- package/marketplace/plugins/git-forge/src/server/filters.test.ts +138 -0
- package/marketplace/plugins/git-forge/src/server/filters.ts +138 -0
- package/marketplace/plugins/git-forge/src/server/forges.test.ts +235 -0
- package/marketplace/plugins/git-forge/src/server/gitea.ts +296 -0
- package/marketplace/plugins/git-forge/src/server/github-extras.ts +92 -0
- package/marketplace/plugins/git-forge/src/server/github.ts +320 -0
- package/marketplace/plugins/git-forge/src/server/gitlab-detail.ts +207 -0
- package/marketplace/plugins/git-forge/src/server/gitlab.test.ts +195 -0
- package/marketplace/plugins/git-forge/src/server/gitlab.ts +176 -0
- package/marketplace/plugins/git-forge/src/server/http.test.ts +270 -0
- package/marketplace/plugins/git-forge/src/server/http.ts +329 -0
- package/marketplace/plugins/git-forge/src/server/map.ts +120 -0
- package/marketplace/plugins/git-forge/src/server/registry.ts +47 -0
- package/marketplace/plugins/git-forge/src/server/remote.test.ts +146 -0
- package/marketplace/plugins/git-forge/src/server/remote.ts +188 -0
- package/marketplace/plugins/git-forge/src/server/scope-probe.test.ts +98 -0
- package/marketplace/plugins/git-forge/src/server/scope-probe.ts +128 -0
- package/marketplace/plugins/git-forge/src/server/scope.ts +66 -0
- package/marketplace/plugins/git-forge/src/server/test-context.ts +67 -0
- package/marketplace/plugins/git-forge/src/server/test-host.ts +51 -0
- package/marketplace/plugins/git-forge/src/server/token.test.ts +107 -0
- package/marketplace/plugins/git-forge/src/server/token.ts +139 -0
- package/marketplace/plugins/git-forge/src/server/write-http.test.ts +127 -0
- package/marketplace/plugins/git-forge/src/server/write-http.ts +110 -0
- package/marketplace/plugins/git-forge/src/server/writes.test.ts +218 -0
- package/marketplace/plugins/git-forge/src/server/writes.ts +313 -0
- package/marketplace/plugins/git-forge/src/server.ts +284 -0
- package/marketplace/plugins/git-forge/tsconfig.json +16 -0
- package/marketplace/plugins/session-info/package.json +4 -2
- package/marketplace/plugins/stats/package.json +4 -2
- package/package.json +6 -1
- package/src/client/components/common/code-surface/blame-hover.ts +188 -0
- package/src/client/components/common/code-surface/blame-panel.test.ts +304 -0
- package/src/client/components/common/code-surface/blame-panel.ts +306 -0
- package/src/client/components/common/code-surface/blame.test.ts +303 -0
- package/src/client/components/common/code-surface/blame.ts +227 -0
- package/src/client/components/common/code-surface/conflict-markers.test.ts +135 -0
- package/src/client/components/common/code-surface/conflict-markers.ts +144 -0
- package/src/client/components/common/code-surface/documents.ts +48 -1
- package/src/client/components/common/code-surface/extensions.test.ts +4 -0
- package/src/client/components/common/code-surface/extensions.ts +44 -0
- package/src/client/components/common/code-surface/fold-stack.test.ts +4 -0
- package/src/client/components/common/code-surface/indent.test.ts +5 -0
- package/src/client/components/common/code-surface/index.tsx +16 -2
- package/src/client/components/common/code-surface/lint-parsers.test.ts +109 -0
- package/src/client/components/common/code-surface/lint-parsers.ts +134 -0
- package/src/client/components/common/code-surface/lint.test.ts +101 -0
- package/src/client/components/common/code-surface/lint.ts +85 -0
- package/src/client/components/common/code-surface/props.ts +17 -0
- package/src/client/components/common/code-surface/surface-failures.test.ts +132 -0
- package/src/client/components/common/code-surface/theme.ts +71 -0
- package/src/client/components/common/header-controls/index.test.tsx +1 -1
- package/src/client/components/common/header-controls/plugin-entry.test.tsx +1 -1
- package/src/client/components/common/header-controls/shell-chrome.test.tsx +1 -1
- package/src/client/components/common/provider-icon/Plate.tsx +88 -0
- package/src/client/components/common/provider-icon/index.tsx +55 -11
- package/src/client/components/layout/session-sidebar/SessionsView.tsx +5 -2
- package/src/client/components/mobile/SessionSidebar.tsx +2 -10
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +6 -0
- package/src/client/components/mobile/mobile-right-sidebar/StatusBar.tsx +8 -0
- package/src/client/components/settings/categories/AppearanceSettings.tsx +3 -0
- package/src/client/components/settings/categories/ProviderSettings.tsx +43 -41
- package/src/client/components/settings/categories/appearance-settings/EditorBlameSection.tsx +97 -0
- package/src/client/components/settings/categories/panel-plugins/AvailableList.tsx +106 -54
- package/src/client/components/settings/categories/panel-plugins/GitFreshness.tsx +14 -1
- package/src/client/components/settings/categories/panel-plugins/InstalledList.tsx +39 -150
- package/src/client/components/settings/categories/panel-plugins/Meta.test.tsx +143 -0
- package/src/client/components/settings/categories/panel-plugins/Meta.tsx +157 -0
- package/src/client/components/settings/categories/panel-plugins/Placement.test.tsx +149 -0
- package/src/client/components/settings/categories/panel-plugins/Placement.tsx +99 -0
- package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +270 -0
- package/src/client/components/settings/categories/panel-plugins/Section.tsx +11 -3
- package/src/client/components/settings/categories/provider-settings/AddModelModal.tsx +25 -0
- package/src/client/components/settings/categories/provider-settings/AuthSection.tsx +135 -80
- package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +51 -21
- package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +175 -0
- package/src/client/components/settings/categories/provider-settings/EntryModal.tsx +275 -0
- package/src/client/components/settings/categories/provider-settings/Header.tsx +40 -9
- package/src/client/components/settings/categories/provider-settings/LoginModal.tsx +142 -160
- package/src/client/components/settings/categories/provider-settings/LogoutProviderModal.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/ModelCapabilitiesModal.tsx +84 -46
- package/src/client/components/settings/categories/provider-settings/ModelsList.tsx +217 -102
- package/src/client/components/settings/categories/provider-settings/PresetPicker.tsx +5 -2
- package/src/client/components/settings/categories/provider-settings/SidebarList.plugin.test.ts +3 -3
- package/src/client/components/settings/categories/provider-settings/SidebarList.tsx +158 -102
- package/src/client/components/settings/categories/provider-settings/auth-section.test.tsx +135 -0
- package/src/client/components/settings/categories/provider-settings/groups.test.ts +98 -0
- package/src/client/components/settings/categories/provider-settings/groups.ts +108 -0
- package/src/client/components/settings/categories/provider-settings/layout.test.tsx +325 -0
- package/src/client/components/settings/categories/provider-settings/model-dialogs.test.tsx +135 -0
- package/src/client/components/settings/categories/provider-settings/preset-picker.test.tsx +73 -0
- package/src/client/components/settings/categories/usage-settings/ProviderCard.tsx +22 -2
- package/src/client/components/settings/categories/usage-settings/ProviderDetail.tsx +2 -0
- package/src/client/components/settings/categories/usage-settings/SidebarList.tsx +16 -6
- package/src/client/components/settings/categories/usage-settings/providers.ts +3 -0
- package/src/client/components/settings/categories/usage-settings/usage-and-picker.test.ts +19 -0
- package/src/client/components/settings/categories/usage-settings/usage-icons.test.tsx +143 -0
- package/src/client/components/workspace/chat-timeline/MinimapShortcuts.test.ts +2 -1
- package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.test.ts +23 -19
- package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.test.ts +23 -19
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +20 -18
- package/src/client/components/workspace/chat-timeline/chat-input/compact.test.tsx +19 -6
- package/src/client/components/workspace/chat-timeline/index.tsx +7 -16
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.missing.test.ts +100 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.test.ts +3 -47
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +8 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/wait-test-util.ts +62 -0
- package/src/client/components/workspace/diff-panel/HunkStepper.tsx +62 -0
- package/src/client/components/workspace/diff-panel/MergeDiffView.tsx +29 -0
- package/src/client/components/workspace/diff-panel/Toolbar.tsx +32 -1
- package/src/client/components/workspace/diff-panel/changes.ts +69 -0
- package/src/client/components/workspace/diff-panel/chunks.ts +85 -0
- package/src/client/components/workspace/diff-panel/index.tsx +21 -1
- package/src/client/components/workspace/diff-panel/merge.test.ts +145 -0
- package/src/client/components/workspace/diff-panel/merge.ts +63 -68
- package/src/client/components/workspace/editor/EditorDropOverlay.tsx +6 -1
- package/src/client/components/workspace/editor/FileDocument.tsx +51 -1
- package/src/client/components/workspace/editor/FilePane.tsx +25 -1
- package/src/client/components/workspace/editor/StatusBar.tsx +19 -0
- package/src/client/components/workspace/editor/Toolbar.tsx +29 -5
- package/src/client/components/workspace/editor/toolbar-clusters.test.ts +86 -0
- package/src/client/components/workspace/editor/toolbar-clusters.tsx +48 -16
- package/src/client/components/workspace/editor/viewers/bytes.ts +16 -0
- package/src/client/components/workspace/git-panel/index.test.ts +46 -1
- package/src/client/components/workspace/git-panel/index.tsx +11 -38
- package/src/client/components/workspace/model-dropdown/Item.plugin.test.ts +66 -0
- package/src/client/components/workspace/model-dropdown/Item.tsx +71 -62
- package/src/client/components/workspace/model-dropdown/Section.tsx +31 -14
- package/src/client/components/workspace/model-dropdown/collapsed.ts +72 -0
- package/src/client/components/workspace/model-dropdown/index.tsx +42 -19
- package/src/client/components/workspace/model-dropdown/refresh.test.tsx +260 -0
- package/src/client/components/workspace/model-dropdown/trigger.test.ts +34 -0
- package/src/client/components/workspace/model-dropdown/use-catalog.ts +13 -2
- package/src/client/components/workspace/usage-panel/ProviderSelect.tsx +19 -3
- package/src/client/hooks/chat/omp/folder-auto-expand.ts +113 -0
- package/src/client/hooks/chat/omp/index.ts +20 -0
- package/src/client/hooks/chat/omp/pending-rows.ts +21 -0
- package/src/client/hooks/chat/omp/pending-sessions.test.ts +16 -1
- package/src/client/hooks/chat/omp/session-sidebar-controller.test.ts +102 -0
- package/src/client/hooks/chat/omp/session-sidebar-controller.ts +21 -1
- package/src/client/hooks/chat/omp/stream.ts +8 -1
- package/src/client/hooks/chat/timeline/index.ts +1 -1
- package/src/client/hooks/chat/timeline/new-chat-open.ts +60 -0
- package/src/client/hooks/editor/blame-settings.ts +67 -0
- package/src/client/hooks/editor/blame.test.ts +272 -0
- package/src/client/hooks/editor/blame.ts +232 -0
- package/src/client/hooks/editor/file-editor-types.ts +23 -0
- package/src/client/hooks/editor/save-file.test.ts +20 -0
- package/src/client/hooks/editor/use-editor-drop.test-util.ts +198 -0
- package/src/client/hooks/editor/use-editor-drop.test.ts +70 -175
- package/src/client/hooks/editor/use-editor-drop.ts +19 -36
- package/src/client/hooks/editor/use-file-editor.ts +7 -1
- package/src/client/hooks/settings/providers/actions.ts +90 -194
- package/src/client/hooks/settings/providers/api.ts +7 -1
- package/src/client/hooks/settings/providers/index.ts +171 -59
- package/src/client/hooks/settings/providers/login.test.ts +79 -0
- package/src/client/hooks/settings/providers/login.ts +276 -0
- package/src/client/hooks/settings/providers/messages.ts +28 -0
- package/src/client/hooks/settings/providers/model-actions.ts +178 -0
- package/src/client/hooks/ui/editor-error-toast.ts +47 -0
- package/src/client/hooks/ui/open-file.ts +7 -0
- package/src/client/hooks/ui/toasts.ts +7 -0
- package/src/client/hooks/workspace/file-tabs.ts +4 -1
- package/src/client/hooks/workspace/folder-expansion.test.ts +62 -0
- package/src/client/hooks/workspace/folder-expansion.ts +33 -0
- package/src/client/hooks/workspace/git-action-outcome.ts +86 -0
- package/src/client/hooks/workspace/git-actions.ts +29 -2
- package/src/client/hooks/workspace/plugin-contributions.test.ts +117 -0
- package/src/client/hooks/workspace/plugin-contributions.ts +146 -0
- package/src/client/lib/editor-errors.test.ts +85 -0
- package/src/client/lib/editor-errors.ts +71 -0
- package/src/client/lib/fs/resolve-open.test.ts +125 -0
- package/src/client/lib/fs/resolve-open.ts +90 -0
- package/src/client/lib/git/action-message.test.ts +82 -0
- package/src/client/lib/git/action-message.ts +160 -0
- package/src/client/lib/launch/device-files.test.ts +160 -0
- package/src/client/lib/launch/device-files.ts +197 -0
- package/src/client/lib/native/open-paths.test.ts +140 -0
- package/src/client/lib/native/open-paths.ts +157 -0
- package/src/client/lib/plugins/bootstrap.test.ts +1 -1
- package/src/client/main.tsx +20 -0
- package/src/server/db.server.test.ts +39 -0
- package/src/server/db.server.ts +21 -2
- package/src/server/lib/db/schema.ts +2 -0
- package/src/server/lib/fs/external-roots.test.ts +100 -0
- package/src/server/lib/fs/external-roots.ts +101 -0
- package/src/server/lib/fs/git-actions-branch.ts +15 -2
- package/src/server/lib/fs/git-actions-shared.ts +24 -0
- package/src/server/lib/fs/git-actions-sync.test.ts +18 -7
- package/src/server/lib/fs/git-actions-worktree.ts +5 -1
- package/src/server/lib/fs/git-blame.test.ts +206 -0
- package/src/server/lib/fs/git-blame.ts +189 -0
- package/src/server/lib/fs/root.ts +14 -0
- package/src/server/lib/http/same-origin.ts +28 -7
- package/src/server/lib/models/catalog.server.ts +230 -0
- package/src/server/lib/models/catalog.test.ts +83 -0
- package/src/server/lib/models/credential-origin.server.ts +108 -0
- package/src/server/lib/models/credential-origin.test.ts +132 -0
- package/src/server/lib/models/provider-icon-fetch.ts +115 -0
- package/src/server/lib/models/provider-icon-parse.test.ts +134 -0
- package/src/server/lib/models/provider-icon-parse.ts +139 -0
- package/src/server/lib/models/provider-icon-store.server.ts +118 -0
- package/src/server/lib/models/provider-icon-store.test.ts +107 -0
- package/src/server/lib/models/provider-icon.server.ts +209 -0
- package/src/server/lib/models/provider-items.server.ts +211 -37
- package/src/server/lib/models/provider-items.test.ts +201 -0
- package/src/server/lib/models/provider-registry.server.test.ts +27 -9
- package/src/server/lib/models/provider-registry.server.ts +160 -67
- package/src/server/lib/models/registry.server.test.ts +3 -3
- package/src/server/lib/models/registry.server.ts +8 -0
- package/src/server/lib/omp/config/definitions.test.ts +5 -4
- package/src/server/lib/omp/config/models-config.ts +42 -0
- package/src/server/lib/omp/config/provider-entry.test.ts +205 -0
- package/src/server/lib/omp/config/provider-entry.ts +197 -0
- package/src/server/lib/omp/config/provider-seeds.ts +10 -0
- package/src/server/lib/omp/core/models-json.ts +69 -0
- package/src/server/lib/omp/session/messages.ts +17 -3
- package/src/server/lib/omp/session/sidebar-data.canonical.test.ts +13 -3
- package/src/server/lib/panels/bundled-catalog.server.ts +7 -0
- package/src/server/lib/panels/catalog-offers.server.ts +68 -0
- package/src/server/lib/panels/git-update.server.test.ts +14 -0
- package/src/server/lib/panels/git-update.server.ts +63 -1
- package/src/server/lib/panels/manifest.test.ts +65 -0
- package/src/server/lib/panels/manifest.ts +55 -1
- package/src/server/lib/panels/offers.server.test.ts +191 -0
- package/src/server/lib/panels/offers.server.ts +108 -0
- package/src/server/lib/panels/registry.server.test.ts +35 -1
- package/src/server/lib/panels/registry.server.ts +51 -142
- package/src/server/lib/panels/scan.server.ts +162 -0
- package/src/server/lib/route-adapter.ts +13 -2
- package/src/server/lib/tray/tray.test.ts +2 -1
- package/src/server/lib/usage/providers.server.ts +4 -1
- package/src/server/routes/chat/session.ts +7 -1
- package/src/server/routes/fs/git-blame-loader.test.ts +146 -0
- package/src/server/routes/fs/git.ts +17 -0
- package/src/server/routes/fs/grant.test.ts +135 -0
- package/src/server/routes/fs/grant.ts +79 -0
- package/src/server/routes/fs/index.ts +2 -0
- package/src/server/routes/fs/scope.ts +34 -17
- package/src/server/routes/omp/login.ts +41 -14
- package/src/server/routes/omp/routes.test.ts +23 -10
- package/src/server/routes/settings/index.ts +8 -0
- package/src/server/routes/settings/provider-entry.ts +108 -0
- package/src/server/routes/settings/provider-icon.ts +99 -0
- package/src/server/routes/settings/provider-model.ts +4 -1
- package/src/server/routes/settings/provider-refresh.ts +87 -0
- package/src/server/routes/settings/providers.ts +31 -2
- package/src/shared/lib/chat/omp/fold.test.ts +34 -0
- package/src/shared/lib/chat/omp/tool-frames.test.ts +20 -0
- package/src/shared/lib/chat/omp/tool-frames.ts +5 -1
- package/src/shared/lib/chat/omp/tool-results.ts +29 -3
- package/src/shared/lib/chat/tool/wait-facts.ts +4 -0
- package/src/shared/lib/fs/git-blame.test.ts +266 -0
- package/src/shared/lib/fs/git-blame.ts +246 -0
- package/src/shared/lib/git/url.ts +18 -0
- package/src/shared/lib/markdown/sanitize.test.ts +57 -0
- package/src/shared/lib/markdown/sanitize.ts +30 -7
- package/src/shared/lib/models/provider/connection.ts +135 -0
- package/src/shared/lib/models/provider/dialect.test.ts +4 -2
- package/src/shared/lib/models/provider/dialect.ts +76 -6
- package/src/shared/lib/models/provider/models.ts +2 -0
- package/src/shared/lib/models/provider/origin.ts +94 -0
- package/src/shared/lib/models/provider/provider-ui.test.ts +7 -0
- package/src/shared/lib/models/server-cache.ts +8 -3
- package/src/shared/lib/omp/session/messages-map-pending.test.ts +110 -0
- package/src/shared/lib/omp/session/messages-map.ts +34 -2
- package/src/shared/lib/omp/session/prewarm-misc.test.ts +7 -90
- package/src/shared/lib/omp/session/prewarm.test.ts +133 -0
- package/src/shared/lib/omp/session/prewarm.ts +23 -1
- package/src/shared/lib/omp/session/wait.test.ts +28 -0
- package/src/shared/lib/omp/session/wait.ts +38 -3
- package/src/shared/lib/panels/slot-labels.test.ts +61 -0
- package/src/shared/lib/panels/slot-labels.ts +133 -0
- package/src/shared/lib/workspace/panel-ids.ts +11 -0
- package/src/shared/types/fs.ts +6 -0
- package/src/shared/types/index.ts +1 -0
- package/src/shared/types/models.ts +12 -0
- package/src/shared/types/panels-registry.ts +277 -0
- package/src/shared/types/panels.ts +46 -213
- package/src/shared/types/settings/provider.ts +58 -0
- package/src/shared/types/settings/usage.ts +10 -0
- package/src/test-support/pristine-globals.ts +7 -0
- package/dist/client/static/js/index-bq6qeayr.css +0 -1
- package/src/client/components/settings/categories/provider-settings/ReconnectModal.tsx +0 -184
|
@@ -9,212 +9,111 @@
|
|
|
9
9
|
* Three claims, and each is a way the gesture can go wrong invisibly:
|
|
10
10
|
*
|
|
11
11
|
* - A drop that RESOLVES opens the file through the same `omp:open-file` event
|
|
12
|
-
* every other surface uses, so the editor has one entry point
|
|
13
|
-
*
|
|
12
|
+
* every other surface uses, so the editor has one entry point — including a
|
|
13
|
+
* file from OUTSIDE every workspace, which the drop itself grants.
|
|
14
|
+
* - A drop that is REFUSED (a binary, an oversized file, a directory) reports
|
|
14
15
|
* the server's own sentence instead of opening a tab that would only render
|
|
15
16
|
* it.
|
|
16
17
|
* - The gesture is CLAIMED (`stopPropagation`) so the composer's window-level
|
|
17
18
|
* drop handler cannot also see it — otherwise one drop both opens the file
|
|
18
19
|
* and queues it as a chat attachment.
|
|
19
20
|
*
|
|
20
|
-
*
|
|
21
|
-
* `
|
|
21
|
+
* The DOM, the `fetch` stub and the `DataTransfer` shapes live in
|
|
22
|
+
* `use-editor-drop.test-util.ts`: this file is the CASES.
|
|
22
23
|
*/
|
|
23
24
|
|
|
24
25
|
import { afterAll, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
|
|
25
|
-
import { Window } from 'happy-dom';
|
|
26
26
|
import { h, render } from 'preact';
|
|
27
27
|
import { act } from 'preact/test-utils';
|
|
28
28
|
import { useEditorDrop, type UseEditorDropResult } from '@/client/hooks/editor/use-editor-drop';
|
|
29
29
|
import { writeThroughHandle } from '@/client/lib/launch/file-handlers';
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const { ok, status, body } = scopeResponse;
|
|
48
|
-
return { ok, status, json: async () => body };
|
|
49
|
-
}) as unknown as typeof globalThis.fetch;
|
|
50
|
-
// The open path is a window event; recording it here is what proves the file
|
|
51
|
-
// was handed to the editor rather than merely resolved.
|
|
52
|
-
win.addEventListener('omp:open-file', (event) => {
|
|
53
|
-
opened.push((event as unknown as CustomEvent).detail);
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
afterAll(() => {
|
|
58
|
-
const target = globalThis as unknown as Record<string, unknown>;
|
|
59
|
-
for (const key of DOM_GLOBALS) {
|
|
60
|
-
if (nativeGlobals[key] === undefined) delete target[key];
|
|
61
|
-
else target[key] = nativeGlobals[key];
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
/** A `DataTransfer` carrying one `text/uri-list` reference, as a Finder drop does. */
|
|
66
|
-
function fileTransfer(reference: string): DataTransfer {
|
|
67
|
-
return {
|
|
68
|
-
types: ['text/uri-list'],
|
|
69
|
-
files: [],
|
|
70
|
-
getData: (type: string) => (type.toLowerCase() === 'text/uri-list' ? reference : ''),
|
|
71
|
-
} as unknown as DataTransfer;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/** A `DataTransfer` with real bytes and no path — the composer's territory. */
|
|
75
|
-
function bytesTransfer(): DataTransfer {
|
|
76
|
-
return {
|
|
77
|
-
types: ['Files'],
|
|
78
|
-
files: [{ name: 'photo.png', size: 100 }],
|
|
79
|
-
getData: () => '',
|
|
80
|
-
} as unknown as DataTransfer;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* A `DataTransfer` shaped exactly as Chrome for macOS presents a Finder drag:
|
|
85
|
-
* `types: ["Files"]`, one `file` item with a handle, and NO path anywhere.
|
|
86
|
-
*/
|
|
87
|
-
function finderTransfer(handle: FileSystemFileHandle): DataTransfer {
|
|
88
|
-
return {
|
|
89
|
-
types: ['Files'],
|
|
90
|
-
files: [],
|
|
91
|
-
getData: () => '',
|
|
92
|
-
items: [
|
|
93
|
-
{
|
|
94
|
-
kind: 'file',
|
|
95
|
-
type: 'application/octet-stream',
|
|
96
|
-
getAsFileSystemHandle: async () => handle,
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
} as unknown as DataTransfer;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/** A handle over `text`, recording writes so a save can be observed. */
|
|
103
|
-
function fakeHandle(name: string, text: string) {
|
|
104
|
-
const writes: string[] = [];
|
|
105
|
-
const handle = {
|
|
106
|
-
name,
|
|
107
|
-
kind: 'file',
|
|
108
|
-
async getFile() {
|
|
109
|
-
return new File([new TextEncoder().encode(text)], name);
|
|
110
|
-
},
|
|
111
|
-
async createWritable() {
|
|
112
|
-
return {
|
|
113
|
-
async write(data: string) {
|
|
114
|
-
writes.push(data);
|
|
115
|
-
},
|
|
116
|
-
async close() {},
|
|
117
|
-
};
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
return { handle: handle as unknown as FileSystemFileHandle, writes };
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
interface Harness {
|
|
124
|
-
drop: (transfer: DataTransfer) => Promise<void>;
|
|
125
|
-
dragging: () => boolean;
|
|
126
|
-
results: { ok: boolean; message: string }[];
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
async function mount(enabled = true): Promise<Harness> {
|
|
130
|
-
const results: { ok: boolean; message: string }[] = [];
|
|
131
|
-
const container = document.createElement('div');
|
|
132
|
-
document.body.appendChild(container);
|
|
133
|
-
|
|
134
|
-
let api: UseEditorDropResult | null = null;
|
|
135
|
-
const Probe = () => {
|
|
136
|
-
api = useEditorDrop({ enabled, onResult: (r) => results.push(r) });
|
|
137
|
-
return null;
|
|
138
|
-
};
|
|
139
|
-
await act(async () => {
|
|
140
|
-
render(h(Probe, {}), container);
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
return {
|
|
144
|
-
drop: async (transfer) => {
|
|
145
|
-
const event = new window.Event('drop', { bubbles: true, cancelable: true });
|
|
146
|
-
Object.defineProperty(event, 'dataTransfer', { value: transfer });
|
|
147
|
-
Object.defineProperty(event, 'stopPropagation', { value: () => {} });
|
|
148
|
-
Object.defineProperty(event, 'preventDefault', { value: () => {} });
|
|
149
|
-
await act(async () => {
|
|
150
|
-
api?.dropProps.onDrop(event as never);
|
|
151
|
-
});
|
|
152
|
-
// The handler resolves the reference over `fetch` and then `res.json()`,
|
|
153
|
-
// so the assertion needs that chain drained before it runs.
|
|
154
|
-
for (let pass = 0; pass < 4; pass += 1) {
|
|
155
|
-
await act(async () => {
|
|
156
|
-
await Promise.resolve();
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
dragging: () => api?.isDragging ?? false,
|
|
161
|
-
results,
|
|
162
|
-
};
|
|
163
|
-
}
|
|
30
|
+
import {
|
|
31
|
+
bytesTransfer,
|
|
32
|
+
fakeHandle,
|
|
33
|
+
fileTransfer,
|
|
34
|
+
finderTransfer,
|
|
35
|
+
installDropHarness,
|
|
36
|
+
mountEditorDrop,
|
|
37
|
+
openedFiles,
|
|
38
|
+
queueScopeResponses,
|
|
39
|
+
resetDropHarness,
|
|
40
|
+
restoreDropHarness,
|
|
41
|
+
scopeFetchCalls,
|
|
42
|
+
setScopeResponse,
|
|
43
|
+
} from '@/client/hooks/editor/use-editor-drop.test-util';
|
|
44
|
+
|
|
45
|
+
beforeAll(installDropHarness);
|
|
46
|
+
afterAll(restoreDropHarness);
|
|
164
47
|
|
|
165
48
|
describe('useEditorDrop', () => {
|
|
166
|
-
beforeEach(
|
|
167
|
-
scopeResponse = { ok: true, status: 200, body: {} };
|
|
168
|
-
fetchCalls = [];
|
|
169
|
-
opened = [];
|
|
170
|
-
});
|
|
49
|
+
beforeEach(resetDropHarness);
|
|
171
50
|
|
|
172
51
|
test('a resolved reference opens the file through omp:open-file', async () => {
|
|
173
|
-
|
|
52
|
+
setScopeResponse({
|
|
174
53
|
ok: true,
|
|
175
54
|
status: 200,
|
|
176
55
|
body: { root: '/repo', path: 'src/app.ts', name: 'app.ts', kind: 'text' },
|
|
177
|
-
};
|
|
178
|
-
const harness = await
|
|
56
|
+
});
|
|
57
|
+
const harness = await mountEditorDrop();
|
|
179
58
|
await harness.drop(fileTransfer('file:///repo/src/app.ts'));
|
|
180
59
|
|
|
181
|
-
expect(
|
|
182
|
-
expect(
|
|
183
|
-
expect(
|
|
60
|
+
expect(scopeFetchCalls()[0]).toContain('/api/fs/scope?path=');
|
|
61
|
+
expect(openedFiles()).toHaveLength(1);
|
|
62
|
+
expect(openedFiles()[0]).toEqual({ path: 'src/app.ts', name: 'app.ts', root: '/repo' });
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test('a file outside every workspace is granted by the drop, then opened', async () => {
|
|
66
|
+
// The reported case: a report dragged off the Desktop. The scope route
|
|
67
|
+
// refuses it by name, the drop registers the file's own directory, and the
|
|
68
|
+
// SAME reference then resolves — which is what makes a drop from anywhere
|
|
69
|
+
// open a tab instead of a sentence saying it cannot.
|
|
70
|
+
queueScopeResponses([
|
|
71
|
+
{ ok: false, status: 403, body: { error: 'That file is outside every workspace this console can read.', code: 'outside_workspace' } },
|
|
72
|
+
{ ok: true, status: 200, body: { root: '/Users/x/Desktop', path: 'report.pdf', name: 'report.pdf', kind: 'document' } },
|
|
73
|
+
]);
|
|
74
|
+
const harness = await mountEditorDrop();
|
|
75
|
+
await harness.drop(fileTransfer('file:///Users/x/Desktop/report.pdf'));
|
|
76
|
+
|
|
77
|
+
expect(scopeFetchCalls()[0]).toContain('/api/fs/scope?path=');
|
|
78
|
+
expect(scopeFetchCalls()[1]).toContain('/api/fs/grant');
|
|
79
|
+
expect(openedFiles()).toHaveLength(1);
|
|
80
|
+
expect(openedFiles()[0]).toEqual({ path: 'report.pdf', name: 'report.pdf', root: '/Users/x/Desktop' });
|
|
81
|
+
expect(harness.results.at(-1)?.ok).toBe(true);
|
|
184
82
|
});
|
|
185
83
|
|
|
186
84
|
test('a binary file is refused with the server sentence, and opens nothing', async () => {
|
|
187
|
-
|
|
85
|
+
setScopeResponse({
|
|
188
86
|
ok: true,
|
|
189
87
|
status: 200,
|
|
190
88
|
body: { root: '/repo', path: 'blob.bin', name: 'blob.bin', kind: 'binary', error: 'This file is not text, so it cannot be shown in the editor.' },
|
|
191
|
-
};
|
|
192
|
-
const harness = await
|
|
89
|
+
});
|
|
90
|
+
const harness = await mountEditorDrop();
|
|
193
91
|
await harness.drop(fileTransfer('file:///repo/blob.bin'));
|
|
194
92
|
|
|
195
|
-
expect(
|
|
93
|
+
expect(openedFiles()).toHaveLength(0);
|
|
196
94
|
expect(harness.results.at(-1)?.ok).toBe(false);
|
|
197
95
|
expect(harness.results.at(-1)?.message).toContain('not text');
|
|
198
96
|
});
|
|
199
97
|
|
|
200
98
|
test('a path outside every workspace reports the refusal by name', async () => {
|
|
201
|
-
|
|
202
|
-
|
|
99
|
+
// A refusal with NO `outside_workspace` code: final, so no grant is tried.
|
|
100
|
+
setScopeResponse({ ok: false, status: 403, body: { error: 'That file is outside every workspace this console can read.' } });
|
|
101
|
+
const harness = await mountEditorDrop();
|
|
203
102
|
await harness.drop(fileTransfer('file:///etc/hosts'));
|
|
204
103
|
|
|
205
|
-
expect(
|
|
104
|
+
expect(openedFiles()).toHaveLength(0);
|
|
206
105
|
expect(harness.results.at(-1)?.message).toContain('outside every workspace');
|
|
207
106
|
});
|
|
208
107
|
|
|
209
108
|
test('a Finder drag with a handle opens the file and can be saved', async () => {
|
|
210
109
|
const { handle, writes } = fakeHandle('from-finder.ts', 'const a = 1;\n');
|
|
211
|
-
const harness = await
|
|
110
|
+
const harness = await mountEditorDrop();
|
|
212
111
|
await harness.drop(finderTransfer(handle));
|
|
213
112
|
|
|
214
113
|
// No server round trip: a Finder drag carries no path at all.
|
|
215
|
-
expect(
|
|
216
|
-
expect(
|
|
217
|
-
const detail =
|
|
114
|
+
expect(scopeFetchCalls()).toHaveLength(0);
|
|
115
|
+
expect(openedFiles()).toHaveLength(1);
|
|
116
|
+
const detail = openedFiles()[0] as { path: string; content?: string; handleId?: string };
|
|
218
117
|
expect(detail.path).toBe('from-finder.ts');
|
|
219
118
|
expect(detail.content).toBe('const a = 1;\n');
|
|
220
119
|
expect(detail.handleId).toBeTruthy();
|
|
@@ -226,20 +125,20 @@ describe('useEditorDrop', () => {
|
|
|
226
125
|
});
|
|
227
126
|
|
|
228
127
|
test('bytes with no path are reported, not silently dropped', async () => {
|
|
229
|
-
const harness = await
|
|
128
|
+
const harness = await mountEditorDrop();
|
|
230
129
|
await harness.drop(bytesTransfer());
|
|
231
130
|
|
|
232
131
|
// No scope request is made — there is no path to resolve.
|
|
233
|
-
expect(
|
|
132
|
+
expect(scopeFetchCalls()).toHaveLength(0);
|
|
234
133
|
expect(harness.results.at(-1)?.message).toContain('composer');
|
|
235
134
|
});
|
|
236
135
|
|
|
237
136
|
test('a disabled target makes no request and opens nothing', async () => {
|
|
238
|
-
const harness = await
|
|
137
|
+
const harness = await mountEditorDrop(false);
|
|
239
138
|
await harness.drop(fileTransfer('file:///repo/src/app.ts'));
|
|
240
139
|
|
|
241
|
-
expect(
|
|
242
|
-
expect(
|
|
140
|
+
expect(scopeFetchCalls()).toHaveLength(0);
|
|
141
|
+
expect(openedFiles()).toHaveLength(0);
|
|
243
142
|
expect(harness.results).toHaveLength(0);
|
|
244
143
|
});
|
|
245
144
|
});
|
|
@@ -302,18 +201,14 @@ describe('useEditorDrop capture claim', () => {
|
|
|
302
201
|
return { api: () => api, inner, composer, results };
|
|
303
202
|
}
|
|
304
203
|
|
|
305
|
-
beforeEach(
|
|
306
|
-
scopeResponse = { ok: true, status: 200, body: {} };
|
|
307
|
-
fetchCalls = [];
|
|
308
|
-
opened = [];
|
|
309
|
-
});
|
|
204
|
+
beforeEach(resetDropHarness);
|
|
310
205
|
|
|
311
206
|
test('claims a file drop aimed at a code surface, and opens the file', async () => {
|
|
312
|
-
|
|
207
|
+
setScopeResponse({
|
|
313
208
|
ok: true,
|
|
314
209
|
status: 200,
|
|
315
210
|
body: { root: '/repo', path: 'src/b.ts', name: 'b.ts', kind: 'text' },
|
|
316
|
-
};
|
|
211
|
+
});
|
|
317
212
|
const { api, inner } = await mountWithTargets();
|
|
318
213
|
const { event, calls } = captureEvent(inner, fileTransfer('file:///repo/src/b.ts'));
|
|
319
214
|
|
|
@@ -321,7 +216,7 @@ describe('useEditorDrop capture claim', () => {
|
|
|
321
216
|
|
|
322
217
|
// Claimed BEFORE the surface's own handler could insert the file's text.
|
|
323
218
|
expect(calls).toEqual(['preventDefault', 'stopPropagation']);
|
|
324
|
-
expect(
|
|
219
|
+
expect(openedFiles()).toHaveLength(1);
|
|
325
220
|
});
|
|
326
221
|
|
|
327
222
|
test('leaves a drop aimed anywhere else to the bubble handler', async () => {
|
|
@@ -331,7 +226,7 @@ describe('useEditorDrop capture claim', () => {
|
|
|
331
226
|
await capture(api(), event);
|
|
332
227
|
|
|
333
228
|
expect(calls).toEqual([]);
|
|
334
|
-
expect(
|
|
229
|
+
expect(openedFiles()).toHaveLength(0);
|
|
335
230
|
});
|
|
336
231
|
|
|
337
232
|
test('ignores a text drag, which CodeMirror should still insert', async () => {
|
|
@@ -15,8 +15,12 @@
|
|
|
15
15
|
* route to a writable file is `DataTransferItem.getAsFileSystemHandle()`,
|
|
16
16
|
* which is populated from the first `dragenter`.
|
|
17
17
|
* 2. **A path or URL** handed over by a page (VS Code, a browser download) as
|
|
18
|
-
* `text/uri-list` / `text/plain`. That resolves through
|
|
19
|
-
* because a path can be written back through the
|
|
18
|
+
* `text/uri-list` / `text/plain`. That resolves through
|
|
19
|
+
* `client/lib/fs/resolve-open`, because a path can be written back through the
|
|
20
|
+
* server — and a file from `~/Desktop`, which no workspace contains, is
|
|
21
|
+
* granted by the drop itself (`POST /api/fs/grant`) rather than refused. The
|
|
22
|
+
* same resolver serves the OS-launch path, so a file dropped here and the same
|
|
23
|
+
* file double-clicked in Finder behave identically.
|
|
20
24
|
*
|
|
21
25
|
* 3. **A Finder drag onto a DESKTOP SHELL's webview.** Neither of the above
|
|
22
26
|
* exists there: WebKit implements no `getAsFileSystemHandle` (WebKit bug
|
|
@@ -44,15 +48,7 @@ import { useDragPresence } from '@/client/hooks/ui/drag-presence';
|
|
|
44
48
|
import { openHandleAsTab } from '@/client/lib/launch/file-handlers';
|
|
45
49
|
import { readShellDroppedPaths } from '@/client/lib/desktop/dropped-paths';
|
|
46
50
|
import { openFileInEditor } from '@/client/hooks/ui/open-file';
|
|
47
|
-
|
|
48
|
-
/** What `/api/fs/scope` answers with. */
|
|
49
|
-
interface FileScope {
|
|
50
|
-
root?: string;
|
|
51
|
-
path?: string;
|
|
52
|
-
name?: string;
|
|
53
|
-
kind?: 'image' | 'document' | 'text' | 'binary' | 'too-large';
|
|
54
|
-
error?: string;
|
|
55
|
-
}
|
|
51
|
+
import { resolveOpenableFile } from '@/client/lib/fs/resolve-open';
|
|
56
52
|
|
|
57
53
|
export interface EditorDropResult {
|
|
58
54
|
ok: boolean;
|
|
@@ -126,38 +122,25 @@ function isOpenableDrag(dataTransfer: DataTransfer | null | undefined): boolean
|
|
|
126
122
|
/**
|
|
127
123
|
* Resolve one dropped reference and open it.
|
|
128
124
|
*
|
|
129
|
-
* Used for the path/URL shape
|
|
130
|
-
*
|
|
125
|
+
* Used for the path/URL shape — a `text/uri-list` entry from a browser drag, and
|
|
126
|
+
* the paths a desktop shell read off its own pasteboard (a Finder drag gives a
|
|
127
|
+
* `WKWebView` no path at all, see `client/lib/desktop/dropped-paths.ts`).
|
|
128
|
+
*
|
|
129
|
+
* The scope resolution is shared with the OS-launch path (`resolve-open.ts`), so
|
|
130
|
+
* a file dropped from the Desktop and the same file opened from Finder both work
|
|
131
|
+
* — and both are refused with the same sentence when they cannot be.
|
|
131
132
|
*/
|
|
132
133
|
async function openDroppedReference(
|
|
133
134
|
reference: string,
|
|
134
135
|
onResult: ((result: EditorDropResult) => void) | undefined,
|
|
135
136
|
): Promise<void> {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
} catch {
|
|
140
|
-
onResult?.({ ok: false, message: 'Could not reach the console to open that file.' });
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const body = (await res.json().catch(() => null)) as FileScope | null;
|
|
145
|
-
if (!res.ok || !body?.path || !body.root) {
|
|
146
|
-
onResult?.({ ok: false, message: body?.error ?? `Could not open that file (HTTP ${res.status}).` });
|
|
137
|
+
const resolved = await resolveOpenableFile(reference);
|
|
138
|
+
if (!resolved.ok) {
|
|
139
|
+
onResult?.({ ok: false, message: resolved.message });
|
|
147
140
|
return;
|
|
148
141
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
// sentence, rather than opened as a tab whose whole content is that sentence.
|
|
152
|
-
// A document (PDF/DOCX/XLSX) is NOT refused: its viewer fetches the bytes
|
|
153
|
-
// itself, so it opens like any other file.
|
|
154
|
-
if (body.kind === 'binary' || body.kind === 'too-large') {
|
|
155
|
-
onResult?.({ ok: false, message: body.error ?? `${body.name ?? 'That file'} cannot be opened here.` });
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
openFileInEditor({ path: body.path, name: body.name, root: body.root });
|
|
160
|
-
onResult?.({ ok: true, message: `Opened ${body.name ?? body.path}` });
|
|
142
|
+
openFileInEditor({ path: resolved.file.path, name: resolved.file.name, root: resolved.file.root });
|
|
143
|
+
onResult?.({ ok: true, message: `Opened ${resolved.file.name}` });
|
|
161
144
|
}
|
|
162
145
|
|
|
163
146
|
/**
|
|
@@ -3,6 +3,7 @@ import { getLanguageFromPath } from '@/shared/lib/code/language';
|
|
|
3
3
|
import { resolveViewer } from '@/client/hooks/editor/resolve-viewer';
|
|
4
4
|
import { detectLineEnding, toDiskText, toLf, type LineEnding } from '@/shared/lib/code/line-endings';
|
|
5
5
|
import { retainKeys } from '@/client/hooks/editor/save-file';
|
|
6
|
+
import { deviceFileFor } from '@/client/lib/launch/device-files';
|
|
6
7
|
import { fileHandleFor } from '@/client/lib/launch/file-handlers';
|
|
7
8
|
import { useFileRead } from '@/client/hooks/editor/use-file-read';
|
|
8
9
|
import { useFileTransfer } from '@/client/hooks/editor/use-file-transfer';
|
|
@@ -277,7 +278,12 @@ export function useFileEditor(
|
|
|
277
278
|
byteSource,
|
|
278
279
|
isBinaryViewer,
|
|
279
280
|
revision,
|
|
280
|
-
|
|
281
|
+
// A device-backed tab has no handle by design, so it must not read as
|
|
282
|
+
// "the permission ended" — `deviceBacked` is the accurate answer, and the
|
|
283
|
+
// surface words the two differently.
|
|
284
|
+
handleMissing: Boolean(target?.handleId) && !target?.deviceFile && fileHandleFor(target?.handleId) === null,
|
|
285
|
+
deviceBacked: Boolean(target?.deviceFile),
|
|
286
|
+
deviceMissing: Boolean(target?.deviceFile) && deviceFileFor(target?.handleId) === null,
|
|
281
287
|
saveNow: writes.saveNow,
|
|
282
288
|
copy,
|
|
283
289
|
download,
|