diff --git a/Sources/ContentView.swift b/Sources/ContentView.swift index 8145ea58..5f349123 100644 --- a/Sources/ContentView.swift +++ b/Sources/ContentView.swift @@ -4539,7 +4539,6 @@ struct ContentView: View { } return currentMatchingQuery == resolvedMatchingQuery - || currentMatchingQuery.hasPrefix(resolvedMatchingQuery) } private func scheduleCommandPaletteResultsRefresh( diff --git a/cmuxTests/CommandPaletteSearchEngineTests.swift b/cmuxTests/CommandPaletteSearchEngineTests.swift index 128ecc01..eac9916e 100644 --- a/cmuxTests/CommandPaletteSearchEngineTests.swift +++ b/cmuxTests/CommandPaletteSearchEngineTests.swift @@ -499,6 +499,20 @@ final class CommandPaletteSearchEngineTests: XCTestCase { ) } + func testPendingEmptyStateIsPreservedForSameResolvedNoMatchQuery() { + XCTAssertTrue( + ContentView.commandPaletteShouldPreserveEmptyStateWhileSearchPending( + isSearchPending: true, + visibleResultsScopeMatches: true, + resolvedSearchScopeMatches: true, + resolvedSearchFingerprintMatches: true, + resolvedResultsAreEmpty: true, + currentMatchingQuery: "zzzzzzzz", + resolvedMatchingQuery: "zzzzzzzz" + ) + ) + } + func testPendingEmptyStateIsNotPreservedWhenQueryDoesNotRefineResolvedNoMatch() { XCTAssertFalse( ContentView.commandPaletteShouldPreserveEmptyStateWhileSearchPending(