Skip to content

Conversation

@samhvw8
Copy link
Contributor

@samhvw8 samhvw8 commented Apr 12, 2025

Fix duplicate mention suggestion

Context

When exist open tab, and mention file that is open mention suggest will show 2 duplicate value for open tab

Implementation

Screenshots

before after
image image

How to Test

Get in Touch


Important

Fixes duplicate mention suggestions in getContextMenuOptions() by adjusting deduplication logic for File, Folder, and OpenedFile types.

  • Behavior:
    • Fixes duplicate mention suggestions in getContextMenuOptions() in context-mentions.ts by adjusting deduplication logic.
    • Ensures unique keys for File, Folder, and OpenedFile types by using normalizedValue directly as the key.
  • Misc:
    • No changes to other functions or files.

This description was created by Ellipsis for 3fc4ce9. It will automatically update as commits are pushed.

@samhvw8 samhvw8 requested review from cte and mrubens as code owners April 12, 2025 12:24
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 12, 2025
item.type === ContextMenuOptionType.Folder ||
item.type === ContextMenuOptionType.OpenedFile
) {
key = normalizedValue!
Copy link
Contributor

Choose a reason for hiding this comment

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

Using the non-null assertion (!) on normalizedValue may be risky because item.value is optional. Consider handling the undefined case explicitly.

Suggested change
key = normalizedValue!
key = normalizedValue ?? ''

@dosubot dosubot bot added the bug Something isn't working label Apr 12, 2025
Copy link
Collaborator

@mrubens mrubens left a comment

Choose a reason for hiding this comment

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

Good catch!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 12, 2025
@mrubens mrubens merged commit e9980bc into RooCodeInc:main Apr 12, 2025
21 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Apr 12, 2025
SmartManoj pushed a commit to SmartManoj/Raa-Code that referenced this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants