Skip to content

feat(macos): port RedBox 2.0 to AppKit via RCTUIKit compatibility primitives - #3054

Open
Saad Najmi (Saadnajmi) wants to merge 21 commits into
microsoft:saadnajmi/0-85-redbox2-mergefrom
Saadnajmi:saadnajmi/0-85-redbox2-merge-appkit
Open

Saad Najmi (Saadnajmi) wants to merge 21 commits into
microsoft:saadnajmi/0-85-redbox2-mergefrom
Saadnajmi:saadnajmi/0-85-redbox2-merge-appkit

Conversation

@Saadnajmi

@Saadnajmi Saad Najmi (Saadnajmi) commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Current release stack

Depends on #3058. AppKit RedBox port; #3035 follows. V1 remains default and V2 native-opt-in.

Validation and backups

The branch-specific repaired source passed hardened immutable installation, constraints, and its complete release-helper selection. The selected 18-head packet records 1,406 passing helper tests. Exact source-tree equivalence is used for rewritten endpoints where applicable; the two changed linear RC checkpoints were tested separately.

Native/API evidence retains its recorded scope. The SwiftPM and RNTester repairs have six focused native build passes. Public stable versions and runtime/API contents were preserved except for the independently reviewed SwiftPM destination repair where applicable.

Public-registry lock correction passed all 18 hosted generation, hardened immutable, constraints, and metadata-audit jobs in run 35769816507. Only equivalent executable-path spelling changes are permitted; dependency versions, checksums, and ranges are unchanged. The previous functional test results remain applicable to this metadata-only correction. Fresh GitHub CI and review remain required. Previous heads are preserved on the same repository under backup/pre-ci-repair-20260922/<original-branch> and backup/pre-public-registry-20260922/<original-branch>; local complete-history bundles were verified as well.

The 0.87 PR sequence is one first-parent path: #3037#3104#3105#3106#3100#3101#3107. The redundant #3102/#3103 reviews are consolidated into #3105.

This section supersedes earlier stack order, source identity, and validation-status notes below.


Summary

This draft is stacked on #3058 and contains:

  1. reusable RCTUITableView, RCTUIButton, and RCTUILabel compatibility primitives
  2. the RedBox 2.0 AppKit port and reachability fix
  3. a RedBox 2.0 consumer refactor onto the shared primitives

The consumer refactor removes the local associated-object NSButton action category and the duplicated AppKit table implementation. RedBox 2.0 now uses the shared RCT-prefixed table datasource/delegate methods, cell builders, labels, buttons, and action bridge.

RCTUIKit provenance

Selected from #3056 in logical order:

  • fe71e06879c468ef143a720580a6ce306d2c6ac5
  • 553f1a27e698fd30f9c9c90d5f1bbe6a4bd8a64c
  • 7e3c010d42009816977ab6dd889280a565463ee9
  • bbc3c8abd573a27e981f51a126f86874b16714f3
  • d9d3cc59bd251f58f51f2fdff433edca4b4170f0
  • 6f7039b5a7fe4260ff3a7444f9010faecaaeb70f
  • d2b18ce148f0cf4bab2bd05a7fff755e553f4d45
  • a3f1e512c69ae63218be05b0a897b6f7ec3cb89d
  • f47aa235200567670303b8044107a4ef07fd7469
  • ddaf23958b5435d9a710be6e952414bf647ced43
  • the primitive-only RCTUITableView.m hunk from mixed commit 16689a363439fa4db08b387d08a030fa9fb6a890

The mixed inset commit was split only because its other hunk changes the V1 consumer. The retained primitive commit preserves the original author, message, and Co-authored-by trailer.

The native test file and all project target/file wiring are intentionally excluded per the repository owner's direct #3056 review comment 3670949171 ("We don't run native tests and can delete this"). This drops:

  • f7f6fa45f8e9d1385c936bd17fa142fd75e95202
  • b82f4de8900cb39ef29deca59c2b65d2116df97d
  • 19d39e57e0218be98683a14257b9f81d74e39c52

Deliberately excluded V1-only RCTRedBox.mm changes:

  • 786ebf4aba219d37c2cd623a4a6a78b768e8296e
  • 5734e2dc3b48665171c421f0d0ca24b50f8ec8da
  • 9d8dd2a6072ffe9a5bd323ea84efe38d2d5e1037
  • f20f454c5f58760fdedbe09728d76bd42dd26019
  • the RCTRedBox.mm hunk from 16689a363439fa4db08b387d08a030fa9fb6a890

#3056 remains unchanged.

Equivalence and fork reduction

Validation

  • RNTester macOS builds clean at this head: a from-scratch xcodebuild … -scheme RNTester-macOS build
    compiled 854 translation units — including RCTUITableView.m, RCTUIButton.m, RCTUILabel.m, and
    RCTRedBox2Controller.mm — and linked RNTester-macOS.app with zero compile or link errors
  • that run exits non-zero solely on the CocoaPods [CP] Check Pods Manifest.lock guard: the committed
    packages/rn-tester/Podfile.lock still pins hermes-v250829098.0.2 while .hermesv1version is
    hermes-v250829098.0.12, so a locally regenerated Pods/Manifest.lock disagrees with it. CI runs
    bundle exec pod install before building, which rewrites both files, so the guard passes there
  • repository lint, format check, and TypeScript checks passed
  • manual RedBox 2.0 GUI validation is not claimed

Fork CI does not execute native Objective-C unit tests: .github/workflows/test-all.yml is gated to github.repository == 'facebook/react-native', while .github/workflows/microsoft-build-rntester.yml invokes build-only RNTester schemes. Accordingly, no native test target is shipped, per repository-owner review comment 3670949171.

The head branch name still contains merge-appkit for historical reasons because GitHub cannot rename the head branch of an open pull request.

Final CI follow-up

This branch receives only these independently reviewed follow-up paths:

  • .github/scripts/__tests__/resolve-hermes-test.js
  • packages/react-native/ReactNativeApi.d.ts
  • packages/react-native/scripts/ios-prebuild/__tests__/hermes-test.js

The complete 16-head batch passed 92 recorded validation commands, including branch-specific API revalidation/generated TypeScript, full formatting checks, and combined targeted suites where applicable. Native changes are limited to the reviewed #3033 destination guards (also present in stable 0.85) and #3104's sidecar-copy correction (already present in its descendants). Exact source equivalence preserves earlier native results elsewhere. The public-registry lockfiles and package manifests remain byte-identical.

Previous heads are backed up at backup/pre-ci-followup-20260922/<original-branch> on their source repository. Fresh current-head CI remains required. The one-first-parent 0.87 sequence is preserved.

@Saadnajmi
Saad Najmi (Saadnajmi) force-pushed the saadnajmi/0-85-redbox2-merge-appkit branch from 3d47c9c to c631f74 Compare July 29, 2026 05:50
@Saadnajmi Saad Najmi (Saadnajmi) changed the title feat(macos): merge RN through RedBox 2.0 cutoff and port RedBox 2.0 to AppKit feat(macos): port RedBox 2.0 to AppKit via RCTUIKit compatibility primitives Jul 29, 2026
@Saadnajmi
Saad Najmi (Saadnajmi) changed the base branch from 0.85-merge to saadnajmi/0-85-redbox2-merge July 29, 2026 05:50
Saad Najmi (Saadnajmi) added a commit that referenced this pull request Jul 29, 2026
Import the final production bytes from PR #3054 tree be27899 for the six RCTUIKit table, label, button, and umbrella-header paths only.

Provenance: 8f279b5, 0758fae, c1e5784, c2ebe70, ca3135f, a02d20a, ac7aa63, 24f6059, cb3148a, 994efe8, e61b81c. Native RCTUITableView tests and RNTesterPods project changes are intentionally excluded.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Saad Najmi (Saadnajmi) added a commit that referenced this pull request Jul 29, 2026
Import the final RedBox 2.0 controller and ANSI parser bytes from PR #3054 tree be27899. The parser adaptation originates in c616 and the final consumer layer is represented by adapted commits b1c27df and 7976bf1.

The controller uses the shared RCTUIKit table, label, and button primitives. RCTRedBox.mm remains exclusively reconciled by the preceding 0.83 restoration and V1 AppKit commits.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Saadnajmi
Saad Najmi (Saadnajmi) marked this pull request as ready for review July 29, 2026 21:11
@Saadnajmi
Saad Najmi (Saadnajmi) requested a review from a team as a code owner July 29, 2026 21:11
Saad Najmi (Saadnajmi) added a commit that referenced this pull request Aug 5, 2026
Import the final production bytes from PR #3054 tree be27899 for the six RCTUIKit table, label, button, and umbrella-header paths only.

Provenance: 8f279b5, 0758fae, c1e5784, c2ebe70, ca3135f, a02d20a, ac7aa63, 24f6059, cb3148a, 994efe8, e61b81c. Native RCTUITableView tests and RNTesterPods project changes are intentionally excluded.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Saad Najmi (Saadnajmi) added a commit that referenced this pull request Aug 5, 2026
Import the final RedBox 2.0 controller and ANSI parser bytes from PR #3054 tree be27899. The parser adaptation originates in c616 and the final consumer layer is represented by adapted commits b1c27df and 7976bf1.

The controller uses the shared RCTUIKit table, label, and button primitives. RCTRedBox.mm remains exclusively reconciled by the preceding 0.83 restoration and V1 AppKit commits.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use AppKit-owned reuse preparation and automatic row heights, remove per-row measurement retention, avoid visibleRect coordinate overriding, and guard deselection against selection-query re-entry.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pin the compatibility content view to the AppKit cell so native automatic row heights can derive wrapped label intrinsic height at the actual cell width.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Apply private cell height constraints for explicit delegate heights while leaving automatic rows to AppKit intrinsic sizing and intercell spacing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refresh preferred wrapping widths when AppKit assigns cell frames so automatic height fitting sees the current content width before layout.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Constrain each lazily cached header to its declared slot height so AppKit automatic row sizing keeps the explicit header contract.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use NSTableViewRowSizeStyleCustom so NSTableCellView does not override the compatibility label constraints assigned through textField.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Associate one primitive-owned height constraint with each header view, deactivate it between reload generations, and update/reactivate it when a delegate reuses the view.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep 5pt vertical containment for subtitle cells and the RedBox stack carve-out so AppKit cannot clip glyph tops at row boundaries.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve validated per-branch source and corrected stack dependencies.
Preserve package versions and the linear stack; change only equivalent executable-path metadata.
Apply the independently reviewed branch-specific CI follow-up while preserving public-registry locks and the linear stack.
Apply the independently reviewed branch-specific CI follow-up while preserving public-registry locks and the linear stack.
Apply the independently reviewed branch-specific CI follow-up while preserving public-registry locks and the linear stack.
Apply the independently reviewed branch-specific CI follow-up while preserving public-registry locks and the linear stack.

This branch has not been deployed

No deployments
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.

2 participants