Skip to content

[bugfix] canvas: preserve Escape ownership and repair nightly tests - #672

Merged
wangtiance merged 2 commits into
ThinkFlowLab:mainfrom
wangtiance:codex/fix-nightly-canvas-interactions
Dec 4, 2026
Merged

wangtiance merged 2 commits into
ThinkFlowLab:mainfrom
wangtiance:codex/fix-nightly-canvas-interactions

Conversation

@wangtiance

@wangtiance wangtiance commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Nightly run 47181192889 repeatedly failed canvas interaction checks. With chat open, staged references swallowed Escape before the inline text editor; chat keyboard focus also prevented cancellation of an active reference drag. This change lets the owning editor or active gesture handle Escape and preserves IME composition.

The supporting browser checks now establish canvas geometry, hit-test pan origins inside the actual canvas, await persisted connections and media-failure state, and count view writes separately from reads. Existing movement, persistence, undo/reload and rejection assertions remain in place.

Linked issue and labels

No issue applies; this addresses the linked Nightly failures. Labels: type:bug, area:canvas.

Validation

  • Local: all seven previously failing scripts (reference_drag_performance, canvas_selection_history, node_connections, multi_selection_references, composer_expansion, first_last_frame_connections, node_versions), plus context_menu_dismissal. The node-connection script covers nine combinations.
  • Production preview: first_last_frame_connections, composer_expansion, canvas_selection_history passed.
  • npm run build, 19 related Node tests (nodeReferencePorts, pendingCanvasReferences, selectionReferences, canvasPointerGesture), browser manifest/locale checks, npm run check:i18n, and git diff --check passed.
  • Windows / Node 26.13.0 / Python 3.14.7 / Chrome 158 / Playwright Core 1.65.1. Linux Release checks, the complete Nightly suite and the CI toolchain remain unverified locally. No real provider calls or speed-improvement claims. No user-facing copy changed.

Evidence

Current candidate is ffdc7a9389c5745f2ed1490a5235ce7c479a33f9, based on 9f24de145389dab2186944d6fcc79acee5492dad.

  • Text Escape screenshot and recording: type ABC, delete C, then Escape while chat has staged references. AB remains and the textarea closes; previously it remained attached.
  • Reference Escape screenshot and recording: leave keyboard focus in chat, drag a reference port, then Escape. The preview disappears; previously one preview remained.
  • Reproduction and environment. Temporary projects and fixture model configurations only. Recordings show focused portions of the full tested journeys.

CodeQL follow-up

The original PR check reported js/insecure-temporary-file (alert 94) because CPU profiles used predictable names directly under the OS temporary directory. Each run now creates a private directory with fs.mkdtemp; Nightly collects profiles from that directory. The actual pan/node sample and Bash collection of both CPU profiles passed on the updated source. Remote CodeQL still needs to confirm the alert is resolved. UI screenshots and recordings were captured from 3a36fd76; both UI implementation files remain unchanged in the current candidate.

Candidate review

  • Author self-review: 93/100 (scope 3, correctness 3, validation 2, evidence 3, simplicity 3). No blocking findings; remote CI remains pending.
  • Independent candidate review: 93/100, ratings 3/3/2/3/3, no blocking findings. The reviewer checked the full 17-path diff, reran 19 related Node tests, parsed both collected CPU profiles (nonempty nodes/samples), verified screenshots/video metadata, report consumers and original browser/production logs. Formal verdict is WITHHOLD pending remote CI, not a merge PASS.
  • Reviewed base: 9f24de145389dab2186944d6fcc79acee5492dad.
  • Reviewed head: ffdc7a9389c5745f2ed1490a5235ce7c479a33f9.
  • Material validation gap: local Windows toolchain differs from Linux CI; full Release checks and Nightly have not run on this candidate.

中文总结

修复聊天区与画布之间的 Escape 事件冲突,使文本编辑能正常退出、参考连线能正常取消;修正聊天布局影响测试坐标、异步保存等待不足,以及历史版本测试将读取误计为写入的问题。原失败脚本、相关单测和三项生产构建检查均在本机通过,附实际截图与录屏,另已修复 CodeQL 报出的临时文件创建风险,使用独立安全临时目录并同步更新产物收集路径;完整 Linux CI 待运行。

## summary

- Let inline editors and active reference drags handle Escape while
  chat is open, without intercepting IME composition.
- Establish canvas geometry and await persisted reference state in
  browser checks; count view writes separately from reads.
- Add reproduction screenshots and recordings for both interactions.
@wangtiance wangtiance added type:bug Something is broken area:canvas Canvas, nodes and direct manipulation labels Dec 4, 2026
## summary

- Create a private temporary directory for each browser profile run.
- Keep profile names and update nightly artifact collection to find
  profiles inside the new directory.

## validation

- Real pan and node samples passed with two readable CPU profiles.
- Bash artifact collection found both profiles in the new directory.
- Browser manifest and diff whitespace checks passed.

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WITHHOLD ffdc7a9 · no linked issue

两段录屏已下载、完整解码并抽看,连线预览的取消与聊天焦点切换有可见证据;文本截图呈现保留的 AB。录制时的两个 UI 实现文件和当前 head 一致,之后只改了 Nightly CPU profile 路径及对应测试脚本。当前 Release、CodeQL 和 DSH 已绿,仍缺这个 SHA 的 Linux Nightly:需要确认原先失败的画布用例与 profile 上传一起通过。

当前证据暂定 93/100(范围 3,正确性 3,验证 2,主张证据 3,简洁性 3;均满分 3)。Ran: 变更、前后版本文件范围、媒体及 GitHub 检查核对。Not run: 本地浏览器、Linux Nightly、真实 provider。

Dot,代表 @david6666666;非表决。

@wangtiance

Copy link
Copy Markdown
Collaborator Author

In response to the latest review: agreed that Linux Nightly evidence for the current head is still required.

I have triggered the complete Nightly checks run on the fork's PR branch. Its verified head is ffdc7a9389c5745f2ed1490a5235ce7c479a33f9, matching this PR, using the committed workflow and Ubuntu 22.04 runners. browser-extended, browser-production and perf-outputs are running, alongside gate parity and Python flake triage.

The remaining evidence is that the previously failing canvas journeys pass on Linux and both CPU profiles are collected from the private temporary directory into the uploaded nightly-perf artifact. The run and artifact verification are still pending; the existing Release, CodeQL and DSH results are green on this head.

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WITHHOLD ffdc7a9 · no linked issue

Linux Nightly 补到了。这个 SHA 的 browser-extended 通过,perf-outputs 成功上传了 nightly-perf(我核对了上传记录,没独立解包)。但 browser-production 在 workspace_modes.mjs 等 filechooser 超时,整轮 Nightly 没通过。这里不把超时归因给 Escape 改动;下一步先用同一 production runner 和浏览器对照 main,判断是环境旧问题还是本分支回归。

当前证据暂定 93/100(范围 3,正确性 3,验证 2,主张证据 3,简洁性 3;均满分 3)。已核对 exact-head job 日志和上传结果,未重跑。

Dot,代表 @david6666666;非表决。

@wangtiance

Copy link
Copy Markdown
Collaborator Author

Follow-up to the latest review: I independently downloaded and unpacked the nightly-perf artifact. Both profiles parse successfully with nonempty nodes and samples:

  • opendirector-drag-nightly-ffdc7a9-pan.cpuprofile: 1,447 nodes / 1,141 samples.
  • opendirector-drag-nightly-ffdc7a9-node.cpuprofile: 1,564 nodes / 913 samples.

The exact-head extended lane passed. The production failure is workspace_modes.mjs:789, waiting for the file chooser after pressing Enter on the keyboard-focused upload button. The overall Nightly conclusion is cancelled, with production failed and other jobs cancelled; I am not claiming a complete Nightly pass.

For the requested comparison, I have triggered Nightly on the exact main base, verified SHA 9f24de145389dab2186944d6fcc79acee5492dad. It uses the same fork, Ubuntu 22.04 runner image, production-build workflow and pinned Playwright Core 1.58.2 / Chromium setup as the PR run. These are separate hosted runner instances. workspace_modes.mjs is unchanged between that base and this PR.

The baseline run is in progress. Its production result is still needed before classifying the file-chooser timeout as a baseline issue, environment issue or PR regression; the changed Escape path has not been ruled out solely because the test file is unchanged.

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WITHHOLD ffdc7a9 · no linked issue

补核了同一 fork、精确 main base 的对照 Nightly。其 production 日志也在 workspace_modes.mjs:789 等 filechooser 15 秒超时,和 PR 是同一失败点。这个失败不是 PR 独有,不能直接归因于 Escape 改动;也不代表 Nightly 已经通过。PR 的 extended 与 perf 产物有独立回执,但 production 仍失败。

维持当前证据暂定 93/100(范围 3,正确性 3,验证 2,主张证据 3,简洁性 3)。Ran: 两轮 hosted 日志和既有录像核对。Not run: 本地 production lane;未自行触发 CI。下一步单独修复键盘上传测试的 filechooser 稳定性,再验证本 PR 声称覆盖的 production 路径。

Dot,代表 @david6666666;非表决。

@wangtiance

Copy link
Copy Markdown
Collaborator Author

Thanks for checking the baseline. I have independently compared the two production logs:

Production scenario Main base 9f24de14 PR head ffdc7a93
first_last_frame_connections.mjs — the production failure addressed by this PR fail pass
workspace_modes.mjs:789 — keyboard upload/file chooser 15-second timeout same 15-second timeout

Sources: exact-base production job, exact-head production job.

For the current head, the entire extended lane passed, the perf lane passed, and both uploaded CPU profiles were independently unpacked and parsed as recorded above. Release checks, CodeQL and DSH are also green. Thus the original canvas failures and profile collection covered by this PR have exact-head Linux evidence, including the repaired production scenario.

The remaining keyboard-upload failure is reproducible on the exact main base. It should be recorded and investigated as a separate follow-up; the evidence currently available does not identify it as a regression introduced here. The complete Nightly remains non-green, and I am not claiming otherwise.

Could you reassess the WITHHOLD against these scoped results? If a gap remains in the behavior changed by this PR, please identify the specific scenario or evidence needed. Requiring the unrelated baseline failure to be fixed first would expand this PR's scope; the documented PR checks and Nightly advisory policy do not establish a requirement for every Nightly job to pass.

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PASS ffdc7a9 · no linked issue

补读了两份 production 日志:这次修的 first_last_frame_connections.mjs 在精确 main 基线失败、在这个 head 通过;两个版本都在另外的 workspace_modes.mjs:789 等 filechooser 超时。算上当前 head 上通过的 extended、perf 和 required Release,这个 PR 的改动已有对应验证。键盘上传问题另追,本条不把整轮 Nightly 说成通过。

93/100(范围 3,正确性 3,验证 2,主张证据 3,简洁性 3)。Ran: 对照日志、已解码录屏和 CI。Not run: 本地生产测试或独立解包 perf。Dot,代表 @david6666666;非表决。Coordinator: 按仓库流程集成。

@wangtiance
wangtiance merged commit 728b407 into ThinkFlowLab:main Dec 4, 2026
12 checks passed
@wangtiance

Copy link
Copy Markdown
Collaborator Author

谢谢复核。合并后同一提交的 main Nightly 中,extended、perf 和发布门禁均通过。production 仍在 workspace_modes.mjs:789 等待 filechooser 超时,与合并前的精确基线一致。这里继续把这条键盘上传问题与本 PR 已验证的首尾帧修复分别记录。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:canvas Canvas, nodes and direct manipulation type:bug Something is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants