surfstudio / ReactiveDataDisplayManager

MIT License
34 stars 13 forks source link

[SPT-1480] RDDM Accessibility optimizations #239

Closed Ikeret closed 1 year ago

Ikeret commented 1 year ago

Что сделано?

Зачем это сделано?

На что обратить внимание?

Пример:

Если раньше стратегии задавались очень длинно и нагроможденно

 var labelStrategy = .joined([.from(object: titleLalel), .just(", "), .from(object: offerLabel)])

var valueStrategy = .joined([
    .just("Количество: \(stepper.value), по цене "),
    .from(object: priceLabel),
    .just(oldPriceLabel.text.map { ". Старая цена \($0)" })
])

то теперь станет это проще

var labelStrategy = .merge(titleLabel.text, offerLabel.text, separator: ", ")

var valueStrategy = .merge(
    "Количество: \(stepper.value), по цене ", 
    priceLabel.text, 
    oldPriceLabel.text.map { ". Старая цена \($0)" }
)
github-actions[bot] commented 1 year ago
Warnings
:warning: Oops! We have found some issues. It's better to fix them to keep code clean

SwiftLint found issues

Severity File Reason
Warning AccessibilityItemWrapper.swift:18 Redundant explicit declaration of default types should be avoided (redundant_default_type)
Warning AccessibilityItem+Invalidation.swift:90 Line should be 145 characters or less: currently 158 characters (line_length)

Generated by :no_entry_sign: Danger Swift against 72f69d735383322d9e15a7c35b40d58ec76c3f37

Ikeret commented 1 year ago

Осталось:

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 58.83% and project coverage change: +26.70 :tada:

Comparison is base (d604813) 36.56% compared to head (eca573b) 63.26%.

:exclamation: Current head eca573b differs from pull request most recent head 0a4f73b. Consider uploading reports for the commit 0a4f73b to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## release/7.4 #239 +/- ## ================================================ + Coverage 36.56% 63.26% +26.70% ================================================ Files 143 151 +8 Lines 5303 5491 +188 Branches 2437 2497 +60 ================================================ + Hits 1939 3474 +1535 + Misses 3283 1886 -1397 - Partials 81 131 +50 ``` | Flag | Coverage Δ | | |---|---|---| | uitests | `48.11% <51.97%> (?)` | | | unittests | `35.36% <18.31%> (-1.20%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=surfstudio#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://app.codecov.io/gh/surfstudio/ReactiveDataDisplayManager/pull/239?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=surfstudio) | Coverage Δ | | |---|---|---| | [...llection/DataSource/BaseCollectionDataSource.swift](https://app.codecov.io/gh/surfstudio/ReactiveDataDisplayManager/pull/239?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=surfstudio#diff-U291cmNlL0NvbGxlY3Rpb24vRGF0YVNvdXJjZS9CYXNlQ29sbGVjdGlvbkRhdGFTb3VyY2Uuc3dpZnQ=) | `77.41% <0.00%> (+38.70%)` | :arrow_up: | | [...Collection/Modifier/CollectionCommonModifier.swift](https://app.codecov.io/gh/surfstudio/ReactiveDataDisplayManager/pull/239?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=surfstudio#diff-U291cmNlL0NvbGxlY3Rpb24vTW9kaWZpZXIvQ29sbGVjdGlvbkNvbW1vbk1vZGlmaWVyLnN3aWZ0) | `46.03% <0.00%> (+3.43%)` | :arrow_up: | | [...llection/Modifier/CollectionDiffableModifier.swift](https://app.codecov.io/gh/surfstudio/ReactiveDataDisplayManager/pull/239?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=surfstudio#diff-U291cmNlL0NvbGxlY3Rpb24vTW9kaWZpZXIvQ29sbGVjdGlvbkRpZmZhYmxlTW9kaWZpZXIuc3dpZnQ=) | `51.47% <0.00%> (+51.47%)` | :arrow_up: | | [.../Collection/Protocols/CollectionFoldableItem.swift](https://app.codecov.io/gh/surfstudio/ReactiveDataDisplayManager/pull/239?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=surfstudio#diff-U291cmNlL0NvbGxlY3Rpb24vUHJvdG9jb2xzL0NvbGxlY3Rpb25Gb2xkYWJsZUl0ZW0uc3dpZnQ=) | `0.00% <0.00%> (ø)` | | | [Source/Protocols/Modifier/Modifier.swift](https://app.codecov.io/gh/surfstudio/ReactiveDataDisplayManager/pull/239?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=surfstudio#diff-U291cmNlL1Byb3RvY29scy9Nb2RpZmllci9Nb2RpZmllci5zd2lmdA==) | `10.00% <0.00%> (-1.12%)` | :arrow_down: | | [...cessibility/Container/AccessibilityContainer.swift](https://app.codecov.io/gh/surfstudio/ReactiveDataDisplayManager/pull/239?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=surfstudio#diff-U291cmNlL1Byb3RvY29scy9QbHVnaW5zL0dlbmVyYXRvcnMvQWNjZXNzaWJpbGl0eS9Db250YWluZXIvQWNjZXNzaWJpbGl0eUNvbnRhaW5lci5zd2lmdA==) | `0.00% <0.00%> (ø)` | | | [...ssibility/Container/AccessibilityItemWrapper.swift](https://app.codecov.io/gh/surfstudio/ReactiveDataDisplayManager/pull/239?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=surfstudio#diff-U291cmNlL1Byb3RvY29scy9QbHVnaW5zL0dlbmVyYXRvcnMvQWNjZXNzaWJpbGl0eS9Db250YWluZXIvQWNjZXNzaWJpbGl0eUl0ZW1XcmFwcGVyLnN3aWZ0) | `0.00% <0.00%> (ø)` | | | [...ators/Accessibility/Item/AccessibilityAction.swift](https://app.codecov.io/gh/surfstudio/ReactiveDataDisplayManager/pull/239?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=surfstudio#diff-U291cmNlL1Byb3RvY29scy9QbHVnaW5zL0dlbmVyYXRvcnMvQWNjZXNzaWJpbGl0eS9JdGVtL0FjY2Vzc2liaWxpdHlBY3Rpb24uc3dpZnQ=) | `0.00% <0.00%> (ø)` | | | [...lity/Modifier/AccessibilityContainerModifier.swift](https://app.codecov.io/gh/surfstudio/ReactiveDataDisplayManager/pull/239?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=surfstudio#diff-U291cmNlL1Byb3RvY29scy9QbHVnaW5zL0dlbmVyYXRvcnMvQWNjZXNzaWJpbGl0eS9Nb2RpZmllci9BY2Nlc3NpYmlsaXR5Q29udGFpbmVyTW9kaWZpZXIuc3dpZnQ=) | `0.00% <0.00%> (ø)` | | | [...ce/Protocols/Plugins/Generators/FoldableItem.swift](https://app.codecov.io/gh/surfstudio/ReactiveDataDisplayManager/pull/239?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=surfstudio#diff-U291cmNlL1Byb3RvY29scy9QbHVnaW5zL0dlbmVyYXRvcnMvRm9sZGFibGVJdGVtLnN3aWZ0) | `0.00% <0.00%> (ø)` | | | ... and [42 more](https://app.codecov.io/gh/surfstudio/ReactiveDataDisplayManager/pull/239?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=surfstudio) | | ... and [49 files with indirect coverage changes](https://app.codecov.io/gh/surfstudio/ReactiveDataDisplayManager/pull/239/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=surfstudio)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

NullIsOne commented 1 year ago

Апдейт

NullIsOne commented 1 year ago

Апдейт

✅ придумать удобный способ задания UIAccessibilityCustomActions Создана AccessibilityActionsStrategy и структура враппер AccessibilityAction Применение в ПР appTemplate ✅ 50/50 подумать над частичной инвалидацией параметров Добавлен базовый инвалидатор, который не лезет за генератором. Полезно в playbook например. Инвалидацию label, value, traits, actions отдельно друг от друга мешает сделать AccessibilityModifier который берет все из AccessibilityItem Оптимизируем этот момент в 8.0

Осталось 🛠️ добавить/обновить документацию по новой логике

NullIsOne commented 1 year ago

Переделал включенный по-умолчанию acessibilityPlugin Поправил документацию Готово к review