Skip to content

Plumb isSelectable into ApplyItemContentInfo#623

Open
RoyalPineapple wants to merge 2 commits into
mainfrom
RoyalPineapple/plumb-isselectable-info
Open

Plumb isSelectable into ApplyItemContentInfo#623
RoyalPineapple wants to merge 2 commits into
mainfrom
RoyalPineapple/plumb-isselectable-info

Conversation

@RoyalPineapple

@RoyalPineapple RoyalPineapple commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Why

A ListableUI item's selection behavior lives in its wrapper — Item.selectionStyle drives the tap handling, highlight, and selection state at the list level. The contained ItemContent view that actually renders on screen has no way to know that its surrounding cell is interactive.

That's a problem for accessibility: when a row is tappable, the content view often needs to represent that itself (for example by applying the .button accessibility trait so VoiceOver announces the row as actionable). Without this signal, the content view is blind to the interaction happening in its wrapper and can't reflect it.

What

Adds an isSelectable flag to ApplyItemContentInfo, so a content view is told — at apply(to:for:with:) time — whether the item it lives in is interactive.

It's populated in PresentationState.ItemState.applyTo from selectionStyle.isSelectable:

  • true for .tappable, .selectable, and .toggles
  • false for .notSelectable

Live selection/highlight state is already available via info.state; this fills the remaining gap of "is this row interactive at all." No trait is forced at the ListableUI/Blueprint level — what to do with the signal stays each content view's call.

TBHFUZZ-165

Checklist

Please do the following before merging:

  • Ensure any public-facing changes are reflected in the changelog. Include them in the Main section.

This issue was discovered via agentic fuzz testing using The Button Heist.

🤖 Generated with Claude Code

Add an `isSelectable` property to `ApplyItemContentInfo`, populated from
the item's `selectionStyle.isSelectable`. This lets content views know
when an item is interactive (`.tappable`, `.selectable`, `.toggles`) so
they can represent themselves accordingly, e.g. by applying the `.button`
accessibility trait for VoiceOver.

TBHFUZZ-165

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@RoyalPineapple RoyalPineapple force-pushed the RoyalPineapple/plumb-isselectable-info branch from 4b2dc6e to c2f8aef Compare June 4, 2026 15:27
Drops the `= false` default on the new public `isSelectable` property so it
matches the sibling `isReorderable` (no default) and makes any future internal
construction site that omits it a compile-time error rather than a silent
wrong default.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@RoyalPineapple RoyalPineapple marked this pull request as ready for review June 4, 2026 15:54
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