Skip to content

fix(web): prompt editor#905

Merged
shuqinzhao merged 1 commit intorelease/v0.3.0from
fix/v0.3.0_zy
Apr 15, 2026
Merged

fix(web): prompt editor#905
shuqinzhao merged 1 commit intorelease/v0.3.0from
fix/v0.3.0_zy

Conversation

@shuqinzhao
Copy link
Copy Markdown
Collaborator

@shuqinzhao shuqinzhao commented Apr 15, 2026

由 Sourcery 总结

改进 Web 界面中提示词编辑器的流式行为和布局。

新功能:

  • 引入可复用的 PromptChatPanel 组件,用于封装提示词会话的聊天列表状态和渲染。

缺陷修复:

  • 防止在流式输出期间提示词编辑器的表单值被覆盖,避免用户编辑内容与流式内容之间的冲突。
  • 确保在追加流式文本时,提示词编辑器能正确滚动到底部,同时不会打扰用户的手动滚动位置。

增强优化:

  • 允许通过 CSS class 字符串配置 Editor 组件的高度,并调整周围布局以使用基于视口的高度。
  • 重构提示词页面和 AI 提示词弹窗,将聊天列表管理委托给新的 PromptChatPanel 组件,并简化本地状态。
  • 根据是否已经生成提示词来显示占位的空状态,而不是依赖表单值是否存在。
Original summary in English

Summary by Sourcery

Improve prompt editor streaming behavior and layout in the web UI.

New Features:

  • Introduce a reusable PromptChatPanel component to encapsulate chat list state and rendering for prompt conversations.

Bug Fixes:

  • Prevent the prompt editor form value from being overwritten while streaming, avoiding conflicts between user edits and streamed content.
  • Ensure the prompt editor scrolls correctly to the bottom during streamed text appends without disrupting manual scroll position.

Enhancements:

  • Allow the Editor component height to be configured via CSS class strings and adjust surrounding layout to use viewport-based heights.
  • Refactor prompt pages and AI prompt modal to delegate chat list management to the new PromptChatPanel component and simplify local state.
  • Show placeholder empty states based on whether a prompt has been generated rather than relying on the presence of form values.

@shuqinzhao shuqinzhao merged commit f4c3974 into release/v0.3.0 Apr 15, 2026
1 check passed
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Apr 15, 2026

Reviewer's Guide

重构了提示词编辑器的流式行为和布局:Lexical 编辑器现在支持通过受节流控制的文本追加、可控滚动行为以及高度类名属性来进行更新;提示词视图将聊天记录委托给新的可复用 PromptChatPanel;并且在流式传输期间会禁用提示词文本到表单的同步以避免闪烁。

带节流编辑器更新的流式提示词处理顺序图

sequenceDiagram
  actor User
  participant Prompt as PromptComponent
  participant SSE as ServerStream
  participant Form as AntForm
  participant Editor as EditorRef
  participant Chat as PromptChatPanelRef

  User->>Prompt: clickSend()
  Prompt->>Form: validateFields()
  Form-->>Prompt: values.message
  Prompt->>Chat: append({ role: user, content: message })
  Prompt->>Form: setFieldsValue(message undefined, current_prompt undefined)
  Prompt->>SSE: startPromptSession(message)

  loop streamEvents
    SSE-->>Prompt: data[] (SSEMessage)
    Prompt->>Prompt: handleStreamMessage(data)

    alt event start
      Prompt->>Prompt: currentPromptValueRef = ""
      Prompt->>Prompt: isStreamingRef = true
      Prompt->>Prompt: hasPrompt = true
      Prompt->>Editor: clear()
    else event message content
      Prompt->>Prompt: currentPromptValueRef += content
      alt editorRef available
        Prompt->>Editor: appendText(content)
        note over Editor: batches text via requestAnimationFrame
      else fallback
        Prompt->>Form: setFieldValue(current_prompt, currentPromptValueRef)
      end
      alt desc exists
        Prompt->>Chat: append({ role: assistant, content: desc })
      end
    else event end
      Prompt->>Prompt: isStreamingRef = false
      Prompt->>Form: setFieldValue(current_prompt, currentPromptValueRef)
      Prompt->>Prompt: setLoading(false)
    end
  end

  User->>Editor: manual edits
  Editor-->>Prompt: onChange(value)
  Prompt->>Form: setFieldValue(current_prompt, value) [only if isStreamingRef is false]
Loading

Lexical 编辑器 append-text 滚动行为顺序图

sequenceDiagram
  participant Parent as PromptOrAiPromptModal
  participant Editor as EditorContent
  participant Lexical as LexicalEditor
  participant Root as LexicalRoot
  participant Scroll as scrollRefDiv

  Parent->>Editor: appendText(text)
  Editor->>Editor: pendingTextRef += text
  alt firstTextInFrame
    Editor->>Editor: requestAnimationFrame(callback)
  else subsequentTextInFrame
    Editor->>Editor: skip scheduling
  end

  rect rgb(230,230,230)
    Editor->>Editor: animationFrame callback
    Editor->>Editor: batch = pendingTextRef
    Editor->>Editor: pendingTextRef = ""
    Editor->>Scroll: read scrollTop into scrollTopRef
    Editor->>Editor: isAppendingRef = true
    Editor->>Lexical: update(fn, { tag: append-text, onUpdate })
    Lexical->>Root: fn($getRoot())
    Root-->>Lexical: lastChild paragraph and lastTextNode
    alt lastTextNode exists
      Lexical->>Root: setTextContent(lastTextNode + batch)
    else noLastTextNode
      Lexical->>Root: append paragraph or text node with batch
    end
    Lexical-->>Editor: onUpdate()
    Editor->>Editor: isAppendingRef = false
  end

  Lexical->>Editor: registerUpdateListener({ tags })
  Editor->>Scroll: onPointerDown store scrollTop when not appending

  alt tags contains append-text
    Editor->>Scroll: scrollTop = scrollHeight
  else normalEdit
    Editor->>Scroll: scrollTop = scrollTopRef
  end
Loading

更新后的提示词编辑器与聊天面板组件类图

classDiagram
  class LexicalEditorProps {
    +string value
    +string placeholder
    +Function onChange
    +string height
    +boolean disabled
  }

  class EditorRef {
    +Function setValue(value string)
    +Function appendText(text string)
    +Function clear()
    +Function scrollToBottom()
  }

  class EditorContent {
    +string value
    +string placeholder
    +Function onChange
    +string height
    +boolean disabled
    -HTMLDivElement scrollRef
    -string pendingTextRef
    -number rafRef
    -boolean isAppendingRef
    -number scrollTopRef
    +Function appendText(text string)
    +Function clear()
    +Function scrollToBottom()
  }

  class PromptChatPanelRef {
    +Function append(item ChatItem)
    +Function clear()
  }

  class PromptChatPanel {
    -ChatItem[] chatList
    +Function append(item ChatItem)
    +Function clear()
  }

  class ChatItem {
    +string role
    +string content
  }

  class Prompt {
    -FormInstance form
    -PromptChatPanelRef chatPanelRef
    -EditorRef editorRef
    -string currentPromptValueRef
    -boolean isStreamingRef
    -boolean hasPrompt
    +Function handleSend()
    +Function handleRefresh()
  }

  class AiPromptModal {
    -FormInstance form
    -PromptChatPanelRef chatPanelRef
    -EditorRef editorRef
    -string currentPromptValueRef
    -boolean isStreamingRef
    -boolean hasPrompt
    +Function handleSend()
    +Function handleClose()
  }

  EditorContent ..|> LexicalEditorProps
  PromptChatPanel ..|> PromptChatPanelRef

  Prompt --> PromptChatPanelRef : uses
  Prompt --> EditorRef : uses
  Prompt --> ChatItem : appends

  AiPromptModal --> PromptChatPanelRef : uses
  AiPromptModal --> EditorRef : uses
  AiPromptModal --> ChatItem : appends

  PromptChatPanel --> ChatItem : manages
Loading

文件级变更

Change Details Files
增强 Lexical 编辑器,使其支持批量流式文本追加、滚动容器控制以及可配置的高度类名。
  • 将编辑器高度属性类型从数值像素改为字符串类名,并应用在外层滚动容器上。
  • 引入滚动容器的引用和状态(scrollRefscrollTopRefisAppendingRef),以便独立于 Lexical root 管理滚动位置。
  • 注册带 append-text 标签的更新监听器,在追加流式文本时自动滚动,同时在非追加场景保留用户的手动滚动位置。
  • 使用 requestAnimationFrame 和内部 pendingText 缓冲区对 appendText 调用进行批处理,在执行单次 Lexical 更新前聚合文本并按需创建节点。
  • 对外暴露 scrollToBottom 方法,使其滚动外层容器而非 Lexical root,并通过移除溢出样式来简化内部 ContentEditable 的类名。
web/src/views/ApplicationConfig/components/Editor/index.tsx
重构 Prompt 页面以使用可复用的聊天面板组件,在存在提示词时才渲染编辑器,并在流式传输期间避免表单更新。
  • 用支持 appendclear 操作的 PromptChatPanel 引用替换本地 chatList 状态,并更新 SSE 处理逻辑,通过面板推送消息而不是通过 setState 操作数组。
  • 通过 refs/state 跟踪 hasPromptisStreaming,控制何时显示编辑器以及何时更新表单字段 current_prompt,防止在流式传输过程中互相干扰。
  • 在历史记录选择和刷新时正确重置聊天、提示词标志和会话,并以高度类名方式连接编辑器,同时只在非流式状态下通过 onChange 同步表单。
  • ChatContent 替换为 PromptChatPanel,更新与布局相关的 className,同时保留标签格式和空状态渲染。
web/src/views/Prompt/index.tsx
web/src/components/Chat/PromptChatPanel.tsx
让 AI Prompt 弹窗行为与主 Prompt 视图保持一致,通过集中化聊天管理、受控编辑器可见性以及在流式期间保护表单更新。
  • 在弹窗中引入 PromptChatPanel 并移除内部 chatList 状态,在打开/关闭和流式流程中都通过面板引用来代理消息追加和清空。
  • 新增 hasPromptisStreaming 标志,用于控制仅在存在提示词后才显示编辑器,并在流式期间跳过对表单 current_prompt 的更新。
  • 通过向编辑器传入基于类名的高度属性并调整表单容器高度类,来调整布局高度,同时清理调试日志。
  • 更新 SSE 流式交互逻辑,使用重构后编辑器的 appendText 路径而不再手动滚动到底部,并确保在关闭时重置提示词相关状态。
web/src/views/ApplicationConfig/components/AiPromptModal.tsx
web/src/components/Chat/PromptChatPanel.tsx

Tips and commands

Interacting with Sourcery

  • 触发新评审: 在 Pull Request 上评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的评审评论。
  • 根据评审评论生成 GitHub issue: 在某条评审评论下回复,请求 Sourcery 根据该评论创建 issue。你也可以直接回复 @sourcery-ai issue 来创建对应的 issue。
  • 生成 Pull Request 标题: 在 Pull Request 标题任意位置写上 @sourcery-ai,即可在任意时间生成标题。也可以在 PR 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 Pull Request 总结: 在 Pull Request 描述正文任意位置写上 @sourcery-ai summary,即可在指定位置生成 PR 总结。也可以在 PR 中评论 @sourcery-ai summary 来在任意时间(重新)生成总结。
  • 生成评审指南: 在 Pull Request 中评论 @sourcery-ai guide,即可在任意时间(重新)生成评审指南。
  • 一次性解决所有 Sourcery 评论: 在 Pull Request 中评论 @sourcery-ai resolve,即可将所有 Sourcery 评论标记为已解决。如果你已经处理完所有评论且不希望继续看到它们,这会很有帮助。
  • 一次性忽略所有 Sourcery 评审: 在 Pull Request 中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 评审。尤其适用于你希望从头开始新的评审时——别忘了再评论一次 @sourcery-ai review 来触发新的评审!

Customizing Your Experience

访问你的 dashboard 以:

  • 启用或禁用评审功能,例如 Sourcery 生成的 Pull Request 总结、评审指南等。
  • 更改评审语言。
  • 添加、移除或编辑自定义评审指令。
  • 调整其他评审相关设置。

Getting Help

Original review guide in English

Reviewer's Guide

Refactors the prompt editor streaming behavior and layout: the Lexical editor now supports throttled text appends with controlled scroll behavior and a height class prop, prompt views delegate chat history to a new reusable PromptChatPanel, and prompt text syncing to forms is disabled while streaming to avoid flicker.

Sequence diagram for streaming prompt handling with throttled editor updates

sequenceDiagram
  actor User
  participant Prompt as PromptComponent
  participant SSE as ServerStream
  participant Form as AntForm
  participant Editor as EditorRef
  participant Chat as PromptChatPanelRef

  User->>Prompt: clickSend()
  Prompt->>Form: validateFields()
  Form-->>Prompt: values.message
  Prompt->>Chat: append({ role: user, content: message })
  Prompt->>Form: setFieldsValue(message undefined, current_prompt undefined)
  Prompt->>SSE: startPromptSession(message)

  loop streamEvents
    SSE-->>Prompt: data[] (SSEMessage)
    Prompt->>Prompt: handleStreamMessage(data)

    alt event start
      Prompt->>Prompt: currentPromptValueRef = ""
      Prompt->>Prompt: isStreamingRef = true
      Prompt->>Prompt: hasPrompt = true
      Prompt->>Editor: clear()
    else event message content
      Prompt->>Prompt: currentPromptValueRef += content
      alt editorRef available
        Prompt->>Editor: appendText(content)
        note over Editor: batches text via requestAnimationFrame
      else fallback
        Prompt->>Form: setFieldValue(current_prompt, currentPromptValueRef)
      end
      alt desc exists
        Prompt->>Chat: append({ role: assistant, content: desc })
      end
    else event end
      Prompt->>Prompt: isStreamingRef = false
      Prompt->>Form: setFieldValue(current_prompt, currentPromptValueRef)
      Prompt->>Prompt: setLoading(false)
    end
  end

  User->>Editor: manual edits
  Editor-->>Prompt: onChange(value)
  Prompt->>Form: setFieldValue(current_prompt, value) [only if isStreamingRef is false]
Loading

Sequence diagram for Lexical editor append-text scroll behavior

sequenceDiagram
  participant Parent as PromptOrAiPromptModal
  participant Editor as EditorContent
  participant Lexical as LexicalEditor
  participant Root as LexicalRoot
  participant Scroll as scrollRefDiv

  Parent->>Editor: appendText(text)
  Editor->>Editor: pendingTextRef += text
  alt firstTextInFrame
    Editor->>Editor: requestAnimationFrame(callback)
  else subsequentTextInFrame
    Editor->>Editor: skip scheduling
  end

  rect rgb(230,230,230)
    Editor->>Editor: animationFrame callback
    Editor->>Editor: batch = pendingTextRef
    Editor->>Editor: pendingTextRef = ""
    Editor->>Scroll: read scrollTop into scrollTopRef
    Editor->>Editor: isAppendingRef = true
    Editor->>Lexical: update(fn, { tag: append-text, onUpdate })
    Lexical->>Root: fn($getRoot())
    Root-->>Lexical: lastChild paragraph and lastTextNode
    alt lastTextNode exists
      Lexical->>Root: setTextContent(lastTextNode + batch)
    else noLastTextNode
      Lexical->>Root: append paragraph or text node with batch
    end
    Lexical-->>Editor: onUpdate()
    Editor->>Editor: isAppendingRef = false
  end

  Lexical->>Editor: registerUpdateListener({ tags })
  Editor->>Scroll: onPointerDown store scrollTop when not appending

  alt tags contains append-text
    Editor->>Scroll: scrollTop = scrollHeight
  else normalEdit
    Editor->>Scroll: scrollTop = scrollTopRef
  end
Loading

Class diagram for updated prompt editor and chat panel components

classDiagram
  class LexicalEditorProps {
    +string value
    +string placeholder
    +Function onChange
    +string height
    +boolean disabled
  }

  class EditorRef {
    +Function setValue(value string)
    +Function appendText(text string)
    +Function clear()
    +Function scrollToBottom()
  }

  class EditorContent {
    +string value
    +string placeholder
    +Function onChange
    +string height
    +boolean disabled
    -HTMLDivElement scrollRef
    -string pendingTextRef
    -number rafRef
    -boolean isAppendingRef
    -number scrollTopRef
    +Function appendText(text string)
    +Function clear()
    +Function scrollToBottom()
  }

  class PromptChatPanelRef {
    +Function append(item ChatItem)
    +Function clear()
  }

  class PromptChatPanel {
    -ChatItem[] chatList
    +Function append(item ChatItem)
    +Function clear()
  }

  class ChatItem {
    +string role
    +string content
  }

  class Prompt {
    -FormInstance form
    -PromptChatPanelRef chatPanelRef
    -EditorRef editorRef
    -string currentPromptValueRef
    -boolean isStreamingRef
    -boolean hasPrompt
    +Function handleSend()
    +Function handleRefresh()
  }

  class AiPromptModal {
    -FormInstance form
    -PromptChatPanelRef chatPanelRef
    -EditorRef editorRef
    -string currentPromptValueRef
    -boolean isStreamingRef
    -boolean hasPrompt
    +Function handleSend()
    +Function handleClose()
  }

  EditorContent ..|> LexicalEditorProps
  PromptChatPanel ..|> PromptChatPanelRef

  Prompt --> PromptChatPanelRef : uses
  Prompt --> EditorRef : uses
  Prompt --> ChatItem : appends

  AiPromptModal --> PromptChatPanelRef : uses
  AiPromptModal --> EditorRef : uses
  AiPromptModal --> ChatItem : appends

  PromptChatPanel --> ChatItem : manages
Loading

File-Level Changes

Change Details Files
Enhance Lexical editor to support batched streaming text appends with scroll container control and configurable height class.
  • Change editor height prop type from numeric pixel value to string-based class name used on outer scroll container.
  • Introduce scroll container refs and state (scrollRef, scrollTopRef, isAppendingRef) to manage scroll position separately from Lexical root.
  • Register an update listener tagged with 'append-text' to auto-scroll when appending streamed text while preserving manual scroll when not appending.
  • Batch appendText calls using requestAnimationFrame and an internal pendingText buffer before performing a single Lexical update with appropriate node creation logic.
  • Expose a scrollToBottom method that scrolls the outer container instead of the Lexical root and simplify inner ContentEditable classes by removing overflow styles.
web/src/views/ApplicationConfig/components/Editor/index.tsx
Refactor Prompt page to use a reusable chat panel component, gate editor rendering on prompt presence, and avoid form updates while streaming.
  • Replace local chatList state with a PromptChatPanel ref that supports append and clear operations, and update SSE handlers to push messages through the panel instead of setState arrays.
  • Track hasPrompt and isStreaming via refs/state to control when the editor is shown and when form current_prompt is updated, preventing interference during streaming.
  • Reset chat, prompt flags, and session correctly on history selection and refresh, and wire the Editor with height className and non-streaming onChange form sync.
  • Swap ChatContent usage for PromptChatPanel, updating layout-related classNames and preserving label formatting and empty-state rendering.
web/src/views/Prompt/index.tsx
web/src/components/Chat/PromptChatPanel.tsx
Align AI Prompt modal behavior with main prompt view by centralizing chat management, gating editor visibility, and protecting form updates during streaming.
  • Introduce PromptChatPanel in the modal and remove internal chatList state, delegating message appends and clears to the panel ref across open/close and streaming flows.
  • Add hasPrompt and isStreaming flags to control showing the editor only after a prompt exists and to skip form current_prompt updates while streaming.
  • Adjust layout heights using class-based height prop passed into Editor and container Form height classes, and clean up debug logging.
  • Update SSE streaming interaction to use the refactored editor appendText path without manual scroll to bottom, and ensure reset of prompt-related state on close.
web/src/views/ApplicationConfig/components/AiPromptModal.tsx
web/src/components/Chat/PromptChatPanel.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@shuqinzhao shuqinzhao deleted the fix/v0.3.0_zy branch April 15, 2026 06:41
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - 我在这里给出了一些总体反馈:

  • EditorContent.appendText 中,editor.update 被传入了一个 Lexical 并不支持的 onUpdate 选项,因此 isAppendingRef.current 被设置为 true 后从未被重置;可以考虑在 registerUpdateListener 中监听到 append-text 标签时重置它,或者在 editor.update 完成后立即重置。
  • appendText 中用于批处理的 requestAnimationFrame 被存储在 rafRef 中,但在组件卸载时从未被取消;增加一个清理 effect,在其中调用 cancelAnimationFrame(rafRef.current) 可以避免潜在的内存泄漏和意外的延迟更新。
  • 编辑器上的 height 属性现在是一个类名字符串,但注释中仍然写着“height in pixels”;更新这个 prop 的说明会更清晰一些(并且可以考虑使用 clsx 来合并 height 类和 rb:overflow-y-auto,而不是通过字符串拼接)。
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- In `EditorContent.appendText`, `editor.update` is called with an `onUpdate` option that Lexical doesn’t support, so `isAppendingRef.current` is set to `true` but never reset; consider resetting it in the `registerUpdateListener` when the `append-text` tag is seen or immediately after `editor.update` resolves.
- The `requestAnimationFrame` used for batching in `appendText` is stored in `rafRef` but never canceled on unmount; adding a cleanup effect to `cancelAnimationFrame(rafRef.current)` will avoid potential leaks and unexpected late updates.
- The `height` prop on the editor is now a class name string but the comment still says 'height in pixels'; it would be clearer to update the prop description (and consider using `clsx` to merge the height class with `rb:overflow-y-auto` instead of string concatenation).

Sourcery 对开源项目免费——如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English

Hey - I've left some high level feedback:

  • In EditorContent.appendText, editor.update is called with an onUpdate option that Lexical doesn’t support, so isAppendingRef.current is set to true but never reset; consider resetting it in the registerUpdateListener when the append-text tag is seen or immediately after editor.update resolves.
  • The requestAnimationFrame used for batching in appendText is stored in rafRef but never canceled on unmount; adding a cleanup effect to cancelAnimationFrame(rafRef.current) will avoid potential leaks and unexpected late updates.
  • The height prop on the editor is now a class name string but the comment still says 'height in pixels'; it would be clearer to update the prop description (and consider using clsx to merge the height class with rb:overflow-y-auto instead of string concatenation).
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `EditorContent.appendText`, `editor.update` is called with an `onUpdate` option that Lexical doesn’t support, so `isAppendingRef.current` is set to `true` but never reset; consider resetting it in the `registerUpdateListener` when the `append-text` tag is seen or immediately after `editor.update` resolves.
- The `requestAnimationFrame` used for batching in `appendText` is stored in `rafRef` but never canceled on unmount; adding a cleanup effect to `cancelAnimationFrame(rafRef.current)` will avoid potential leaks and unexpected late updates.
- The `height` prop on the editor is now a class name string but the comment still says 'height in pixels'; it would be clearer to update the prop description (and consider using `clsx` to merge the height class with `rb:overflow-y-auto` instead of string concatenation).

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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