Skip to content
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

separating accessibilityUnit from accessibilityMinutes and accessibilityHours #4

Draft
wants to merge 6 commits into
base: tts-span-accessibility-unit-cpp-settings
Choose a base branch
from

Conversation

fabOnReact
Copy link
Owner

The changes will crash the app at startup with the following stack trace

Related: facebook#35130 (comment) (was solved by modyfing the file and then running the artifacts)

Related PR #3
This functionalities will be part of future PR

full log

11-14 21:26:04.564 19462 19462 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
11-14 21:26:04.564 19462 19462 F DEBUG   : Build fingerprint: 'Redmi/camellian_id/camellian:11/RP1A.200720.011/V12.5.4.0.RKSIDXM:user/release-keys'
11-14 21:26:04.564 19462 19462 F DEBUG   : Revision: '0'
11-14 21:26:04.564 19462 19462 F DEBUG   : ABI: 'arm64'
11-14 21:26:04.565 19462 19462 F DEBUG   : Timestamp: 2022-11-14 21:26:04+0100
11-14 21:26:04.565 19462 19462 F DEBUG   : pid: 19337, tid: 19423, name: mqt_js  >>> com.facebook.react.uiapp <<<
11-14 21:26:04.565 19462 19462 F DEBUG   : uid: 10417
11-14 21:26:04.565 19462 19462 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
11-14 21:26:04.565 19462 19462 F DEBUG   : Abort message: '/Users/fabriziobertoglio/Sourcecode/opensource/react-native/ReactCommon/react/renderer/core/RawValue.h:271: function castValue: assertion failed (dynamic.isObject())'
11-14 21:26:04.565 19462 19462 F DEBUG   :     x0  0000000000000000  x1  0000000000004bdf  x2  0000000000000006  x3  0000007b7e4e8fd0
11-14 21:26:04.565 19462 19462 F DEBUG   :     x4  0000007b7e4e8a60  x5  0000007b7e4e8a60  x6  0000007b7e4e8a60  x7  0000000000000000
11-14 21:26:04.565 19462 19462 F DEBUG   :     x8  00000000000000f0  x9  0000007c972bf718  x10 ffffff80fffffbdf  x11 0000000000000001
11-14 21:26:04.565 19462 19462 F DEBUG   :     x12 000000001de49168  x13 0000000000000001  x14 000000000013a000  x15 0000000000000000
11-14 21:26:04.565 19462 19462 F DEBUG   :     x16 0000007c9738f948  x17 0000007c9736eb90  x18 0000007b7da42000  x19 0000000000004b89
11-14 21:26:04.565 19462 19462 F DEBUG   :     x20 0000000000004bdf  x21 00000000ffffffff  x22 0000007c13c46359  x23 0000000000000002
11-14 21:26:04.565 19462 19462 F DEBUG   :     x24 0000007c13c260a7  x25 0000000000000001  x26 0000007c13c3d037  x27 0000007c14235000
11-14 21:26:04.565 19462 19462 F DEBUG   :     x28 b400007c9a4ae360  x29 0000007b7e4e9050
11-14 21:26:04.565 19462 19462 F DEBUG   :     lr  0000007c973228c8  sp  0000007b7e4e8fb0  pc  0000007c973228f8  pst 0000000000001000
11-14 21:26:04.681 19462 19462 F DEBUG   : backtrace:
11-14 21:26:04.681 19462 19462 F DEBUG   :       #00 pc 00000000000898f8  /apex/com.android.runtime/lib64/bionic/libc.so (abort+168) (BuildId: 91daf2d5bf0aef9792c0820dfdc3c79e)
11-14 21:26:04.681 19462 19462 F DEBUG   :       #01 pc 0000000000552284  /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+2260) (BuildId: 372a904938922ad5207bc369223ccd45)
11-14 21:26:04.681 19462 19462 F DEBUG   :       #02 pc 0000000000013990  /system/lib64/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+76) (BuildId: 40363036c1f5a305d00fe1d058a86ccb)
11-14 21:26:04.681 19462 19462 F DEBUG   :       #03 pc 0000000000006e58  /system/lib64/liblog.so (__android_log_assert+336) (BuildId: a258efec13e9100f9a53e795c419da98)
11-14 21:26:04.681 19462 19462 F DEBUG   :       #04 pc 0000000000000728  /data/app/~~CKf-utu26a69kjr__380jA==/com.facebook.react.uiapp-iW5nq9fgff1KQOWeC701DQ==/lib/arm64/libreact_debug.so (react_native_assert_fail+104) (BuildId: 3ff5096a1517e0c6)
11-14 21:26:04.681 19462 19462 F DEBUG   :       #05 pc 00000000000b83a8  /data/app/~~CKf-utu26a69kjr__380jA==/com.facebook.react.uiapp-iW5nq9fgff1KQOWeC701DQ==/lib/arm64/librrc_view.so (folly::F14FastMap<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, folly::HeterogeneousAccessHash<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, void>, folly::HeterogeneousAccessEqualTo<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, void>, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > > facebook::react::RawValue::castValue<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > >(folly::dynamic const&, folly::F14FastMap<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, folly::HeterogeneousAccessHash<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, void>, folly::HeterogeneousAccessEqualTo<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, void>, std::__ndk1::allocator<std::__ndk1::pair<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > > > >*)+88) (BuildId: c526f14cf8933b15)

@github-actions
Copy link

github-actions bot commented Nov 14, 2022

Fails
🚫

❗ Base Branch - The base branch for this PR is something other than main or a -stable branch. Are you sure you want to target something other than the main branch?

🚫

📋 Missing Changelog - Can you add a Changelog? To do so, add a "## Changelog" section to your PR description. A changelog entry has the following format: [CATEGORY] [TYPE] - Message.

CATEGORY may be:
  • General
  • iOS
  • Android
  • JavaScript
  • Internal (for changes that do not need to be called out in the release notes)

TYPE may be:

  • Added, for new features.
  • Changed, for changes in existing functionality.
  • Deprecated, for soon-to-be removed features.
  • Removed, for now removed features.
  • Fixed, for any bug fixes.
  • Security, in case of vulnerabilities.

MESSAGE may answer "what and why" on a feature level. Use this to briefly tell React Native users about notable changes.

Warnings
⚠️ 📋 Missing Test Plan - Can you add a Test Plan? To do so, add a "## Test Plan" section to your PR description. A Test Plan lets us know how these changes were tested.
⚠️ 📋 Missing Summary - Can you add a Summary? To do so, add a "## Summary" section to your PR description. This is a good place to explain the motivation for making this change.
⚠️

Libraries/Components/View/ViewPropTypes.js#L13 - Libraries/Components/View/ViewPropTypes.js line 13 – Requires should be sorted alphabetically (lint/sort-imports)

⚠️

Libraries/Components/View/ViewPropTypes.js#L30 - Libraries/Components/View/ViewPropTypes.js line 30 – 'AccessibilityUnit' is defined but never used. (no-unused-vars)

⚠️

packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js#L1535 - packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js line 1535 – 'pressed' is assigned a value but never used. (no-unused-vars)

⚠️

packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js#L1535 - packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js line 1535 – 'setPressed' is assigned a value but never used. (no-unused-vars)

Generated by 🚫 dangerJS against b7332ee

@fabOnReact fabOnReact changed the title Tts span additional props separating accessibilityUnit from accessibilityMinutes and accessibilityHours Nov 14, 2022
fabOnReact added a commit that referenced this pull request Nov 15, 2022
## Summary

Adds the accessibilityUnit to fabric CPP API  (part of PR facebook#35130 Adding support for Android Accessibility TtsSpan API)

The TtsSpan API now supports verbatim, date, and fraction but may not work with other span types like phone numbers, currency, time, measure, and money.

An explanation of the use case is as follows:
- Time is spelled 1 0 3 0 instead of ten thirty
- The developer does not have the option to specify if 10m stands for 10 meters or 10 miles, or 10 minutes
- Phone numbers, for example, 33312344, are not yet supported

Implementing the above functionality requires adding a new prop to the react-native API responsible for managing attributes of nested Text. 

- Java and CPP TextAttributes manage the functionality.
- Nested Text does not correspond to a Widget on Android but an Android TextView Span.  

The spans are updated based on a caching mechanism that re-renders the Android TextView only if specific attributes are updated.
The updates are triggered only if the Text or Paragraph Text attributes change.
- An example of Text attributes is accessibilityRole, font-weight, and backgroundColor.
- An example of Paragraph attributes is textBreakstrategy. They are updated with different mechanisms because they may change the paragraph layout.
These mappings are configured in Java, CPP, and Javascript.

As this and PR [facebook#33468](facebook#33468) require changes to the text attributes, the below work was needed:

- issue documented in PR [facebook#33468 (comment)](facebook#33468 (comment)) and PR [facebook#35130 (comment)](facebook#35130 (comment)). The CPP changes for facebook#35130 are moved to a separate PR ([fabriziobertoglio1987#2](#2)). The RNTester App would crash without a clear stack trace on startup after making changes to CPP. This was later fixed by adding the CPP headers to the prefab library rrc_view (see this [comment](facebook#35130 (comment))).
- Adding the CPP configurations (see [fabriziobertoglio1987#2](https://github.com/fabriziobertoglio1987/react-- native/pull/2)) required extensive troubleshooting and analysis

Related: PR #4 - separating accessibilityUnit from accessibilityMinutes and accessibilityHours
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