Skip to content

Comments

fix(greenhouse): prevent wide content from causing page-level horizontal scrollbar#1477

Open
edda wants to merge 2 commits intomainfrom
edda-fix-greenhouse-layout-overflow
Open

fix(greenhouse): prevent wide content from causing page-level horizontal scrollbar#1477
edda wants to merge 2 commits intomainfrom
edda-fix-greenhouse-layout-overflow

Conversation

@edda
Copy link
Contributor

@edda edda commented Feb 20, 2026

Summary

Fixes #1476

This PR addresses the layout issue where wide content in the YamlViewer component (and potentially other components) causes the entire Greenhouse shell to expand horizontally, resulting in a page-level scrollbar.

Changes

  • YamlViewer.tsx: Add overflow-x-auto max-w-full to container for component-level scrolling
  • styles.css: Change #root from display: inline to display: flex with min-width: 0 to establish constraint foundation
  • ShellLayout.tsx: Add min-w-0 constraint chain and overflow-x-auto catch-all on main content area

How it works

The fix uses a min-w-0 constraint chain from #root down through the shell layout. In CSS flexbox/grid, the default min-width: auto prevents items from shrinking below their content size. Adding min-w-0 allows containers to respect their parent boundaries.

Before:  viewport → #root (inline) → Shell → Content pushes everything wider
After:   viewport → #root (flex, min-w-0) → Shell (min-w-0) → greenhouse-main (overflow-x-auto)

Graceful degradation

Scenario Behavior
Component handles overflow (e.g., YamlViewer) Scrolls within component
Component doesn't handle overflow Scrolls within greenhouse-main
Page-level No scrollbar

Why NOT overflow-hidden at layout level?

Juno UI components use portals for Modals, Select dropdowns, ComboBox, PopupMenus, and Tooltips. Adding overflow-hidden to layout containers would clip these portaled elements. The min-w-0 + overflow-x-auto approach avoids this issue.

Test plan

  • Navigate to a PluginPresets detail page with wide YAML content
  • Verify YamlViewer scrolls horizontally within itself
  • Verify no page-level horizontal scrollbar appears
  • Test Select dropdowns still work correctly
  • Test any modals/tooltips are not clipped
  • Test browser window resize maintains constrained layout

…tal scrollbar

Add min-w-0 constraint chain to layout containers and overflow-x-auto
to catch unhandled wide content. This prevents components like
YamlViewer from pushing the shell layout wider.

Changes:
- styles.css: Change #root from display:inline to flex with min-width:0
- ShellLayout: Add min-w-0 to grid and wrapper, overflow-x-auto to main
- YamlViewer: Add overflow-x-auto and max-w-full to container
@edda edda requested a review from a team as a code owner February 20, 2026 17:12
@changeset-bot
Copy link

changeset-bot bot commented Feb 20, 2026

🦋 Changeset detected

Latest commit: a0c3b46

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudoperators/juno-app-greenhouse Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

[Bug](greenhouse): Wide content in YamlViewer causes page-level horizontal scrollbar

2 participants