From b53bd952db0a06645ac9a90de83c661422eaaec9 Mon Sep 17 00:00:00 2001 From: Saksham Jain <109138272+SakShamJain8@users.noreply.github.com> Date: Wed, 8 Apr 2026 20:39:20 +0530 Subject: [PATCH] Fix/desktop open with tool access (#6056) ## Description Fixes #6029 - Additional selection in windows client no longer necessary ## Problem When opening PDF files in the Windows desktop client using "Open with", the file displays properly but users had to manually select it again in the workbench before any PDF tools (merge, compress, crop, compare, etc.) become functional. ## Root Cause Files opened via "Open with" were added to FileContext but **not selected** (missing `selectFiles: true`). Without selection, the file wasn't marked as active, preventing tool access. Additionally, `AppInitializer` was placed outside `ToolWorkflowProvider`, causing a context error. ## Solution ### Changes: 1. **frontend/src/desktop/hooks/useAppInitialization.ts** - Added `{ selectFiles: true }` when calling `addFiles()` - Files now immediately marked as active in FileContext 2. **frontend/src/core/components/AppProviders.tsx** - Moved `AppInitializer` inside `ToolWorkflowProvider` - Ensures context availability for initialization ## Testing - Open PDF via "Open with" on Windows - File now immediately usable with all tools - No manual reselection needed ## Screenshot Screenshot (3) --------- Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Co-authored-by: EthanHealy01 <80844253+EthanHealy01@users.noreply.github.com> Co-authored-by: Reece Browne <74901996+reecebrowne@users.noreply.github.com> --- frontend/src/desktop/hooks/useAppInitialization.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/desktop/hooks/useAppInitialization.ts b/frontend/src/desktop/hooks/useAppInitialization.ts index 7796842ca1..6bbca20fdb 100644 --- a/frontend/src/desktop/hooks/useAppInitialization.ts +++ b/frontend/src/desktop/hooks/useAppInitialization.ts @@ -59,7 +59,7 @@ export function useAppInitialization(): void { const filesArray = loadedFiles.map(entry => entry.file); const quickKeyToPath = new Map(loadedFiles.map(entry => [entry.quickKey, entry.filePath])); - const addedFiles = await addFiles(filesArray); + const addedFiles = await addFiles(filesArray, { selectFiles: true }); addedFiles.forEach(file => { const localFilePath = quickKeyToPath.get(file.quickKey); if (localFilePath) {