Skip to content

fix(admin): re-audit majors in the editor field (keyboard path to blocks, typing lag, Word bold, live-session discard) - #36

Merged
Schero94 merged 1 commit into
mainfrom
fix/ui-reaudit-majors
Nov 20, 2026
Merged

Schero94 merged 1 commit into
mainfrom
fix/ui-reaudit-majors

Conversation

@Schero94

Copy link
Copy Markdown
Owner

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

# Finding Fix Evidence (isolated host, Strapi 5.63, packed tarball, headless)
1 Cmd/Ctrl+/ taken by the shortcut help, "+" and "⋮⋮" without role/name/tab stop Cmd/Ctrl+/ handed back to Editor.js (block menu); help on Cmd/Ctrl+Alt+/ (also More tools). 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); chrome tabindex=0 role=button name=…. f4-help-key: Cmd+Alt+/ opens help, focus returns to the paragraph; "+" + Enter opens the toolbox.
2 Controls inside blocks unreachable by keyboard 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).
3 ~155 ms per keystroke at 2,000 blocks sanitizeInline memoised by input (LRU 20k, pure function of input → same output and guarantees), stableStringifyBlocks/Cached (native-key cache, output identical to stableStringify), yield between Editor.js save and form update, field panels via startTransition, draft fingerprints only after re-login (useDeferredValue), rendered key computed lazily / skipped when the form returns the emitted object. Server-side sanitising unchanged. s27-perf 2,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).
4 Word bold lost on paste cssProperty() reads inline CSS by exact property name in shared/convert/html.mjs unit test (Word mso-bidi-font-weight:normal, Google Docs wrapper, vendor-only weight, last declaration wins); s12-paste clean
5 Room "Discard changes" wiped others' text without asking Strapi ConfirmDialog ("…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 reset c5-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.keydown Cmd+Slash → block settings, / → toolbox, Toolbar "+" click / settings mousedown), React 18 startTransition / useDeferredValue (react.dev), @strapi/admin 5.63 ConfirmDialog types, DS 2.3.1, DOMPurify 3.

🤖 Generated with Claude Code

…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
Schero94 force-pushed the fix/ui-reaudit-majors branch from 8e5f5bc to 41118aa Compare November 20, 2026 14:38
@Schero94
Schero94 merged commit e8be99e into main Nov 20, 2026
22 checks passed
@Schero94
Schero94 deleted the fix/ui-reaudit-majors branch November 20, 2026 15:08
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**.
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