facebook / facebook/lexical

Feature: Suggestion mode for comments

Open
#8,754 17 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
23.9k
Forks
2.2k
Avg merge
1d 14h
Merged PRs (30d)
57

Description

## Description

In lexical, there is a MarkNode that allows you to store the comment ID relative to the selected text fragment. This functionality can be extended to demonstrate, in the playground, a type of comment with suggested changes.

A comment in “suggest” mode must contain what is being replaced and with what. The comment text changes depending on the type of change: text change, format change, node change, deletion, addition

For example, how it looks in the Google Docs

Image

Unlike regular comments, suggestions are easier to navigate one by one, so a separate pagination interface can be implemented for them. Here's what it looks like in Tiptap, for example.

Image

This feature can be used to supplement the existing [agent-example](https://github.com/facebook/lexical/tree/main/examples/agent-example) shown on the home page https://lexical.dev. In particular, LLM can generate its own suggestion

## Impact

This popular feature in rich WYSIWYG editors will highlight the extensive capabilities of Lexical and facilitate integration

Contributor guide

Open the contributing guide

Research direction

Start by reading the MarkNode comment-ID functionality and the playground, then inspect the existing agent-example integration. Define how suggestion comments represent text, format, node, deletion, and addition changes, and how they are navigated separately. Done means the playground demonstrates suggestion-mode comments with the requested change descriptions and pagination behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.