From a268bc86f313a0e454069790b1cbaadebc74262b Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sat, 18 Jan 2025 11:50:25 -0800 Subject: [PATCH] Fix issue preventing drag-and-drop files into Explorer view (#6030) This change addresses an issue that prevents file drag-n-drop from working in the Explorer view. The problem was that there was no Electron implementation of the accessors that Posit Workbench uses to check for file upload/download permissions. Consequently, in desktop mode these accessors did not work. The fix is to add accessors to the native (Electron) version of the environment service. Addresses https://github.com/posit-dev/positron/issues/5266. ### Release Notes #### New Features - N/A #### Bug Fixes - Fix file drag and drop into the Explorer view (#5266) ### QA Notes This change doesn't touch the logic for Workbench so testing desktop should be sufficient. --- .../electron-sandbox/environmentService.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/vs/workbench/services/environment/electron-sandbox/environmentService.ts b/src/vs/workbench/services/environment/electron-sandbox/environmentService.ts index 1f25e5b8aee..bfe6f6d6844 100644 --- a/src/vs/workbench/services/environment/electron-sandbox/environmentService.ts +++ b/src/vs/workbench/services/environment/electron-sandbox/environmentService.ts @@ -152,6 +152,20 @@ export class NativeWorkbenchEnvironmentService extends AbstractNativeEnvironment @memoize get filesToWait(): IPathsToWaitFor | undefined { return this.configuration.filesToWait; } + // --- Start Positron --- + // Always file downloads and uploads on Positron Desktop. These can be + // disabled in browser mode for security reasons (see + // BrowserWorkbenchEnvironmentService), but are always enabled in the + // desktop/Electron configuration. + get isEnabledFileDownloads(): boolean { + return true; + } + + get isEnabledFileUploads(): boolean { + return true; + } + // --- End Positron --- + constructor( private readonly configuration: INativeWindowConfiguration, productService: IProductService