Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): keep iOS home header stable #8467

Mergedjuliusmarmingemerged 2 commits intomain fromrefs/pull/8467/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Problem

The iOS home header could render without its React-backed brand, and opening the ellipsis menu could leave a large empty Liquid Glass capsule. Our react-native-screens patch skipped header-item reuse whenever a custom React header subview existed, so routine updates rebuilt live UIKit bar-button views during transitions.

Fix

  • collect React-backed header items without clearing or incrementally mutating the live UINavigationItem
  • include stable native item identities in the cache key
  • preserve item groups when configs and views are unchanged, while rebuilding remounted or changed views
  • retain the legacy rebuild path before iOS 16 and refresh the pnpm patch hash

Verification

  • vp i --frozen-lockfile
  • vp run --filter @t3tools/mobile typecheck
  • git diff --check
  • verified the installed mobile dependency contains the patched native implementation
  • iOS runtime verification is pending because this worktree is running on Linux

Visual evidence

Empty headerStranded Glass transition
Empty iOS home headerExpanded empty menu capsule

These are the supplied before/reproduction states. After evidence requires an iOS runtime and is pending device or simulator verification.

This is mobile iOS-only; Android, web, and desktop are unaffected.

Generated with GPT-5.6 Sol in T3 Code through the Codex harness.


Note

Medium Risk Touches native iOS navigation header wiring and caching in a vendored dependency; incorrect reuse could leave stale buttons or missed updates, though pre-iOS 16 keeps the legacy rebuild path.

Overview Updates the react-native-screens@4.25.2 patch so routine header refreshes stop tearing down and rebuilding live UINavigationItem bar buttons when the home screen mixes JS bar-button configs with React header subviews (e.g. a custom brand).

Header application: updateViewController no longer clears leftBarButtonItems / rightBarButtonItems at the start of the subview pass. Left/right subview items are collected into local arrays and merged via barButtonItemsFromConfigs:withCurrentItems: instead of incrementally mutating the navigation item during the loop.

Reuse / cache: The associated-object cache key now retains the config object and includes subview-backed item arrays, so unchanged configs and stable native subview identities can skip rebuild on iOS 16+. Rebuilt groups go through leadingItemGroups / trailingItemGroups (and centerItemGroups on iOS 26+) rather than replacing flat item arrays mid-transition—aimed at empty headers and stuck Liquid Glass menu capsules during UIKit animations.

Lockfile: pnpm-lock.yaml patch hash for react-native-screens@4.25.2 is refreshed to match the updated patch.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit bc972e6f7090f9be5c057893149ddb5f0253ad96. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Keep iOS home header stable by reusing UINavigationItem bar button items

Patches RNSScreenStackHeaderConfig.updateViewController in react-native-screens to avoid rebuilding header bar button items when the config and subview-provided items are unchanged.

  • Introduces a composite cache key (headerItemsKey) covering config arrays and collected subview items, compared against a stored associated object on UINavigationItem.
  • On iOS 16+, reuses previously-applied items when the key matches; assigns leadingItemGroups, trailingItemGroups, and (iOS 26+) centerItemGroups via a new barButtonItemGroupsFromItems helper.
  • Subview-backed items are collected into mutable arrays and merged through barButtonItemsFromConfigs instead of appending incrementally.
  • Behavioral Change: on grouped-item paths, leftBarButtonItems/rightBarButtonItems are no longer cleared to nil; the stored associated object is always set to the new key (no longer conditionally nil).
Macroscope summarized bc972e6.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 02f564f0-109e-44da-9e78-3005cdca6aa8

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. github-actions[bot](GitHub profile, opens in a new tab) added labels📱 Native Change

    4. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.3 KiB13.3 KiB+83 B (+0.6%)15.1 KiB✅
      CodexThread snapshot wire6.9 KiB6.9 KiB+1 B (+0.0%)7.3 KiB✅
      CodexLive turn WebSocket wire6.4 KiB6.5 KiB+82 B (+1.3%)7.8 KiB✅
      CodexLive turn WebSocket decoded55.5 KiB55.6 KiB+88 B (+0.2%)66.4 KiB✅
      CodexLive turn messages911+2 (+22.2%)21✅
      ClaudeTotal thread wire13.3 KiB13.3 KiB−11 B (−0.1%)15.1 KiB✅
      ClaudeThread snapshot wire6.9 KiB6.9 KiB+10 B (+0.1%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.4 KiB6.4 KiB−21 B (−0.3%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded56.4 KiB56.4 KiB−44 B (−0.1%)66.4 KiB✅
      ClaudeLive turn messages1110−1 (−9.1%)21✅

      Baseline: 94401d0 · PR result: bc972e6 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 109.4 KiB
      • Claude decoded thread snapshot: 110.1 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    5. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at bc972e6

      Macroscope's review found this PR approvable — This is a focused iOS navigation-header bug fix that stabilizes existing UIKit bar-button views through bounded identity-aware reuse, with legacy behavior preserved on older platforms. The accompanying lockfile changes only refresh the dependency patch hash.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    6. juliusmarminge merged thisb982847

    7. juliusmarminge closed this

Sign in to join this conversation.