mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5643] [MERGED] fix(client): keep keyboard focus through TTS voice-picker refetches; settle flaky geometry measurements #6862
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#6862
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5643
Author: @kolacheee
Created: 8/29/2026
Status: ✅ Merged
Merged: 8/29/2026
Merged by: @kolacheee
Base:
staging← Head:fix/5642-wave3-flakes📝 Commits (1)
c93847dfix(client): keep keyboard focus through TTS voice-picker refetches; settle geometry e2e measurements📊 Changes
2 files changed (+152 additions, -71 deletions)
View changed files
📝
e2e/core-flows.e2e.ts(+96 -59)📝
packages/client/src/components/panels/settings/TTSConfigCard.tsx(+56 -12)📄 Description
Closes #5642
Why
Three desktop-chromium tests were failing intermittently on unrelated PRs (evidence in #5642: the same suite content flip-flopping between pass and fail across PR #5640's three matrix runs). One of them turned out to be a real accessibility bug, not test noise.
The ElevenLabs focus flake is an app bug — fixed in
TTSConfigCardThe adversarial verification pass traced the full mechanism: every edit in the TTS card schedules a debounced autosave; its
onSuccessinvalidates the voices query; the refetch flipsfetchingVoices, which disables every voice-picker trigger for a beat. Two ways that strands keyboard focus on<body>:<body>synchronously the moment the focused trigger'sdisabledattribute lands.requestAnimationFrame— andfocus()on a disabled button is a silent no-op, never retried. A restore landing in the transient disabled window lost focus permanently.That is exactly CI's
toBeFocused→inactive(full 10s) atcore-flows.e2e.ts:9560, and why it never reproduces locally (the mocked refetch closes the window in ~ms; 30/30 local baseline was green).Fix: a bounded retrying restore (
restoreFocusToTrigger) — retries across frames until the trigger accepts focus, 2s deadline, canceled on unmount, and aborts the moment focus legitimately lands on any real element so it can never steal from a user who moved on. The disabled-close path now restores too, when focus was inside the control (body counts, per the synchronous-drop behavior above). This is a real keyboard-user fix: previously any voices refetch while browsing a voice list dumped focus to<body>.The test also gained a drain step: it now waits out the debounced autosave (and its voices refetch) before opening the per-character picker, closing the sibling window where the refetch could force-close the panel mid-measurement.
The two geometry flakes are measurement races — fixed in the tests
:6387, width 5.47px short): thegetAnimations({subtree: true})settle can see an empty registry for a transition that is scheduled but not started, so the one-shot measurement catches mid-transition geometry. The post-toggle measurements are now one retried unit (expect(...).toPass()), re-reading all boxes per attempt; the right-side re-anchor block got the same treatment (identical structure, CI just hadn't hit it yet). All assertions still compare against pre-toggle baselines, so a real layout regression fails terminally — verified in review that the retry cannot convert a genuine failure into a pass.:17148, ~77px spread): the measurements run right after the settings panel closes, and the six sequential width reads can sample different frames of the resize transition. Now anchored on the 4-column regime and wrapped in a retried unit; the later duplicate width check after the tab round-trip still provides the long-settled comparison.Validation
--repeat-each=10,--retries=0); final round includes every review-pass amendment.pnpm check— passing.Notes
tscon it) — that's how a scope error survivedpnpm check. Left as a separate follow-up task rather than folding a large tsconfig effort into this PR.Summary by CodeRabbit
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.