Repository navigation
fix: keep seeded content out of undo and stabilise the bubble-in-row matrix - #79
Merged
Merged
Conversation
The phone status pill spans the docked bar's width 8px above it, in the band where the presence and Discord/GitHub/Privacy chips float, so a refused "/" pick, a removed format's Undo or an unavailable cell's reason covered them. Hide the chips while the bar holds a pill, as they already hide for the selection bar; they come back when it closes.
The colour hover preview drew one decoration over each selection range,
so Red text or Yellow highlight showed over inline code and code blocks
although applying never colours them: inlineCode excludes every mark
and a code block allows none.
setActionPreview now takes { attrs, mark } and decorates only the inline
nodes addMark would mark (the parent allows the mark and no mark on the
node excludes it), merging adjacent runs. A collaborator's redraw keeps
the same rule.
A highlight preview's run that starts after the selection nests the
blurred selection's span inside its mark, so the colour panel's
stylesheet keeps that tint off.
…loads A brush press before the lazy formatting engine landed went through runWithEngine, which runs a queued action only if the selection has not moved. For Paint format the next selection is the intended next step, so the press was dropped and the brush never showed pressed. The brushes now keep the press in paint-pending.ts: pressed at once, with the copy cursor and the pill, the pressed text kept as a session range that follows edits. Once the engine lands it arms on that range and paints a mouse selection made meanwhile (on touch, the second tap). Other queued actions keep the unmoved-selection rule.
A pointer-up that started in the text set the pending press's apply flag even for a plain click, and landing then painted whatever was selected, a keyboard selection too. Read the selection a frame after the pointer-up, as the armed listener does, keep it only when it is other text, and on landing paint only if it is still that selection; otherwise just arm. The touch second press keeps its selection the same way.
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md # tests/TESTING.md
# Conflicts: # CHANGELOG.md # tests/TESTING.md
UniqueID and the outline append a heading-id transaction to a change made with addToHistory: false. y-tiptap 3.3.0 took the history flag from the last doc-changing transaction of a dispatch, so the Playground seed became an undo step: Undo was enabled on a fresh Playground and wiped it, together with any edit made within the Yjs capture window. Patch y-tiptap so an appended transaction keeps its root transaction's addToHistory: false. User edits stay undoable as before.
The matrix failed about one run in seven under load, two ways: - Its fixture was an undo step, so the first Bold could join it within the Yjs capture window and the undo after it wiped the page. The spec's fixtures now load with addToHistory: false, as the app seeds a document, and the matrix checks that Undo starts disabled. - A bubble still sliding in made Playwright retry the click and scroll its target, which brought the text under the sticky row; the bubble flipped below the text between mousedown and mouseup and the click landed on the page (a missing mark, or no Link popover). The matrix now runs on a page too short to bring the text under the row.
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md # tests/TESTING.md
A "/" typed while an earlier fetch of the menu chunk was still failing (the chunk runtime fetches a failed chunk once more, a moment later) joined that fetch. When it failed, nothing loaded the chunk again while the menu stayed open, so the menu never showed even once the chunk could load. A failed load is now fetched once more straight away.
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.
What and why
selection-bubble.spec.ts"bubble-in-row matrix" failed intermittently under load in Chromium and WebKit (6 of 40 runs at--repeat-each=20 --workers=6, both projects). Two separate root causes, one of them an app bug a user can hit.Root cause 1 (app):
addToHistory: falsewas lost when a plugin appended a transactionaddToHistoryfrom each doc-changing transaction in turn, so the appended transaction (no meta) overrode the root'saddToHistory: false, and the whole dispatch landed in the Yjs undo stack.aria-disabled="false"on main and"true"on this branch.EditorPage.setContent(undoable). When the first bubble Bold landed less than 500 ms later, it merged into the fixture's step, andundo()wiped the page. Next step:"some words" not found. Instrumented runs showed the stack at 1 item after the Bold, and the doc empty after undo.Fix:
patches/@tiptap%[email protected](repo already usespatchedDependencies). A doc-changing transaction counts asaddToHistory: falseif it, or itsappendedTransactionroot, says so. This is a one-line change inySyncPlugin's stateapply. The scope is local dispatches made withaddToHistory: falsethat get appended transactions. Ordinary user edits, including ones with appended ids, are recorded exactly as before. The new unit testtests/unit/lib/y-undo-history-intent.test.tscovers:setContentstill undoable and redoable with ids;The first two fail without the patch.
Root cause 2 (test): a click retry scrolled the page and the bubble flipped mid-click
The Link popover failures and the "mark missing from the bubble" failures share this cause. Event logging showed:
mousedownandmouseup.clicklanded onmain.document-editor-wrapper, not the button.The bubble flipping when the band above is under the row is intended. A user would have to scroll while holding the button down.
Fix: the matrix runs on the fixture without its 30 filler paragraphs. That page scrolls by the row's height at most, which never brings the text near the row. The spec's
openDocnow loads fixtures withsetMeta("addToHistory", false), as the app seeds. The matrix also asserts Undo starts disabled. The existing 200 ms settle after the fixture is kept (see follow-ups).How verified
--project=chromium --project=webkit --workers=6:selection-bubble.spec.ts, both projects,--workers=6 --repeat-each=2/3: green apart from pre-existing flakes. They appear at the same rate with main's spec, measured as 2 of 160 on each side (see follow-ups).bun run check,bun run lint,bun run typecheck,bun run test(1241 pass).bun run build && bun scripts/check-editor-chunk-size.tspasses.node_modules,bun install --frozen-lockfilewith this lockfile applies the patch.Bytes
Patched vs unpatched production builds, same env:
Deploy
Run
bun installbeforebun run build. The newpatchedDependenciesentry patches@tiptap/y-tiptapat install time.Follow-ups
package.jsonallows^3.3.0, so a bump will fail the install until the patch is redone or dropped.EditorPage.setContentis still an undo step. Other specs that undo shortly after it have the same 500 ms merge hazard.openDoc; not investigated here.route.fetch()error is then reported against the next test, "the bubble ends with the Paint format brush".