Skip to content

android: fix custom top bar button measurement#8320

Open
yedidyak wants to merge 3 commits into
masterfrom
yedidyak/android-title-button-measurement
Open

android: fix custom top bar button measurement#8320
yedidyak wants to merge 3 commits into
masterfrom
yedidyak/android-title-button-measurement

Conversation

@yedidyak
Copy link
Copy Markdown
Contributor

@yedidyak yedidyak commented Jun 1, 2026

Summary

  • Fix Android custom top bar React button fallback measurement to use bounded AT_MOST specs instead of forcing unspecified dimensions to actionBarSize.
  • Preserve explicit width / height behavior as exact dp sizing.
  • Add Robolectric coverage for intrinsic sizing, explicit sizing, bounded fallbacks, RTL bounded specs, and title width regression behavior.

Validation

  • git diff --check — passed.
  • Code review pass — clean; no sensitive files or unrelated changes found.

Not Run

  • cd playground/android && ./gradlew :react-native-navigation:testDebugUnitTest --tests '*TitleBarReactButtonView*' --tests '*TitleAndButtonsContainerTest*' — blocked because node_modules/@react-native/gradle-plugin is missing in this checkout.
  • yarn install --immutable — attempted to restore dependencies, but Yarn failed during fetch with repeated RequestError EBADF, so local Android unit tests could not be started.

Risks

  • Low to medium: scoped to Android top bar custom React button measurement.
  • Main compatibility risk is custom button components that unintentionally relied on the temporary default 48dp exact sizing when no dimensions were provided.

Review Context

  • This keeps the RTL fix's bounded-measurement property by avoiding UNSPECIFIED, but restores intrinsic-width behavior so buttons do not unnecessarily shrink the title area.
  • Height still falls back to actionBarSize when the parent provides no height; width falls back to screen width only as a non-zero bound.

Suggested Reviewers

  • @markdevocht — latest and dominant editor on the Android top bar button/title measurement code touched here.

artald
artald previously approved these changes Jun 1, 2026
@yedidyak yedidyak enabled auto-merge (squash) June 1, 2026 13:52
@yedidyak yedidyak requested a review from artald June 1, 2026 13:53
@yedidyak yedidyak added this pull request to the merge queue Jun 1, 2026
@yedidyak yedidyak removed this pull request from the merge queue due to the queue being cleared Jun 1, 2026
@yedidyak yedidyak enabled auto-merge (squash) June 1, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants