-
Notifications
You must be signed in to change notification settings - Fork 2.4k
5527 multiple file popups #5905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug where users could open multiple file picker or directory chooser dialogs by rapidly clicking the corresponding buttons. The fix adds state tracking to prevent re-opening dialogs while one is already active.
Key changes:
- Added state management to track when pickers/choosers are open
- Disabled buttons and added visual feedback (opacity) during picker/chooser operations
- Wrapped async operations in try-finally blocks to ensure cleanup
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ui/desktop/src/components/bottom_menu/DirSwitcher.tsx | Adds isDirectoryChooserOpen state, disables button during directory selection, and prevents tooltip from showing when chooser is active |
| ui/desktop/src/components/ChatInput.tsx | Adds isFilePickerOpen state and disables file attachment button during file selection |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
…active Signed-off-by: benjamindrussell <[email protected]>
3bcc306 to
70a4c2e
Compare
70a4c2e to
f30a0f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
| if (isDirectoryChooserOpen) { | ||
| event.preventDefault(); | ||
| event.stopPropagation(); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity, can you explain why just using return; won't work here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, returning only exits the handler, it doesn’t cancel the browser’s default behavior or stop the event from bubbling. We could remove preventDefault and add a type="button" to the button, since the default type is submit. TBH it would probably still work fine with just return.
* origin/main: Update Anthropic and Google Gemini models to latest API versions (#5980) docs: chat recall tutorial (#5975) fix: `final assistant content cannot end with trailing whitespace` error from Anthropic (#5967) 5527 multiple file popups (#5905) Groq configure fix (#5833) added sidebar contextual information for firefox (#5433) docs: council of mine MCP (#5979) docs: nano banana extension (#5977) fix: remove prompt change, read model from config (#5976) Enable recipe deeplink parameters for pre-population (#5757) chore: upgrade npm packages (#5951) feat: ActionRequired (#5897) feat(acp): support loading sessions in acp (#5942) docs: add videos to multi-model page (#5938) docs: promote planning guide (#5934)
* main: fix params not being substituted in activities (#5992) blog: MCP Sampling (#5987) Update Anthropic and Google Gemini models to latest API versions (#5980) docs: chat recall tutorial (#5975) fix: `final assistant content cannot end with trailing whitespace` error from Anthropic (#5967) 5527 multiple file popups (#5905) Groq configure fix (#5833) added sidebar contextual information for firefox (#5433) docs: council of mine MCP (#5979) docs: nano banana extension (#5977) fix: remove prompt change, read model from config (#5976) Enable recipe deeplink parameters for pre-population (#5757)
…nses-streaming * 'main' of github.com:block/goose: blog: MCP Sampling (#5987) Update Anthropic and Google Gemini models to latest API versions (#5980) docs: chat recall tutorial (#5975) fix: `final assistant content cannot end with trailing whitespace` error from Anthropic (#5967) 5527 multiple file popups (#5905) Groq configure fix (#5833) added sidebar contextual information for firefox (#5433) docs: council of mine MCP (#5979) docs: nano banana extension (#5977) fix: remove prompt change, read model from config (#5976) Enable recipe deeplink parameters for pre-population (#5757) chore: upgrade npm packages (#5951) feat: ActionRequired (#5897) feat(acp): support loading sessions in acp (#5942) docs: add videos to multi-model page (#5938)
* 'main' of github.com:block/goose: (21 commits) Hide recipe icon in empty chat (#6022) docs: provider and model config (#6008) Show modal selector after configuring a provider (#6005) docs: additional mcp sampling resources (#6020) Flutter PR Code Review (#6011) feat(mcp): elicitation support (#5965) Onboarding detect provider from api key (#5955) Fix PATH on Windows for extensions (#6000) recipe(datahub): Add a recipe for searching & understanding data in DataHub (#5859) fix params not being substituted in activities (#5992) blog: MCP Sampling (#5987) Update Anthropic and Google Gemini models to latest API versions (#5980) docs: chat recall tutorial (#5975) fix: `final assistant content cannot end with trailing whitespace` error from Anthropic (#5967) 5527 multiple file popups (#5905) Groq configure fix (#5833) added sidebar contextual information for firefox (#5433) docs: council of mine MCP (#5979) docs: nano banana extension (#5977) fix: remove prompt change, read model from config (#5976) ... # Conflicts: # ui/desktop/src/api/sdk.gen.ts # ui/desktop/src/components/bottom_menu/DirSwitcher.tsx
* 'main' of github.com:block/goose: (159 commits) Cleanup: Remove Recipe Key Flow (#6015) chore(deps): bump mdast-util-to-hast from 13.2.0 to 13.2.1 in /documentation (#5963) remove problematic corrupted woff font (#6006) Added search bar / filtering for recipes (#6019) Hide recipe icon in empty chat (#6022) docs: provider and model config (#6008) Show modal selector after configuring a provider (#6005) docs: additional mcp sampling resources (#6020) Flutter PR Code Review (#6011) feat(mcp): elicitation support (#5965) Onboarding detect provider from api key (#5955) Fix PATH on Windows for extensions (#6000) recipe(datahub): Add a recipe for searching & understanding data in DataHub (#5859) fix params not being substituted in activities (#5992) blog: MCP Sampling (#5987) Update Anthropic and Google Gemini models to latest API versions (#5980) docs: chat recall tutorial (#5975) fix: `final assistant content cannot end with trailing whitespace` error from Anthropic (#5967) 5527 multiple file popups (#5905) Groq configure fix (#5833) ...
Summary
Added state to track file picker status, disabled the button when file picker open.
Also, not mentioned in the original issue but the same behavior occurs for the directory chooser as well so I went ahead and fixed it.
Added state to track directory chooser status, disabled the button when directory chooser open.
Type of Change
AI Assistance
Testing
Manual Testing
Related Issues
Relates to #5527
Discussion: LINK (if any)
Screenshots/Demos (for UX changes)
Before:

After:

Submitting a Recipe?
Email: