fix(mobile): reconcile authoritative terminal frames - #197
Conversation
Ark0N
commented
Aug 5, 2026
Hi Lior, closing this one as part of a cleanup of the seventeen PRs currently open from you. The full explanation is in #173, and I would rather you read that one than this note, because it is the honest version and it is not a dismissal of your work. The short form: sixteen PRs opened in a single day, roughly 42,000 added lines in total, landing mostly on the same few files (nine touch Going forward, please keep no more than three open PRs at a time, each one a single behavior change that stands on its own, with a test that fails on master and passes with the fix. #214 and #215, merged today, are good models. If this particular change fixes something that genuinely annoys you in daily use, it is a good candidate to be the first one you reopen on its own, rebased on current master. I will review it properly. Thanks for the effort you put in, and sorry to close it this way. |
Summary
mux-visiblepane after keyboard resize, WebSocket attachment, or foreground dialogue submission.Motivation
Codex can emit several resize redraws while the mobile visual viewport changes. xterm may briefly expose an older pane, blank rows, or overlapping history before the TUI reaches its final size. A visual cover removes the intermediate paint, while cursor-qualified reconciliation makes the frame behind that cover current before it is revealed.
Dialogue selection uses the same path because a prompt can be replaced immediately after Enter or a terminal mouse selection. Input is still dispatched once; the frame capture is asynchronous and cannot block delivery.
Commit Scope
This branch is a focused terminal stack:
92dbe64retains buffer-load ownership during replay (also carried by fix(terminal): preserve replay and history ownership #193).45f425dcoalesces keyboard viewport settling (patch-equivalent to fix(mobile): coalesce keyboard viewport settling #194).cc37643drains deferred terminal output without a later wake event (patch-equivalent to fix(terminal): drain deferred output without a wake event #190).7bfee75adds the inert resize-frame cover.fddd53aadds authoritative cursor reconciliation and its tests.It does not include the mobile navigation pad, terminal tap policy, repository viewer, shutdown endpoint, input controller, or other features from #173.
Dependencies
Merge the terminal contracts before this PR:
takeControl/refitresize options.An integration rehearsal combined #189, #191, and this branch. Two overlapping merge blocks are additive:
t: "h") and viewport takeover (a: true) inws-routes.ts, with one sharedannouncedViewportdeclaration beside announced rows/columns._requestTerminalFrameReconcile()inmobile-handlers.jsinstead of the older directsendResize()call.The reconciled tree built successfully and passed the joint route and browser suites.
Failure Behavior
mux-visible, non-empty, and has a valid stream cursor.Verification
npm run buildnpm run typechecknpm run lintnpm run check:frontend-syntaxnpm run check:public-assetsnpm run format:checknpm run test:ciwith test: isolate runtime state and PTY integration #175 fixture safeguards: 189 files passed, 1 skipped; 3,817 tests passed, 12 skippedRelated
Extracted from the terminal transition portion of #173 in response to the maintainer's scope review.