4.5 KiB
Browser Node Actions Implementation Plan
For Claude: REQUIRED SUB-SKILL: Use
executing-plansto implement this plan task-by-task.
Goal: Add page find, printing, zoom controls, visible-page screenshots, download management, and profile-scoped browsing-data clearing to the Browser Node overflow menu.
Architecture: Extend the reusable @tutti-os/browser-node contract and Electron guest manager with generic browser actions and state events. Keep native file dialogs, download-folder integration, and file opening in the desktop host adapter. Reuse the existing UI System menu, buttons, inputs, and confirmation dialog, with all browser copy in the package i18n module.
Tech Stack: React 19, TypeScript, Electron 35, @tutti-os/ui-system, Node test runner.
Task 1: Extend Browser Node contracts and runtime state
Files:
- Modify:
packages/browser/workbench-node/src/core/types.ts - Modify:
packages/browser/workbench-node/src/core/runtimeStore.ts - Test:
packages/browser/workbench-node/src/core/runtimeStore.test.ts
Steps:
- Add typed inputs for find, zoom, screenshot, browsing-data clearing, and download actions.
- Add find-result and download-state Browser Node events.
- Extend the runtime store with stable find, zoom, and download snapshots.
- Add failing runtime-store tests for find and download event transitions.
- Implement the minimal reducer changes and rerun the focused tests.
Task 2: Implement Electron guest actions
Files:
- Modify:
packages/browser/workbench-node/src/electron-main/types.ts - Modify:
packages/browser/workbench-node/src/electron-main/guestManager.ts - Test:
packages/browser/workbench-node/src/electron-main/electronMain.test.ts
Steps:
- Extend the mockable guest interfaces with find, print, zoom, session clearing, and download APIs.
- Add failing tests for find results, printing, zoom clamping, screenshot capture, data clearing, and download lifecycle/actions.
- Implement action routing against the registered guest only.
- Attach and detach
found-in-pageand session download listeners without leaking across guest lifecycles. - Rerun the focused package tests.
Task 3: Wire package IPC and desktop-native adapters
Files:
- Modify:
packages/browser/workbench-node/src/electron-main/registerElectronMain.ts - Modify:
apps/desktop/src/shared/contracts/ipc.ts - Modify:
apps/desktop/src/preload/api/browser.ts - Modify:
apps/desktop/src/main/ipc/browser.ts - Test:
packages/browser/workbench-node/src/electron-main/electronMain.test.ts
Steps:
- Add optional package IPC channels and handlers for each new action.
- Add desktop IPC request and response mappings.
- Expose the narrow preload API methods.
- Save screenshots through a native save dialog and PNG write in the desktop host.
- Configure browser sessions to use the operating-system Downloads directory.
- Route open-file and reveal-in-folder download actions through Electron
shell. - Add handler-routing tests and rerun them.
Task 4: Build the Browser Node menu and panels
Files:
- Modify:
packages/browser/workbench-node/src/react/BrowserNode.tsx - Modify:
packages/browser/workbench-node/src/i18n/browserNodeI18n.ts
Steps:
- Make the overflow menu independent of the development-only DevTools action.
- Add the find bar with query, result count, previous/next, and close behavior.
- Add the inline zoom controls with reset, decrease, and increase actions.
- Add print, screenshot, and downloads commands.
- Add a compact downloads panel with progress, pause/resume, cancel, open, and reveal actions.
- Add a UI System confirmation dialog before clearing the active browser profile's browsing data.
- Route all English and Simplified Chinese copy through package i18n.
Task 5: Verify boundaries, behavior, and documentation
Files:
- Modify:
docs/architecture/browser-node-package.md - Modify:
docs/conventions/troubleshooting/toolchain-browser-terminal.mdonly if verification reveals a reusable debugging trap.
Steps:
- Run
pnpm --filter @tutti-os/browser-node test. - Run
pnpm --filter @tutti-os/browser-node typecheck. - Run
pnpm --filter @tutti-os/desktop typecheck. - Run
pnpm check:i18nandpnpm check:ui-boundaries. - Run
pnpm --filter @tutti-os/desktop build. - Inspect the final diff for package/host ownership, raw UI copy, and accidental unrelated changes.
- Update the Browser Node architecture document with the new action and native-host ownership boundaries.