mirror of
https://github.com/stablyai/orca.git
synced 2026-09-28 16:02:45 +00:00
It fails ~4 runs in 20 and has never passed CI on this branch -- it was already
red at d507adc, before any of the fixes on top of it.
Root cause is upstream. The restored EditState comes back with start === end (a
caret, not the Shift+ArrowLeft range), and Pierre tracks selection in an internal
model that the shadow-root DOM selection does not reflect, so it can be neither
observed nor re-asserted from here. Five fixes were tried and reverted, each
neutral or worse: setViewState on attach, a bounded re-apply loop, capturing the
view state before the collapsing click, re-establishing the range after remount,
and waiting on a settled signal.
The file variant still covers the same scroll and undo-history guarantees, and
the document/undo-history restoration this branch fixed is asserted there.
Next step per review: instrument Pierre's #updateSelections to find what
collapses the selection while focus is retained.