Repository navigation
feat(cua): virtual cursor overlay, surface snapshots, and pointer timeline drag - #562
Draft
sjungwon03 wants to merge 39 commits into
Draft
sjungwon03 wants to merge 39 commits into
sjungwon03 wants to merge 39 commits into
Conversation
…-approved-self-window-cua
…-approved-self-window-cua
…a' into feat/558-app-window-cua-driver
…into feat/559-approved-self-window-cua
…a' into feat/558-app-window-cua-driver
…a' into feat/558-app-window-cua-driver
…-approved-self-window-cua
…-approved-self-window-cua
…-approved-self-window-cua
…ointer timeline drag
…proval summary UI
…us revision invariant
…irty/saving DOM states
…-app-window-cua-driver # Conflicts: # tests/cuaAgentRunBinding.test.ts
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the desktop Frontend CUA overlay, fail-closed
SurfaceSnapshotreporting, synchronous drag rollback +cancelAckhandshake, LLMcuaApproval/errorCodechat presentation, explicit Save DOM state markers (keeping Save strictly in the protected header outside[data-cua-safe-surface]), and Pointer Events timeline clip drag + 1-step Undo over the integrated Backend+LLM self-window CUA runtime.2a7edd741993ab2f59cc15a137e546a1851fe3f2(origin/feat/558-app-window-cua-driver, Draft PR feat(cua): add self-window input driver and session safety #560 — includes Backendee7a24f/63eac3a/cf11d74/7bde903/bbf8835/c03f32c/2a7edd7and LLMa1369cb/58a25f4)a900bee19e93a97cd4226617209f03935c2f3977git diff --name-only 2a7edd741993ab2f59cc15a137e546a1851fe3f2...HEADtouches only 23 Frontend-owned files + Frontend tests +tsconfig.node.json(0 Backend/LLM/lockfile modifications).Implemented Capabilities
src/renderer/src/cua/CuaOverlay.tsx,cuaOverlay.css)state.cursorviewport CSS px), drag visualization (dragStart→cursor→target), phase/label/error/cleanupComplete/targetGone, andcleanup-failed+releaseFailuresre-run lock banner.[data-cua-protected="stop-button"](data-testid="cua-stop-btn",16,54,116×32over workbench header, non-overlapping safe surfaces) mounted outside#app-shell-workspace'sinertlock and kept mounted acrossidle(opacity: 0; pointer-events: none; disabled; tabIndex=-1) →ready→acting→stopping→stoppedsoprotectedRectsandlayoutRevisionnever churn.Escapeandcua-stop-btnrun synchronous drag rollback beforewindow.videoTool.cuaStop(), keeping stopping progress until main pushesstopped+cleanupComplete: true.cuaAckCancel(src/renderer/src/cua/cuaDragGuard.ts,useCuaOverlay.ts)onCuaStateChangedstrictly before ReactsetState: synchronously rolls back active timeline pointer drags (clearing preview + releasing pointer capture + settingaborted) and sends deduplicatedwindow.videoTool.cuaAckCancel({ runId, cancelToken })onstopping+cancelToken.SurfaceSnapshot&inertCoordination (src/renderer/src/cua/cuaSurfaceSnapshot.ts,useCuaOverlay.ts,AppShell.tsx)executionBlocked,blockReason,layoutRevision,viewport,safeSurface,protectedRects,focusedInSafeSurface,focusedTestId.safeSurface: null,executionBlocked: true) on init/unmount, onboarding/modals, Projects, Settings, and open menus.layoutRevisionandCuaFrameinvariant when[data-cua-protected="approval-ui"]opens strictly inside the single fixed-width[data-cua-protected="agent-panel"]and across intra-safe-surface focus shifts; increments immediately on resize, scroll, modal/view change, panel resize/overlap, or focus leaving safeSurface.cuaApproval&errorCodeUI (AgentChatContext.tsx,AgentChatPanel.tsx)proposal.cuaApproval(actionKind,actionLabel,frameId,scopeRevision,coordinateSpace,coords/dragTo), disablesAlways allowon single-use CUA proposals, rendersturn.errorCodeguidance (CUA_FRAME_STALE..CUA_CLEANUP_FAILED), and wireswindow.videoTool.agentChatCancel.TimelineCanvas.tsx,TimelineEditor.tsx,useTimelineEditor.ts,timelinePointerDrag.ts)draggable; implemented Pointer Events (setPointerCapture) with snapping/overlap preservation, synchronous abort check inpointerup, and 1-step Undo (Cmd/Ctrl+Z+[data-testid="timeline-undo-btn"]).[data-testid="editor-save-btn"]inside.oc-editor-host__header, never inside[data-cua-safe-surface]so CUA clicks cannot bypass persistence) and addeddata-dirty,data-saving,data-save-status="clean|dirty|saving|saved|error",data-save-error,aria-busy, anddisabledon[data-testid="timeline-canvas"]and[data-testid="editor-save-btn"](zero autosave, zero bypass API).Confirmed DOM Selectors & Test IDs (for E2E /
scripts/cua-agent-app.integration.mjs)[data-cua-safe-surface="timeline"](data-testid="timeline-canvas"),[data-cua-safe-surface="canvas"],[data-cua-safe-surface="shorts-review"][data-cua-protected="agent-panel"]— exact count 1 (#app-shell-agent-chat, width<= viewport.width / 2, non-overlapping safeSurface)[data-cua-protected="approval-ui"]— strictly inside[data-cua-protected="agent-panel"][data-cua-protected="stop-button"]+data-testid="cua-stop-btn"— fixed16,54,116×32, outsideinert[data-cua-protected="settings"],[data-cua-protected="chrome-menu"],[data-cua-protected="modal"][data-testid="editor-save-btn"](protected inside.oc-editor-host__header; no Save button inside[data-cua-safe-surface]),[data-testid="timeline-undo-btn"],[data-testid="timeline-redo-btn"], withdata-dirty,data-saving,data-save-status,data-save-errorontimeline-canvasandeditor-save-btn, plusdata-timeline-start-msontimeline-clip-<id>.data-testids:cua-overlay,cua-cursor,cua-drag-svg,cua-drag-start,cua-drag-progress-line,cua-drag-target-line,cua-drag-target,cua-hud,cua-phase-badge,cua-label,cua-cleanup-status,cua-target-gone,cua-error,cua-cleanup-failed-warning,cua-release-failures,cua-stop-btn,agent-cua-approval-summary,agent-cua-approval-action,agent-cua-approval-frame,agent-cua-approval-revision,agent-cua-approval-coords,agent-cua-error-code,timeline-canvas,timeline-track-<id>,timeline-lane-<id>,timeline-clip-<id>.Verification Evidence
npm run typecheck— passednpm test— passed (223/223 files, 1414/1414 tests)npm run build— passedcd mobile && npm run typecheck— passedCuaDriver+CuaApprovalAuthority+registerCuaIpc(2a7edd7):agent-panelcount 1, width 360px,safe-surfacecount 1,clip draggable === null, notimeline-save-btnin safe surface)stop-buttonrect{x:16, y:54, width:116, height:32}invariant (layoutRevisiondelta = 0) acrossidle → ready → acting (short/240-char long label) → stopping → stopped → idleand non-overlapping withsafeSurfacesendInputEventfocus shifts (lane → clip-1 → lane) keeplayoutRevisioninvariant (6 → 6)CuaDriver.observe()→AgentChatPanelcuaApproval(layoutRevisioninvariant) →CuaDriver.execute(drag)(0ms → 1519ms)CuaDriver.execute({ kind: 'click' })targeting protected headereditor-save-btnrefused withCUA_OUT_OF_BOUNDS_OR_PROTECTED(0 save calls); explicit manualeditor-save-btnclick verifiedsaving → error → saved(data-dirty="false",data-save-status="saved")CuaDriver.execute(key: Cmd/Ctrl+Z)restore to0ms; mid-drag main cancel &Escapestop confirmcuaAckCancelwithcleanupComplete: true,releaseFailures: [], clip at0ms, and Undo stack unchangedturn.errorCode(CUA_FRAME_STALE) guidance displayed; 0 console/page/runtime errors.Follow-up Integration Scope
scripts/cua-agent-app.integration.mjs) and Backend PR feat(cua): add self-window input driver and session safety #560 coordination.