Skip to content

settings: Use vertical layout when container is small#2564

Merged
huacnlee merged 2 commits into
mainfrom
setting-layout
Jul 13, 2026
Merged

settings: Use vertical layout when container is small#2564
huacnlee merged 2 commits into
mainfrom
setting-layout

Conversation

@huacnlee

@huacnlee huacnlee commented Jul 13, 2026

Copy link
Copy Markdown
Member

Description

Use GPUI container_query on the settings content panel to make setting fields responsive to their available width. At 480px or narrower, horizontal title/field rows switch to a stacked vertical layout while explicitly vertical items remain unchanged. The resolved layout is also passed to field renderers.

The GPUI update also makes auto-sized window roots fill the viewport. Update the scrollable auto-height test fixture so the simulated dialog panel is a descendant of an explicit viewport root, matching real application structure.

How to Test

  • cargo check -p gpui-component
  • cargo test -p gpui-component --lib — 313 passed
  • Resize the Settings content panel above and below 480px and verify fields switch between side-by-side and stacked layouts.

Checklist

  • I have read the CONTRIBUTING document and followed the guidelines.
  • Reviewed the changes in this PR and confirmed AI generated code is accurate.
  • Passed cargo run for story tests related to the changes.
  • Tested macOS, Windows and Linux platforms performance (not platform-specific).

Co-authored-by: Codex <codex@openai.com>
@huacnlee huacnlee changed the title feat(settings): stack fields in narrow containers settings: Use vertical layout when container is small Jul 13, 2026
@huacnlee
huacnlee enabled auto-merge (squash) July 13, 2026 11:05
GPUI now stretches auto-sized window roots to the viewport. Keep the auto-height panel under an explicit viewport root so the test continues to exercise descendant intrinsic sizing.

Co-authored-by: Codex <codex@openai.com>
@huacnlee
huacnlee disabled auto-merge July 13, 2026 11:31
@huacnlee
huacnlee enabled auto-merge (squash) July 13, 2026 11:31
@huacnlee
huacnlee merged commit b004e59 into main Jul 13, 2026
3 checks passed
@huacnlee
huacnlee deleted the setting-layout branch July 13, 2026 11:32
boboshan added a commit to neath-audio/gpui-component that referenced this pull request Jul 14, 2026
boboshan added a commit to neath-audio/gpui-component that referenced this pull request Jul 14, 2026
Upstream longbridge#2564 (settings vertical-small layout) uses gpui::container_query,
added after the previous pin c545fb67. Bump the fork's gpui pin to the rev
upstream's Cargo.lock resolves so the merged tree compiles.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant