Skip to content

fix: mention ping detection#926

Open
beladiyaraj wants to merge 5 commits intopingdotgg:mainfrom
beladiyaraj:fix/issue-876-thread-sync
Open

fix: mention ping detection#926
beladiyaraj wants to merge 5 commits intopingdotgg:mainfrom
beladiyaraj:fix/issue-876-thread-sync

Conversation

@beladiyaraj
Copy link

@beladiyaraj beladiyaraj commented Mar 11, 2026

What Changed

Fixed @ file/folder mentions in the message box.

  1. Fixed the issue where @ mentions only worked at the end of the message.
  2. Fixed the issue where adding one file mention could break a later @ mention in the same message.
  3. Fixed the issue where typing a new @ could show old search results from the previous mention for the same message.
  4. Improved the logic so file suggestions follow the actual cursor position more reliably when editing text around existing mentions.
  5. Added regression tests for the broken mention flows we found.

Why

Previously:

  • @ mentions could behave differently depending on where they were typed in the sentence.
  • After selecting one file, going back and typing another @ could fail or behave inconsistently.
  • A fresh @ could show stale results from the previous search instead of starting clean for the same message.

Now:

  • @ mentions work more reliably anywhere in the message.
  • Multiple mentions in the same message behave correctly.
  • A new @ starts from a clean suggestion state and only shows current matches.

UI Changes

None

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

This PR fixes the issue #857

Note

Fix mention ping detection by using expanded cursor for @-token trigger resolution

  • Adds detectComposerTriggerFromSnapshot in composer-logic.ts to use the editor's expandedCursor when available, fixing trigger detection when revisiting @-tokens whose visual width differs from text length.
  • Extends ComposerPromptEditorInner to track and emit an expandedCursor that reflects mention nodes' full text length, propagating it through onChange and readSnapshot.
  • Adds resolveComposerPathMenuEntries in composer-path-menu.ts to suppress path menu entries when the query is empty, debouncing, or while a fetch is in progress.
  • Updates ChatView.tsx to use both new utilities, replacing direct query data access and the old trigger detection path.

Macroscope summarized 4ef19c3.

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 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: 6bc619c3-d0a7-4f18-96c7-27c87500942b

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
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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 the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Mar 11, 2026
@juliusmarminge
Copy link
Member

conflicts

@juliusmarminge juliusmarminge added the accepted feature request accepted label Mar 12, 2026
@juliusmarminge
Copy link
Member

@macroscope-app review this

@github-actions github-actions bot added the size:L 100-499 changed lines (additions + deletions). label Mar 12, 2026
@juliusmarminge
Copy link
Member

bug with cursor moving to the end when inserting a mention at the start:
https://github.com/user-attachments/assets/6cf8108e-f3ea-419d-8012-30208fcc9757

@beladiyaraj
Copy link
Author

bug with cursor moving to the end when inserting a mention at the start: https://github.com/user-attachments/assets/6cf8108e-f3ea-419d-8012-30208fcc9757

Let me fix this

@juliusmarminge
Copy link
Member

conflcits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted feature request accepted 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