Skip to content

setting: Add optional footers outside group surfaces - #3133

Open
AprilNEA wants to merge 1 commit into
longbridge:mainfrom
AprilNEA:feat/setting-group-footer
Open

AprilNEA wants to merge 1 commit into
longbridge:mainfrom
AprilNEA:feat/setting-group-footer

Conversation

@AprilNEA

Copy link
Copy Markdown

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 uses the variant's default horizontal content inset; callers control its typography and color. In Settings, it scrolls and filters with its group without adding a sidebar entry or independently searchable item.

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.

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.

Screenshot

Footer outside the filled GroupBox

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.

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