feat(code): use Quill Chip for mention chips + PromptInput story#1756
Merged
jonathanlab merged 4 commits intomainfrom Apr 21, 2026
Merged
feat(code): use Quill Chip for mention chips + PromptInput story#1756jonathanlab merged 4 commits intomainfrom
jonathanlab merged 4 commits intomainfrom
Conversation
…f react portals for performance
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Prompt To Fix All With AIThis is a comment left during a code review.
Path: apps/code/src/renderer/features/message-editor/components/PromptInput.stories.tsx
Line: 61-69
Comment:
**Chips may be re-inserted on re-render**
`useEffect` runs whenever `chips` reference changes. In Storybook, switching between stories or toggling any control causes a full re-render with a new `chips` array reference, so `insertChip` fires again for each chip already in the editor, producing duplicates. A stable reference (e.g. `useRef` guard or deep-equal comparison) would prevent this.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix: revert pastedText interface change,..." | Re-trigger Greptile |
Comment on lines
+61
to
+69
| useEffect(() => { | ||
| if (!chips?.length) return; | ||
| const timer = setTimeout(() => { | ||
| for (const chip of chips) { | ||
| ref.current?.insertChip(chip); | ||
| } | ||
| }, 200); | ||
| return () => clearTimeout(timer); | ||
| }, [chips]); |
There was a problem hiding this comment.
Chips may be re-inserted on re-render
useEffect runs whenever chips reference changes. In Storybook, switching between stories or toggling any control causes a full re-render with a new chips array reference, so insertChip fires again for each chip already in the editor, producing duplicates. A stable reference (e.g. useRef guard or deep-equal comparison) would prevent this.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/message-editor/components/PromptInput.stories.tsx
Line: 61-69
Comment:
**Chips may be re-inserted on re-render**
`useEffect` runs whenever `chips` reference changes. In Storybook, switching between stories or toggling any control causes a full re-render with a new `chips` array reference, so `insertChip` fires again for each chip already in the editor, producing duplicates. A stable reference (e.g. `useRef` guard or deep-equal comparison) would prevent this.
How can I resolve this? If you propose a fix, please make it concise.Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jonathanlab
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<span>/<button>mention chips with Quill<Chip>component for design system consistencyPromptInput.stories.tsxwith real tiptap editor, realUnifiedModelSelector/ReasoningLevelSelectorwith mock dataTest plan
🤖 Generated with Claude Code