Skip to content

✨ feat(mention): add mention service and chat demo - #208

Open
ilimei wants to merge 2 commits into
masterfrom
feat/metion-events-chat-demo
Open

ilimei wants to merge 2 commits into
masterfrom
feat/metion-events-chat-demo

Conversation

@ilimei

@ilimei ilimei commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator

💻 变更类型 | Change Type

  • ✨ feat

🔀 变更说明 | Description of Change

Add a plugin-scoped IMentionService, resolved through editor.requireService(IMentionService). getMentions() synchronously returns the latest committed document's mentions in order, including duplicates, with detached metadata snapshots. subscribe() reports successful command insertions after Lexical commits, so listeners can inspect the committed document. Imports, undo, and mentions removed before commit do not produce insertion notifications. No mention-specific types or events are added to the kernel.

Add a separate, focused ChatInput example that reuses the existing chat container and toolbars without modifying the original demos. Its send handler queries the service and applies recipient deduplication and filtering before updating simulated notification counts. All notification behavior stays in the demo's business code; there is no notification framework or external delivery service.

📝 补充信息 | Additional Information

  • Plugin tests cover committed-state visibility, nested/duplicate mentions, metadata isolation, batching, removal/undo, subscription cleanup, disposal, and aborted updates.
  • New tests live under src/plugins/mention/__test__; no tests or business-service classes are added under demos.
  • Local validation: mention tests, TypeScript, focused ESLint, circular-dependency check, and package build.
  • Browser validation: actual cross-page documentation link, keyboard mention selection, insertion subscription, duplicate queries, send-time notification deduplication, and empty query after clearing.
  • The example runs inline in ChatInput documentation; the existing standalone-preview loading issue is outside this change.

@vercel

vercel Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lobe-editor Ready Ready Preview Sep 7, 2026 7:12am UTC

Request Review

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

👍 @ilimei


Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@pkg-pr-new

pkg-pr-new Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@lobehub/editor@208

commit: 6a2c073

@ilimei ilimei changed the title ✨ feat(mention): add events, mention query and chat demo ✨ feat(mention): add mention service and chat demo Sep 7, 2026

This branch was successfully deployed

1 active deployment
Preview — 6a2c0731 Deployed Sep 7, 2026 by vercel[bot]
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