Skip to content

fix: prevent stale terminal surface repins on workspace switch - #93

Merged
chenbstack merged 1 commit into
chenbstack:mainfrom
defia:fix/stale-surface-repin
Jul 21, 2026
Merged

fix: prevent stale terminal surface repins on workspace switch#93
chenbstack merged 1 commit into
chenbstack:mainfrom
defia:fix/stale-surface-repin

Conversation

@defia

@defia defia commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

变更内容 / Summary

  • 延迟 re-pin 在执行时重新确认 pane 仍属于当前 workspace 的当前 tab。
  • 阻止已退出的 SwiftUI representable 把旧 terminal surface 重新挂进复用的可见容器。
  • 增加 workspace 切换后的 stale re-pin 回归测试。

验证方式 / Testing

  • 回归测试已确认旧策略失败、修复后通过。
  • 完整 macOS 测试:250 tests,0 failures。
  • Dev 实测:3 个 workspace 连续 100 轮、300 次切换;581 次 stale re-pin 回调被拦截,应用保持可用且无崩溃。

截图或录屏 / Screenshots or recordings

不适用(无 UI 样式变化)。

关联议题 / Related issues

无。

@chenbstack
chenbstack merged commit ba973a4 into chenbstack:main Jul 21, 2026
1 check passed
chenbstack added a commit that referenced this pull request Jul 21, 2026
…可见性判断

PaneView's deferred re-pin guard (#93) duplicated WorkspaceStore's
private isPaneVisible verbatim because it wasn't callable from outside.
Split the logic into a pure static core plus an instance wrapper, reuse
it from PaneView, and cover the visibility semantics with a unit test
(selected tab vs background tab vs foreign/no workspace).

CN: 将 PaneView 中与 WorkspaceStore.isPaneVisible 逐字重复的 pane 可见性判断收敛为共享实现(纯静态核心 + 实例包装),并补充可见性语义的单元测试,防止两处逻辑日后漂移。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
chenbstack added a commit that referenced this pull request Jul 21, 2026
Add the curated bilingual What's New entry for 0.1.26-beta.5: fix for
stale terminal surface repins after workspace/tab switches (#93).

CN: 补充 0.1.26-beta.5 更新内容:修复 workspace/标签页切换后窗格被旧终端 surface 重新占用的问题。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants