Description
The Cmd+P project switcher (and the general command palette) does not filter results when typing in the search field. All items disappear immediately after entering any character.
Steps to Reproduce
- Have 2+ projects open in Mori
- Press Cmd+P to open the project switcher
- Observe that all projects are listed correctly (e.g.
dotfiles, work)
- Type any character (e.g.
d to filter for dotfiles)
Expected: The list filters to show matching projects (e.g. dotfiles for query d)
Actual: The list becomes empty — no results are shown
This also affects the full command palette (Cmd+Shift+P).
Screenshots
Before typing — projects listed correctly:
After typing d — all results disappear:
Analysis
The code path is:
controlTextDidChange → updateResults() → dataSource?.search(query:)
search() calls FuzzyMatcher.score(query:candidate:) on each item's title
FuzzyMatcher unit tests pass and the algorithm should return positive scores for valid matches (e.g. score(query: "d", candidate: "dotfiles") → 42 by manual trace). The issue is likely that controlTextDidChange is not firing, or searchField.stringValue is not synced with the field editor during editing.
Possible root cause: NSPanel configured with .nonactivatingPanel style mask + becomesKeyOnlyIfNeeded = true may interfere with the NSTextField delegate notification chain. In some macOS versions, the field editor inside a floating panel may not properly trigger controlTextDidChange, or stringValue may return stale content during active editing.
Relevant files
Sources/Mori/App/CommandPaletteController.swift — panel setup, controlTextDidChange, updateResults()
Sources/Mori/App/CommandPaletteDataSource.swift — search(query:) method
Packages/MoriCore/Sources/MoriCore/FuzzyMatcher.swift — scoring algorithm
Environment
- Mori v0.4.1
- macOS Tahoe 26.3.1
Description
The Cmd+P project switcher (and the general command palette) does not filter results when typing in the search field. All items disappear immediately after entering any character.
Steps to Reproduce
dotfiles,work)dto filter fordotfiles)Expected: The list filters to show matching projects (e.g.
dotfilesfor queryd)Actual: The list becomes empty — no results are shown
This also affects the full command palette (Cmd+Shift+P).
Screenshots
Before typing — projects listed correctly:
After typing
d— all results disappear:Analysis
The code path is:
controlTextDidChange→updateResults()→dataSource?.search(query:)search()callsFuzzyMatcher.score(query:candidate:)on each item's titleFuzzyMatcherunit tests pass and the algorithm should return positive scores for valid matches (e.g.score(query: "d", candidate: "dotfiles")→ 42 by manual trace). The issue is likely thatcontrolTextDidChangeis not firing, orsearchField.stringValueis not synced with the field editor during editing.Possible root cause:
NSPanelconfigured with.nonactivatingPanelstyle mask +becomesKeyOnlyIfNeeded = truemay interfere with theNSTextFielddelegate notification chain. In some macOS versions, the field editor inside a floating panel may not properly triggercontrolTextDidChange, orstringValuemay return stale content during active editing.Relevant files
Sources/Mori/App/CommandPaletteController.swift— panel setup,controlTextDidChange,updateResults()Sources/Mori/App/CommandPaletteDataSource.swift—search(query:)methodPackages/MoriCore/Sources/MoriCore/FuzzyMatcher.swift— scoring algorithmEnvironment