Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: feigeCode/navop
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.19.3
Choose a base ref
...
head repository: feigeCode/navop
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.19.4
Choose a head ref
  • 7 commits
  • 36 files changed
  • 2 contributors

Commits on Sep 28, 2026

  1. chore(deps): 切到 gpui-pre fork-0.3.121(守卫只吸收那一个重复注销异常)

    fork-0.3.121 是 Touch Bar 守卫的第三版,方向从「跳过」改成「只吸收那一个异常」。
    
    ## 为什么还要再改
    
    fork-0.3.118 的守卫对查找器发起的注销一律直接 return。这太重:KVO 的契约要求合法注册必须
    可注销,跳过第一次合法注销会留下「已注册、但调用方以为已注销」的观察项 —— 真机退出应用时
    崩在 Foundation KVO 记账里(`navop-2026-09-27-165228.ips`,`KERN_INVALID_ADDRESS`)的头号
    嫌疑就是它。
    
    ## fork-0.3.121 做了什么
    
    - 每一次注销都真的执行,转发放进 `objc2::exception::catch`(`objc2` 的 `exception` feature,
      即 C 编译出来的 `@try`/`@catch`)。正常返回 ⇒ 注销真的发生了,记账保持一致。
    - 抛出时只匹配这一种组合:观察者是查找器的、key path 是 `nextResponder`、异常名
      `NSRangeException`、reason 含 `because it is not registered as an observer`。匹配 ⇒ 记一条
      warn(观察者类与地址、被观察对象类与地址、key path、context、异常名与 reason)后吸收。
    - 不匹配 ⇒ `objc2::exception::throw` 原样重抛,让它像从被替换的实现里抛出一样 `C-unwind`
      穿过守卫。Cocoa 不是异常安全的,网撒太大会把 bug 藏起来而不是修掉。
    
    `fork-0.3.121` 快照提交 `c335307a`,`zed-rev` = `83e4b04b60`
    (`gpui_macos: Answer the Touch Bar finder's duplicate retraction instead of skipping retractions`)。
    
    ## 验证
    
    - 上游 `cargo test -p gpui_macos --lib`:16 passed / 0 failed。新增
      `the_finders_first_retraction_removes_and_the_duplicate_is_absorbed`(旧版做错的那件事)、
      `another_key_paths_retraction_is_thrown_back` 与
      `only_the_unregistered_next_responder_retraction_counts`(把网收窄)、以及 `rethrow` probe。
    - 本仓 `cargo check -p one-core -p main --all-targets`:通过(exit 0)。
    - 24 条 `[patch.crates-io]` 与 `Cargo.lock` 同步指向 `fork-0.3.121`。
    
    docs/macos-memory-investigation.md 新增 §10.10 记录这一轮的判断与证据。
    
    真机第五版组合 = 弹窗只隐藏不销毁(§10.7)+ 这版守卫。
    feigeCode committed Sep 28, 2026
    Configuration menu
    Copy the full SHA
    99fc35b View commit details
    Browse the repository at this point in the history
  2. chore(deps): 切到 gpui-pre fork-0.3.122(守卫的 @try/@catch 移出 Rust 帧,relea…

    …se 的 panic=abort 下才有效)
    
    `fork-0.3.121` 的守卫单测全绿,却在 navop 自己的 release 配置下是坏的:它的
    `@try`/`@catch` 用的是 `objc2::exception::catch`,把 Rust 闭包包在 `@try` 里;而 navop 的
    `[profile.release]` 是 `panic = "abort"`(省掉 `__eh_frame` / `__gcc_except_tab`),这种构建
    下 ObjC 的 unwind 穿过 Rust 帧会变成 `panic in a function that cannot unwind` 并直接 abort。
    cargo 对 test/bench profile 忽略 `panic` 设置,所以 16 个单测全过说明不了 release 包的问题。
    独立探针(与 navop 一致的 release profile + `#[path]` 引入真实守卫源码)复现:重复注销这一步
    在 dev 下被吸收,换成 release 配置后退出码 **134**,`@catch` 根本没执行。
    
    `fork-0.3.122` 把 `@try`/`@catch` 挪进 crate 自己编译的 Objective-C
    (`crates/gpui_macos/objc/gpui_macos_try_remove.m`,由 `build.rs` 用 `cc` 编译):`@try` 体里
    **直接调用原实现**,raise 与 `@catch` 之间没有 Rust 帧,因此与构建的 panic 策略无关。shim 返回
    被 retain 的异常,Rust 侧照旧判断:查找器的重复注销(`nextResponder` + `NSRangeException` +
    `because it is not registered as an observer`)吸收并记 warn,其余交给 shim 的 `@throw` 原样
    重抛(仍以 `C-unwind` 穿过被替换的实现)。顺带把 `objc2` 的 `exception` feature 关掉 —— 树里
    已经没人用它,留着只会把同一个 abort 请回来。
    
    ## 验证
    
    - 独立探针 + navop 的 release profile:吸收生效并打出完整 warn,通知计数 before=1 / after=1
      (首次注销真的删掉了,通知不再来),进程正常退出。
    - 同一探针换回 `fork-0.3.121` 的守卫做对照:`panic in a function that cannot unwind` →
      `thread caused non-unwinding panic. aborting.` → 退出码 **134** —— 探针确实能检出这个问题。
    - 上游 `cargo test -p gpui_macos --lib`:16 passed / 0 failed。
    - 快照 `4188a6b2`(`zed-rev` = `283416671d`)已确认带上 `crates/gpui_macos/build.rs`、
      `objc/gpui_macos_try_remove.m` 与 `cc` build-dependency(少任何一个都会在链接期失败)。
    - 本仓 24 条 `[patch.crates-io]` 与 `Cargo.lock` 同步切换;`cargo check -p one-core -p main
      --all-targets` 通过。
    
    docs/macos-memory-investigation.md 新增 §10.10(改成「只吸收那一个异常」,附「单测绿≠release
    可用」的教训)与 §10.11(shim 修法与全部验证记录)。
    
    真机包组合 = 弹窗只隐藏不销毁(§10.7)+ `fork-0.3.122` 的守卫。
    feigeCode committed Sep 28, 2026
    Configuration menu
    Copy the full SHA
    5a0959f View commit details
    Browse the repository at this point in the history
  3. fix(core): Touch Bar「关闭即隐藏」收进 macos-touchbar-window-hide 开关,只为 Intel …

    …Mac 生效
    
    关闭窗口时销毁原生 NSWindow 会触发 AppKit 的 Touch Bar 观察者注销路径
    (navop#262 / #308 / #314 的 SIGABRT)。前一版修法是「一律不销毁、只隐藏」,
    但它对所有平台生效:隐藏的原生窗口会一直占着 NSWindow / CAMetalLayer 直到进程退出,
    而 Touch Bar 只存在于 x86_64 机型 —— ARM macOS、Windows、Linux 付了代价却没有任何收益。
    
    - 新增 cargo feature `macos-touchbar-window-hide`(crates/core,main 转发),
      整条链路只读一个常量
      `HIDE_WINDOWS_ON_CLOSE = cfg!(all(target_os = "macos", feature = "macos-touchbar-window-hide"))`:
      `hide_for_reuse` 直接拒绝隐藏、`install_popup_close_routes` 什么都不装、
      `open_popup_window_inner` 不登记窗口、编辑器窗口的 `hide_for_reuse` 同样退回销毁。
      用常量而不是散落的 `#[cfg]`,是因为这三处必须同时成立,任何一处单独打开都会静默错配
      (隐藏了却不登记 = 业务 view 不卸载;登记了却不隐藏 = 条目永远探活失败)。
    - 复用键从 `&'static str` 改成 `String`:同类弹窗会为不同目标各开一个(同时编辑两个连接、
      同时连两台远程桌面),只按「弹窗种类」复用会把先开的窗口顶掉。
    - 发布流水线只为 `x86_64-apple-darwin` 传该 feature(`extra_features`),
      打包契约测试钉住三点:feature 只出现一次、只挂在 x86_64 判定下、两条编译命令都消费它。
    - 契约测试 `the_hide_switch_gates_every_link_of_the_chain` 门控链上的每一环。
    
    验证:`cargo check -p main`(feature 关)exit 0;`cargo check -p main --features
    macos-touchbar-window-hide`(Intel Mac 交付形态)exit 0;`cargo test -p one-core --lib`
    两种配置各 698 passed;`cargo test -p remote_file_editor --lib` 70 passed;
    `node script/test-release-packaging.mjs` 29 passed。
    feigeCode committed Sep 28, 2026
    Configuration menu
    Copy the full SHA
    eaad024 View commit details
    Browse the repository at this point in the history
  4. refactor(window): 弹窗一律复用、视图内关闭一律走关闭漏斗,补齐「所有打开窗口的地方」

    开关只管「关闭时隐藏」,但如果还有别的入口自己 `window.remove_window()`,
    那条入口照样会销毁原生窗口 —— #308 的「确定 / 取消」、#314 的「保存」就是这么漏出来的。
    这一版把「所有打开窗口的地方」都收到同一套机制下。
    
    - 24 处一次性弹窗改成 `open_reusable_popup_window`,并给每个目标一个复用键
      (`connection-form:ssh:42`、`table-export:{conn}:{db}.{schema}.{table}`、
      `remote-desktop:{destination}`、`credential-form:{id}` 等),
      为此给各表单窗口的 config 结构补上 `Clone`:复用时要按本轮目标重建 view。
    - 15 个表单 / 工具栏窗口里视图自己发起的关闭改成
      `one_core::window_close::close_window_for_reuse(window, cx)`。
    - 契约测试 `secondary_windows_never_destroy_themselves` 逐文件断言这些文件里不再出现
      `window.remove_window()`:漏掉任何一个入口,那条入口就照旧销毁原生窗口。
    - 文档 §10.12 记录开关的生效范围与这次收敛(含「ARM Mac 不开」的理由:
      没有 Touch Bar 就没有崩溃链,代价却是真实的)。
    
    验证:`cargo check -p main`(feature 关)exit 0;`cargo check -p main --features
    macos-touchbar-window-hide`(Intel Mac 交付形态)exit 0;`cargo test -p one-core --lib`
    两种配置各 698 passed(含新契约测试);`cargo test -p remote_file_editor --lib` 70 passed;
    `cargo clippy -p one-core --features macos-touchbar-window-hide --all-targets` 改动文件零告警。
    feigeCode committed Sep 28, 2026
    Configuration menu
    Copy the full SHA
    6635cd4 View commit details
    Browse the repository at this point in the history
  5. Merge pull request #321 from feigeCode/dev

    chore: 合并 dev 到 main(Touch Bar 窗口关闭全链路修复 + gpui fork-0.3.122)
    feigeCode authored Sep 28, 2026
    Configuration menu
    Copy the full SHA
    bd26da3 View commit details
    Browse the repository at this point in the history
  6. chore(release): 准备 v0.19.4(CHANGELOG 双语条目 + 版本号)

    - CHANGELOG.md 增加 v0.19.4 双语发布说明,覆盖 v0.19.3 之后 dev 上的 4 笔提交:
      - 更新内容:macOS(Intel Mac / Touch Bar)关闭窗口闪退收口到「所有会开窗口的入口」——
        弹窗、表单、远程桌面、表导出、编辑器窗口的关闭统一走同一条漏斗(关闭即隐藏、
        复用同一个原生窗口),不再从别的入口销毁原生窗口
      - 修复与优化:「关闭即隐藏」改为只对 Intel Mac 生效(ARM Mac / Windows / Linux 恢复
        关闭即销毁,不再承担隐藏窗口的内存代价);gpui 分支更新到 fork-0.3.122(Touch Bar
        重复注销异常的捕获挪到 Objective-C 侧编译,release 的 panic=abort 下才有效)
    - main/Cargo.toml 与 Cargo.lock 的主包版本 0.19.3 -> 0.19.4
    feigeCode committed Sep 28, 2026
    Configuration menu
    Copy the full SHA
    b10d0d8 View commit details
    Browse the repository at this point in the history
  7. Merge pull request #322 from feigeCode/dev

    chore(release): v0.19.4
    feigeCode authored Sep 28, 2026
    Configuration menu
    Copy the full SHA
    a695469 View commit details
    Browse the repository at this point in the history
Loading