Files
orca/src/preload/api/ui-window-api.ts
T
Brennan Benson e4cd14d914 Remove legacy OS file-drop routing (STA-6940 PR6/6) (#26385)
* feat(file-drop): add element owner preparation plumbing

* Fix terminal and chat file drop destination ownership

* fix runtime terminal drop ownership and queued chat retries

* fix(file-drop): preserve feedback acceptance and destination ordering

* fix(file-drop): attach chat and composer files at the drop surface

* fix(file-drop): preserve project destinations and live chat availability

* fix(file-drop): keep path resolution in filesystem namespace

* test(file-drop): use filesystem path bridge in PR3 fixtures

* fix(file-drop): bind terminal drops to pane elements

* fix(file-drop): compare terminal pane identity across public views

* test(file-drop): align composer lifecycle with element-owned drops

* Fix interrupted chat composition and refuse unused quick-create drops

* Type the quick-create drop regression transfer

* fix(file-drop): let the explorer, project sidebar, tab strip and editor own OS drops

STA-6940 PR5. The file explorer tree, the project sidebar, each editor
group's tab strip and its editor area now take OS file drops on their own
element through the shared owner hook, with identity from their own render
(the explorer's shown workspace and target row, the tab strip's and editor
group's worktree and group) instead of the active worktree. The explorer and
sidebar broadcast subscribers and their legacy drop markers are deleted;
editor-open moves out of useGlobalFileDrop into editor-dropped-file-open,
which the legacy unmarked-chrome route still uses until PR6.

* fix(file-drop): keep editor delivery tied to its destination group

* fix(file-drop): guard delayed opens and share floating ownership

* fix(file-drop): remove legacy OS drop routing (STA-6940 PR6/6)

* test(file-drop): finish owner test and comment cleanup

* Clarify dropped-file default editor destination

* Retain UI test namespace for terminal resume coverage
2026-10-07 23:11:37 -07:00

63 lines
3.0 KiB
TypeScript

import type { AgentSessionAttachmentClipboardTarget } from '../../shared/agent-session-attachments'
import type { ClipboardImageThumbnail } from '../../shared/clipboard-image'
import type { ReadClipboardTextOptions } from '../../shared/clipboard-text'
import type {
RichMarkdownContextMenuCommandPayload,
RichMarkdownContextMenuTableTarget
} from '../../shared/rich-markdown-context-menu'
export type UiWindowApi = {
readClipboardText: (options?: ReadClipboardTextOptions) => Promise<string>
readSelectionClipboardText: (options?: ReadClipboardTextOptions) => Promise<string>
saveClipboardImageAsTempFile: (args?: {
connectionId?: string | null
runtimeEnvironmentId?: string | null
agentSessionAttachment?: AgentSessionAttachmentClipboardTarget
/** A native-chat composer paste, kept where its draft can bring it back. */
forNativeChatDraft?: boolean
}) => Promise<string | null>
clipboardHasImage: () => Promise<boolean | null>
/** Paths of files a file manager copied; empty when there are none or the host cannot list them. */
readClipboardFilePaths: () => Promise<string[]>
/** Which restored draft pastes are still kept: files really in Orca's paste folder. */
restoreNativeChatPastes: (
paths: string[]
) => Promise<{ path: string; kept: boolean; exists: boolean }[]>
readClipboardImageThumbnail: () => Promise<ClipboardImageThumbnail | null>
writeClipboardText: (text: string) => Promise<void>
writeTerminalClipboardText: (text: string) => Promise<void>
writeSelectionClipboardText: (text: string) => Promise<void>
writeClipboardImage: (dataUrl: string) => Promise<void>
performNativePaste: (options?: { mode?: 'paste' | 'paste-and-match-style' }) => void
performNativeSelectionAction: (action: 'copy' | 'select-all') => void
writeClipboardFile: (
args:
| {
filePath: string
connectionId?: string | null
}
| string
) => Promise<{ ok: boolean; reason?: string }>
getZoomLevel: () => number
setZoomLevel: (level: number) => void
syncTrafficLights: (zoomFactor: number) => void
setMarkdownEditorFocused: (focused: boolean) => void
setRichMarkdownContextMenuTarget: (target: RichMarkdownContextMenuTableTarget | null) => void
setTerminalInputFocused: (focused: boolean) => void
setFloatingFocus: (state: { panelFocused: boolean; terminalFocused: boolean }) => void
setShortcutRecorderFocused: (focused: boolean) => void
onRichMarkdownContextCommand: (
callback: (payload: RichMarkdownContextMenuCommandPayload) => void
) => () => void
onFullscreenChanged: (callback: (isFullScreen: boolean) => void) => () => void
minimize: () => void
maximize: () => void
isMaximized: () => Promise<boolean>
onMaximizeChanged: (callback: (isMaximized: boolean) => void) => () => void
requestClose: () => void
popupMenu: () => void
onWindowCloseRequested: (callback: (data: { isQuitting: boolean }) => void) => () => void
confirmWindowClose: () => void
notifyWindowRevealed: () => void
}