Skip to content

fix(ios): distinguish split expansion in display-mode events - #1

Open
PixPMusic wants to merge 1 commit into
pingdotgg:t3/mainfrom
PixPMusic:pixpmusic/fix-split-display-mode-traits
Open

PixPMusic wants to merge 1 commit into
pingdotgg:t3/mainfrom
PixPMusic:pixpmusic/fix-split-display-mode-traits

Conversation

@PixPMusic

@PixPMusic PixPMusic commented Oct 11, 2026 •

Copy link
Copy Markdown

Description

On the iOS 27.1 RC1 Duo simulator, the split host reports oneBesideSecondary → secondaryOnly while expanding, before the primary column appears and before onExpand. At that point UIKit still reports isCollapsed = YES, although the host's current horizontal size class is regular. A consumer tracking only collapse/expand completion can therefore mistake expansion for a compact Back action and clear the selected thread.

Expose the host's current horizontalSizeClass on the existing onDisplayModeWillChange event. This is a prerequisite for the T3 navigation fix; the library change alone does not change navigation or toolbar placement. It adds no new event or delegate and does not change completion-event semantics.

Changes

Pass the current host trait into the existing Fabric event as compact, regular, or unspecified, and expose the same union in the public event type. No package-version bump or release archive is included.

Test plan

Library TypeScript, scoped ESLint/Prettier, native formatting and Fabric code generation passed. A local test archive applied only this source change to the T3 app's existing t3.17 dependency, and the SDK 27.1 simulator native build passed.

LLDB confirmed regular traits with stale isCollapsed = YES during expansion, and compact traits during a real folded Back. A consumer using the payload passed two cycles of folded Back → select another thread → unfold → fold, with the selected thread visible throughout. The event trace shows horizontalSizeClass: regular before primary appearance during expansion; the router no longer pops there.

Consumer evidence: main reproduces the hidden second selection; the companion consumer opens both selections. This is the same folded Duo, fixture and theme. The recordings demonstrate the native prerequisite together with the app router reconciliation, not a standalone library UI change.

Minimal consumer probe:

import React from 'react';
import { Button, Text, View } from 'react-native';
import { Split, type SplitHostCommands } from 'react-native-screens';

export default function SplitTraitProbe() {
  const host = React.useRef<SplitHostCommands>(null);
  return (
    <Split.Host
      ref={host}
      preferredDisplayMode="oneBesideSecondary"
      onDisplayModeWillChange={({ nativeEvent }) => console.log(nativeEvent)}
      onCollapse={() => console.log('collapse')}
      onExpand={() => console.log('expand')}>
      <Split.Column>
        <View style={{ flex: 1 }}>
          <Text>Primary</Text>
          <Button title="Open detail" onPress={() => host.current?.show('secondary')} />
        </View>
      </Split.Column>
      <Split.Column>
        <View style={{ flex: 1 }}>
          <Text>Detail</Text>
          <Button title="Back to primary" onPress={() => host.current?.show('primary')} />
        </View>
      </Split.Column>
    </Split.Host>
  );
}

Open a thread while unfolded, fold, press Back, select another thread, and unfold. Inspect the expansion event before primary appearance; its size class should be regular. Android does not implement this iOS split host. The final app dependency update must wait for a maintainer release/archive from t3/main.

Model: GPT-6.1 Sol | Harness: Codex in T3 Code

@PixPMusic

Copy link
Copy Markdown
Author

@juliusmarminge This is the native prerequisite for the reproducible Duo navigation bug: expansion currently looks like a compact Back to the consumer until the late onExpand callback. The current trait payload was verified in a rebuilt SDK 27.1 client and two full folded Back/select/unfold/fold cycles. If accepted, the T3 app needs a released archive containing it before its dependency update can be ready. This PR does not move controls or change the UI layout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant