Skip to content

Use scoped document previews for local workspace file links - #27171

Closed
noisefallacy wants to merge 1 commit into
stablyai:mainfrom
noisefallacy:fix/20997-local-document-preview
Closed

noisefallacy wants to merge 1 commit into
stablyai:mainfrom
noisefallacy:fix/20997-local-document-preview

Conversation

@noisefallacy

Copy link
Copy Markdown

Change

Route local workspace file previews through the existing permission-scoped orca-preview:// document path instead of creating raw file:// browsing tabs. Add a local grant owner to renderer/preload/main contracts and serve local bytes through the canonical authorized reader, without a base64 round trip. Treat linked Python source as plain text.

Reuse entry/initial-directory/additional-directory authorization, canonical path and symlink containment, trusted-renderer grant minting, and existing bounded reads (10 MiB). Keep document CSP, raw-file navigation refusal, remote ownership and external-navigation fences unchanged. Remove obsolete browser-only local-preview branches and incidental mock-echo tests; add actual-filesystem consumer regressions. Update existing README asset guidance.

Scope

Related to #16717 and #20997 for the native Open Preview to the Side workflow. This deliberately does not change raw orca tab create --url file:///... navigation, and does not claim to close those issues in full. Existing browser pages are not migrated. Native preview assets must be local; CDN scripts remain blocked by the existing document CSP.

Verification

  • Nine targeted Node suites: 161 passed, one existing skipped; includes document reader/grants/policy/protocol/IPC, authorized access and renderer preview/grant behavior.
  • Actual filesystem regressions: sibling HTML, explicitly authorized cross-directory CSV, junction escape refusal and plain-text Python source.
  • Node and renderer typechecks passed.
  • Targeted oxlint and commit-hook lint/format checks passed.
  • Standard CLI and electron-vite builds passed.
  • Actual built Windows app: native local HTML preview navigated to seven sibling documents and returned to the inventory under its scoped document URL. Additional-directory permission UI remained present; no broad grant was approved.

Limits

The isolated verification app has been closed; no installed app/profile replacement was performed. Remaining report-specific section/evidence/image link activation and locally vendored formula rendering have not been visually verified. Development-mode renderer hit a pre-existing GrowingByteBuffer export error; verification used the successful standard production build, not an unrelated code workaround.

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.

1 participant