[workspace] members = [ "nebula_app", "nebula_terminal", "nebula_config", "nebula_config_derive", "nebula-completions", "nebula_hook", "nebula_gpui", "nebula_settings", "nebula_split", ] resolver = "2" [workspace.package] edition = "2024" rust-version = "1.97.1" [profile.release] # Thin LTO preserves package-specific optimization levels. Dependencies retain # one codegen unit; the application uses parallel codegen with the same O3 level. lto = "thin" debug = 0 strip = "symbols" incremental = false codegen-units = 1 # 发布包体积预算:安装包 <30MB。冷代码(协议栈、序列化、CLI、SSH 等 # 几百个依赖)按体积编译;渲染/塑形/布局/VT 热路径在下面逐个钉回 O3, # 手感不受影响。改动这里必须重新跑 scripts/tests/package-release.tests.ps1。 opt-level = "s" [profile.release.package] resvg = { opt-level = 3 } rustybuzz = { opt-level = 3 } taffy = { opt-level = 3 } ttf-parser = { opt-level = 3 } smol = { opt-level = 3 } gpui = { opt-level = 3 } gpui-component = { opt-level = 3 } nebula_terminal = { opt-level = 3 } nebula = { opt-level = 3, codegen-units = 16 } image = { opt-level = 3 } # Debug 壳仍要承担真实终端负载:GPUI 布局/字体塑形和 VT 解析若以 # opt-level 0 运行,窗口拖拽与持续输入都会出现发布版没有的延迟。 # 外部依赖统一 O2(图形栈/图像解码/Unicode 处理散布在 # 几十个 crate 里,逐个点名永远漏),少数塑形/布局热点保持 O3; # workspace 成员不受 "*" 影响,主 crate 继续增量 debug。 [profile.dev] codegen-units = 16 debug = "limited" split-debuginfo = "unpacked" [profile.dev.package] "*" = { opt-level = 2 } resvg = { opt-level = 3 } rustybuzz = { opt-level = 3 } taffy = { opt-level = 3 } ttf-parser = { opt-level = 3 } smol = { opt-level = 3 } gpui = { opt-level = 3 } gpui_macros = { opt-level = 3 } nebula_terminal = { opt-level = 3 } [workspace.dependencies] mlua = { version = "0.11.4", features = ["lua54", "vendored", "serialize", "send"] } serde_path_to_error = "0.1.20" toml = "0.9.11" toml_edit = "0.24.0" # GPUI v1.16.1 把平台启动入口拆到独立 crate。它必须与 `gpui` 使用完全相同 # 的 Git URL 和 rev,否则 Cargo 会把同名类型解析成两套互不兼容的 crate。 # Without font-kit, the macOS platform uses NoopTextSystem and renders no text. gpui_platform = { git = "https://github.com/Kuddev/zed", rev = "7c662384cd77c1d1e1566206920e3a420ea6767b", version = "=0.1.0", features = ["font-kit"] } # TODO: Drop this pin and return to the crates.io release once the fix ships there. [patch.crates-io] x11-clipboard = { git = "https://github.com/quininer/x11-clipboard.git", rev = "19ab2163cf0bd0db607e827a5214571990307866" } # Keep the 0.30.13 API/rwh_06 surface while backporting winit upstream # 488c036a's Windows 11 mixed-DPI positioning fix. The upstream revision has # since moved to a different EventLoop API and cannot be used directly here. winit = { path = "third_party/winit-0.30.13" } # ---- GPUI v1.16.1 固定基线 ------------------------------------------------ # # 版本配对:Zed v1.16.1 提交上的 gpui 0.2.2 / gpui_platform 0.1.0,配套 # gpui-component 0.5.2 和 gpui-component-assets 0.5.1。版本号与 Git rev 都 # 精确固定,禁止 main、通配版本或仅凭 branch 名解析。 # # GitHub 固定点(branch/tag 只用于审计,Cargo 始终使用下面的完整 SHA): # 上游来源:zed-industries/zed v1.16.1 # @ eb8e1c8b5502b7007465fbbc465f4a736fa39210 # Kuddev/zed nebula-v1.16.1-owned-base @ 同一 SHA(纯上游镜像) # Kuddev/gpui-component nebula-v1.16.1-math # @ c20dbef8ed0d4c0fbebbf2e8f02d39e4fa0ac0a7 # (4eb39176 owned base + 数学薄桥、GFM TextView 语义和紧凑阴影 helper) # Kuddev/gpui-component nebula-v1.16.1-test-support # @ fa3763c681dba5b3ea028395148488e1281d478d # (c20dbef8 基线 + 下游虚拟窗口测试支持) # # 窗口生命周期修补(2026-09-06,保留以上上游/组件基线): # Kuddev/zed nebula-v1.16.1-virtual-window-handles-20260906 # @ 8a1a62727bcb2ead7352e32e7e0d2e919a943535 # (TestWindow 对不存在的原生窗口/显示句柄返回 Unavailable;真实窗口路径不变) # Kuddev/gpui-component nebula-v1.16.1-virtual-window-handles-20260906 # @ 2dd896281102c7d5a0137ac7c754886dc0d5e1fc # (五个 Zed 依赖同步到上面的同一提交,避免两套 GPUI 类型) # 原因:macOS 密码输入的原生 content-type 适配已处理 Err,但虚拟窗口此前 # 直接 panic,阻止完整对话框回归测试。X11 checked MapWindow 还会把事件留在 # XCB 内部队列而使 fd 不可读;延后 drain 并唤醒 calloop,才能启动首次刷新。 # 该问题由原样 Xvfb/libxcb 与 CI AppImage 重现;上游包含这些合同后撤销薄修补。 # # 当前字体内存修补(2026-09-13,基于以上窗口生命周期提交): # Kuddev/zed pebrel-v1.16.1-font-owner-20260913 # @ 7c662384cd77c1d1e1566206920e3a420ea6767b # Kuddev/gpui-component pebrel-v1.16.1-font-owner-20260913 # @ e411cc06dfff83a96c4705076483a87a26ea992d # DirectWrite 用 COM owner 保持不可变字体数据的生命周期,避免完整复制内嵌字体。 # 原生测试覆盖借用/自有字节、最后引用释放、错误路径和长度;组件五个 Zed 引用同步。 # 上游提供同等字体所有权与释放合同后撤销此薄修补,保留其余固定基线。 # # 所有 Zed 依赖统一使用 Kuddev URL:Cargo 的 source identity 包含 URL,应用 # 与 component 内部若混用官方/自有 URL,即使 SHA 相同也会解析成两套 gpui # 类型。新增 Zed/component 补丁必须从固定基线开独立分支、逐条提交并更新 # exact rev,不能移动基线 branch/tag。 # # 升级基点到 gpui-component 0.5.2+ 时的回归检查单(0.5.1 上这些行为本来是对的, # 是 0.5.2 重构 button 颜色推导时弄丢的,届时把下面两个 fix 带上): # 1. ButtonVariant::Custom 的 text_color 必须回 colors.foreground(0.5.2 # 回归成背景色 colors.color,透明底按钮字直接隐形)→ 3826fafacd3c # 2. hovered()/active() 必须读 ButtonCustomVariant::hover/active(0.5.2 # 回归成从 color 派生,透明底按钮没有任何悬停/按下反馈)→ 469ab7a44f72 # 3. 新增的 text/inline_flow.rs:shape_line 前把 \n\r 换成空格(gpui # shaper 遇换行 panic;替换保 byte 长度,run 偏移不失效) # 本地工作树只用于开发和验收,不再参与 Cargo 解析。 # # 上游行为备忘(不是补丁,是调用侧要知道的事):`Scrollable` # (scroll/scrollable.rs 的 overflow_*_scrollbar)不是就地加滚动条,而是把 # 被包装元素的 StyleRefinement 整个 clone 到它新建的外层 div,再把原元素 # 样式清空、只补 flex_1,然后塞进一层 `overflow_y_scroll` 的 scroll-area。 # 后果:真正承载 children 的那层退回 gpui 默认的 Display::Block 且宽度不 # 确定,children 上的 `w_full`(width:100%)无从解析、回落到 max-content, # 于是每个子块按自己的内容宽度收缩,看起来就是"分组宽度参差、控件既不贴 # 左也不贴右"(2026-08-17 设置页实测 A/B 确认)。**调用侧约定:滚动区内 # 先放一层 `v_flex().w_full()`,内容写在它里面**——竖向 flex 的子项走交叉 # 轴 stretch 拿宽度,绕开百分比解析。settings_pane.rs 的设置正文即按此写。 # # 产品补丁清单(从固定基线逐条迁移并验收,不能一次性混入): # 1. popover 单层紧凑阴影 helper(c20dbef8);不改新版组件的全局 # popover_style,只供 Nebula 原本显式设置阴影的 surface 调用。 # 2. TextView 数学公式钩子(nebula-v1.16.1-math 分支,9a2f663c): # markdown 解析启用 math 构造;新增 text/math.rs 的 set_math_renderer # 全局注册点;InlineNode/Node 增加数学节点并在渲染时调钩子,未注册时 # 回退现状(inline=code 文本、block=CodeBlock)。TeX 引擎/栅格化/绘制 # 全部住在 nebula_app::gpui_shell::math_view,fork 只有接线层。上游 # 0.6 线出现 MarkdownPlugin/Custom block 后应迁过去并撤掉本补丁。 # 3. TextView 阅读器 GitHub 化(同分支,随 2 一起 push):软换行按 # CommonMark 合并为空格(CJK 相邻直连);图片 URL 分流(http(s)/data # 走 URI、绝对路径读盘、相对路径按 TextViewStyle::image_base 解析); # HTML `align="center"` 居中(Paragraph/Heading 的 align_center); # 同一
内多枚 徽章同段横排不再逐图切段;
按文档序断行
# (旧逻辑先 push Break 再统一 flush 文本,A
B 画成
AB);
# 链接徽章不再整个丢失(图片转移并挂 link)。除
# image_base 外全部是 GitHub 语义对齐的纯 bug 修,上游 PR 候选,合并
# 即撤。
# 4. Input 水平滚动回不到行首(input/element.rs,光标越出左边界的分支):
# 原式 `scroll_offset.x - cursor_pos.x` 没有解方程,而是把当前偏移再减
# 一次光标位置,于是光标每次往左移动内容反而更往左跑,长值永远滑不到
# 开头(用户 08-19 在 tab 重命名框上报)。改成 `-cursor_pos.x`,与右
# 边界分支同样的解法,也与同函数 is_selected_all 分支里既有的正确写法
# 一致。纯 bug 修,上游 PR 候选,合并即撤。
# 5. Input 拖选缺自动滚动(input/state.rs,新增 autoscroll_for_drag):
# index_for_mouse_position 把「鼠标到内容原点的距离」换算成字符下标,而
# 内容原点已含滚动偏移,于是要选到更前面的字符就得把鼠标再往可视框左边
# 挪同样多的像素——输入框贴在侧栏左侧时根本没这段空间(撞屏幕边),长
# 文本永远拖不到开头。改为越界即按越出距离推进滚动(复用既有的
# update_scroll_offset,边界 clamp 现成)。补丁 4 修的是键盘移动那条路,
# 这条修的是鼠标拖选,两者都要。上游 PR 候选,合并即撤。
#
# 6. 下游虚拟窗口测试支持(2026-09-05):crates/ui/Cargo.toml 增加显式
# test-support feature;src/lib.rs 与 src/root.rs 在该模式下不安装需要
# 原生窗口句柄的 macOS 无障碍转发器。普通构建的无障碍接线不变。
# tests/root_test_window.rs 验证以依赖方式编译的 Root 可使用虚拟窗口;
# 上游提供等价的下游 headless 测试支持后撤销本补丁。
#
# 当前精确引用包含补丁 1-3、6 及字体内存修补;Input 补丁 4-5 仍保持独立。
gpui = { git = "https://github.com/Kuddev/zed", rev = "7c662384cd77c1d1e1566206920e3a420ea6767b", version = "=0.2.2" }
# Native inputs share rendered text's device-pixel line height and expose a
# post-paint point lookup. Window selection ends on release even when a child
# consumes MouseUp or the platform reports the next move without a held button.
gpui-component = { git = "https://github.com/Kuddev/gpui-component", rev = "f46ecbb06de5907af9700f3f6e2b5b0845459188", version = "=0.5.2" }
gpui-component-assets = { git = "https://github.com/Kuddev/gpui-component", rev = "f46ecbb06de5907af9700f3f6e2b5b0845459188", version = "=0.5.1" }