Repository navigation
feat(desktop): use native right-click menus - #4650
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (c8efbf029dad34b661f15bbde09fcb8b65323215). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
c8efbf0 to
21ddb06
Compare
|
Passed · 1/1 tests · 2/2 assertions · 0 images Commit |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (61e7b810f8f872e8e9d303ac01c95a1e85cfa515). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
…he snapshot-error composer test apps/app/tests/composer-editable-on-snapshot-error.test.tsx has been red on dev since #4293 (composer renders WorkspaceRunModeMenu, which reads DesktopConfigProvider) and #4650 (message list renders ActionContextMenu, which reads PlatformProvider). Both providers exist at the real app root, so this is test drift, not a product regression. Mirror the fix already applied to composer-focus-continuity.test.tsx in #4631 and #4640.
…r (missing PlatformProvider / run-mode menu) (#4802) apps/app/tests/composer-editable-on-snapshot-error.test.tsx has been red on dev since #4293 (composer renders WorkspaceRunModeMenu, which reads DesktopConfigProvider) and #4650 (message list renders ActionContextMenu, which reads PlatformProvider). Both providers exist at the real app root, so this is test drift, not a product regression. Mirror the fix already applied to composer-focus-continuity.test.tsx in #4631 and #4640.
…observation (#4744) * test(evals): state that a pending consent tab has no hidden host or viewport A background conversation's browser.open_url allocates a blank consent tab that stays off every native host and unsized until its approved first navigation completes (deferBackground, #4468). The spec asserted the 1280x800 background viewport on that blank tab; assert zero bounds and no hidden window there, and assert the background host geometry once the page holds a document. Also read state through probe.browserState() in the last step, which this world never exposed as readBrowserState. * feat(desktop): observe native context menus in development Native popups have no DOM and no CDP target, so nothing outside the main process can see which entries a right-click offered or deliver a choice. Record each shown template as plain data (ids, labels, enabled, no callbacks) plus the last selection, and expose inspect/choose/dismiss to the app's main frame only when OPENWORK_DEV_MODE=1 and the app is unpackaged. * test(evals): drive the transcript link menu through the native menu seam be5ab61 (#4650) replaced the overlay.html link menu with a native popup, so the spec's overlay target never appears. Read entries and deliver choices through the development seam, keep the negative half (no HTML menu in the app document), and assert Copy Link Address through the recorded selection and the clipboard. * test(evals): issue the background open at the window boundary The spec proved a pending background open through POST /experimental/ui-control/request, but the server mailbox answers "did not answer within 5 seconds" (#4459) while the step needs the user to switch conversations and approve navigation. Stamp the command with its origin through window.__openworkControl.command instead, which is exactly what the mailbox hands the window, and print the reply when it lacks a result. * test(evals): baseline the paused-open comparison after the reading tab re-attaches Switching back to the reading conversation re-attaches its view to the panel asynchronously; snapshotting native state mid-transition made the rejected paused open look like it changed geometry. * test(evals): assert task protection through the panel's disabled Suspend control The panel renders a "Suspend" button that is disabled while a task protects the page (title: Protected until browser work is released) and never sends the request, so the "Suspend tab" click and "protected or busy" toast the step expected could not exist. Assert the disabled control, then that browser.release_tab enables it. * test(testkit): wait for a seeded session's title like sessions() does seed.session fired session.rename and returned; three of five Daytona runs of browser-tabs-owned-by-thread then never saw the new conversation's title in the sidebar (it stayed "New session"). Reuse renameSessionAndWait, which confirms the listed title and retries the rename once. * test(desktop): type the context-menu template fixture against the IPC contract The typecheck:electron step rejected the inspection fixture because the request() helper inferred a narrow item shape from its default argument, so a separator entry could not be passed. Annotate the fixture helpers with the NativeContextMenuItem contract from @openwork/types/desktop-ipc.
* chore: delete dead code, unused deps and orphaned assets Remove code that nothing reaches, verified against origin/dev with knip (new knip.jsonc) plus manual reference checks, including hidden dirs. Typecheck passes for app, server, desktop, den-api, den-web, landing, gateway and telemetry; the app builds; app boot and desktop tests pass. App (apps/app): - React-port leftovers and orphaned modules: actions store/provider, global sync and SDK providers, unused settings, connections and session modules, test-only helpers and their scripts. - Dead exports: unused utils, Advanced sections, migration deferral helpers, compactSession, the deprecated signUpEmail stub. - The unregistered OpenAI image settings state and the never-read microsandboxCreateSandbox flag. - The menu-overlay renderer (native context menus replaced it in #4650), unused i18n keys and 192 unused grain-art images. - Deps: @ai-sdk/react, @radix-ui/colors, @radix-ui/react-use-controllable-state, remark-breaks, remark-gfm. Desktop (apps/desktop) and types: - 16 renderer-unreachable IPC handlers and their types and re-exports (some wrote files), plus 7 unused browser and microphone channels. - menu-overlay preload, unused dev icons, electron-devtools-installer. Server (apps/server): - Unused exports, @types/minimatch, @openwork/headless-threads and the opencode-chrome-devtools devDep with its module declaration (the bundled openwork-chrome-devtools plugin replaced it in #4423). Den: - Orphaned landing components, the den-api plugin-system barrel and desktop-policy-role-assignments re-export, a test-only cache hook, test helpers and evidence scripts left without tests, and unused deps (grammy, drizzle-orm in gateway, zod in telemetry). Repo: - apps/ui-demo, Tauri migration scripts, the broken dev-web-local and dev-den-local scripts, the den-controller stub and DEN_CONTROLLER_PORT, one-off scripts, HANDOFF.md, committed tsbuildinfo files and tracked evals/results output, the Remote MCP Apps docs. - Add knip.jsonc and make scripts/find-unused.sh a thin knip wrapper that uses pnpm. Signed-off-by: Benjamin Shafii <[email protected]> * chore(app): keep only the artifact helpers production uses lib/artifacts.ts keeps ArtifactType, getArtifactType and useOpenArtifactPath; the rest had no production caller and its tests were already removed. Signed-off-by: Benjamin Shafii <[email protected]> --------- Signed-off-by: Benjamin Shafii <[email protected]>
Summary
Verification
Verdict: Incomplete. The implementation and focused checks are complete, but real native-menu interaction and head-matching journey evidence are not. This is not a merge-readiness claim.
Checked at
21ddb0623383f6ac02f78a55a91c34da3f2ce956, based on canonicaldevat52a028817ec185df72c28d08bc87db90ba7c71a4:Passed (all exit 0):
node --test apps/desktop/electron/context-menu.test.mjs apps/desktop/electron/browser-panel.test.mjs— 62 passed, 0 failed, 0 skipped.corepack pnpm --filter @openwork/app exec bun test --isolate ./tests/action-menu-model.test.ts— 6 passed, 0 failed.corepack pnpm --filter @openwork/app typecheck.corepack pnpm --filter @openwork/app exec tsc --allowJs --checkJs --noEmit --skipLibCheck --target ES2022 --module NodeNext --moduleResolution NodeNext ../desktop/electron/context-menu.mjs.node --check apps/desktop/electron/main.mjs,node --check apps/desktop/electron/preload.mjs, andgit diff --check.Failed setup attempt: the initial browser-panel test invocation could not resolve a workspace dependency before installation. After a frozen-lockfile filtered install, the command passed. No failed assertions remain in the selected checks.
Skipped/deferred:
browser-tabs-owned-by-thread,new-split-session,cross-workspace-split-view, andsession-archive-undojourneys still interact with DOM menus. They must be adapted to a real native-menu driver, then run on this head; their current selectors will not validate the new Desktop presenter. No test-only HTML fallback or direct callback invocation is being counted as OS-level proof.Manual verification still required