toToolbarTestTag

Derives a Compose testTag from an R.id by resolving its resource entry name (e.g. R.id.pspdf__menu_option_search"pspdf__menu_option_search").

This is the mechanical bridge for customers migrating Espresso withId(R.id.x) matchers to Compose onNodeWithTag("x") (P1-12 / ESPRESSO-1): the derived tag string is identical to the legacy resource entry name, so the rewrite is a one-to-one find-and-replace.

Auto-applied to every toolbar item by Modifier.toolbarItemSemantics. Because it runs for every item — including custom items whose id is View.NO_ID or an integer that isn't a registered resource — it never throws: an id without a resolvable resource name falls back to a stable, deterministic synthetic tag so a custom item can still be targeted by tag and never crashes the toolbar.