🤖 refactor: migrate SectionHeader actions menu to PositionedMenu#3111
🤖 refactor: migrate SectionHeader actions menu to PositionedMenu#3111
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b630e9527
ℹ️ 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".
|
@codex review Added toggle behavior: clicking the kebab button now closes the menu if it's already open, instead of always repositioning. This restores the pre-migration UX. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 361f3d45dc
ℹ️ 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".
|
@codex review Fixed: added |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cee5767a03
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 621a975eb0
ℹ️ 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".
| onClick={(e: React.MouseEvent) => { | ||
| if (sectionMenu.isOpen) { | ||
| setShowColorPicker(false); | ||
| sectionMenu.close(); | ||
| return; | ||
| } | ||
| sectionMenu.onContextMenu(e); |
There was a problem hiding this comment.
Keep kebab click from reopening an already-open menu
When the section actions menu is open, clicking the kebab can close-and-immediately-reopen the popover instead of toggling it off. PositionedMenu (Radix Popover) dismisses on outside pointer interaction before the button onClick runs, so by the time this handler executes sectionMenu.isOpen may already be false and the fallback path calls sectionMenu.onContextMenu(e), reopening at the click position. This makes the trigger unreliable for closing the menu and regresses the previous explicit toggle behavior.
Useful? React with 👍 / 👎.
Summary
Migrates the section kebab (⋮) menu from a custom absolute-positioned dropdown to the shared
PositionedMenu+useContextMenuPositionprimitives, so the menu stays fully visible when opened near the viewport bottom.Background
The section actions menu rendered as an
absolute top-full right-0panel with manual outside-click handling. When a section was near the bottom of the window, the menu clipped offscreen — and expanding "Change color" made it worse. The codebase already has shared positioning primitives (PositionedMenu+useContextMenuPosition) used inProjectSidebarthat handle viewport collision via Radix Popover + Floating UI.Implementation
isActionsMenuOpenstate,actionsMenuRef, anddocument.addEventListener("mousedown")outside-click handler withuseContextMenuPosition()+<PositionedMenu>.showColorPickerresets tofalseon menu close via theonOpenChangecallback.PositionedMenu/PositionedMenuItemmocks (same pattern as ProjectSidebar tests) and a new"SectionHeader actions menu"test suite covering: menu opens, color picker expands, rename enters edit mode, delete calls handler. Existing auto-create editing tests preserved.Risks
Low — this is a container-level swap using primitives already proven in
ProjectSidebar. Menu content and action handlers are unchanged.Generated with
mux• Model:anthropic:claude-opus-4-6• Thinking:xhigh• Cost:$4.42