Repository navigation
fix(admin): re-audit majors in the editor field (keyboard path to blocks, typing lag, Word bold, live-session discard) - #36
Merged
Conversation
…ion discard Re-audit majors (editor field, v2.7.6/2.7.7): - Ctrl/Cmd+/ is Editor.js' block menu again; the shortcut help moved to Ctrl/Cmd+Alt+/. "+" and the block menu handle are named buttons (role, tabindex, Enter/Space) with a focus ring. - Tab/Shift+Tab and the arrow keys reach controls inside blocks (audio and video Choose, person photo, toggle, column toolbar, button style and new tab, component inputs/combobox/switch); lists, tables and code keep Tab. - Typing at 2,000 blocks: inline sanitiser and canonical block JSON cached by input, save and form update in separate tasks, panels as a transition, draft fingerprints only after re-login, lazy rendered key. s27: p95 149 -> 36-46 ms, longest task 140 ms -> none over 50 ms. - Paste: inline CSS read by exact property name (Word mso-bidi-font-weight:normal kept bold). - Room "Discard changes": Strapi ConfirmDialog naming everyone, Undo with focus, a notice with "Restore my text" for the others in the session. Docs read: Editor.js 2.31.7 dist (BlockEvents keydown, Toolbar plus/settings handlers), React 18 startTransition/useDeferredValue (react.dev), @strapi/admin 5.63 ConfirmDialog types, DS 2.3.1 Button/Dialog, DOMPurify 3 README (pure function of input and config). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Schero94
force-pushed
the
fix/ui-reaudit-majors
branch
from
November 20, 2026 14:38
8e5f5bc to
41118aa
Compare
github-actions Bot
pushed a commit
that referenced
this pull request
Nov 20, 2026
## [2.8.2](v2.8.1...v2.8.2) (2026-11-20) ### Bug Fixes * **admin:** keyboard block menu and block controls, fast typing in long documents, Word bold, safe room discard ([#36](#36)) ([e8be99e](e8be99e)) ### Fixed (editor field: keyboard, typing speed, paste, live session) - **Keyboard path to the block menu.** Ctrl/Cmd+/ opened the plugin's shortcut help, which blocked Editor.js' own shortcut for the block menu, and the **+** and block menu (⋮⋮) handles had no role, name or tab stop. Ctrl/Cmd+/ opens the block menu of the current block again; the shortcut help moved to **Ctrl/Cmd+Alt+/** (also More tools > Keyboard shortcuts). Both handles are buttons with names ("Add a block", "Open the block menu") that open with Enter or Space. The shortcut help and the README list the keyboard path. - **Controls inside blocks were not reachable by keyboard.** Editor.js moves Tab and the arrow keys only between text inputs, so the audio and video Choose buttons, the person photo, the toggle's show/hide, the column style and layout, the button block's style and "new tab", and the inputs, select and switch of component blocks were skipped. Tab and Shift+Tab now stop on them in document order, the arrow keys stop on a control Editor.js would skip (not on selects), tools that use Tab themselves (lists, tables, code) keep it, and every control in a block shows a focus ring. - **Typing lag in long documents.** Every keystroke sanitised the whole document with DOMPurify several times (form value, rendered key, draft fingerprint) and compared it in canonical JSON: about 150 ms per key at 2,000 blocks. The inline sanitiser and the canonical JSON of blocks are cached by input (same output, so the same security; the server still sanitises on save), Editor.js' save and the form update run in separate tasks, the field's panels update as a React transition, and the draft fingerprints are only computed after signing in again. At 2,000 blocks a keystroke now takes p95 about 40 ms with no task over 50 ms (see the PR for the measurements). - **Bold from Word was lost on paste.** Word writes `<b style='mso-bidi-font-weight:normal'>` and the check for Google Docs' `<b style="font-weight:normal">` wrapper matched the text `font-weight:normal` inside the other property. Inline styles are now read by exact property name, everywhere in the HTML import. - **"Discard changes" in the live session notice removed other people's text without asking.** It now asks first in a Strapi confirmation that says it affects everyone editing the field, then shows a notice with **Undo** (focused) that puts the previous text back for everyone. People in the same session get a notice that the field went back to the saved content, with **Restore my text**.
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.
First of up to three stacked PRs for the independent UI re-audit of v2.7.6 (editor field). This one fixes the five majors. Settings pages (
admin/src/pages/**) are handled in a separate PR by another agent.Changes
editor/toolbar-a11y.mjs:role=button,tabindex=0, names "Add a block" / "Open the block menu", Enter/Space, focus ring. Shortcut help and README updated.s5-blockmenu-kbd: Meta+/ and Control+/ open the block menu (was: shortcut dialog); chrometabindex=0 role=button name=….f4-help-key: Cmd+Alt+/ opens help, focus returns to the paragraph; "+" + Enter opens the toolbox.editor/block-tab-stops.mjs: Tab/Shift+Tab stop on block controls in document order, arrows stop on controls Editor.js skips (not on selects/comboboxes), lists/tables/code keep Tab; generic focus ring for block controls.s23-reach: audio 1→0, personality 2→0, toggle 1→0, button 2→0, simpleImage 1→0 unreachable. Columns keep their ARIA toolbar (roving tabindex + arrows, Alt+F10): Tab reaches its stop. Component: only the DS NumberInput steppers (tabindex −1 by design) and the Switch's hidden checkbox remain. Table: Alt+F10 (unchanged, documented).sanitizeInlinememoised by input (LRU 20k, pure function of input → same output and guarantees),stableStringifyBlocks/Cached(native-key cache, output identical tostableStringify), yield between Editor.js save and form update, field panels viastartTransition, draft fingerprints only after re-login (useDeferredValue), rendered key computed lazily / skipped when the form returns the emitted object. Server-side sanitising unchanged.s27-perf2,000 blocks: before (2.7.7) p50 136 / p95 149 / max 153 ms, longest task 140 ms → after p50 21–24 / p95 36–46 / max 41–54 ms, no long task ≥ 50 ms (two runs). 50 blocks unchanged (p95 16–17).cssProperty()reads inline CSS by exact property name inshared/convert/html.mjsmso-bidi-font-weight:normal, Google Docs wrapper, vendor-only weight, last declaration wins);s12-pastecleanConfirmDialog("…for everyone?"), Undo notice with focus, others get "Someone in this live session brought this field back…" with Restore my text; form not marked changed after a remote resetc5-discard: confirm shown, focus on Undo, other editor notified, Save disabled on both.f3-undo-restore: Cancel keeps text and focus on Discard; Undo restores for both; Restore (other editor) restores for both.Tests:
tests/admin/block-keyboard.test.jsx,tests/admin/room-notice.test.jsx,tests/admin/sanitize-cache.test.jsx,tests/convert.test.mjs,tests/room-state.test.mjs,tests/shared-ydoc.test.mjs. lint, format:check, npm test (977), test:admin (53), test:core-blocks (33) green locally.Docs read: Editor.js 2.31.7 dist (
BlockEvents.keydownCmd+Slash → block settings,/→ toolbox, Toolbar "+"click/ settingsmousedown), React 18startTransition/useDeferredValue(react.dev),@strapi/admin5.63ConfirmDialogtypes, DS 2.3.1, DOMPurify 3.🤖 Generated with Claude Code