Skip to content

🐛(frontend) pick a mention with the mouse in comment threads - #3059

Closed
sanketpatel32 wants to merge 1 commit into
suitenumerique:mainfrom
sanketpatel32:devin/3034-mention-click-sidebar
Closed

sanketpatel32 wants to merge 1 commit into
suitenumerique:mainfrom
sanketpatel32:devin/3034-mention-click-sidebar

Conversation

@sanketpatel32

Copy link
Copy Markdown

Purpose

Fixes #3034.

In the comment sidebar, typing @ showed the mention suggestions but clicking one did nothing: the portalled dropdown's mousedown moved focus out of the .bn-thread, which unmounted the composer before click fired.

Proposal

  • preventDefault on the dropdown's onMouseDown so focus stays in the editor thread.

External contributions

General requirements

CI requirements

  • I made sure that all existing tests are passing
  • I have signed off my commits with git commit --signoff (DCO compliance)
  • I have signed my commits with my SSH or GPG key (git commit -S) — no signing key is available in this environment; let me know if it is required and I will arrange it
  • My commit messages follow the required format: <gitmoji>(type) title description
  • I have added a changelog entry under ## [Unreleased] section (if noticeable change)

AI requirements

  • I used AI assistance to produce part or all of this contribution (Devin, on behalf of Sanket Patel)
  • I have read, reviewed, understood and can explain the code I am submitting
  • I can jump in a call or a chat to explain my work to a maintainer

Clicking a suggestion of the mention search did nothing in the
sidebar comment threads: the dropdown is portalled, so mousedown
moved focus out of .bn-thread, the thread was unselected on blur
and the reply composer unmounted before click fired. Preventing
the default focus shift on mousedown keeps the thread selected.

Refs suitenumerique#3034

Signed-off-by: Sanket Patel <sanpatel323@gmail.com>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The mention dropdown now prevents the default mousedown action, keeping focus in the editor thread when a user clicks a suggestion. The Unreleased changelog records mouse-based mention selection in comment threads.

Estimated code review effort: 2 (Simple) | ~5 minutes

Fixed issue severity: <fixed_issue_severity>Medium</fixed_issue_severity>

Suggested reviewers: antolc, ovgodd

Merge Risk: Minimal · up to 2fdec

Clicking a mention suggestion in comment sidebar threads should now keep the thread selected and complete the selection. The change is small and isolated, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a mention can now be picked with the mouse in comment threads. The raw summary and objectives both describe the mousedown preventDefault fix for the mention dropdown i…
Description check Passed The description states the purpose (fixes #3034), the cause (dropdown mousedown moves focus out of the thread, unmounting the composer before click), and the proposal (preventDefault on the dropdown's…
Linked Issues check Passed [#3034] The issue requires clicking a mention suggestion in comment sidebar threads to work. The reviewed head implements the suggested fix. In Search.tsx, the dropdown Box (the `ref={setModalRef}…
Out of Scope Changes check Passed The PR summary lists two changed files. Search.tsx gets the mousedown guard that the linked issue #3034 requests. The CHANGELOG.md entry under Unreleased 'Fixed' documents the same fix and refer…
Full details: Title check

Explanation

The title names the main change: a mention can now be picked with the mouse in comment threads. The raw summary and objectives both describe the mousedown preventDefault fix for the mention dropdown in the comment sidebar. The 🐛 emoji is noise but does not make the title unrelated.

Full details: Description check

Explanation

The description states the purpose (fixes #3034), the cause (dropdown mousedown moves focus out of the thread, unmounting the composer before click), and the proposal (preventDefault on the dropdown's onMouseDown). This matches the Search.tsx change and the linked objectives. Some checklist items are unticked, such as commit signing, but the description is clearly related to the changeset.

Full details: Linked Issues check

Explanation

[#3034] The issue requires clicking a mention suggestion in comment sidebar threads to work. The reviewed head implements the suggested fix. In Search.tsx, the dropdown Box (the ref={setModalRef} element inside Popover.Dropdown) now has onMouseDown={(e) =&gt; e.preventDefault()} with a comment explaining the focus loss. This stops the default focus shift that unselected the thread and unmounted the composer before click. Preventing the default on mousedown does not block the click event, so the suggestion selection path still runs. The change matches the issue's suggested fix. Keyboard selection is not altered. Automated tests were not confirmed from a diff: the diff could not be read in this review, and the test file Mention/__tests__/Search.test.tsx exists at head, but its changes are unverified. The issue does not require a specific test, so this does not change the verdict. Runtime click behavior was not executed; the verdict relies on source inspection.

Full details: Out of Scope Changes check

Explanation

The PR summary lists two changed files. Search.tsx gets the mousedown guard that the linked issue #3034 requests. The CHANGELOG.md entry under Unreleased 'Fixed' documents the same fix and references #3034. Both changes relate directly to the issue. No unrelated code changes appear in the summary. The whole-PR diff could not be read (changed blobs unavailable in the checkout), so this verdict relies on the supplied summary and the file content at head. Scope for other files is therefore based on the summary only.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 1d7ea20b-73a8-482f-9578-3c19c525a125
Commits

Reviewing files that changed from the base of the PR and between 5b55459 and 2fdec68.

Files selected for processing: 2

  • CHANGELOG.md
  • src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-inline-content/Mention/Search.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@AntoLC
AntoLC self-requested a review November 24, 2026 09:07
@AntoLC AntoLC added frontend duplicate This issue or pull request already exists labels Nov 24, 2026
@AntoLC

AntoLC commented Nov 24, 2026

Copy link
Copy Markdown
Member

Duplicated of #3055.

@AntoLC AntoLC closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛(Bug) Clicking a mention suggestion does nothing in comment sidebar threads

2 participants