Skip to content

fix: prevent horizontal orientation from collapsing to zero height#210

Merged
paodb merged 1 commit intomasterfrom
fix-orientation-switch
May 6, 2026
Merged

fix: prevent horizontal orientation from collapsing to zero height#210
paodb merged 1 commit intomasterfrom
fix-orientation-switch

Conversation

@ngonzalezpazFC
Copy link
Copy Markdown
Contributor

@ngonzalezpazFC ngonzalezpazFC commented Apr 17, 2026

Close #201

Summary by CodeRabbit

  • Bug Fixes
    • Improved grid layout styling to fix container sizing and orientation, resulting in more consistent component display and better responsiveness.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b66da008-8a75-4df1-bea2-f8ab9777bf7f

📥 Commits

Reviewing files that changed from the base of the PR and between 8a4d250 and 53846b8.

📒 Files selected for processing (1)
  • src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java

Walkthrough

Updated inline layout styles in TwinColGrid to change flex-basis values from 1 1 0px to 1 1 auto and replace a min-width constraint with min-height for the vertical container; no API, control flow, or public declarations were changed.

Changes

TwinColGrid layout fixes

Layer / File(s) Summary
Layout style adjustment
src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java
In horizontal container: flex-basis changed from 1 1 0px to 1 1 auto.
Vertical container constraint
src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java
In vertical container: replaced min-width with min-height and changed flex-basis from 1 1 0px to 1 1 auto.
Context / Integration
src/main/java/.../TwinColGrid.java (same file)
No changes to control flow, method signatures, or public API; edits are confined to inline style strings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • mlopezFC
  • paodb
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main fix: preventing horizontal orientation from collapsing to zero height, which directly addresses the core issue being resolved.
Linked Issues check ✅ Passed The PR implements the exact fix proposed in issue #201: changing flex-basis from '1 1 0px' to '1 1 auto' in both containers and fixing min-width to min-height in createVerticalContainer.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the horizontal orientation collapse issue; no unrelated modifications or side effects are introduced.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-orientation-switch

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@javier-godoy
Copy link
Copy Markdown
Member

javier-godoy commented Apr 30, 2026

on hl was intentionally introduced in 457ce76 (Aug 2020) alongside flex: 1 1 0px to fix #15 (fixed height support). Replacing it with min-width: 0px removes a load-bearing property.

Both containers always live inside TwinColGrid, which extends VerticalLayout (a flex column). In that context, min-width: 0 has no effect — min-width: auto on a block-level flex item in a column already resolves to zero. It has been a no-op in createVerticalContainer since it was introduced in ccbd69c (Sep 2021).

The actual root cause of the collapse is flex-basis: 0px in flex: 1 1 0px. When TwinColGrid has no defined height, the inner container starts at zero and has nothing to grow into.

A correct fix:

  • Change flex: 1 1 0pxflex: 1 1 auto in both createHorizontalContainer and createVerticalContainer
  • Keep min-height: 0px in both (it is correct for flex items in a column and still needed for fixed-height support)
  • Fix createVerticalContainer's min-width: 0pxmin-height: 0px while at it

With flex-basis: auto, the container starts from its natural content height, so there is no collapse when TwinColGrid has no defined height. min-height: 0 still allows shrinking below content size when a fixed height is set on TwinColGrid.

Could you test with this approach?

Generated with Claude

@ngonzalezpazFC ngonzalezpazFC force-pushed the fix-orientation-switch branch from 8a4d250 to 2f0860c Compare May 6, 2026 13:37
Replaces flex:1 1 0px with flex:1 1 auto in both the horizontal and vertical inner containers so TwinColGrid renders at its natural height when no explicit height is set.
Corrects the no-op min-width:0px to min-height:0px in the vertical container.

Close #201
@ngonzalezpazFC ngonzalezpazFC force-pushed the fix-orientation-switch branch from 2f0860c to 53846b8 Compare May 6, 2026 13:39
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

@javier-godoy
Copy link
Copy Markdown
Member

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@javier-godoy javier-godoy requested review from paodb and scardanzan May 6, 2026 16:04
Copy link
Copy Markdown
Member

@paodb paodb left a comment

Choose a reason for hiding this comment

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

Tested and it's working as expected.

@paodb paodb merged commit 741f4c7 into master May 6, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from To Do to Pending release in Flowing Code Addons May 6, 2026
@paodb paodb deleted the fix-orientation-switch branch May 6, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending release

Development

Successfully merging this pull request may close these issues.

Horizontal orientation breaks

3 participants