Skip to content

fix(window): 修复窗口恢复后残留置顶导致的窗口遮挡问题 - #1810

Merged
vastsa merged 20 commits into
vastsa:mainfrom
xuesecanmeng:codex/fix-windows-alt-tab-stacking
Oct 22, 2026
Merged

vastsa merged 20 commits into
vastsa:mainfrom
xuesecanmeng:codex/fix-windows-alt-tab-stacking

Conversation

@xuesecanmeng

Copy link
Copy Markdown
Contributor

背景

本 PR 拆分自 #1708(已关闭)。原 PR 同时包含全屏及窗口按钮状态同步、Windows 窗口切换时的层叠异常,以及 Windows 10 自定义圆角边缘显示等修复。

原PR修改范围较大,为便于独立审查、验证和合入,本 PR 仅保留出现后无法正常复原的窗口恢复后残留置顶导致遮挡的修复,以及对应的回归测试和文档更新。全屏、按钮状态和圆角相关修改不包含在本 PR 中。

问题与原因

Windows 主窗口从异常小尺寸恢复后(例如我所使用的Seelen UI,其替换掉了windows的原生任务栏,会导致windows的 PI-Desktop 主窗口有概率出现储存小于预期最小窗口尺寸的情况,同时无法确保正常windows原生条件下永不触发窗口异常的问题),可能持续保持置顶状态。其他窗口即使已经获得焦点,仍可能被 PI-Desktop 覆盖,表现为应用切换后目标窗口无法正常显示。

根因是临时置顶与释放机制的平台范围不一致:

  • 共享的窗口恢复逻辑可以在 Windows/Linux 上开启临时置顶,并记录四秒后的截止时间。
  • 负责检查截止时间并解除置顶的 boundsWatchdog 仅在 macOS 上运行。
  • 尺寸恢复正常后,后续普通 focus 事件会提前退出恢复逻辑,无法清除残留的置顶状态。

修改内容

添加了判断条件将恢复过程中的临时置顶限定为 macOS,使其与已有释放机制的平台范围一致。

  • 保留 Windows/Linux 的尺寸恢复流程,恢复后保持普通窗口层级。
  • 保留 macOS 的临时置顶和 watchdog 释放行为。
  • 增加生命周期回归测试,覆盖恢复事件、正常聚焦及隐藏/最小化保护。
  • 同步窗口行为规范和 E2E 场景说明。

生产代码仅调整置顶条件及对应注释。本 PR 不包含原组合分支中的全屏、窗口按钮、边框或圆角修复。

验证结果

59 项相关回归测试通过。

Windows Electron 43.6.0 原生窗口对比实验结果:

检查项 修复前 修复后
异常小尺寸恢复正常 成功 成功
PI 保持置顶 是 否
切换目标获得焦点 是 是
切换目标位于 PI 上方 否 是

以下检查均通过:

  • JavaScript 构建:pnpm build:js
  • 桌面 TypeScript 类型检查
  • 静态检查:pnpm lint
  • 差异空白检查:git diff --check

xuesecanmeng and others added 20 commits October 22, 2026 09:41
Bounds recovery could leave Windows and Linux windows always-on-top
because only the macOS watchdog releases the temporary recovery pin.
Keep pin acquisition on the platform that owns its cleanup.

Regression coverage protects normal focus and hidden or minimized state
while preserving the existing macOS recovery behavior.
The shimmer styles were inserted after the first half of the running-label selector, so the active label inherited inline-grid and the pulse marker became an auto-placed grid item. Separate the marker and shimmer selectors again so the marker stays in the label's inline flow and does not disturb truncation.
The live dot was generated content inside the running label. A selector collision with the shimmer rule turned that label into a grid and pushed the dot onto a second row; even with the selectors separated, the inline pseudo-element sat below the row centre and could be clipped by the label's ellipsis box.

Render the marker as a real flex sibling so the header's existing align-items centres it, and keep the label's text truncation untouched.
Refresh the bundled provider catalog so the 0.21.0-beta.5 test build packages the current models.dev snapshot.
The refreshed models.dev snapshot publishes a 1,048,576-token window for deepseek-v4-flash; update the endpoint metadata assertion so the release verification pins the shipped catalog.
A review-backed Edit or Write now renders as a single tool-level review row: the file header is the only disclosure header, with its diff body directly beneath it. This removes the duplicate generic tool row while keeping rollback and adding a copy action for the hunks.

The command-first and fully-folded group bodies restore the released v0.20.1 12px child indent and left hover/focus collapse rail, so non-command tools keep their two-level hierarchy without adding a third disclosure.
feat(transcript): flatten edit rows and restore group hierarchy
Keep translated display-mode labels on one line instead of squeezing them
into the fixed field column. Allow settings controls and whole options
to wrap when the available pane width is limited.
…ay-width

fix(settings): size segmented controls to their content
Repeated provider IDs were mistaken for replayed history, dropping real
results and freezing the outgoing request. Assign execution IDs before
Pi journals each response and retain completed pairs at the request
boundary. Keep identity reservations across compaction and model fallback.

Fixes vastsa#1815
Gemini rejects the additionalProperties keyword in its setup Schema.
Use its supported schema subset while keeping OpenAI and Host validation
strict. Reject failed setup immediately and retain the first socket
failure's diagnostics in the provider log without exposing them over IPC.

Fixes vastsa#1812
Anchor the global toast stack to the live main-content bounds so docked and resized work panels remain usable while notifications are visible. Preserve viewport fallback placement outside the chat shell and cover resize and horizontal-shift geometry in the question-notification journey.

Refs vastsa#1820
…ini-live

fix(runtime): preserve repeated tool executions and repair Gemini Live setup
Refresh the toast fix candidate after the runtime changes landed so its head contains the current integration base.
Drive the focus and blur lifecycle through explicit DOM events so the countdown coverage does not depend on operating-system window activation. Keep native keyboard input coverage in Electron.
…overlap

fix(desktop): keep toasts clear of the work panel
The pull request was based on an earlier main revision. Merge the current production tree into the shared branch so review and landing use the latest main without rewriting the contributor's commits.
@vastsa
vastsa merged commit ce9bb4b into vastsa:main Oct 22, 2026
@xuesecanmeng
xuesecanmeng deleted the codex/fix-windows-alt-tab-stacking branch October 23, 2026 01:35
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.

5 participants