-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Remove half-second wait, rework auto submit #4282
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
69d494f to
6350848
Compare
DOsinga
left a comment
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.
!!!
| pastedImages, | ||
| setLocalDroppedFiles, | ||
| ] | ||
| ); |
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.
what happened here? did we not get warnings about this?
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.
The key change here is running performSubmit() in a useEffect, but in order to do that I wrapped that in a useCallback, and that meant enumerating its dependencies.
We could have gotten away with keeping this a function re-created on every render, since the submit effect should only actually do something just once anyway, but we'd have to suppress some warnings and potentially invite some future bugs. Using hooks for all of them seemed the right way to go
| const allDroppedFiles = useMemo( | ||
| () => [...droppedFiles, ...localDroppedFiles], | ||
| [droppedFiles, localDroppedFiles] | ||
| ); |
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.
does this help?
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.
it's a dependency of a hook now, so we don't want to make a new list every time
* main: docs: Plan tutorial (#4309) Extensions Modal Improvements (#4293) docs: fixed cicd tutorial pipeline in docs (#4223) Read oltp config from config and env (#4292) release/1.6.0 (#4280) docs: fix broken links in Docker tutorial (#4285) Remove half-second wait, rework auto submit (#4282) Block send until extensions are ready (#4271) fix: improve OpenAI-compatible error handling and add test coverage (#4175) Move To-Do Tool to Session Scope from Agent Scope (#4157) fix: recipe params not being replaced all the time (#4207) chore: removing little-used session sharing feature (#4249) Stop auto scrolling when agent responds and let scroll area handle scrolling to bottom (#4257) restore cli projects from accidental removal during cleanup (#4266) Fix: deep link extension installation to show dialog for headers configuration (#4150)
* main: (24 commits) feat: autovisualiser of structured data with mcp-ui (#4153) docs: Plan tutorial (#4309) Extensions Modal Improvements (#4293) docs: fixed cicd tutorial pipeline in docs (#4223) Read oltp config from config and env (#4292) release/1.6.0 (#4280) docs: fix broken links in Docker tutorial (#4285) Remove half-second wait, rework auto submit (#4282) Block send until extensions are ready (#4271) fix: improve OpenAI-compatible error handling and add test coverage (#4175) Move To-Do Tool to Session Scope from Agent Scope (#4157) fix: recipe params not being replaced all the time (#4207) chore: removing little-used session sharing feature (#4249) Stop auto scrolling when agent responds and let scroll area handle scrolling to bottom (#4257) restore cli projects from accidental removal during cleanup (#4266) Fix: deep link extension installation to show dialog for headers configuration (#4150) feat: Add message queue system with interruption handling (#4179) Start extensions concurrently (#4234) Add X-Title and referer headers on exchange to tetrate (#4250) docs: update View/Edit Recipe menu item name (#4267) ...
Signed-off-by: Alex Rosenzweig <[email protected]>
Signed-off-by: Dorien Koelemeijer <[email protected]>
Do the auto-submit using props instead of imperatively so we don't need to wait.