fix(iOS): support Unicode tab keys in Fabric events - #563
Draft
thiagobrez wants to merge 1 commit into
Draft
Conversation
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.
Fixes #560.
PR Description
On Fabric, the tab selection and long-press event payloads passed the Core Foundation
kCFStringEncodingUTF8constant to-[NSString cStringUsingEncoding:], which expects anNSStringEncoding. Non-ASCII tab keys therefore returnedNULL, and constructing the generated event'sstd::stringfrom that pointer aborted the app.This changes both event paths to build the event key from
-[NSString UTF8String], with an empty-string fallback for a nil receiver. That preserves the existing UTF-8 event payload behavior for ASCII keys while safely supporting arbitrary Unicode. The implementation uses Foundation and C++ APIs already available to the current Objective-C++ source, without raising the supported React Native, iOS, or compiler requirements.The example now includes a Korean tab key, a focused agent-device/Maestro flow covers selection and long press, and a patch changeset is included.
How to test?
corepack yarn build— passedcorepack yarn lint— passed (three existing warnings, no errors)corepack yarn typecheck— passedcorepack yarn jest --config '{"preset":"react-native","rootDir":"packages/react-native-bottom-tabs"}' src/__tests__/index.test.tsx --runInBand— passedcorepack yarn teststill exits non-zero in the unchanged repository-wide harness because@bottom-tabs/react-navigationhas no discovered tests. The focused package Jest command above passes; this known harness condition is separate from the branch.Device verification
Captured with agent-device 0.20.10 against the Fabric example app (
bottomtabs.example):메시지produced SIGABRT instd::string(char const *)fromonPageSelectedWithKey:(selection video, crash report). A long-press attempt reproduced the same abort at the selection boundary (video, crash report).XCUITest's synthesized hold selected the tab but did not fire the example's custom
UILongPressGestureRecognizer; the same limitation occurred on the existing ASCII tab. The focused flow therefore verifies the original crash boundary by asserting that Unicode selection and long-press gestures keep the app alive and the correct tab visible. Full evidence notes and logs are inartifacts/issue-560.Screenshots
Before interaction
After fix, selected on iOS 26.5