test(cli): tolerate transient incomplete TUI frames - #2564
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
English
Summary
Fixes #2563
CLI TUI polling could fail on a valid intermediate render because
editorInputText()called a helper that asserted both editor borders were already present. The assertion escaped the polling predicate immediately instead of allowing it to observe the next settled frame.This change separates the two contracts:
findInputSurfaceRows()returnsundefinedwhile the input surface is incomplete, so polling remains pending.inputSurfaceRows()retains strict assertions for checks that require a settled layout.The slash-autocomplete query now reuses the same non-throwing lookup, and a focused regression preserves the intermediate-versus-settled frame contract.
Verification
/recaptest: 20 consecutive passesgit diff --checkChecklist
Does this PR entail a change in behavior?
中文
概要
修复 #2563
CLI TUI 的轮询可能在合法的中间渲染 frame 上失败,因为
editorInputText()调用了一个要求输入框上下边框已经完整存在的断言 helper。该断言会立即逃出轮询 predicate,使其无法继续观察下一个稳定 frame。本次变更将两种契约分开:
findInputSurfaceRows()在输入区域尚不完整时返回undefined,让轮询继续等待。inputSurfaceRows()为要求稳定布局的检查保留严格断言。Slash autocomplete 查询也复用了同一个非抛错 lookup,并添加一项聚焦回归,固定中间 frame 与稳定 frame 的契约。
验证
/recap测试:连续 20 次通过git diff --check检查清单
此 PR 是否改变行为?