{{ message }}
fix: prevent flash of unfiltered list when pressing Enter to open app#371
Merged
shobhit99 merged 5 commits intoMay 13, 2026
Merged
Conversation
Reorder hide-then-clear sequences so window.electron.hideWindow() is
awaited before setSearchQuery('') and setSelectedIndex(0). Without this,
React re-renders the unfiltered command list between the IPC return and
the main process's 50ms hideWindow() timer, producing a visible flash.
Closes SuperCmdLabs#370
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: add1147d78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Check the return value of executeCommand() before hiding the window and clearing search. When the user cancels the native confirmation dialog for system-close-all-apps, system-restart, or system-logout, the IPC returns false — the launcher should stay open and keep the current search state rather than disappearing. Addresses PR review feedback on SuperCmdLabs#371
…out flash Don't clear searchQuery/selectedIndex when hiding the window. The onWindowShown handler already resets them on reopen, so the clears are redundant. Worse, they cause a React re-render showing the unfiltered list during the window's blur/fade-out animation — still visible as a 2-3 frame flash even when hideWindow() is awaited first. Instead, keep the filtered list rendered while the window animates out. No re-render = no flash.
Moving setSearchQuery('') and setSelectedIndex(0) into the
window-hidden handler clears the state while the window is still
invisible, eliminating the flash of the old filtered list that
appeared on reopen before onWindowShown could reset it.
In onWindowShown, search state is only set when there's a
pendingQuery (pre-filled search for commands with missing args).
Collaborator
Author
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.

Summary
Fixes a visible flash of the default (unfiltered) command list that appears when pressing Enter to open an application from search, and the corresponding flash of stale search results when reopening the launcher.
Closes #370
Problem
Two related flash issues:
On close: When pressing Enter on a search result, the renderer clears
searchQueryafter the IPC call returns, triggering a React re-render of the unfiltered list while the window is still visible (the main process hides it on a 50ms delay).On reopen: If the search state is not cleared before hiding, the filtered list persists while the window is hidden — and when the window reopens,
onWindowShownresets the search, causing a flash of the old filtered state before it clears.Before:
Screen.Recording.2026-05-09.at.01.54.12.mov
After:
Screen.Recording.2026-05-09.at.01.56.43.mov
Fix
Clear the search state (
searchQueryandselectedIndex) in thewindow-hiddenhandler instead. The window is already invisible at that point, so the React re-render happens offscreen — no flash on close. When the window reopens, the state is already empty — no flash on open.In
onWindowShown, search state is only set when there is apendingQuery(pre-filled search for hotkey-triggered commands with missing args). The redundantsetSearchQuery("")/setSelectedIndex(0)calls throughout the hide-and-clear code paths are removed entirely.Additionally, the return value of
executeCommand()is now checked for system commands with native confirmation dialogs (system-close-all-apps,system-restart,system-logout) — if the user cancels, the launcher stays open.Changes in
App.tsxonWindowHiddenhandlersetSearchQuery("")andsetSelectedIndex(0)— clears state while window is invisibleonWindowShownhandlersetSearchQuery("")/setSelectedIndex(0)from routed system command, direct-launch guard, and default reopen paths; only sets search whenpendingQueryis presenthandleCommandExecute— generic app commandssetSearchQuery("")/setSelectedIndex(0)afterhideWindow()handleCommandExecute— system commands with confirmationexecuteCommand()return value; removed redundant search clearhandleCommandExecute— menu-bar extension togglesetSearchQuery("")/setSelectedIndex(0)afterhideWindow()handleCommandExecute— file result pathsetSearchQuery("")/setSelectedIndex(0)(already callshideWindow()viaopenFileResultByPath)submitBrowserSearchsetSearchQuery("")/setSelectedIndex(0)afterhideWindow()executeQuickLinkCommand(×2)setSearchQuery("")/setSelectedIndex(0)afterhideWindow()runScriptCommand— hidden result modesetSearchQuery("")/setSelectedIndex(0)afterhideWindow()ExtensionPreferenceSetupViewsave callbacksetSearchQuery("")andsetSelectedIndex(0)Testing