Bug: prevent multiple file picker dialogs on double-click#5640
Bug: prevent multiple file picker dialogs on double-click#5640Lymah123 wants to merge 4 commits intoblock:mainfrom
Conversation
Signed-off-by: Lymah123 <[email protected]>
Signed-off-by: Lymah123 <[email protected]>
Signed-off-by: Lymah123 <[email protected]>
There was a problem hiding this comment.
Pull Request Overview
This pull request includes improvements to file dialog handling in the desktop application, adds a new community content submission, and updates the .gitignore file.
- Prevents multiple simultaneous file dialogs using a flag with try-finally cleanup
- Adds a community blog post submission about managing goose configurations
- Ignores the .cargo/ directory in version control
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ui/desktop/src/main.ts | Adds protection against multiple simultaneous file dialogs with proper cleanup using try-finally pattern |
| documentation/src/pages/community/data/community-content.json | Adds a community blog post entry about managing goose configurations |
| .gitignore | Adds .cargo/ directory to ignored paths |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "title": "Managing goose Configurations Across Multiple Projects", | ||
| "author": { | ||
| "name": "Halimah", | ||
| "handle": "lymah123" | ||
| }, | ||
| "type": "blog", | ||
| "url": "https://dev.to/lymah/managing-goose-configurations-across-multiple-projects-58i3", | ||
| "thumbnail": "https://i.imgur.com/VvM8sMR.png", | ||
| "submittedDate": "2025-10-30", | ||
| "tags": ["hacktoberfest"], |
There was a problem hiding this comment.
This entry appears to be a duplicate of the existing entry at lines 273-286. Both entries have the same title, author, URL, thumbnail, and submitted date. This duplicate should be removed to avoid redundant content in the community submissions list.
| "title": "Managing goose Configurations Across Multiple Projects", | |
| "author": { | |
| "name": "Halimah", | |
| "handle": "lymah123" | |
| }, | |
| "type": "blog", | |
| "url": "https://dev.to/lymah/managing-goose-configurations-across-multiple-projects-58i3", | |
| "thumbnail": "https://i.imgur.com/VvM8sMR.png", | |
| "submittedDate": "2025-10-30", | |
| "tags": ["hacktoberfest"], | |
| "title": "Managing Goose Configurations Across Multiple Projects: A Practical Guide", | |
| "author": { | |
| "name": "Viet Bui", | |
| "handle": "vietbui1999ru" | |
| }, | |
| "type": "blog", | |
| "url": "https://dev.to/vietbui1999ru/managing-goose-configurations-across-multiple-projects-a-practical-guide-48ei", | |
| "thumbnail": "https://imgur.com/a/ubyYbVJ", | |
| "submittedDate": "2025-10-31", | |
| "tags": [ | |
| "hacktoberfest" | |
| ], |
|
Hi @DOsinga! I will be waiting for your review. |
DOsinga
left a comment
There was a problem hiding this comment.
Thanks for jumping on this. I think we need to solve this at the caller level though
if we add functonality to the selectFileOrDirectory calls (there's two, but we only really care about the one in ChatInput.tsx) we can just dissable the button while the modal is open.
that would be a better experience since with the current proposed fix, if we have two goose windows and you select files from both, as soon as the first one closes, the second one would allow you to open an extra window, but also, disabling a button is better than just doing nothing because that other window is already open
|
Hi! |
yes, I think that would work better - thanks |
Alright. I will work on the requested changes. Thanks |
| "hacktoberfest" | ||
| ], | ||
| "hacktoberfest": true | ||
| }, |
There was a problem hiding this comment.
These changes don't seem relevant to the intended scope of the PR. Are they left in unintentionally?
There was a problem hiding this comment.
I will remove those files once I am done making the requested changes. They were from my past PRs.
f8fed0c to
a5434b9
Compare
There was a problem hiding this comment.
This file shouldn't be deleted; just your changes need to be reverted
419d128 to
3691122
Compare
| const [displayValue, setDisplayValue] = useState(initialValue); // For immediate visual feedback | ||
| const [isFocused, setIsFocused] = useState(false); | ||
| const [pastedImages, setPastedImages] = useState<PastedImage[]>([]); | ||
| const [isFileDialogOpen, setIsFileDialogOpen] = useState(false); // NEW: Track file dialog state |
There was a problem hiding this comment.
just removing extra comments that we may not need
| const [isFileDialogOpen, setIsFileDialogOpen] = useState(false); // NEW: Track file dialog state | |
| const [isFileDialogOpen, setIsFileDialogOpen] = useState(false); |
| <DirSwitcher className="mr-0" /> | ||
| <div className="w-px h-4 bg-border-default mx-2" /> | ||
|
|
||
| {/* Attach button now disables when dialog is open */} |
There was a problem hiding this comment.
i think we may not need this comment either
| {/* Attach button now disables when dialog is open */} |
.gitignore
Outdated
|
|
||
| # Goose self-test artifacts | ||
| gooseselftest/ | ||
| .cargo/ |
There was a problem hiding this comment.
You can remove this change
Signed-off-by: Lymah123 <[email protected]>
| </TooltipTrigger> | ||
| <TooltipContent>Attach file or directory</TooltipContent> | ||
| <TooltipContent> | ||
| {isFileDialogOpen ? 'Dialog open...' : 'Attach file or directory'} |
There was a problem hiding this comment.
This here isn’t working, when a button is disabled, radix UI tooltips don’t show on hover by default, so you might need to add an alternate fix for showing dialog is open or maybe just disable grey button is fine or you can show a disabled point there.
Also, when I’m in different tabs, I’m not able to open multiple dialogs, but that might be because we’re only fixing it for the chat input, so maybe we can ignore that for now
There was a problem hiding this comment.
Ok, I will look into it.
|
I merged the other one since that didn't have a conflict, but I believe the approach is the same, so thanks! |
Summary
Add fileDialogOpen guard flag to select-file-or-directory IPC handler to prevent
race condition where rapid double-clicks would spawn multiple overlapping
file picker dialogs. Uses try-finally to ensure flag is always reset.
Also add .cargo/ to .gitignore to exclude local cargo config.
Type of Change
AI Assistance
Testing
Related Issues
Relates to #5527
Discussion: LINK (if any)
Screenshots/Demos (for UX changes)
Before:

After:


Submitting a Recipe?
Email: