Skip to content

fix: keep a pinned dialog inside the viewport and scroll the Add User roles - #5898

Merged
norman-abramovitz merged 3 commits into
cloudfoundry:developfrom
nabramovitz:fix/pinned-dialog-height
Sep 9, 2026
Merged

fix: keep a pinned dialog inside the viewport and scroll the Add User roles#5898
norman-abramovitz merged 3 commits into
cloudfoundry:developfrom
nabramovitz:fix/pinned-dialog-height

Conversation

@nabramovitz

Copy link
Copy Markdown
Contributor

Closes #5897.

TailwindDialogService pins any dialog with a drag handle to a fixed position measured right after open, while the panel is still small and centred. Content that arrives later grows the panel downward from that pinned top under its 90vh cap, so top plus height spills past the bottom edge of the window and the action buttons end up off screen — the panel's own scroll cannot bring up a footer that lies outside the viewport. Add User on an org with a dozen spaces does this at both 900 and 1600 pixel tall windows; a scripted click on Cancel fails with "element is outside of the viewport" at both sizes.

The service already ties a panel's maximum height to the viewport from its own position, but that clamp only ran for resizable dialogs, and Add User is draggable-only. It now applies to every pinned panel: the smaller of the configured pixel maxHeight and innerHeight − top. A unit test on the service covers the draggable-only case and the configured-cap-wins case.

With the panel capped, Add User still needed the whole panel scrolled to reach its buttons, and with overlay scrollbars nothing indicated more content existed. The scope and roles section now has its own bounded scroll region (max-h-[45vh] overflow-y-auto custom-scrollbar), the pattern the share and entitle dialogs already use, so every org and space is reachable while Add User and Cancel stay in view.

Verified live against the lab: panel bottom at 891 of a 900px window, the roles section scrolls its 923px of content, the scrollbar is visible, and Cancel is clickable. make check gate green (3741 tests).

A dialog with a drag handle is pinned to a fixed position measured
right after open, while it is still small and centred. Content that
arrives later grows the panel from that top under its 90vh cap, so
top plus height spills past the bottom of the viewport and the action
buttons end up unreachable: the panel's own scroll cannot bring up a
footer that lies off screen. Add User on an org with a dozen spaces
does this at 900 and 1600 pixel tall windows.

The service already ties the maximum height to the viewport from the
panel's position, but only for resizable dialogs. Apply that cap to
every pinned panel; a configured pixel maxHeight still wins when it is
smaller.

Closes cloudfoundry#5897
With the panel capped at the viewport, Add User on an org with many
spaces still needed the whole panel scrolled to reach its buttons, and
with overlay scrollbars nothing showed that more content existed. Give
the scope and roles section its own bounded scroll region with the
console's visible scrollbar styling, the way the share and entitle
dialogs already do, so every org and space is reachable and the Add
User and Cancel buttons stay in view.

@norman-abramovitz norman-abramovitz 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.

LGTM - Still need a live verify after all the fixes are in place.

…height

# Conflicts:
#	src/frontend/packages/cloud-foundry/src/features/cf/users/add-user/add-user-dialog.component.html
@norman-abramovitz
norman-abramovitz merged commit e41b3d3 into cloudfoundry:develop Sep 9, 2026
24 checks passed
@nabramovitz
nabramovitz deleted the fix/pinned-dialog-height branch September 9, 2026 07:30
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.

Draggable dialogs can grow past the bottom of the viewport, hiding their buttons

2 participants