Skip to content

fix(admin): native Strapi look in the editor field (DS icons, tabs, tooltips, tokens) - #39

Merged
Schero94 merged 1 commit into
mainfrom
fix/ui-native-feel
Nov 20, 2026
Merged

Schero94 merged 1 commit into
mainfrom
fix/ui-native-feel

Conversation

@Schero94

Copy link
Copy Markdown
Owner

Third of three stacked PRs for the UI re-audit of the editor field. Base: #38 (retarget after #36 and #38 merge).

Native-feel list: what this PR does

Item Status
(a) Editor.js chrome to DS tokens and shapes, incl. mobile Done across #38/#39: popover radius = DS radius, DS overlay (setOpacity(neutral800, .2)) for the bottom sheet, handles with DS surface/border and 32 px phone targets, loader/image-tool/nothing-found/attaches tokens, color-scheme.
(b) Hand-drawn SVG → @strapi/icons Done for every tool icon with a DS equivalent (editor/tools/ds-icons.js, renderToStaticMarkup with an empty theme because the icons call useTheme): code, image, gallery (GridFour), video (Play), audio (MusicNotes), link, Media Library (Images), person (User), table (GridNine), component (PuzzlePiece), copy (Duplicate), trash, plus, minus, check, upload, colour (Palette), AI (Sparkle), underline, strikethrough, arrows, warning, TOC (List). Kept: alignment, columns layouts, borders/background/stretch, merge/split/rows/columns, sub/superscript, abbreviation/annotation, delimiter, toggle, checklist, marker, mention, footnote, math, line numbers (no DS match). Editor.js' own bold/italic/link icons are inside Editor.js and not replaced.
(c) DS components in block toolbars and forms via createPortal Not done (see below).
(d) Fullscreen focus trap + backdrop Focus wrap done (DS FocusTrap logic on the role=dialog aria-modal frame; a wrapper component would remount Editor.js). Backdrop not needed: the full-screen frame is position: fixed; inset: 0 and opaque.
(e) Gutter markers DS IconButton/Tooltip/Badge DS Tooltip done; the markers stay a styled button because they show a count next to the icon (IconButton has no text slot).
(f) SessionBanner → DS Alert Not done: DS 2.3.1 Alert always renders a close button and wraps children in one <p>; the signed-out banner must not be dismissible and holds a heading, a live region and the sign-in action.
(g) MentionTextarea listbox → DS Popover/Combobox Not done (see below).
(h) Native title → DS Tooltip Done for the gutter markers; remaining: <time title> in comments/suggestions/draft notice (not focusable, a DS Tooltip needs a focusable trigger) and three title attributes in Editor.js tool DOM.
(i) Annotation Apply → buttonPrimary tokens Done.
(j) theme.fonts.code Removed; the DS theme has no font tokens, one plugin constant editor/code-font.mjs.
(k) Undo/redo icons ArrowClockwise for redo, the same icon mirrored for undo (no undo/redo icon in @strapi/icons 2.3; the two-arrow ArrowsCounterClockwise read as "refresh").
(l) Version-history tabs DS Tabs.Root variant="simple" (underlined, as the Content Manager).

Why (c) and (g) stopped here: the block toolbars and popups (table, columns, media forms, embedded-entry listbox, link, annotation, mention) are DOM built inside Editor.js blocks and inline-toolbar popovers; moving them to React portals changes focus handling, Editor.js' selection save/restore and the collaboration DOM diffing of each tool. That is a per-tool rewrite with its own regression tests, too risky to fold into this fix PR.

Measurements (f7-matrix, all-blocks entry, 1440/1024/768/390/320 × light/dark): document overflow 0, row mismatch 0, off-scale gaps 0, clipped text 0, low contrast 0, elements outside viewport 0 at every stop; handles 24 px from 520 px up and 32 px below, DS surface in both themes. Remaining small targets are inline text links (WCAG 2.5.8 inline exception), checklist checkboxes (20 px, unchanged) and DS-internal parts (SingleSelect clear 22 px, NumberInput steppers, Switch 40×24).

Tests: tests/admin/native-feel.test.jsx; lint, format:check, npm test (1000), test:admin (79), test:core-blocks (33) green locally.

🤖 Generated with Claude Code

@Schero94
Schero94 force-pushed the fix/ui-reaudit-minors branch from a420dde to 570af2e Compare November 20, 2026 15:12
Base automatically changed from fix/ui-reaudit-minors to main November 20, 2026 15:17
…ooltips, tokens)

- @strapi/icons for the tool icons with an equivalent, rendered to static
  markup once (Editor.js takes icon strings); own SVG only where the DS has
  no match.
- Undo: mirrored DS ArrowClockwise (no undo/redo icon in @strapi/icons 2.3).
- Version history: DS Tabs variant "simple" (underlined).
- Gutter markers: DS Tooltip instead of native title.
- Annotation Apply: buttonPrimary600/500 and buttonNeutral0.
- Full screen: Tab wraps inside the modal editor (DS FocusTrap logic).
- theme.fonts.code removed (the DS theme has no font tokens).

Docs read: @strapi/icons 2.3.1 (icons use styled-components useTheme for
token fills), react-dom 18 renderToStaticMarkup, DS 2.3.1 Tabs (variant
regular|simple), Tooltip, FocusTrap, Button token usage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Schero94
Schero94 merged commit a035b48 into main Nov 20, 2026
22 checks passed
@Schero94
Schero94 deleted the fix/ui-native-feel branch November 20, 2026 15:27
github-actions Bot pushed a commit that referenced this pull request Nov 20, 2026
## [2.8.4](v2.8.3...v2.8.4) (2026-11-20)

### Bug Fixes

* **admin:** native Strapi look in the editor field (DS icons, tabs, tooltips, tokens) ([#39](#39)) ([a035b48](a035b48))

### Changed (editor field: native Strapi look)

- **Strapi Design System icons in the editor.** Block types, block menus and tool buttons use @strapi/icons where an equivalent exists (code, image, gallery, video, audio, link, Media Library, person, table, component, copy, delete, add, upload, check, colour, AI, underline, strikethrough, arrows, warning, table of contents); the editor-specific shapes (alignment, columns, borders, merge and split, sub- and superscript) keep their own icons.
- **Undo and redo** use one DS arrow, mirrored for undo (the two-arrow icon read as "refresh"). @strapi/icons has no undo or redo icon.
- **Version history** uses the DS underlined tabs (`variant="simple"`, as the Content Manager's Draft and Published tabs).
- **Comment and suggestion markers** show a DS tooltip instead of the browser's `title`.
- **Annotation Apply** uses the DS primary button colours in both themes.
- **Full screen** keeps Tab inside the editor (it is a modal dialog), like the DS focus trap.
- **Code font.** The Design System theme has no font tokens; the shortcut help and the preview read a plugin constant instead of the undefined `theme.fonts.code`.
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