Skip to content

[core] Correct the expanded state exposed by Section - #8296

Open
maximilliangrand wants to merge 2 commits into
palantir:developfrom
maximilliangrand:codex/section-expanded-state
Open

maximilliangrand wants to merge 2 commits into
palantir:developfrom
maximilliangrand:codex/section-expanded-state

Conversation

@maximilliangrand

@maximilliangrand maximilliangrand commented Oct 7, 2026 •

Copy link
Copy Markdown

Checklist

  • Includes tests
  • Update documentation (changelog entry and existing Storybook assertions updated)

Changes proposed in this pull request:

A collapsible Section currently exposes aria-expanded="false" when its content is open and "true" when closed. This contradicts both the visible state and the control's accessible name.

Use !isCollapsed for aria-expanded, matching the state passed to Collapse and the ARIA disclosure pattern. Correct the existing unit and Storybook expectations, and cover mouse/Enter/Space activation plus controlled updates.

Reviewers should focus on:

The expanded state should follow the rendered content. In controlled mode, invoking onToggle should leave the state unchanged until isOpen changes.

Validation on macOS, Node 26.7.0:

  • Section Vitest suite: 5 passed / 9 failed before, 14 passed after.
  • Core test TypeScript check: passed.
  • ESLint for the component and unit tests, Prettier for all changed files, and git diff --check: passed.
  • Storybook play tests and the full suite were not run. Type-aware lint including the story exceeded an imposed 512 MiB heap limit; its three expectation changes were reviewed separately.

AI assistance was used for implementation, tests, and review.

Screenshot

No visual change. This corrects the control's exposed expanded state.

@palantirtech

Copy link
Copy Markdown
Member

Thanks for your interest in palantir/blueprint, @maximilliangrand! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

@changelog-app

changelog-app Bot commented Oct 7, 2026

Copy link
Copy Markdown

Generate changelog in packages/core/changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

[core] Correct the expanded state exposed by Section

Check the box to generate changelog(s)

  • Generate changelog entry

This branch has not been deployed

No deployments
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