feat(web): add tooltip to composer file mention pill#1944
feat(web): add tooltip to composer file mention pill#1944GuilhermeVieiraDev wants to merge 2 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Worth noting: |
ApprovabilityVerdict: Approved Minor UI enhancement adding a tooltip to file mention pills in the composer. The refactoring from TextNode to DecoratorNode is a standard Lexical pattern change to enable React-based tooltip rendering. Changes are self-contained with net negative lines and no runtime behavior changes beyond the additive tooltip feature. You can customize Macroscope's approvability policy. Learn more. |
Dismissing prior approval to re-evaluate 0311e7d


What Changed
Migrated
ComposerMentionNodefromTextNodetoDecoratorNodeand added a<Tooltip />that shows the full file path on hover. Also cleaned up the offset/selection functions to useisComposerInlineTokenNodeinstead of per-typeinstanceofchecks.Why
The mention pill only shows the basename, so when multiple files share the same name (e.g.
src/utils/index.tsandsrc/api/index.ts) there's no way to tell them apart.ComposerMentionNodewas the only inline chip still onTextNode, Skills and Terminal already usedDecoratorNode, so this aligns all three and enables proper<Tooltip />support.UI Changes
Checklist
Note
Medium Risk
Moderate risk because it refactors the Lexical
ComposerMentionNodefrom aTextNodeto aDecoratorNode, which can affect editor serialization and cursor/selection behavior around inline tokens.Overview
Shows the full file path when hovering a composer file mention chip by rendering the mention as a
DecoratorNodewith aTooltip(while still displaying only the basename in the chip).This removes the previous manual DOM rendering/update logic for mention chips, adjusts mention JSON import/export to the new node type, and consolidates selection/offset calculations to treat mentions the same as other inline token nodes via
isComposerInlineTokenNode.Reviewed by Cursor Bugbot for commit 0311e7d. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Show full file path on composer mention pill hover
ComposerMentionNodein ComposerPromptEditor.tsx from aTextNodeto aDecoratorNode, switching from imperative DOM rendering to a newComposerMentionDecoratorReact component.isComposerInlineTokenNodepath, removing mention-specific branches.SerializedLexicalNodeinstead ofSerializedTextNode; existing serialized mention data may need re-validation.Macroscope summarized 0311e7d.