Repository navigation
feat(marketplace): recommend workspace plugins via notifications (#2228) - #2229
Merged
Merged
Conversation
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.
关联 Issue / Linked issue
PR 类型 / Type
改动说明 / What changes
背景 / Why
用户打开包含特定构建配置或语言源码的项目(如 Spring Boot / Maven 项目)时,若尚未安装对应插件,仅会遇到语义/运行能力缺失,但不知应前往插件市场安装哪些插件。为在不破坏
<= 0.8.10客户端兼容性及坚持“宿主对具体插件零依赖”原则的前提下提供安装引导,我们通过独立的市场同级推荐索引 + Rust Core 规则匹配,在打开工作区时自动检测并在通知中提示可安装的插件。改动 / Changes
scripts/desktop/build-desktop-core.sh):PINNED_CORE_REVISION升级至合入Lithe-core-rust#130后的main提交d6309386cbc164ed82eb8728cf6b7d90db12fc61。desktop/internal/core/marketplace.go、marketplace_test.go):MarketplaceSource增加RecommendationsURL(recommendationsURL),为marketplaceOutcome增加Recommendation。MarketplaceRecommendationCatalog、MarketplaceRecommendation、MarketplaceRecommendationResult及Client.RecommendMarketplacePlugins(调用plugins.marketplace.recommendForWorkspace),并在TestMarketplaceSourceFixture/TestMarketplaceRecommendationFixture中接入 Core 契约 fixture 校验。desktop/internal/marketplace/service.go、service_test.go):fetchJSON共享辅助(保留 HTTPS/重定向限制、MaxIndexBytes、响应关闭错误处理与json.Valid校验)。RecommendationBundle与Service.FetchRecommendationBundle:优先拉取recommendationsURL,遇到 HTTP404静默返回ok=false, err=nil(不再额外请求索引正文),否则再拉取indexURL;补充 200 / 404 / 超限 / 非法 JSON 单测。desktop/internal/workbench/notifications.go、notifications_test.go):notification新增可选detail与secondaryAct/secondaryActLabel,提供notifyActions(title, detail, kind, label, act, secondaryLabel, secondaryAct)(原notifyAction直接委托复用)。Title+ 自动换行Description展示,防止插件名被单行标题截断;通知抽屉与通知工具窗口在主按钮旁渲染次级幽灵按钮,按钮Shrink(0)、时间计数Grow(1).Ellipsis()保证排版整齐。desktop/internal/workbench/plugin_recommendations.go、plugin_auto_update.go、app.go、app_test.go、plugin_recommendations_test.go):plugin_auto_update.go中构建市场来源列表与宿主平台标识的逻辑提炼为marketplaceSources()与marketplaceHostPlatform()复用,并导出PluginRecommendationSource。scanWorkspaceRecommendationFiles(最大深度3、上限4000项、跳过常见构建/依赖目录、绝不跟随目录符号链接),在openProjectWithTrust中非阻塞触发checkPluginRecommendations。a.plugins.CurrentInstalled与settings.DismissedPluginRecommendations读取排除列表,并在汇总通知中提供:View Plugins):单个匹配直接带插件名搜索打开插件设置,多个匹配打开插件市场列表;Don't Show Again):同步写入所有标签页设置的dismissedPluginRecommendations并保存settings.json,关闭对应浮动 Toast。newHarnessWithDriver中当未提供注入PluginRecommendationFetcher时默认开启DisablePluginRecommendations,保证既有单测零网络请求。shared/i18n/、desktop/internal/i18n/shared.generated.go):desktop.marketplace.recommendedTitle、desktop.marketplace.recommendedPlugins、desktop.marketplace.recommendedAction、desktop.marketplace.recommendedDismiss并重新生成。shared/platform-feature-matrix/features/plugin-workspace-recommendations.json、desktop/internal/workbench/plugin_recommendations_visual_test.go、docs/assets/plugin-workspace-recommendations/):不在本 PR 范围内 / Out of scope
类型专属:feat
多平台对齐
Lithe-core-rust,工作区探测、拉取服务、通知界面与设置持久化在跨平台 Viva Go 桌面层共享实现)范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/plugin-workspace-recommendations.json:macOS 记为implemented/verified,Windows 记为implemented/pending(等待 Windows 原生 Runner/VM 复验),全部使用共享证据路径且未引用任何插件或外部仓库./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh与MATRIX_BASE_SHA="$(git rev-parse origin/main)" ./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh.artifacts/下生成的矩阵视图插件归属 / Plugin ownership
rg -n -i 'io\.github\.lithe-idea\.|lithe-idea/lithe-plugin-|PLUGIN_(ARCHIVE|MANIFEST|PACKAGE)\b|"plugin-provided"' desktop scripts shared .github docs/ci-builds.md -g '!desktop/internal/core/testdata/marketplace/**',结果为空io.example.demo-lang/io.example.demo-build/io.github.example.output-links与 Core 契约 fixture,无跳过分支shared/i18n/插件自身词条、没有把插件信息写入docs/ci-builds.mdUI 验证 / UI evidence
LITHE_VISUAL_OUTPUT_DIR="$(pwd)/docs/assets/plugin-workspace-recommendations" ./scripts/desktop/desktop-go.sh test -tags vivahead,lithevisual ./internal/workbench -run '^TestVisualPluginWorkspaceRecommendations$' -count=1 -timeout 180s,窗口1200x760,覆盖dark/light×zh-Hans/en,共 6 张)并通过read_file逐张检查,初版发现浮动 Toast 单行标题截断后已改用短标题 + 换行详情并重采确认无截断、无重叠、对比度清晰短标题 + 换行详情),原生桌面窗口待实机/CI 补充验证统一日志系统 / Structured logging
a.backgroundFailed/a.backgroundFailedIn记录到统一日志系统;持久化失败走既有a.saveSettings()终态报错(operationFailed("settings_save", ...));并发下子目录os.ErrNotExist标注// log-exempt: 预期的缺失:...;无NSLog/os_log/print或手写未定义通道Lithe-core-rust#130运行verify-rust-core-comments.sh通过界面文案 / i18n
shared/i18n/messages.json、locales/en-US.json、locales/zh-CN.json,并通过node scripts/i18n/generate-i18n.mjs生成desktop/internal/i18n/shared.generated.gonode scripts/i18n/generate-i18n.mjs --check与node scripts/i18n/verify-app-language-localization.mjs并全部通过逻辑归属 / Logic placement
recommendationsURL)、索引校验、规则匹配、coveredBy/已安装/已忽略过滤与排序均在 Rust Core(Lithe-core-rust#130)完成;Go 宿主层仅做工作区有界目录扫描、HTTPS 传输与通知呈现性能与内存 / Performance and memory
a.background(p, 0, ...)后台运行,受p.ctx与a.tasks生命周期管理;扫描硬限制最大深度3、最多访问4000个条目、跳过重型构建目录与目录符号链接,会话目录缓存 TTL15分钟且仅覆盖本会话已开过的目录,关闭项目自动取消设置 / Settings
settings.json中持久化用户的“不再提示”列表dismissedPluginRecommendations插件契约 / Plugin contract
plugin-recommendations.schema.json)、fixture 与protocol-changelog.md已在 Lithe-core-rust#130 同 PR 提交scripts/desktop/build-desktop-core.sh的PINNED_CORE_REVISION已升级至d6309386cbc164ed82eb8728cf6b7d90db12fc61plugins.marketplace.recommendForWorkspace为宿主内部 Core 命令)发行包与资源 / Bundle and resources
settings.json与内存缓存);已运行./scripts/desktop/verify/verify-runtime-bundle-immutability.shdocs/ci-builds.md无需补充无用代码与重构 / Dead code and refactoring
marketplaceSources/marketplaceHostPlatform、fetchJSON与notifyActions辅助,无新增冗余或未使用的测试辅助函数验证 / Verification
node scripts/desktop/validate-pins.mjscore d6309386cbc164ed82eb8728cf6b7d90db12fc61、viva均可达node scripts/i18n/generate-i18n.mjs --check&verify-app-language-localization.mjs11885/11885完整翻译,本地化检查通过rg -n -i ...(具体插件零依赖自查)./.agents/skills/write-stable-tests/scripts/verify-test-stability.sh --base origin/mainorigin/main..HEAD, all./scripts/desktop/verify/verify-runtime-bundle-immutability.shnode scripts/platform-feature-matrix/generate-platform-feature-matrix.mjs&verify-platform-feature-matrix.shMATRIX_BASE_SHA=<origin/main> ./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh./scripts/desktop/desktop-go.sh test -count=1 -timeout 300s ./internal/core ./internal/marketplace ./internal/workbenchcore(18.434s)、marketplace(2.896s)、workbench(267.856s)./scripts/desktop/desktop-go.sh test -race -count=1 -timeout 180s ./internal/core ./internal/marketplace ./internal/workbench -run 'TestMarketplace|TestNotification|TestPluginRecommendation|TestScanWorkspaceRecommendation'core(2.200s)、marketplace(3.083s)、workbench(4.807s)LITHE_VISUAL_OUTPUT_DIR=... ./scripts/desktop/desktop-go.sh test -tags vivahead,lithevisual ./internal/workbench -run '^TestVisualPluginWorkspaceRecommendations$' -count=1 -timeout 180s