Skip to content

Commit d59a198

Browse files
author
gjulivan
committed
fix: e2e and styling and icons
1 parent 702b399 commit d59a198

33 files changed

Lines changed: 2191 additions & 1994 deletions

packages/pluggableWidgets/rich-text-web/CHANGELOG.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9-
### Security
10-
11-
- We fixed a security vulnerability (CVE-2026-13149).
12-
139
### Added
1410

1511
- We added new configuration to allow users to use class names instead of inline styling in generated HTML to support strict CSP.
@@ -18,23 +14,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1814

1915
- We added translations for the toolbar, dialogs, and help texts. The editor UI now follows the page language automatically, with bundled translations for English, Dutch, German, French, and Spanish (falling back to English).
2016

21-
- We added a clear button to every color picker (font color, font background, and the table and cell background and border color pickers) so a color can be reset to none.
22-
23-
### Fixed
24-
25-
- We fixed the image dialog to only show the image source tabs that are available: the Media Library tab now appears only when an image data source is configured, and the Upload tab is hidden when default upload is disabled.
26-
27-
- We fixed Tiptap duplicate extension warnings for `link`, `textStyle`, `underline`, and `textDirection` by properly configuring StarterKit, removing redundant extension registrations in TextColorClass, memoizing the extensions array to prevent re-registration on component re-renders, and disabling the core TextDirection extension that conflicts with our custom implementation.
28-
29-
- We fixed an issue where empty editor content was saving as `<p></p>` instead of an empty string, which incorrectly passed required field validation. Empty content now correctly saves as `""`, ensuring proper validation behavior. Note: This is a breaking change for forms that were relying on the incorrect behavior - required RichText fields will now correctly reject empty content.
30-
31-
- We fixed an issue where the editor pasting back the whole sentence instead of the single copied word
32-
33-
- We fixed an issue where table header cells did not honor background color and border (color, style, width) configuration. Header cells can now be styled the same way as regular cells.
34-
3517
### Changed
3618

37-
- We aligned the image dialog's "Upload" tab dropzone with the File Uploader widget's dropzone so both share the same look, states, and messages.
19+
- We changed rich text's internal WYSIWYG engine from Quill to Tiptap.
3820

3921
- We removed codemirror from code dialog viewer due to unsupported strict CSP policy. A simple internally built code editor using highlightjs is now replacing it.
4022

6.05 KB
Loading
6.55 KB
Loading
5.07 KB
Loading
-3.02 KB
Loading
5.91 KB
Loading
6.69 KB
Loading
20 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
schema: spec-driven
2+
created: 2026-07-28
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## Context
2+
3+
The Rich Text widget's image insert dialog (`ImageDialog.tsx`) currently collects only `src`, `alt`, and `title`, then calls `editor.chain().focus().setImage(imageAttrs).run()`. The underlying `ImageResize` TipTap extension already defines `width` and `height` node attributes (both defaulting to `null`), but they are only ever populated by the drag-resize node view (`ImageResize.tsx`) after the image is on the canvas. This change surfaces those attributes at insert time.
4+
5+
Constraints:
6+
7+
- No node schema changes are required — `width`/`height` attributes already flow through `setImage`.
8+
- Dialog UI must match existing patterns (`dialog-field`, i18n via `useT`).
9+
- Values must be consistent with the drag-resize output, which writes pixel strings like `"300px"`.
10+
11+
## Goals / Non-Goals
12+
13+
**Goals:**
14+
15+
- Let users set initial width and (optionally) height when inserting an image.
16+
- Provide a "maintain aspect ratio" toggle that, when on, applies width only and lets the browser derive height.
17+
- Keep the change contained to the dialog + i18n + tests; no extension or widget-prop changes.
18+
19+
**Non-Goals:**
20+
21+
- Changing how drag-resize behaves (it continues to always preserve ratio).
22+
- Persisting "maintain aspect ratio" as a property of the image node — it is an insert-time decision only.
23+
- Supporting non-pixel units (`%`, `em`) or a unit picker.
24+
- Preloading images to read natural dimensions.
25+
26+
## Decisions
27+
28+
**Decision: "Maintain aspect ratio" leaves height auto (Interpretation A).**
29+
When checked, only `width` is applied and `height` is left `null`, so the browser renders height proportionally via `height: auto`. Chosen over computing a locked height because it requires no natural-dimension lookup (no image preloading, no async resolution differences between URL/base64/entity sources) and always stays proportional.
30+
31+
- Alternative considered: read natural width/height and write both attributes. Rejected — adds async complexity and source-specific handling for little benefit at insert time.
32+
33+
**Decision: Pixel-only number inputs.**
34+
Inputs are numeric and interpreted as pixels, applied as `"<n>px"` strings to match the drag-resize output. A unit picker was considered but rejected as scope creep.
35+
36+
**Decision: Checkbox defaults to ON.**
37+
Matches common editor behavior and avoids accidental distortion. Height input is disabled (greyed) while ON.
38+
39+
**Decision: Non-destructive toggle.**
40+
Toggling the checkbox ON keeps any previously typed height value in component state; it is simply not sent on submit. Un-ticking restores the value. Avoids surprising data loss.
41+
42+
**Decision: Apply only filled, positive-numeric values.**
43+
Empty or invalid (non-numeric, zero, negative) width/height are omitted from `imageAttrs`, falling back to today's natural-size behavior. Any combination of filled/empty is allowed (e.g., height only → width auto).
44+
45+
## Risks / Trade-offs
46+
47+
- [Ratio checkbox is insert-time only, but drag-resize always keeps ratio] → Acceptable; an image inserted with ratio unchecked (distorted) will re-derive ratio from its current box on next drag. Documented as a non-goal.
48+
- [Users may expect `%` or other units] → Out of scope for this change; pixel-only keeps behavior consistent with existing resize. Can be revisited later.
49+
- [Disabled height field showing a stale typed value could confuse] → Field is visually greyed while checkbox is ON, signalling it is inactive; value is preserved intentionally.

0 commit comments

Comments
 (0)