Skip to content

refactor: 抽取命令上下文匹配公共逻辑#546

Open
Particaly wants to merge 2 commits into
ZToolsCenter:mainfrom
Particaly:fix/shared-command-context-matching
Open

refactor: 抽取命令上下文匹配公共逻辑#546
Particaly wants to merge 2 commits into
ZToolsCenter:mainfrom
Particaly:fix/shared-command-context-matching

Conversation

@Particaly

Copy link
Copy Markdown
Collaborator

复用已有的cmd匹配逻辑,解决部分插件在全局快捷键开启自动复制时,错误匹配到低优先级的指令问题

@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 refactors and consolidates command context matching logic (for regex, over, files, and window commands) into a new shared utility file src/shared/commandContextShared.ts, updating both the main API manager and the renderer's command data store to use these standardized functions. It also adds a comprehensive test suite for the shared matching utilities. The review feedback highlights two critical compatibility issues where refactoring to parseMatchPattern without enabling allowPlainString breaks window title matching for plain string patterns that do not use the standard /pattern/flags format.

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 src/renderer/src/stores/commandDataStore.ts Outdated
Comment thread src/shared/commandContextShared.ts Outdated
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.

1 participant