--- a/search-config.json +++ b/search-config.json @@ -1,5 +1,5 @@ { - "enabled": false, - "minChars": 3, - "showCount": false + "enabled": true, + "minChars": 2, + "showCount": true } --- a/search-items.js +++ b/search-items.js @@ -1,4 +1,4 @@ export function searchItems(items, text, config) { - if (!config.enabled) return []; + if (!config.enabled || text.length < config.minChars) return []; return items.filter(item => item.title.includes(text)); } --- a/search-view.js +++ b/search-view.js @@ -1,3 +1,3 @@ export function describeResults(matches, config) { - return "Search"; + return config.showCount ? `Search (${matches.length})` : "Search"; }