Skip to content

48792 fix actions dropdown layout shift#49430

Open
rrahul-1 wants to merge 2 commits into
fleetdm:mainfrom
rrahul-1:48792-fix-actions-dropdown-layout-shift
Open

48792 fix actions dropdown layout shift#49430
rrahul-1 wants to merge 2 commits into
fleetdm:mainfrom
rrahul-1:48792-fix-actions-dropdown-layout-shift

Conversation

@rrahul-1

@rrahul-1 rrahul-1 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Related issue: Resolves #48792

Summary

Default menuPlacement to "auto" inside tables so the menu flips upward when there's no room below, instead of stretching the document. Also added marginBottom to match the existing marginTop: 0, so a flipped-up menu sits flush against its trigger instead of floating 8px above it.

Screenshot demonstrating the fix

  • Labels Page:
image - Users Page: image
  • Fleets Page:
image

Checklist for submitter

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.

Testing

  • QA'd all new/changed functionality manually

Manual QA steps

On a local dev server, with enough rows that the page content exactly fills the viewport (no scrollbar):

  1. Settings → Labels (/labels/manage), Settings → Users (/settings/users), and Settings → Fleets (/settings/fleets)
  2. Click Actions on the last row → menu opens upward; document.documentElement.scrollHeight, clientWidth, and scrollY are unchanged (no scrollbar, no 15px shift, no scroll jump)
  3. Click Delete → modal opens with zero movement of the page behind it
  4. Click Actions on a top row → menu still opens downward as before

Summary by CodeRabbit

  • Bug Fixes
    • Prevented horizontal page shifting when opening action menus near the bottom of tables.
    • Action menus now automatically open upward when there isn’t enough space below, avoiding jumps when opening delete dialogs.
    • Improved spacing around action menus for a more consistent layout.

@rrahul-1
rrahul-1 requested a review from a team as a code owner July 16, 2026 16:59
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.16%. Comparing base (b3d8baf) to head (44ea356).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #49430    +/-   ##
========================================
  Coverage   68.16%   68.16%            
========================================
  Files        3849     3855     +6     
  Lines      243476   243629   +153     
  Branches    13124    13166    +42     
========================================
+ Hits       165956   166067   +111     
- Misses      62521    62562    +41     
- Partials    14999    15000     +1     
Flag Coverage Δ
frontend 60.15% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai

coderabbitai Bot commented Jul 16, 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d17c79f9-6b8b-4d79-9fc1-151d512f4b62

📥 Commits

Reviewing files that changed from the base of the PR and between 9fbe1ef and 44ea356.

📒 Files selected for processing (2)
  • changes/48792-actions-dropdown-layout-shift
  • frontend/components/ActionsDropdown/ActionsDropdown.tsx

Walkthrough

Updated ActionsDropdown to resolve menu placement dynamically: table-rendered dropdowns use automatic placement, while other dropdowns retain bottom placement unless explicitly configured. Added conditional bottom margin styling to complement existing top margin styling for the brand-button variant. Added a changelog entry documenting the layout-shift fix.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change to fix the Actions dropdown layout shift.
Description check ✅ Passed The description includes the related issue, summary, screenshots, and manual QA steps required by the template.
Linked Issues check ✅ Passed The change matches #48792 by preventing table-page layout shifts when Actions/Delete is used on labels, users, and fleets pages.
Out of Scope Changes check ✅ Passed The PR stays focused on the dropdown placement and spacing fix, with no obvious unrelated code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@RachelElysia

Copy link
Copy Markdown
Member

@rrahul-1 - hey thanks for the contribution, this ticket is actually waiting on design responses once I get them screenrecordings of a few intended behaviors. Will circle back to you once confirmed

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.

Page layout shifts left when delete modal opens on labels/fleets/users pages

2 participants