Skip to content
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

feat: Add support for inflating flyout separators. #8592

Merged
merged 4 commits into from
Sep 27, 2024

Conversation

gonfunko
Copy link
Contributor

The basics

The details

Proposed Changes

This PR adds a new FlyoutSeparator class to represent a gap between items in a flyout, and a corresponding flyout inflater for items of this type. This will allow flyouts to no longer have to track gaps and content in separate lists, and instead just use one list of content items, some of which are rendered blocks/buttons/labels/etc and some of which are invisible spacers that simply occupy space between other items.

@gonfunko gonfunko requested a review from a team as a code owner September 25, 2024 22:04
@gonfunko gonfunko requested review from cpcallen and rachel-fenichel and removed request for cpcallen September 25, 2024 22:04
@gonfunko gonfunko assigned rachel-fenichel and unassigned cpcallen Sep 25, 2024
@github-actions github-actions bot added the PR: feature Adds a feature label Sep 25, 2024
core/flyout_separator.ts Show resolved Hide resolved
core/flyout_separator.ts Show resolved Hide resolved
private y = 0;
constructor(private gap: number) {}

getBoundingRectangle(): Rect {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone uses a really big gap value in a vertical flyout, can it cause the flyout to become excessively wide as a result of the gap being a square instead of a rectangle? If yes, I think we should have gapX and gapY be specified separately

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes; updated it to take an axis argument and be zero-width on the non-dominant axis.

core/separator_flyout_inflater.ts Show resolved Hide resolved
@gonfunko gonfunko merged commit bdc43bd into google:rc/v12.0.0 Sep 27, 2024
7 checks passed
@gonfunko gonfunko deleted the separator-inflater branch September 27, 2024 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: feature Adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants