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

[Draft] feat: create ModalPageV2 #6759

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

inomdzhon
Copy link
Contributor

@inomdzhon inomdzhon commented Mar 26, 2024

Описание

Пример рефактора модалок с помощью touch-событий.

Решение пограничных кейсов

  • выделение текста – с помощью функции hasSelectionWithRangeType определяем, что пользователь выделил текст и перестаём реагировать на touchstart и touchmove пока выделение не будет удалено.

  • поля ввода – через useKeyboard узнаём, что пользователь работает с клавиатурой и не реагируем не реагируем на touchstart.

    UPD хотя см. есть #599, где это считается багом 🤔

  • вертикальный и горизонтальный скроллы – при touchstart достаём скроллируемый элемент через event.target и подписываемся на событие скролла, а также получаем информацию про позицию скролла.

    • при горизонтальном скролле мы дополнительно проверяем на scrollTop === 0, если true, то включаем свайп вниз и через event.preventDefault предотвращаем bounce скролла.

TODO

Вкратце:

Остальное см. в checklist.md.

Референсы

Copy link
Contributor

github-actions bot commented Mar 26, 2024

size-limit report 📦

Path Size
JS 366.26 KB (+0.06% 🔺)
JS (gzip) 112.39 KB (+0.05% 🔺)
JS (brotli) 92.75 KB (+0.02% 🔺)
JS import Div (tree shaking) 1.42 KB (0%)
CSS 273.95 KB (+0.03% 🔺)
CSS (gzip) 35.62 KB (+0.05% 🔺)
CSS (brotli) 28.87 KB (+0.08% 🔺)

Copy link

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 Mar 26, 2024

e2e tests

⚠️ Some screenshots were failed. See Playwright Report.

Playwright Report

Copy link
Contributor

github-actions bot commented Mar 26, 2024

👀 Docs deployed

Commit 7d03282

Copy link

codecov bot commented Mar 26, 2024

Codecov Report

Attention: Patch coverage is 2.54545% with 268 lines in your changes are missing coverage. Please review.

Project coverage is 80.31%. Comparing base (7685144) to head (50e2aac).
Report is 2 commits behind head on master.

❗ Current head 50e2aac differs from pull request most recent head 6685334. Consider uploading reports for the commit 6685334 to get more accurate results

Files Patch % Lines
.../vkui/src/lib/bottomSheet/BottomSheetController.ts 0.00% 80 Missing ⚠️
...es/vkui/src/components/ModalPageV2/ModalPageV2.tsx 0.00% 48 Missing ⚠️
...rc/lib/bottomSheet/UIScrollableChildrenObserver.ts 0.00% 44 Missing ⚠️
...vkui/src/lib/bottomSheet/UIPanGestureRecognizer.ts 0.00% 38 Missing ⚠️
.../vkui/src/components/ModalPageV2/ModalPageRoot.tsx 0.00% 24 Missing ⚠️
packages/vkui/src/lib/dom.tsx 18.75% 13 Missing ⚠️
...kui/src/lib/jsAnimation/rubberbandIfOutOfBounds.ts 0.00% 12 Missing ⚠️
...src/components/ModalPageFooter/ModalPageFooter.tsx 0.00% 5 Missing ⚠️
...c/components/ModalPageContent/ModalPageContent.tsx 0.00% 2 Missing ⚠️
packages/vkui/src/lib/adaptivity/functions.ts 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6759      +/-   ##
==========================================
- Coverage   83.31%   80.31%   -3.00%     
==========================================
  Files         350      344       -6     
  Lines       10442    10634     +192     
  Branches     3464     3536      +72     
==========================================
- Hits         8700     8541     -159     
- Misses       1742     2093     +351     
Flag Coverage Δ
unittests 80.31% <2.54%> (-3.00%) ⬇️

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.

@vkcom-publisher vkcom-publisher added pr-needs-work Автоматизация: PR автоматически закроется через 14 дней при отсутствии активности and removed pr-needs-work Автоматизация: PR автоматически закроется через 14 дней при отсутствии активности labels Apr 3, 2024
@inomdzhon inomdzhon added the no-stale Добавляет PR в исключения для автоматического закрытия label Apr 6, 2024
@inomdzhon inomdzhon force-pushed the imirdzhamolov/research/refactor-modal branch 2 times, most recently from 6685334 to 4a0d455 Compare May 16, 2024 15:39
@inomdzhon inomdzhon force-pushed the imirdzhamolov/research/refactor-modal branch from 4a0d455 to 7d03282 Compare May 16, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-stale Добавляет PR в исключения для автоматического закрытия
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants