Skip to content

Add gridbox children to children_ #1070

Open
KenReneris wants to merge 2 commits intoArthurSonzogni:mainfrom
KenReneris:main
Open

Add gridbox children to children_ #1070
KenReneris wants to merge 2 commits intoArthurSonzogni:mainfrom
KenReneris:main

Conversation

@KenReneris
Copy link
Copy Markdown
Contributor

Fix so layout will iterate when there's a flex element inside of a gridbox that grows it's box size on the y axis. (Allows need_iteration_ to work from Flexbox::SetBox() that's within the grid so that layout will re-run as the box grows)

Copy link
Copy Markdown
Owner

@ArthurSonzogni ArthurSonzogni left a comment

Choose a reason for hiding this comment

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

Thanks!

It looks like there is definitely a bug that this patch is fixing (adding elements as children). However I do not understand the parts about flexbox_helper.

Comment thread src/ftxui/dom/table.cpp
// Cells
if ((x % 2) == 1 && (y % 2) == 1) {
it = std::move(it) | flex_shrink;
// it = std::move(it) | flex_shrink; //it = std::move(it) | flex_shrink;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Could you please remove the comment line and explain why removing this? (This sounds wrong to me)

};

void Compute(std::vector<Element>* elements, int target_size);
void Compute(std::vector<Element>* elements, int target_size, bool hack=false);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why do you need hack? What is this?

Comment thread src/ftxui/dom/gridbox.cpp
for (const auto &element : line) {
children_.push_back( element );
}
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This sounds useful to support flexbox and selection. Thanks!

Is there any regression tests in gridbox_test.cpp we could add to show the impact of this patch?

@ArthurSonzogni ArthurSonzogni force-pushed the main branch 2 times, most recently from 3bdbccd to 11f7132 Compare August 27, 2025 16:51
ArthurSonzogni added a commit that referenced this pull request Feb 15, 2026
This ensures that the gridbox implements correctly the non overriden functions
from the base class.

Thanks to @KenReneris for the report and the patch.

Bug:#1070
@ArthurSonzogni
Copy link
Copy Markdown
Owner

I merged the first part of this patch!

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.

2 participants