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

Use grid-based gap detection for placeholder creation. #15545

Merged
merged 7 commits into from May 24, 2023

Conversation

dennisoelkers
Copy link
Member

Note: This requires a backport to 5.1.

Description

Motivation and Context

This PR is implementing a different approach for detecting gaps in the widget grid in order to create placeholders for inline widget creation.

Instead of detecting leading, trailing and intermediate gaps by comparing widgets to the boundaries of the grid and itself, it fills a m x n grid with markers for existing widgets. After that, it tries to fill rectangles of the biggest possible size in the unfilled spaces. It avoids creating placeholders for rectangles with a width lower than 2, as well as skipping empty rows between widgets.

This is supposed to avoid placement problems that we have seen in #15308 & #15538.

Fixes #15308.
Fixes #15538.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

Copy link
Contributor

@linuspahl linuspahl left a comment

Choose a reason for hiding this comment

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

Looks good to me, works as expected.

@dennisoelkers dennisoelkers merged commit f79fb78 into master May 24, 2023
5 checks passed
@dennisoelkers dennisoelkers deleted the fix/issue-15308 branch May 24, 2023 06:28
dennisoelkers added a commit that referenced this pull request May 24, 2023
* Adding test case for invalid placeholder.

* Adding grid-based gap filling algorithm to generate placeholders.

* Compare results regardless of order in array.

* Avoid `continue`.

* Only add placeholders which are wide enough, skip empty rows.

* Removing debug printer.

* Adding changelog snippet.

(cherry picked from commit f79fb78)
linuspahl pushed a commit that referenced this pull request May 24, 2023
* Use grid-based gap detection for placeholder creation. (#15545)

* Adding test case for invalid placeholder.

* Adding grid-based gap filling algorithm to generate placeholders.

* Compare results regardless of order in array.

* Avoid `continue`.

* Only add placeholders which are wide enough, skip empty rows.

* Removing debug printer.

* Adding changelog snippet.

(cherry picked from commit f79fb78)

* Fixing up changelog snippet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants