Skip to content

vps-115-context-menus-noticeably-flicker-at-previous-position - #451

Open
K1mmyn wants to merge 1 commit into
masterfrom
vps-115-context-menus-noticeably-flicker-at-previous-position
Open

vps-115-context-menus-noticeably-flicker-at-previous-position#451
K1mmyn wants to merge 1 commit into
masterfrom
vps-115-context-menus-noticeably-flicker-at-previous-position

Conversation

@K1mmyn

@K1mmyn K1mmyn commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Issue

The main cause for the flicker is that, the current function which create the context menu check onmouseup if your cursor is on a piece of html which is apart of the context menu. This bug happens when you are holding right click and move your cursor off the context menu and release right click.

Solution

Change from mouseup to mousedown because it is guaranteed that the mouse will start on top of the context menu due to negative offset

Risk

NONE

Checklist

  • Acceptance criteria met
  • Wiki documentation is written and up to date
  • Unit tests written and passing
  • Integration tests written and passing
  • Continuous integration build passing

Summary by CodeRabbit

  • Bug Fixes
    • Improved context menu click-away handling by responding when the mouse button is pressed, providing more consistent dismissal behavior.

@linear

linear Bot commented Jul 26, 2026

Copy link
Copy Markdown

VPS-115

@K1mmyn
K1mmyn requested review from GogaIV and hazikchaudhry July 26, 2026 00:57
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bf0a7baa-3e90-43e4-8aba-df0f3fe62907

📥 Commits

Reviewing files that changed from the base of the PR and between cb75254 and b9143e9.

📒 Files selected for processing (1)
  • frontend/src/components/ContextMenu/portal.jsx

📝 Walkthrough

Walkthrough

Changes

Context menu event handling

Layer / File(s) Summary
Update click-away event binding
frontend/src/components/ContextMenu/portal.jsx
clickAwayListener now removes and registers a document-level passive mousedown listener instead of a mouseup listener.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is specific and matches the context-menu flicker fix, though it is written like an issue slug rather than a polished summary.
Description check ✅ Passed The description follows the required template with Issue, Solution, Risk, and Checklist sections and is mostly complete.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch vps-115-context-menus-noticeably-flicker-at-previous-position

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.

@GogaIV GogaIV left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I mean i guesss

@harbassan harbassan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Virtual.Patient.System.-.UoA.Mozilla.Firefox.2026-07-27.23-38-02.mp4

@GogaIV
GogaIV self-requested a review July 27, 2026 11:45

@GogaIV GogaIV left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Screencast_20260727_235200.webm
it is working for me idk hartej, im on firefox browser
the other sort of flicker thats happening seems to be from the previous context menu location so could not be closing properly or smthn like that

@harbassan

Copy link
Copy Markdown
Contributor

yeah i think that tiny flicker you have at the start of your video is the one im having all the time, where there is a render that happens at the previous location before a rerender at the new location.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants