Skip to content

Update plugin 本地搜索Neo v1.0.0#285

Merged
lzx8589561 merged 4 commits into
ZToolsCenter:mainfrom
guopenghui:plugin/local-search-neo
Jul 1, 2026
Merged

Update plugin 本地搜索Neo v1.0.0#285
lzx8589561 merged 4 commits into
ZToolsCenter:mainfrom
guopenghui:plugin/local-search-neo

Conversation

@guopenghui

@guopenghui guopenghui commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

插件信息

  • 名称: 本地搜索Neo
  • 插件ID: local-search-neo
  • 版本: 1.0.0
  • 描述: 借助 Everything 来进行文件搜索
  • 作者: the_tree
  • 类型: 更新

本次变更

  • 优化匹配路径搜索逻辑,优先显示文件名匹配条目,路径匹配项作为补充
  • 修复在插件因搜索栏推送而首次启动时,会清除一次搜索内容的问题

自检清单

  • plugin.json 的 name / title / version / description / author 字段均已检查
  • 已移除调试日志、未使用文件、敏感信息(.env、token、密钥等)
  • 本次 PR 的 diff 仅涉及 plugins/local-search-neo/ 目录
  • 已在本地 ZTools 客户端实际加载并测试过此插件,主要功能正常
  • 同意以仓库声明的开源协议发布此插件

此 PR 由 ztools-plugin-cli 自动管理:每次 ztools publish 在分支上追加一个 commit,PR 链接保持不变。

- 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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread plugins/local-search-neo/src/App.vue Outdated
const items: MainPushSearchResult[] = resultItems
.slice(0, MAIN_PUSH_RESULT_LIMIT)
.map((item) => ({
title: item.path ?? getParentPath(item.fullPath),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

如果 item.path 为 undefined 且 item.fullPath 也为 undefined(或者仅 item.fullPath 为 undefined),调用 getParentPath(item.fullPath) 将会抛出 TypeError,因为 getParentPath 期望接收一个字符串并对其调用 lastIndexOf。由于 fullPathFinderResult 中是可选属性,我们应该对其进行空值保护,以避免潜在的运行时崩溃。

            title: item.path ?? (item.fullPath ? getParentPath(item.fullPath) : ""),

currentSortMode,
true,
);
results.value = mergeResultsByMatchPathPriority(nameResult.items, matchPathResult.items);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

currentMatchPathEnabled 为 true 时,results.value 是通过合并 nameResult.itemsmatchPathResult.items 得到的。由于这两个查询最多都可以返回 maxResults 个项目,合并后的数组最多可能包含 2 * maxResults 个项目,这违反了 maxResults 的数量限制。我们应该对合并后的结果进行 .slice(0, maxResults) 截取,以严格遵守限制并保证性能一致性。

Suggested change
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
@guopenghui guopenghui marked this pull request as ready for review July 1, 2026 14:01
@lzx8589561 lzx8589561 merged commit 4f5c82b into ZToolsCenter:main Jul 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants