feat(rctuikit): Add RCTUITableView for RedboxV1 and RedboxV2 - #3056
Open
Saadnajmi wants to merge 20 commits into
Open
feat(rctuikit): Add RCTUITableView for RedboxV1 and RedboxV2#3056Saadnajmi wants to merge 20 commits into
Saadnajmi wants to merge 20 commits into
Conversation
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 the inset rounded message card while enabling real cell reuse, resetting reused row configuration, fixing the redbox-error identifier, and mapping nil messages through sections. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the existing AppKit attributed titles, key equivalents, borderless momentary style, layout, and selector actions while fixing accessibility identifiers and retaining block actions through RCTUIAction. 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>
Exercise AppKit-owned reuse preparation, real wrapped-label automatic sizing, spacing-aware fixed heights, SDK-relative inset geometry, accessibility-tree containment, and selection-query-safe deselection. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Skip invalid nil-message scrolling, restore selectable AppKit message and stack labels, and measure message rows against the scroll view content width while retaining iOS sizing. 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>
Put the macOS message fill and continuous corner radius back on NSTableCellView.layer, matching the baseline layer ownership and CURRENT card rendering. 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>
Assert real post-reload label containment for default and subtitle cells, RedBox-like cell-layer rounding, and one reusable primitive-owned header height constraint across changed heights. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Saadnajmi
commented
Jul 29, 2026
Saadnajmi
commented
Jul 29, 2026
Saadnajmi
commented
Jul 29, 2026
Saadnajmi
commented
Jul 29, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tido64
reviewed
Jul 29, 2026
Comment on lines
+60
to
+71
| @interface RCTUIAction : NSObject | ||
|
|
||
| + (instancetype)actionWithHandler:(RCTUIActionHandler)handler; | ||
| @property (nonatomic, readonly, copy) RCTUIActionHandler handler; | ||
|
|
||
| @end | ||
|
|
||
| @interface RCTUIButton (RCTUIAction) | ||
|
|
||
| - (void)rct_setPrimaryAction:(RCTUIAction *)action; | ||
|
|
||
| @end |
Member
There was a problem hiding this comment.
These are hidden behind RCT_DEV_MENU upstream. Should we also be doing that here?
Member
There was a problem hiding this comment.
Also, would Meta accept these changes so we can reduce our diffs?
Saadnajmi
marked this pull request as ready for review
July 29, 2026 21:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds three narrow RCTUIKit compatibility primitives and adopts them in RedBox, which collapses most of RedBox's platform forking.
RCTUITableView/RCTUITableViewCell—@compatibility_aliastoUITableView/UITableViewCellon iOS and visionOS; on macOS anNSScrollViewsubclass wrapping a privateNSTableView, with narrow data-source/delegate protocols and an exactNSIndexPathrow/section bridge.RCTUILabel— implements thetextgetter and thenumberOfLines/textAlignmentpairs that were already declared in the header but never backed.RCTUIButton/RCTUIAction— narrowNSButtonsubclass plus a small title proxy and a block-based action holder, replacing RedBox'sobjc_setAssociatedObjectcategory.RedBox drops from 1125 to 912 lines. Platform-forked lines fall from 441 to 174 (macOS-only 248 → 96, iOS-only 193 → 78) and conditional blocks by 10.
macOS design notes
NSTableViewStyleInsetexplicitly.usesAutomaticRowHeights. Fixed heights come from an explicit height constraint on the cell;tableView:heightOfRow:supplies the estimate. Automatic heights come from AutoLayout, withpreferredMaxLayoutWidthmaintained as the cell resizes so text reflows on window resize.makeViewWithIdentifier:reuse, soprepareForReuseis driven by AppKit rather than called manually.RedBox behavior changes
Visuals are intended to be unchanged. The macOS RedBox keeps its 16pt inset and 8pt continuous-radius message card, and the buttons keep their existing borderless momentary-push appearance, attributed titles, and key equivalents (⎋ / ⌘R / ⌥⌘C).
Bugs fixed along the way, all of which were coupled to the migration:
"red box-error"and is nowredbox-error, matching iOS.redBoxButton:set its accessibility identifier to the literal string@"accessibilityIdentifier"instead of the parameter.Validation status — draft; a reported visual regression has been addressed but not re-verified
A macOS capture of the previous revision showed the RedBox message card losing its rounded
corners and its text insets, and stack frame rows clipped at the top. This revision addresses
all three:
again, matching the code this PR replaces. No competing background is drawn over the corners.
revision had dropped to zero.
RCTUITableViewCellsetsrowSizeStyle = NSTableViewRowSizeStyleCustom, so NSTableCellViewdoes not apply its own standard metrics to the
textFieldoutlet.every reload.
These fixes have NOT been visually re-verified.
Do not merge until all of the following pass:
pod install+xcodebuild)mainand on this branch at an identical window size andcompare corner radius, text insets, glyph tops, 16pt row inset, and the footer
Known risk:
NSTableViewassigns itseffectiveRowSizeStyleonto each cell view, so thecell-side
rowSizeStylemay need to be set on the table as well. This must be validated in themacOS build and GUI pass.
Known follow-ups
RCTUITableViewAutomaticDimensionand the header APIs have no consumer in this PR.