Conversation
The "+" button in the sources panel header serves no practical purpose in the current product flow, so it is now hidden by default. The code path is kept intact and can be re-enabled at launch with CRAFT_FEATURE_ADD_SOURCE_BUTTON=1. The flag is evaluated in the preload (which can read env vars) and exposed to the renderer as a preload-local API, following the getRuntimeEnvironment precedent.
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
@callmeYe thanks for the write-up — the description is thorough and the flag design itself is sensible. I have to stop this at the gate, though, for a reason that has nothing to do with the approach: the code this PR changes no longer exists in this repository.
- All 7 files are under
packages/desktop/**. That tree was deleted frommainon 2026-08-25 by #9085 — "feat(desktop): remove the Electron package after OpenWork fork; keep the Tauri upgrade bridge" — 1723 files, −383,635 lines. - The branch is based on
6ebc79f6, which is 1090 commits behindmain, and GitHub reports the PR as conflicting / not mergeable. Rebasing ontomainwould not hand you conflicts to resolve — it would hand you an empty diff. - Nothing on
maincarries this surface today. Searching the current tree forisAddSourceButtonEnabled,isSourcesNavigation,EditPopover,HeaderIconButton,add-source,@craft-agentandCRAFT_FEATURE_returns zero hits, and there is no rootbun.lock— so thebun run electron:devandbun test ...steps in your test plan cannot run against this repo at all. - Consistent with that, there is no CI signal to review: the head SHA
c32fd41fhas six workflow runs and all six arepull_request_targetbot jobs.Qwen Code CInever fired, andverify/precheck-pr/review-configare all skipped. Most likely because GitHub cannot build a merge ref for a conflicting PR; I won't guess harder than that.
So this is not a "fix the rebase and come back" situation. The sources panel header, the add-source popover, the preload-local API pattern and the feature-flags.ts you extended all belong to the Electron app that was forked out to OpenWork. If hiding that button is still wanted, it belongs in whichever repository now carries that app — the change is small and self-consistent, and I'd expect it to land easily there.
If you actually meant to change something that is on main, the only desktop surface left here is packages/desktop-shell, which is the Tauri upgrade bridge (bootstrap, runtime, src-tauri) and has no renderer UI and no sources panel. Tell us what behavior you were after and we can work out where it belongs now.
And if this branch was simply pushed to the wrong remote, closing the PR is the right move — no harm done.
中文说明
@callmeYe 感谢详细的 PR 说明——描述很完整,开关本身的设计也合理。但这个 PR 需要在准入阶段拦下,原因与方案无关:它修改的代码在本仓库中已经不存在了。
- 7 个文件全部位于
packages/desktop/**。该目录已于 2026-08-25 由 #9085 从main删除——"feat(desktop): remove the Electron package after OpenWork fork; keep the Tauri upgrade bridge",共 1723 个文件、−383,635 行。 - 分支基于
6ebc79f6,落后main1090 个提交,GitHub 判定为冲突/不可合并。rebase 到main不会给你需要解决的冲突,只会给你一个空 diff。 - 当前
main上已无这些代码痕迹:在现有代码树中检索isAddSourceButtonEnabled、isSourcesNavigation、EditPopover、HeaderIconButton、add-source、@craft-agent、CRAFT_FEATURE_均无命中;仓库根目录也没有bun.lock,因此验证步骤里的bun run electron:dev与bun test ...在本仓库根本无法执行。 - 与此一致,没有可供审查的 CI 信号:head SHA
c32fd41f上共 6 次 workflow 运行,全部是pull_request_target的机器人任务。Qwen Code CI从未触发,verify/precheck-pr/review-config均为 skipped。很可能是因为 PR 冲突导致 GitHub 无法构造 merge ref——这一点我不再做进一步推测。
所以这不是"rebase 一下再来"的问题。来源面板头部、添加来源弹层、你扩展的 preload 本地 API 模式以及 feature-flags.ts,都属于已经 fork 到 OpenWork 的那个 Electron 应用。如果仍然需要隐藏该按钮,应该提到现在承载该应用的仓库去——改动本身小而自洽,在那边大概很容易合入。
如果你原本想改的是当前 main 上的东西,这里仅剩的桌面相关模块是 packages/desktop-shell,即 Tauri 升级桥接(bootstrap、runtime、src-tauri),它没有渲染层 UI,也没有来源面板。请说明你想改变的行为,我们再一起确认它现在应该落在哪里。
如果这个分支只是推错了远端,直接关闭 PR 即可,没有任何问题。
— Qwen Code · qwen3.8-max-2026-09-02
|
Closing: this targeted |
What this PR does
Hides the "+" button in the header of the sources panel by default. The button's code path is kept intact: launching the desktop app with the environment variable
CRAFT_FEATURE_ADD_SOURCE_BUTTON=1brings it back. The flag is evaluated in the preload process (the renderer cannot read environment variables) and exposed to the renderer through the existing preload-local API pattern, so checking it costs no IPC round-trip. The web build always reports the button as hidden, and the component playground keeps it visible so the add-source popover remains developable there. Other entry points for adding a source — the panel's empty state and the sidebar context menu — are unchanged.Why it's needed
The plus button in the sources panel header serves no practical purpose in the current product flow, but deleting the code outright would throw away a working add-source interaction that may still be wanted for debugging or future iterations. Hiding it behind a launch flag declutters the default UI while keeping the behavior one environment variable away.
Reviewer Test Plan
How to verify
packages/desktop, runbun run electron:dev, open a workspace, and switch to the sources panel: the header shows no "+" button, and the rest of the panel (source list, item menus, empty state) behaves as before.CRAFT_FEATURE_ADD_SOURCE_BUTTON=1 bun run electron:dev: the "+" button reappears in the sources panel header and still opens the add-source popover.cd packages/desktop/apps/electron && bun test src/transport/__tests__/channel-map-parity.test.ts— it passes, with the new preload-local API registered in the exclusion list.Evidence (Before & After)
Runtime smoke on macOS: the dev app boots cleanly both with the flag unset and with
CRAFT_FEATURE_ADD_SOURCE_BUTTON=1(window created, renderer connected over RPC, no preload or renderer errors in the app log), and the built preload bundle contains the flag evaluation. Visual before/after screenshots of the header were not captured — the dev launcher opens no remote-debugging port, so the window could not be inspected programmatically; the behavior change itself is a single conditional render on the flag.Tested on
Environment (optional)
bun run electron:devfrompackages/desktop(Vite dev server + Electron).Risk & Scope
Linked Issues
N/A
中文说明
本 PR 做了什么
默认隐藏来源面板头部的 "+" 按钮。按钮的代码路径完整保留:启动桌面应用时设置环境变量
CRAFT_FEATURE_ADD_SOURCE_BUTTON=1即可恢复显示。该开关在 preload 进程中求值(渲染进程无法读取环境变量),并通过现有的 preload 本地 API 模式暴露给渲染进程,因此读取开关不需要 IPC 往返。Web 版本始终报告按钮为隐藏状态;组件 playground 中保持可见,以便继续在其中开发"添加来源"弹层。添加来源的其他入口——面板的空状态按钮和侧边栏右键菜单——均不受影响。为什么需要
来源面板头部的加号按钮在当前产品流程中没有实际意义,但直接删除代码会丢掉一个可用的添加来源交互,将来调试或迭代时可能仍需要。用启动开关把它隐藏起来,既让默认界面更干净,又让该行为只需一个环境变量即可找回。
评审者验证计划
如何验证
packages/desktop下运行bun run electron:dev,打开一个工作区并切换到来源面板:头部不再显示 "+" 按钮,面板其余部分(来源列表、条目菜单、空状态)行为与之前一致。CRAFT_FEATURE_ADD_SOURCE_BUTTON=1 bun run electron:dev重新启动:"+" 按钮重新出现在来源面板头部,且仍能打开添加来源弹层。cd packages/desktop/apps/electron && bun test src/transport/__tests__/channel-map-parity.test.ts——测试通过,新的 preload 本地 API 已登记在排除列表中。证据(前后对比)
macOS 上的运行时冒烟验证:不设置开关和设置
CRAFT_FEATURE_ADD_SOURCE_BUTTON=1两种情况下开发应用均正常启动(窗口已创建,渲染进程通过 RPC 连接,应用日志中无 preload 或渲染进程错误),且构建出的 preload 包中包含开关求值逻辑。未截取头部的前后对比截图——开发启动器没有开放远程调试端口,无法以编程方式检查窗口;行为变化本身只是基于该开关的一处条件渲染。已测试平台
macOS ✅ 已测试;Windows⚠️ 未测试;Linux ⚠️ 未测试。
环境(可选)
在
packages/desktop下运行bun run electron:dev(Vite 开发服务器 + Electron)。风险与范围
关联 Issue
无