Skip to content

Add DisclosureGroup#64

Merged
colemancda merged 5 commits into
masterfrom
feature/disclosure-group
Jul 24, 2026
Merged

Add DisclosureGroup#64
colemancda merged 5 commits into
masterfrom
feature/disclosure-group

Conversation

@colemancda

Copy link
Copy Markdown
Member

DisclosureGroup — a label that expands to reveal its content. Supports a plain title or a view label, and either self-managed or bound expansion.

Shape

Emitted as one node whose children are [label..., content...], with a labelCount prop marking where the header ends and the body begins. Expansion has two modes:

  • self-managed (no binding) — the interpreter remembers the open/closed state locally; nothing crosses the bridge
  • bound (isExpanded:) — the header tap round-trips through a callback so Swift stays the source of truth, exactly like a Toggle

The interpreter draws a tappable header (label + a chevron that flips up/down) and shows the content only while expanded.

Verification

  • swift test — 3 new tests, 115 passing: the label/content boundary via labelCount, that an unbound group emits no expansion state (the interpreter owns it), the bound round-trip (onToggle flips isExpanded), and a Label view as the header.
  • Emulator (new "DisclosureGroup" screen), screenshot-checked:
    • self-managed: tapping "What's included" revealed its three bullets and flipped the chevron up
    • bound: tapping an external "Expand from outside" button opened the "Advanced settings" group — the binding drives expansion, not just header taps — and the button flipped to "Collapse from outside"
    • the third group renders a Label header (star + "Notifications") and stays collapsed with a down-chevron

Scope

DisclosureGroupStyle for custom presentation isn't modeled; the built-in header (label + chevron, content indented) is the only layout.

@colemancda
colemancda merged commit 8223c61 into master Jul 24, 2026
6 checks passed
@colemancda
colemancda deleted the feature/disclosure-group branch July 24, 2026 12:06
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