fix(web): command palette stays open under StrictMode in dev - #263
Merged
Conversation
The open palette dialog reset the store from its own effect cleanup. The app mounts under React StrictMode, which runs every new effect's cleanup once right after mount, so in dev the palette closed the instant it opened. Every entry point (Ctrl+K, the sidebar search, the first-run "Choose a folder" button) has been a dead end in dev since the cleanup landed on August 10. The reset now lives on the CommandPalette wrapper, which mounts once with the app shell: StrictMode's extra cleanup pass finds the palette closed and does nothing, while the wrapper's real teardown still resets the store. The ChatView browser harness gains a `strictMode` option and one test that opens the palette under StrictMode; it fails on the old code.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In dev the command palette opened and closed within the same instant, so Ctrl+K, the sidebar search, and the first-run "Choose a folder" button all appeared to do nothing. The packaged app was unaffected.
The open palette dialog reset the store from its own effect cleanup. The app mounts under React StrictMode, which runs every new effect's cleanup once right after mount, and that extra run closed the palette as soon as it opened. This has been the case since the cleanup landed on August 10.
The reset moves to the
CommandPalettewrapper, which mounts once with the app shell. StrictMode's extra pass finds the palette closed there and does nothing, while the wrapper's real teardown still resets the store as before.Adds a
strictModeoption to the ChatView browser harness and one regression test. The test fails on the old code and passes with the fix. Palette and folder-affordance browser tests, format, lint, and typecheck pass.