Skip to content

feat: support rendering diff previews for files outside current workspace - #40

Open
edahlseng wants to merge 1 commit into
MasuRii:mainfrom
edahlseng:feat/allow-external-diff-previews
Open

feat: support rendering diff previews for files outside current workspace#40
edahlseng wants to merge 1 commit into
MasuRii:mainfrom
edahlseng:feat/allow-external-diff-previews

Conversation

@edahlseng

Copy link
Copy Markdown

Description

This PR introduces the allowExternalDiffPreviews configuration option, enabling edit and write tool diff previews for files located outside the active workspace directory when explicitly enabled by the user.

Key Changes

  • src/types.ts & src/config-store.ts: Added allowExternalDiffPreviews boolean configuration property (defaults to false).
  • src/pending-diff-preview.ts: Added ReadWorkspaceOptions parameter to readWorkspaceUtf8File, resolveWorkspaceReadPath, buildPendingWritePreviewData, and buildPendingEditPreviewData to conditionally allow external path previews.
  • src/tool-overrides.ts: Passed current config option to diff preview builders during edit and write display calls and write execution content capture.
  • src/config-modal.ts: Added configuration modal setting with inspector details and off/on toggles.
  • src/presets.ts: Updated configsEqual check.
  • Docs & Config Examples: Updated README.md and config/config.example.json.
  • Tests: Added unit tests in tests/tool-ui-utils.test.ts verifying blocked behavior when false and successful diff generation when true.

Related Issue

Closes #39

Testing

Ran unit tests via npx tsx --test tests/tool-ui-utils.test.ts to verify both default blocked and enabled behavior.

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.

Feature Request: Allow pending diff previews for files outside the active workspace

1 participant