fix(chat): preserve answer focus during session activation - #846
Merged
Merged
Conversation
Recheck input, interruption and modal ownership when deferred activation runs rather than only before scheduling it. Cancel pending frames on deactivation, disposal or superseding session activation so a stale callback cannot redirect an answer into the composer. Preserve ordinary composer and conversation activation and phone keyboard behavior. Gate the final activation frame in the browser fixture to deterministically cover competing controls, modal ownership, stale callbacks and normal activation. Seven focus tests and UI TypeScript pass. Correct the transcript fixture's permission-receipts response to valid empty JSON; all 46 transcript tests pass without assertion relaxation. These address the three full-CI failures reported after PR845: the focus race and invalid receipt mock were independently reproduced on its baseline as well as its head.
pascalandr
commented
Oct 4, 2026
pascalandr
left a comment
Contributor
Author
There was a problem hiding this comment.
Independent gatekeeper: ZERO FINDINGS on 96457a3.
Reviewed complete 69d33b4..96457a3 diff. Solid on() preserves ownership through untrack(), so effect cleanup registration is valid. Cancellation/stale-callback fences cover deactivation, reactivation and disposal; early protected-focus returns preserve existing focus-intent behavior. Frame-gated regressions execute production callbacks and assert actual DOM focus. Independently reran interruption-selection.test.ts: 7/7 passed. Read-only review; working tree clean.
Full CI is still being awaited before admin merge.
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.
Summary
Follow up the three full-CI failures reported after #845. A delayed session-activation callback could steal focus from an answer field and insert the answer into the composer. Recheck input/dock/modal ownership at execution and fence deactivation, disposal and superseded callbacks.
Baseline evidence
The focus race reproduces at baseline 0465499 and #845 head; deterministic new coverage fails against the old focus implementation. The other two failures also reproduce on both snapshots: the transcript fixture returned an empty body for permission-receipts, rendering error panels that changed row geometry. Fulfill that route with valid empty receipts; no assertion changes, added waits or forced clicks.
Validation
Maintenance
Existing oversized file: packages/ui/src/components/session/session-view.tsx (~720 lines).