Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94e70d52ce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| {{on 'mouseenter' this.cancelCloseMenuTimer}} | ||
| {{on 'mouseleave' this.startCloseMenuTimer}} |
There was a problem hiding this comment.
Keep file menu open for non-mouse interactions
The new timeout-based close behavior is only coordinated through mouseenter/mouseleave, so keyboard- or touch-opened menus never cancel the 800ms timer and will auto-close even while the user is trying to navigate to Delete. This introduces an accessibility regression (keyboard/screen-reader users lose the menu before they can act) and can also cause intermittent failures on slower devices; the timer should also be paused by focus/pointer/touch interaction (or not enforced while the menu is active).
Useful? React with 👍 / 👎.
Preview deployments |
lukemelia
left a comment
There was a problem hiding this comment.
Any reason not to use floating-ui for this kind of thing?
There was a problem hiding this comment.
Pull request overview
Fixes a regression in the file tree “…” context menu positioning by binding a tracked inline style to the hidden BoxelDropdown anchor so ember-basic-dropdown can compute the correct trigger rect.
Changes:
- Bind a tracked
anchorStyleto the hidden dropdown anchor and set it from the clicked trigger’sgetBoundingClientRect(). - Add an auto-close timer for the menu, with pointer/focus enter/leave handlers to pause/resume the timer.
- Ensure timer cleanup on close and destruction.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I find the auto close behavior unexpected and inconsistent with other contextual menus that we have. If I open a contextual menu I would expect it to stay open |
4789782 to
bac8e56
Compare
good point. refactored to use ember-velcro |
noted! thanks for feedback. removed any auto-closing and accounted for click outside close |
lukemelia
left a comment
There was a problem hiding this comment.
So we have an onClickOutside modifier we can use?
File Tree Delete Dropdown Regression
The Issue
Commit
6bea2ee2e3refactored the file tree context menu to use a single sharedBoxelDropdownacross all file rows (to avoid memory leaks from per-file dropdown instances).The new design separates the visible trigger (the 3-dot
ContextButton) from the dropdown anchor (a hidden button):The anchor is styled to be invisible:
ember-basic-dropdownpositions its content by callinggetBoundingClientRect()on the trigger element. Since the anchor has notop/left, it sits at its natural DOM position. The dropdown renders in the DOM but appears offscreen, hidden behind other UI.Why direct DOM manipulation doesn't work
An obvious fix is to set the anchor's inline styles via
anchorEl.style.top = ...before callingopen(). However, callingthis.dropdownApi?.actions.open(e)sets tracked state on the BasicDropdown component, which triggers a Glimmer re-render. During that re-render, Glimmer reconciles the anchor button's DOM attributes against the template — and since the template declares nostyleattribute on the anchor, Glimmer strips the inline styles we just set. By the timeember-basic-dropdowncallsreposition()after render, the anchor is back at its default position.The Fix
Use a
@trackedproperty for the anchor's style string so that Glimmer includes it in the re-render instead of removing it:In the template, bind it to the anchor button:
In
openFileMenu, set the tracked property before opening the dropdown:Now the re-render triggered by
open()appliesanchorStyleto the anchor, and whenember-basic-dropdowncallsgetBoundingClientRect()on the anchor after render, it gets the correct coordinates of the 3-dot button.Reset
anchorStylewhen the menu closes:Auto-close Timer
The menu also auto-closes after 800 ms if the user does not hover over it. Hovering pauses the timer; moving the mouse away restarts it.
The timer starts when the menu opens and is wired to the menu content via
mouseenter/mouseleave: