v0.4.0 — Editor UX bundle
Big editor UX bundle on top of the v0.3.0 voice-to-text release.
New
- Highlight what the assistant just changed — yellow flash + scroll-to on every replace / insert / update / recover.
- AI dropdown on the Gutenberg block toolbar — Rewrite / Shorten / Expand / Improve clarity / Translate-to-LANG on text blocks; Replace with AI image / Vary this image (keep style) / Improve alt text on
core/image. Sends messages into the chat that flow through the existing typed editor tools. - Selection-aware chat — composer chip shows what's selected (text range / whole block / multi-block / non-text), and the server inlines that context into the user message so the model has it without an extra
read_selectionround-trip. - Read assistant replies aloud (Web Speech) — toggle in the voice popover. Streams sentence-by-sentence as the reply lands. Half-duplex mic: auto-stops dictation while the AI speaks, resumes after; Stop button silences TTS too. Rate bumped to 1.35×.
- Voice mode (silence-based auto-send) — toggle next to read-aloud. ~1.5s of silence after a final result auto-sends.
- Per-tool-call diff in the chat — line-level LCS + git-style word-level inline highlighting, context collapsed around hunks. Replaces the raw JSON args/result preview when present.
<details open>so the diff is visible without an extra click. - Image generation via OpenAI
gpt-image-1—assistant__generate_imagetool; auto-imports into the WP media library with alt +_gds_assistant_ai_*meta. Supportsreference_attachment_id/reference_image_urlfor the gpt-image-1 edit endpoint ("vary this image but keep the style"). Per-user daily budget (default 20, filterable). - Cmd/Ctrl + J — opens the chat panel + focuses the composer when pressed inside the editor canvas. No floating overlay so it doesn't lock the user into a single intent; selection chip handles the context.
- Block-reference chips in user messages —
(block <uuid> — paragraph)markers in toolbar-sent messages render as compact clickable pills that scroll + select that block in the editor. Live block-name lookup → cached label → "block" fallback.
Fixes / hardening
- Healed conversations stranded by orphan
tool_useblocks (page refresh mid-edit, etc.) — server now patches missingtool_results on history load. - Fixed "mixed user message" bug where
mergeConsecutiveRolescombined atool_resultuser message with subsequent typed text, causing the OpenAI converter to silently drop everything but the tool_result. - WP 7.0
RichTextValueobject support throughout (block-toolbar selection, selection chip, diff snapshots).
Full per-commit changelog: v0.3.0...v0.4.0