Skip to content

fix: hide completion cache hint by default#39

Merged
ChangeHow merged 1 commit into
mainfrom
fix/suppress-completion-hint
May 21, 2026
Merged

fix: hide completion cache hint by default#39
ChangeHow merged 1 commit into
mainfrom
fix/suppress-completion-hint

Conversation

@ChangeHow
Copy link
Copy Markdown
Owner

What changed

  • 默认关闭 completion cache 命中提示,仅在 SUITUP_SHOW_COMPLETION_CACHE_HINT=1 时显示。
  • 为工具相关模块文件补充 Generated by suitup 标记:configs/shared/tools/{_loader,atuin,bun,fzf,runtime}.zsh,确保 setup diff 检测可识别这些托管文件的行级更新。
  • 新增 setup 测试:托管工具模块改动应触发 detectPendingStepUpdates 返回 zsh-config。

Validation

  • npx vitest run tests/configs.test.js
  • npx vitest run tests/setup.test.js

@ChangeHow ChangeHow merged commit 35899ca into main May 21, 2026
1 check passed
Copy link
Copy Markdown

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

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 introduces a feature flag to control the visibility of the ZSH completion cache hint and adds 'Generated by suitup' headers to several tool configuration files. It also includes a new test case to verify that modifications to managed tool modules correctly trigger a pending zsh-config update. Review feedback suggests streamlining the test setup by removing unnecessary file copies and unused properties from the options object to improve focus and maintainability.

Comment thread tests/setup.test.js
Comment on lines +379 to +394
for (const file of ["tools.zsh", "completion.zsh", "highlighting.zsh", "aliases.zsh", "plugins.zsh", "prompt.zsh"]) {
copyFileSync(
join(CONFIGS_DIR, "shared", file),
join(completedSandbox.path, ".config", "zsh", "shared", file)
);
}
for (const file of ["_loader.zsh", "fzf.zsh", "runtime.zsh", "atuin.zsh", "bun.zsh"]) {
copyFileSync(
join(CONFIGS_DIR, "shared", "tools", file),
join(completedSandbox.path, ".config", "zsh", "shared", "tools", file)
);
}
copyFileSync(
join(CONFIGS_DIR, "local", "machine.zsh"),
join(completedSandbox.path, ".config", "zsh", "local", "machine.zsh")
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

测试设置中包含了拷贝多个不相关文件(aliases.zshplugins.zshprompt.zshmachine.zsh)的操作,这些文件与正在测试的 zsh-config 待更新状态无关。具体来说,aliases.zshplugins.zsh 会触发它们各自独立的待更新标记,而 prompt.zshmachine.zsh 并不在更新检测范围内。移除这些无关设置可以使测试更聚焦且更易于维护。

Suggested change
for (const file of ["tools.zsh", "completion.zsh", "highlighting.zsh", "aliases.zsh", "plugins.zsh", "prompt.zsh"]) {
copyFileSync(
join(CONFIGS_DIR, "shared", file),
join(completedSandbox.path, ".config", "zsh", "shared", file)
);
}
for (const file of ["_loader.zsh", "fzf.zsh", "runtime.zsh", "atuin.zsh", "bun.zsh"]) {
copyFileSync(
join(CONFIGS_DIR, "shared", "tools", file),
join(completedSandbox.path, ".config", "zsh", "shared", "tools", file)
);
}
copyFileSync(
join(CONFIGS_DIR, "local", "machine.zsh"),
join(completedSandbox.path, ".config", "zsh", "local", "machine.zsh")
);
for (const file of ["tools.zsh", "completion.zsh", "highlighting.zsh"]) {
copyFileSync(
join(CONFIGS_DIR, "shared", file),
join(completedSandbox.path, ".config", "zsh", "shared", file)
);
}
for (const file of ["_loader.zsh", "fzf.zsh", "runtime.zsh", "atuin.zsh", "bun.zsh"]) {
copyFileSync(
join(CONFIGS_DIR, "shared", "tools", file),
join(completedSandbox.path, ".config", "zsh", "shared", "tools", file)
);
}

Comment thread tests/setup.test.js
Comment on lines +406 to +412
const opts = {
home: completedSandbox.path,
platform: "darwin",
commandExistsFn(name) {
return ["zsh", "brew"].includes(name);
},
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

传递给 detectPendingStepUpdatesopts 对象包含未使用的属性 platformcommandExistsFn。该函数仅利用 home 属性进行路径解析。清理这些属性可以提高测试代码的清晰度。

      const opts = {
        home: completedSandbox.path,
      };

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