Update plugin 本地搜索Neo v1.0.0#285
Conversation
- Initialize Everything file finder - Refactor Finder components - Add richer file previews - Add Markdown and code previews - Add PDF preview support - Fix PDF local file loading - Refactor Finder module structure - Centralize Finder persistence - Polish Finder UI styling - Implement local file icon caching - Polish Finder preview layout - Add file tree preview support - Add image preview copy action - Document project guidance - Add file copy menu action - Clean dist addon build output - Refine addon preview support - Tune Finder result pagination - Move category management to settings - Highlight Finder search matches - Stabilize image preview layout - Refine Finder enter handling - Centralize Finder shared state - Polish Finder UI behavior - Add bundled Everything management - Rename dist cleanup script - Refine bundled Everything shutdown - Add manual release workflow - Trigger release workflow on changes - Package dist contents in release - Limit large tar archive previews - Add shared addon argument parsing - Replace WMIC lookup with PowerShell CIM - Fix tail text preview decoding - Update README and test typings - Add platform info - Refactor Finder preview flow - Copy preview images as files - Add code preview line numbers - Add floating preview zoom - Improve match path search results - fix unexpected cleaning sub input when UI initializing
There was a problem hiding this comment.
Code Review
This pull request updates the local search plugin to query name matches and path matches separately when match path is enabled, merging and deduplicating the results with a new priority helper. It also cleans up sub-input lifecycle methods and adds unit tests. The review feedback identifies a potential TypeError in App.vue due to a missing null check on item.fullPath, and notes that the merged results in useFinderSearch.ts can exceed the maxResults limit, recommending a slice operation to enforce the limit.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| const items: MainPushSearchResult[] = resultItems | ||
| .slice(0, MAIN_PUSH_RESULT_LIMIT) | ||
| .map((item) => ({ | ||
| title: item.path ?? getParentPath(item.fullPath), |
There was a problem hiding this comment.
如果 item.path 为 undefined 且 item.fullPath 也为 undefined(或者仅 item.fullPath 为 undefined),调用 getParentPath(item.fullPath) 将会抛出 TypeError,因为 getParentPath 期望接收一个字符串并对其调用 lastIndexOf。由于 fullPath 在 FinderResult 中是可选属性,我们应该对其进行空值保护,以避免潜在的运行时崩溃。
title: item.path ?? (item.fullPath ? getParentPath(item.fullPath) : ""),
| currentSortMode, | ||
| true, | ||
| ); | ||
| results.value = mergeResultsByMatchPathPriority(nameResult.items, matchPathResult.items); |
There was a problem hiding this comment.
当 currentMatchPathEnabled 为 true 时,results.value 是通过合并 nameResult.items 和 matchPathResult.items 得到的。由于这两个查询最多都可以返回 maxResults 个项目,合并后的数组最多可能包含 2 * maxResults 个项目,这违反了 maxResults 的数量限制。我们应该对合并后的结果进行 .slice(0, maxResults) 截取,以严格遵守限制并保证性能一致性。
| results.value = mergeResultsByMatchPathPriority(nameResult.items, matchPathResult.items); | |
| results.value = mergeResultsByMatchPathPriority(nameResult.items, matchPathResult.items).slice(0, maxResults); |
- Initialize Everything file finder - Refactor Finder components - Add richer file previews - Add Markdown and code previews - Add PDF preview support - Fix PDF local file loading - Refactor Finder module structure - Centralize Finder persistence - Polish Finder UI styling - Implement local file icon caching - Polish Finder preview layout - Add file tree preview support - Add image preview copy action - Document project guidance - Add file copy menu action - Clean dist addon build output - Refine addon preview support - Tune Finder result pagination - Move category management to settings - Highlight Finder search matches - Stabilize image preview layout - Refine Finder enter handling - Centralize Finder shared state - Polish Finder UI behavior - Add bundled Everything management - Rename dist cleanup script - Refine bundled Everything shutdown - Add manual release workflow - Trigger release workflow on changes - Package dist contents in release - Limit large tar archive previews - Add shared addon argument parsing - Replace WMIC lookup with PowerShell CIM - Fix tail text preview decoding - Update README and test typings - Add platform info - Refactor Finder preview flow - Copy preview images as files - Add code preview line numbers - Add floating preview zoom - Improve match path search results - fix unexpected cleaning sub input when UI initializing - update version
- Initialize Everything file finder - Refactor Finder components - Add richer file previews - Add Markdown and code previews - Add PDF preview support - Fix PDF local file loading - Refactor Finder module structure - Centralize Finder persistence - Polish Finder UI styling - Implement local file icon caching - Polish Finder preview layout - Add file tree preview support - Add image preview copy action - Document project guidance - Add file copy menu action - Clean dist addon build output - Refine addon preview support - Tune Finder result pagination - Move category management to settings - Highlight Finder search matches - Stabilize image preview layout - Refine Finder enter handling - Centralize Finder shared state - Polish Finder UI behavior - Add bundled Everything management - Rename dist cleanup script - Refine bundled Everything shutdown - Add manual release workflow - Trigger release workflow on changes - Package dist contents in release - Limit large tar archive previews - Add shared addon argument parsing - Replace WMIC lookup with PowerShell CIM - Fix tail text preview decoding - Update README and test typings - Add platform info - Refactor Finder preview flow - Copy preview images as files - Add code preview line numbers - Add floating preview zoom - Improve match path search results - fix unexpected cleaning sub input when UI initializing - update version - update package.json
- Initialize Everything file finder - Refactor Finder components - Add richer file previews - Add Markdown and code previews - Add PDF preview support - Fix PDF local file loading - Refactor Finder module structure - Centralize Finder persistence - Polish Finder UI styling - Implement local file icon caching - Polish Finder preview layout - Add file tree preview support - Add image preview copy action - Document project guidance - Add file copy menu action - Clean dist addon build output - Refine addon preview support - Tune Finder result pagination - Move category management to settings - Highlight Finder search matches - Stabilize image preview layout - Refine Finder enter handling - Centralize Finder shared state - Polish Finder UI behavior - Add bundled Everything management - Rename dist cleanup script - Refine bundled Everything shutdown - Add manual release workflow - Trigger release workflow on changes - Package dist contents in release - Limit large tar archive previews - Add shared addon argument parsing - Replace WMIC lookup with PowerShell CIM - Fix tail text preview decoding - Update README and test typings - Add platform info - Refactor Finder preview flow - Copy preview images as files - Add code preview line numbers - Add floating preview zoom - Improve match path search results - fix unexpected cleaning sub input when UI initializing - update version - update package.json - Fix match path review issues
插件信息
本次变更
匹配路径搜索逻辑,优先显示文件名匹配条目,路径匹配项作为补充自检清单
plugins/local-search-neo/目录此 PR 由 ztools-plugin-cli 自动管理:每次
ztools publish在分支上追加一个 commit,PR 链接保持不变。