Skip to content

docs(text-editor): document that clear discards pending changes and the flush-first pattern - #4239

Draft
john-traas wants to merge 1 commit into
mainfrom
docs/text-editor-clear-flush-first
Draft

docs(text-editor): document that clear discards pending changes and the flush-first pattern#4239
john-traas wants to merge 1 commit into
mainfrom
docs/text-editor-clear-flush-first

Conversation

@john-traas

Copy link
Copy Markdown
Contributor

What

Documents two facts about clear() that the JSDoc omits, on both
limel-text-editor and its ProseMirror adapter:

  • clearing also discards any pending debounced change, so content typed just
    before the call is never reported;
  • the pattern for capturing the final content anyway is to flush first:
await editor.flushPendingChanges(); // emits the final content
send(this.boundValue);
await editor.clear();

No behavior change.

Why

clear() silently swallows a pending change, and the only way to learn that
today is reading the implementation. The one in-tree consumer (the AI chat
composer in lime-crm-components) depends on the flush-first pattern for
correctness, but the pattern is not discoverable from the API docs — the next
consumer would have to rediscover it.

Verification

  • Docs-only change; text-editor spec 268/268 and e2e 130/130 passing

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 13ba87f7-41ba-45e7-9ca8-8aa2363e4609

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@john-traas
john-traas requested a lite review from Copilot August 18, 2026 13:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-4239/

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