Skip to content

feat: Add file explorer open in browser actions#1843

Open
elashera wants to merge 1 commit into
stablyai:mainfrom
elashera:open-files-in-orca-browser
Open

feat: Add file explorer open in browser actions#1843
elashera wants to merge 1 commit into
stablyai:mainfrom
elashera:open-files-in-orca-browser

Conversation

@elashera
Copy link
Copy Markdown

@elashera elashera commented May 14, 2026

Summary

With the growing use of HTML files for local text, diagrams, and generated artifacts, this adds a faster way to open local files in Orca's built-in browser.

  • Adds an "Open in Orca Browser" context-menu action for file explorer rows.
  • Allows dragging local file explorer entries onto the browser pane to open them as file:// URLs.

Screenshots

Screen recording:

Screen.Recording.2026-05-14.at.13.07.36.mov

The recording shows:

  • opening a file with "Open in Orca Browser"
  • dragging a file from the file explorer into the browser pane

Testing

  • pnpm lint
    • Ran focused lint:
      pnpm exec oxlint src/renderer/src/components/browser-pane/BrowserPane.tsx src/renderer/src/components/right-sidebar/FileExplorerRow.tsx src/renderer/src/components/right-sidebar/FileExplorerBackgroundMenu.tsx src/renderer/src/lib/file-preview.ts src/renderer/src/lib/file- preview.test.ts
  • pnpm typecheck
    • Ran:
      pnpm exec tsc --noEmit -p config/tsconfig.web.json --composite false
  • pnpm test
    • Ran:
      env -u OPENCODE_CONFIG_DIR -u ORCA_OPENCODE_CONFIG_DIR -u PI_CODING_AGENT_DIR -u ORCA_PI_CODING_AGENT_DIR pnpm test
  • pnpm build
    • Ran:
      env -u OPENCODE_CONFIG_DIR -u ORCA_OPENCODE_CONFIG_DIR -u PI_CODING_AGENT_DIR -u ORCA_PI_CODING_AGENT_DIR pnpm build
    • Note: build completed successfully. Local environment warned that the repo expects Node 24 while the shell used Node 25.6.1, and it could
      not create /usr/local/bin/orca-dev due permissions.
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed
    • Added file-preview.test.ts for opening local file URLs in Orca browser tabs.
    • Ran:
      pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/file-preview.test.ts

AI Review Report

The AI coding agent reviewed the change for scope, interaction behavior, and cross-platform compatibility.

Checked risks:

  • Cross-platform file path handling for macOS, Linux, and Windows.
  • Browser file:// URL conversion.
  • SSH worktree behavior.
  • Context-menu pointer behavior in Electron/Radix.
  • Whether the change introduced new IPC, shell execution, or platform-specific shortcuts.

Findings and results:

  • File URL creation uses Orca's existing absolutePathToFileUri helper instead of hardcoded separators.
  • No keyboard shortcuts or shortcut labels were added, so there are no new Cmd/Ctrl platform differences.
  • SSH worktrees are explicitly guarded because browser file:// URLs resolve on the local machine, not on the remote host.
  • Right-click menu handling was adjusted to prevent the right-button release from selecting "New File" immediately after opening the menu.
  • No new main-process IPC was added.

Security Audit

The AI coding agent reviewed the security impact of the browser/file explorer changes.

Reviewed areas:

  • Path handling
  • Browser navigation
  • IPC surface
  • Command execution
  • Remote SSH behavior
  • Dependency changes
  • Secrets/auth handling

Summary:

  • No new dependencies were added.
  • No secrets or auth behavior were touched.
  • No shell commands are executed by this feature.
  • No new main-process IPC surface was introduced.
  • The action opens paths already present in Orca's file explorer state.
  • SSH paths are blocked from local file:// navigation to avoid misleading or broken remote-file assumptions.
  • Drag-and-drop opens the file as a browser navigation target; it does not inject file contents into arbitrary pages.

Follow-up:

  • None required for this PR.

Notes

  • Manual verification was done on macOS.
  • The implementation should be portable across macOS, Linux, and Windows because file URL conversion is centralized through the existing
    renderer helper.
  • SSH worktrees intentionally show a notice instead of opening remote files in the local browser.
  • X / Twitter: @elashera

@elashera elashera changed the title Add file explorer open in browser actions feat: Add file explorer open in browser actions May 14, 2026
@AmethystLiang AmethystLiang self-requested a review May 14, 2026 16:58
@AmethystLiang
Copy link
Copy Markdown
Contributor

thx for the PR! will review and get this in today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants