Skip to content

Integrate block-text editor into WordAI and adapt documents/tests#1

Merged
khuepm merged 2 commits into
mainfrom
copilot/add-block-text-feature
Mar 27, 2026
Merged

Integrate block-text editor into WordAI and adapt documents/tests#1
khuepm merged 2 commits into
mainfrom
copilot/add-block-text-feature

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

WordAI editor needed richer block-based editing similar to react-block-text.

  • Block editor integration

    • Replaced textarea canvas with react-block-text (header, list, quote, todo plugins) and consistent colors.
    • Added conversion utilities to wrap existing plain text into block-text JSON, extract plain text, ensure compatibility for loads/saves, and handle AI replacement.
    • Updated document lifecycle (new/load/restore/export/AI context) to work with block-based content.
  • Test and runtime stability

    • Added React internals shim and jsdom-safe setup; mocked react-block-text in Vitest to avoid CSS/DOM incompatibilities.
    • Updated EditorCanvas tests to target the new editable surface; added blockText utility tests.
    • Downgraded React/ReactDOM to 18 for library compatibility and refreshed lockfile.
  • UI/UX adjustments

    • Version history previews now show plain text from block values.
    • Editor key bindings preserved (AI trigger, export, version history, save).

Example conversion helper:

import { ensureBlockValue, extractPlainText } from '../utils/blockText';

const stored = ensureBlockValue(doc.content);
const readable = extractPlainText(stored); // for exports, AI context, previews

Copilot AI and others added 2 commits March 26, 2026 19:30
Agent-Logs-Url: https://github.com/khuepm/WordAI/sessions/da649b0d-6071-4cc2-9f18-72cbcb3f519b

Co-authored-by: khuepm <8740125+khuepm@users.noreply.github.com>
Agent-Logs-Url: https://github.com/khuepm/WordAI/sessions/da649b0d-6071-4cc2-9f18-72cbcb3f519b

Co-authored-by: khuepm <8740125+khuepm@users.noreply.github.com>
@khuepm khuepm marked this pull request as ready for review March 27, 2026 08:02
@khuepm khuepm merged commit a8070e0 into main Mar 27, 2026
@khuepm khuepm deleted the copilot/add-block-text-feature branch March 27, 2026 08:03
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.

2 participants