Skip to content

feat(web): add tooltip to composer file mention pill#1944

Open
GuilhermeVieiraDev wants to merge 2 commits intopingdotgg:mainfrom
GuilhermeVieiraDev:feat/composer-mention-tooltip
Open

feat(web): add tooltip to composer file mention pill#1944
GuilhermeVieiraDev wants to merge 2 commits intopingdotgg:mainfrom
GuilhermeVieiraDev:feat/composer-mention-tooltip

Conversation

@GuilhermeVieiraDev
Copy link
Copy Markdown
Contributor

@GuilhermeVieiraDev GuilhermeVieiraDev commented Apr 12, 2026

What Changed

Migrated ComposerMentionNode from TextNode to DecoratorNode and added a <Tooltip /> that shows the full file path on hover. Also cleaned up the offset/selection functions to use isComposerInlineTokenNode instead of per-type instanceof checks.

Why

The mention pill only shows the basename, so when multiple files share the same name (e.g. src/utils/index.ts and src/api/index.ts) there's no way to tell them apart. ComposerMentionNode was the only inline chip still on TextNode, Skills and Terminal already used DecoratorNode, so this aligns all three and enables proper <Tooltip /> support.

UI Changes

image image

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Medium Risk
Moderate risk because it refactors the Lexical ComposerMentionNode from a TextNode to a DecoratorNode, 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 DecoratorNode with a Tooltip (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

  • Refactors ComposerMentionNode in ComposerPromptEditor.tsx from a TextNode to a DecoratorNode, switching from imperative DOM rendering to a new ComposerMentionDecorator React component.
  • The decorator renders an inline, non-editable chip with an icon and label, wrapped in a tooltip that displays the full file path on hover.
  • Consolidates offset and selection point utilities to handle mention nodes via the generic isComposerInlineTokenNode path, removing mention-specific branches.
  • Behavioral Change: mention nodes now serialize as SerializedLexicalNode instead of SerializedTextNode; existing serialized mention data may need re-validation.

Macroscope summarized 0311e7d.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5dd7178d-3fea-465c-9d83-56180cd0768a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 12, 2026
@GuilhermeVieiraDev
Copy link
Copy Markdown
Contributor Author

Worth noting: ComposerMentionNode is the only inline chip still extending TextNode, Skills and Terminal both use DecoratorNode. If there's interest in aligning them I'm happy to take that on as a follow-up.

macroscopeapp[bot]
macroscopeapp bot previously approved these changes Apr 12, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 12, 2026

Approvability

Verdict: 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.

Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge left a comment

Choose a reason for hiding this comment

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

should use <Tooltip /> like skills:

Image

@macroscopeapp macroscopeapp bot dismissed their stale review April 12, 2026 13:42

Dismissing prior approval to re-evaluate 0311e7d

@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Apr 12, 2026
@GuilhermeVieiraDev
Copy link
Copy Markdown
Contributor Author

Yeah I noticed that earlier, but was trying to keep it simple. ComposerMentionNode was the only one using TextNode still, so to have proper Tooltip support I did the refactor and migrated the mention node to DecoratorNode as well.
image

@GuilhermeVieiraDev GuilhermeVieiraDev changed the title feat(web): show full file path on composer mention pill hover feat(web): add tooltip to composer file mention pill Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants