Skip to content

feat(iOS, SplitView): Add API for organizing columns #3003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
Jul 21, 2025

Conversation

t0maboro
Copy link
Contributor

@t0maboro t0maboro commented Jul 16, 2025

Description

Closes https://github.com/software-mansion/react-native-screens-labs/issues/229

In this PR, I'm adding new APIs for SplitView column management. I updated SplitViewScreen component export to separate Column which is rendered as typical SplitViewColumn and Inspector which in some cases might be rendered as modal. Additionally, I'm adding a prop to Host for toggling inspector, at the moment it's really laggy, but I'm leaving it as a followup.

In this PR we also noticed that the logic for updating props needs to be updated. For number of columns management we need to delay SplitViewHostController initialization until we'll receive reactSubviews from the initial render. This is causing a problem, when 1st updateProps call is coming, because if inspector should be displayed, we need to notify the component about that fact. Therefore, this logic was rewritten to collect all prop updates in batch, create controller on 1st updateProps call and notify controller to flush updates on didMount.

Changes

  • Updated SplitViewBaseApp
  • Changed the logic for props updates
  • Added showInspector prop to host component
  • Added columnType prop to screen component
  • Added assertions for unexpected column manipulations
  • Updated JS definitions

Test code and steps to reproduce

Updated SplitViewBaseApp

inspector-mobile.mov
inspector-tablet.mov

Checklist

  • Included code example that can be used to test this change
  • Ensured that CI passes

@t0maboro t0maboro changed the base branch from main to @t0ms0n00/split-shows-secondary-only-button July 16, 2025 16:29
@t0maboro t0maboro self-assigned this Jul 16, 2025
@t0maboro t0maboro force-pushed the @t0ms0n00/split-shows-secondary-only-button branch from 4a90c74 to 4ccfd22 Compare July 16, 2025 19:53
@t0maboro t0maboro force-pushed the @t0ms0n00/toggle-inspector branch from 749b327 to d88a21b Compare July 16, 2025 19:54
@t0maboro t0maboro force-pushed the @t0ms0n00/split-shows-secondary-only-button branch from 4ccfd22 to 51eec95 Compare July 16, 2025 21:49
@t0maboro t0maboro force-pushed the @t0ms0n00/toggle-inspector branch from d88a21b to df6af72 Compare July 16, 2025 22:02
Base automatically changed from @t0ms0n00/split-shows-secondary-only-button to main July 17, 2025 06:01
@t0maboro t0maboro force-pushed the @t0ms0n00/toggle-inspector branch 2 times, most recently from 692b84a to 04ee9c3 Compare July 17, 2025 11:05
@t0maboro t0maboro force-pushed the @t0ms0n00/toggle-inspector branch from d9aa9fa to c6be87a Compare July 17, 2025 14:34
Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a series of remarks. This looks good overall.

@t0maboro t0maboro requested a review from kkafar July 21, 2025 09:29
@t0maboro t0maboro force-pushed the @t0ms0n00/toggle-inspector branch from 737cda8 to 415cfb0 Compare July 21, 2025 10:00
Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last few remarks, and we shoudl be good!

Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include verbally agreed adjustments & let's go. Thank you!

@t0maboro t0maboro merged commit c6afcc2 into main Jul 21, 2025
6 of 12 checks passed
@t0maboro t0maboro deleted the @t0ms0n00/toggle-inspector branch July 21, 2025 13:53
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.

3 participants