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

feat(SegmentedControl): support using SegmentedControl as tabs #7960

Merged
merged 6 commits into from
Dec 11, 2024

Conversation

EldarMuhamethanov
Copy link
Contributor

@EldarMuhamethanov EldarMuhamethanov commented Nov 19, 2024


  • Unit-тесты
  • Документация фичи
  • Release notes

Описание

Добавлена поддержка WAI-ARIA для компонента SegmentedControl при использовании в качестве табов. Реализована навигация с помощью клавиатуры и корректная семантическая разметка для улучшения доступности.

Изменения

  1. Вынесен хук useTabsNavigation из Tabs для обработки клавиатурной навигации и переиcпользовал в SegmentedControl
  2. В SegmentedControl добавлена поддержка роли tablist
  3. Обновлена документация с примером использования в качестве табов
  4. Добавлены unit-тесты для нового функционала

Release notes

Улучшения

  • SegmentedControl: добавлена поддержка использования компонента в качестве табов. Для этого нужно прокинуть role="tablist"

@EldarMuhamethanov EldarMuhamethanov requested a review from a team as a code owner November 19, 2024 13:47
Copy link
Contributor

github-actions bot commented Nov 19, 2024

size-limit report 📦

Path Size
JS 390.41 KB (+0.08% 🔺)
JS (gzip) 117.98 KB (+0.12% 🔺)
JS (brotli) 97.04 KB (+0.05% 🔺)
JS import Div (tree shaking) 1.56 KB (0%)
CSS 340.75 KB (0%)
CSS (gzip) 42.18 KB (0%)
CSS (brotli) 33.56 KB (0%)

Copy link
Contributor

github-actions bot commented Nov 19, 2024

e2e tests

⚠️ Some screenshots were failed. See Playwright Report.

Playwright Report

@vkcom-publisher vkcom-publisher added the pr-needs-work Автоматизация: PR автоматически закроется через 14 дней при отсутствии активности label Nov 27, 2024
@EldarMuhamethanov EldarMuhamethanov removed the pr-needs-work Автоматизация: PR автоматически закроется через 14 дней при отсутствии активности label Nov 27, 2024
Copy link

codesandbox-ci bot commented Nov 27, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Contributor

github-actions bot commented Nov 27, 2024

👀 Docs deployed

Commit a6e884e

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 96.20253% with 3 lines in your changes missing coverage. Please review.

Project coverage is 95.51%. Comparing base (334e5b2) to head (a6e884e).
Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
packages/vkui/src/hooks/useTabsNavigation.ts 94.91% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7960   +/-   ##
=======================================
  Coverage   95.51%   95.51%           
=======================================
  Files         396      397    +1     
  Lines       11235    11271   +36     
  Branches     3720     3730   +10     
=======================================
+ Hits        10731    10766   +35     
- Misses        504      505    +1     
Flag Coverage Δ
unittests 95.51% <96.20%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@andrey-medvedev-vk andrey-medvedev-vk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@inomdzhon inomdzhon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💅

inomdzhon
inomdzhon previously approved these changes Dec 11, 2024
Copy link
Contributor

@inomdzhon inomdzhon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@EldarMuhamethanov EldarMuhamethanov merged commit a1285fe into master Dec 11, 2024
25 of 26 checks passed
@EldarMuhamethanov EldarMuhamethanov deleted the e.muhamethanov/7952/segmented-control-a11y branch December 11, 2024 11:05
BlackySoul pushed a commit that referenced this pull request Dec 16, 2024
* feat(SegmentedControl): support using SegmentedControl as tabs

* test(SegmentedControl): add tests

* fix(SegmentedControl): refactor logic

* fix(SegmentedControl): fix before renderning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants