Skip to content

fix(view): include mouse fields in macOS touch debug descriptions - #3170

Open
Jason Morse (JasonVMo) wants to merge 1 commit into
mainfrom
user/jasonvmo/cpp-touch-debug
Open

Jason Morse (JasonVMo) wants to merge 1 commit into
mainfrom
user/jasonvmo/cpp-touch-debug

Conversation

@JasonVMo

Copy link
Copy Markdown

Summary:

The macOS-only mouse button and modifier fields in BaseTouch debug descriptions
are guarded by the misspelled TARGET_OS_SX. That undefined macro evaluates to
zero, so those fields never appear, even in macOS debug builds.

Use the existing TARGET_OS_OSX guard, matching the payload serialization and
the field declarations, and align the newly enabled entries with their neighbors.
This corrects a fork-only extension; upstream React Native does not have these
macOS debug fields. Event payloads and release builds are unchanged.

Test Plan:

The macOS debug compile below fails before the fix with
'TARGET_OS_SX' is not defined, evaluates to 0 [-Werror,-Wundef]. After the
fix, all three compilation checks pass, as do the scoped native formatter and
whitespace checks. Commands were run from the worktree root:

common=(-std=c++20 -Ipackages/react-native/ReactCommon -Ipackages/react-native/ReactCommon/jsi)
source=packages/react-native/ReactCommon/react/renderer/components/view/BaseTouch.cpp

# Passed: macOS debug, including the formerly excluded field descriptions.
xcrun clang++ "${common[@]}" -DREACT_NATIVE_DEBUG=1 -Ipackages/react-native/ReactCommon/react/renderer/components/view/platform/macos -Ipackages/react-native/ReactCommon/react/renderer/graphics/platform/ios -Werror=undef -fsyntax-only "$source"

# Passed: non-macOS debug, without the macOS-only fields.
xcrun clang++ "${common[@]}" -DREACT_NATIVE_DEBUG=1 -UTARGET_OS_OSX -DTARGET_OS_OSX=0 -Ipackages/react-native/ReactCommon/react/renderer/components/view/platform/cxx -Ipackages/react-native/ReactCommon/react/renderer/graphics/platform/cxx -Werror=undef -fsyntax-only "$source"

# Passed: macOS release, without debug string conversion.
xcrun clang++ "${common[@]}" -DNDEBUG -Ipackages/react-native/ReactCommon/react/renderer/components/view/platform/macos -Ipackages/react-native/ReactCommon/react/renderer/graphics/platform/ios -Werror=undef -fsyntax-only "$source"

# Passed: native formatting and whitespace.
xcrun clang-format --dry-run --Werror "$source"
git diff --check

Not run: a full RNTester native build, native unit tests, or runtime logging.
No UI changes or screenshots.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 33ea5c72-8bbd-448d-aa21-c9b99dd03c96
@JasonVMo

Copy link
Copy Markdown
Author

Additional validation: the six independent main fixes (#3170–#3175) were combined at e9667492e9 in an isolated worktree. After regenerating Pods from packages/rn-tester, RNTester-macOS and RNTester for arm64/x86_64 iOS simulators both built successfully. Exact commands, corrected codegen invocation, and limitations are recorded in #3175 (integration validation comment). This is build evidence, not live UI or sanitizer qualification; no PR was merged.

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.

1 participant