Skip to content

setting: Add optional footers outside group surfaces - #3133

Merged
huacnlee merged 2 commits into
longbridge:mainfrom
AprilNEA:feat/setting-group-footer
Sep 20, 2026
Merged

huacnlee merged 2 commits into
longbridge:mainfrom
AprilNEA:feat/setting-group-footer

Conversation

@AprilNEA

@AprilNEA AprilNEA commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Description

Settings sometimes need supporting text below a group, outside its background or border. A custom SettingItem still renders inside that surface.

This adds an optional footer to GroupBox and exposes it through SettingGroup. The footer shares the title's leading edge, sits 8 px under the surface on its own gap, and renders as small muted text like a description, so callers pass plain content. In Settings, it scrolls and filters with its group without adding a sidebar entry or independently searchable item; a group still needs at least one item to be shown.

Existing groups without footers are unchanged. Includes gallery examples, English/Chinese documentation, and a search-visibility regression test. No gpui-base changes.

Public API

gpui-component

GroupBox::footer(self, footer: impl IntoElement) -> Self

Adds supporting content below and outside the group's surface, aligned with the title and styled as small muted text.

SettingGroup::footer<F, E>(self, footer: F) -> Self
where
    E: IntoElement,
    F: Fn(&mut Window, &mut App) -> E + 'static

Renders a group footer using the current window and application context.

Both additions are optional and backward compatible.

How to Test

Passed on Linux with Rust 1.98.1:

cargo fmt --all -- --check
cargo test -p gpui-component --locked
cargo clippy -p gpui-component -p gpui-component-story \
  --all-targets --no-default-features --locked -- -D warnings
cargo build -p gpui-component-story --no-default-features --locked
python3 script/check-ai docs
git diff --check
  • 580 tests passed, including footer visibility when a group is filtered out and restored.
  • Ran the GroupBox and Settings stories under X11/OpenGL. Inspected Normal, Outline, and Fill variants, Font navigation, and a narrower window.
  • To reproduce, open the Settings story, change Group Variant, and select Font.
  • Not run locally: macOS/Windows rendering or the full workspace CI matrix.

Co-authored-by: Xuan Zhang <xuan@arcbox.dev>
Copilot AI lite review requested due to automatic review settings September 19, 2026 06:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Address the Outline inset issue and add GroupBox variant coverage.

Review effort: Lite
Findings: None

What changed in this PR

Adds optional footers to GroupBox and SettingGroup, keeping footer content outside group surfaces while preserving settings filtering and scrolling.

Changes:

  • Added GroupBox::footer and SettingGroup::footer APIs.
  • Added search-visibility regression coverage.
  • Updated stories and English/Chinese documentation.
File Reviewed changes
website/​zh-CN/​component/​settings.md Documents SettingGroup footers in Chinese.
website/​zh-CN/​component/​group-box.md Documents GroupBox footers in Chinese.
website/​component/​settings.md Documents the SettingGroup footer API.
website/​component/​group-box.md Documents the GroupBox footer API.
crates/​story/​src/​stories/​settings_story.rs Demonstrates settings footers.
crates/​story/​src/​stories/​group_box_story.rs Demonstrates GroupBox footers.
crates/​component/​src/​setting/​tests.rs Tests footer visibility during filtering.
crates/​component/​src/​setting/​group.rs Exposes callback-based setting footers.
crates/​component/​src/​group_box.rs Adds variant-aware footer rendering; the Outline inset should account for the surface border, with automated coverage for all variants.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

The footer shares the title's leading edge instead of the content inset,
which also removes the one-pixel drift under the Outline border. It sits
8 px under the surface on its own gap, independent of the root gap a
caller may override, and renders as small muted text like a description
so callers pass plain content.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@huacnlee
huacnlee enabled auto-merge (squash) September 20, 2026 13:20
@huacnlee

Copy link
Copy Markdown
Member

Welcome to join gpui-kit party.

@huacnlee
huacnlee merged commit cc05eb7 into longbridge:main Sep 20, 2026
12 checks passed
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.

3 participants