-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[CL-473] Adjust popup page max width and scroll containers #14853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Great job, no security vulnerabilities found in this Pull Request |
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #14853 +/- ##
==========================================
- Coverage 36.41% 36.41% -0.01%
==========================================
Files 3212 3212
Lines 93265 93275 +10
Branches 16833 16835 +2
==========================================
Hits 33967 33967
- Misses 56831 56841 +10
Partials 2467 2467 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screen recording looks as expected. Thanks for fixing this one!
## With Virtual Scroll | ||
|
||
If you are using a virtual scrolling container inside of the popup page (aka replacing the default | ||
popup page scrolling container with a virtual scroll container), you'll want to configure the | ||
component in the following ways: | ||
|
||
- Use the `disablePadding` input on the `popup-page` | ||
- Add padding and scrollbar to the virtual scrolling element to match the default behavior of the | ||
popup page scroll container, which ensures that the scrollbar is at the far right edge of the | ||
popup | ||
- Add max width to the child of the virtual scroll element, matching the max width breakpoints used | ||
in the `popup-page` | ||
|
||
See the code in the example below. | ||
|
||
<Canvas of={stories.WithVirtualScrollChild} /> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, this seems like a non-intentional limitation of the current design of the component. Thoughts?
// FIXME: Update this file to be type safe and remove this and next line | ||
// @ts-strict-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
|
||
if (!compact) { | ||
// eslint-disable-next-line | ||
console.error(`#${containerId} [data-testid=popup-layout-scroll-region] not found`); | ||
return; | ||
} | ||
|
||
const label = canvasEl.querySelector(`#${containerId} .example-label`); | ||
|
||
if (!label) { | ||
// eslint-disable-next-line | ||
console.error(`#${containerId} .example-label not found`); | ||
return; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the goal of this change?
> | ||
<div | ||
class="tw-max-w-screen-sm tw-mx-auto tw-flex-1 tw-flex tw-flex-col tw-w-full" | ||
[ngClass]="{ 'tw-p-3 bit-compact:tw-p-2': !disablePadding }" | ||
class="has-[[cdkvirtualscrollingelement]]:tw-max-w-full tw-max-w-screen-sm tw-mx-auto tw-flex-1 tw-flex tw-flex-col tw-w-full" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This seems fragile. Is Tailwind
has
just direct descendants? - It seems odd that we are asking consumers to manually configure the component base on its supplied descendants in one place
disablePadding
, but then automatically checking descendants in another.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does Vault need their own cdkVirtualScrollingElement
?
🎟️ Tracking
CL-473
📔 Objective
The popup page had strange jumping behavior at its max width breakpoint, and the scrollbar was appearing at that content max width instead of on the righthand side of the window. This PR fixes these issues by:
popup-page
nonscrollable region to set the max widthpopup-page
scrollable container to have the padding appear on the container that has the scrollbar, and setting the max width on the child of that container depending on whether or not a virtual scroll child is present (we want it full width if there's a virtual scroll child so that the virtual scroll child can set its own padding and max width, since it has its own scrollbar that needs to stick to the right side of the page)popup-page
's scrollable container implementation📸 Screenshots
Before:
Screen.Recording.2025-05-20.at.9.38.16.AM.mov
After:
Screen.Recording.2025-05-20.at.9.35.06.AM.mov
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes