Skip to content

[Due for payment 2026-08-21] Migrate ActionableItemButtons to composition #98059

Description

@mountiny

Problem

ActionableItemButtons took its buttons as a serialized items: ActionableItem[] array and rendered them itself. That config-object indirection meant every caller had to build an array of {key, text, onPress, isPrimary} descriptors, push entries conditionally, and thread presentation concerns back through the component as props — shouldUseLocalization, primaryTextNumberOfLines, and a styles: {text, button} bag. The component also owned localization, calling translate(item.text as TranslationPaths) behind a boolean flag, which required an unsafe cast and left each call site unable to render anything a plain Button descriptor could not express.

Solution

Convert ActionableItemButtons to composition: it now accepts children and only owns layout, keeping layout (horizontal / vertical) plus a single style prop and dropping items, shouldUseLocalization, primaryTextNumberOfLines, the styles bag, and the exported ActionableItem type. Each of the six call sites in src/pages/inbox/report/actionContents/ now renders ButtonComposed children directly with <Button.Text>{translate(...)}</Button.Text>, so localization happens at the call site with properly typed keys, conditional buttons become ordinary JSX conditionals instead of array pushes, and per-button styling no longer travels through the container. Net effect is 409 additions against 388 deletions across 7 files with no user-visible change.

PR

#97905

Issue OwnerCurrent Issue Owner: @ZhenjaHorbach

Metadata

Metadata

Labels

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions