已修复:CW卡片仅在检测到时展示(commit d6a275e)。 - #16
Open
opencode-agent[bot] wants to merge 1 commit into
Open
Conversation
…present Previously the four dual-end linkage apps (ClassIsland / Class Widgets / SecRandom / ICC-CE) were force-listed on the OOBE plugins page regardless of detection, so e.g. Class Widgets appeared as "detected" on machines that never had it installed. A card now appears only when there is real evidence for it: - the app was auto-detected, or - its SecAgent-side connector is already installed, or - an installation target was found or manually picked. The empty state keeps a manual "choose executable" entry point so non-standard installs remain configurable, and the install-all button is disabled when nothing qualifies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复已完成。已提交到分支
opencode/issue4-20260901124620(commitd6a275e),push 和 PR 创建由基础设施自动处理。问题根因
OobeWizard.tsx中recommended列表(原第 910 行)除了app.detected外,还硬编码了 4 个双端联动插件的 pluginId 无条件展示:于是即使
detectInstalledApps()返回detected: false(本机没装 Class Widgets),CW 卡片仍会出现在"本机已检测到"区域。后端companion-apps.ts的检测逻辑本身是对的,问题只在前端渲染。改动内容
新增
src/renderer/src/companion-recommend.ts— 把过滤逻辑抽成纯函数filterRecommendedCompanionApps,卡片仅在满足任一条件时展示:app.detected);或plugins.some(...));或classIslandTargets.length > 0等)。OobeWizard.tsx:recommended改用上述纯函数(第 916-919 行)。recommended.length === 0时禁用,避免无目标时点击报错。styles.css— 为空状态新增.oobe-plugin-empty/.oobe-plugin-manual-picks最小样式。新增
src/renderer/src/companion-recommend.test.ts— 6 个单测覆盖:全新机器不出卡片、检测到/已装连接器/已手动选目标时保留卡片、各联动插件各自的目标列表门控、单端插件不被强制列出。验证结果
tsc -p tsconfig.json:0 错误electron-vite build:成功npm test:135 项测试全部通过(含新增 6 项),0 失败行为变化
Closes #4
opencode session | github run