Skip to content

fix(chat): preserve answer focus during session activation - #846

Merged
pascalandr merged 1 commit into
devfrom
fix/interruption-activation-focus
Oct 4, 2026
Merged

pascalandr merged 1 commit into
devfrom
fix/interruption-activation-focus

Conversation

@pascalandr

Copy link
Copy Markdown
Contributor

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

  • 7 deterministic activation/selection tests pass; competing inputs, modal/dock ownership, stale callbacks, normal activation and phone behavior covered.
  • 46 transcript tests pass.
  • Header/mobile/dock: 57/58 initially; one cold fixture navigation timeout passed its isolated rerun.
  • UI TypeScript and production UI build pass.
  • Independent gatekeeper and full CI required before the requested admin merge.

Maintenance

Existing oversized file: packages/ui/src/components/session/session-view.tsx (~720 lines).

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 pascalandr left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@pascalandr
pascalandr merged commit 5c523e3 into dev Oct 4, 2026
12 of 13 checks passed
@pascalandr
pascalandr deleted the fix/interruption-activation-focus branch October 4, 2026 17:34
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.

1 participant