toolbar Item Semantics
The single accessibility contract for every toolbar item (A11Y-1 / P1-6).
Applied at the leaf composable of each item by NutrientToolbarLayout; producers never call it directly. Centralizing it means a11y review is a one-time design exercise instead of per-PR vigilance, and it matches or exceeds the View toolbar's AppCompatImageButton baseline.
It sets, from item and its state:
Role —
Role.Switchfor a ToolbarItem.Toggle,Role.Buttonotherwise.contentDescription —
item.contentDescription(the label TalkBack reads).stateDescription —
"on"/"off"for a toggle; otherwise"selected","disabled","selected and disabled", or unset when the item is in its default state.testTag — derived from
item.idvia toToolbarTestTag (closes P1-12: customers map per-buttonR.idEspresso matchers toonNodeWithTagmechanically).disabled() + 38% alpha when not enabled; hidden from accessibility when not visible.
an onClick label (
"Activate …", or"Open … menu"for a submenu) so TalkBack reads a meaningful action; the actual click is handled by the host composable'sclickable.
It's @Composable because the test tag is resolved from the R.id resource name, which needs a Context (LocalContext).
Note: ToolbarItem.Submenu expanded/collapsed announcement is deferred to the popup layer (it depends on transient expansion state not held by ToolbarItem).