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

fix(Galery): fix autoPlay when dragging slides #7877

Merged

Conversation

EldarMuhamethanov
Copy link
Contributor

@EldarMuhamethanov EldarMuhamethanov commented Nov 1, 2024


  • Unit-тесты
  • Release notes

Описание

Сейчас при включеном autoPlay в компоненте Gallery при попытке потянуть слайд, таймер не сбрасывается, из-за чего происходит переход прямо во время drag

Изменения

Сделал рефакторинг хука useAutoPlay, добавил возможность сделать pause и resume во время работы с Gallery

Release notes

Исправления

  • Gallery: теперь во время drag происходит остановка автопереключения слайдов

@EldarMuhamethanov EldarMuhamethanov requested a review from a team as a code owner November 1, 2024 11:06
Copy link
Contributor

github-actions bot commented Nov 1, 2024

size-limit report 📦

Path Size
JS 383.62 KB (+0.09% 🔺)
JS (gzip) 122.73 KB (+0.09% 🔺)
JS (brotli) 101.64 KB (-0.04% 🔽)
JS import Div (tree shaking) 1.47 KB (0%)
CSS 342.28 KB (0%)
CSS (gzip) 49.35 KB (0%)
CSS (brotli) 40 KB (0%)

Copy link

codesandbox-ci bot commented Nov 1, 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 1, 2024

e2e tests

⚠️ Some screenshots were failed. See Playwright Report.

Playwright Report

Copy link

codecov bot commented Nov 1, 2024

Codecov Report

Attention: Patch coverage is 96.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 95.36%. Comparing base (5775640) to head (c81ef9c).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
packages/vkui/src/components/Gallery/hooks.ts 96.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7877      +/-   ##
==========================================
- Coverage   95.37%   95.36%   -0.01%     
==========================================
  Files         378      378              
  Lines       11160    11165       +5     
  Branches     3711     3712       +1     
==========================================
+ Hits        10644    10648       +4     
- Misses        516      517       +1     
Flag Coverage Δ
unittests 95.36% <96.66%> (-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

github-actions bot commented Nov 1, 2024

👀 Docs deployed

Commit c81ef9c

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.

Шикарно отрефакторил и useImperativeHandle очень к месту пришелся! 🥇

packages/vkui/src/components/Gallery/hooks.ts Show resolved Hide resolved
packages/vkui/src/components/Gallery/hooks.ts Outdated Show resolved Hide resolved
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.

🔥

@EldarMuhamethanov EldarMuhamethanov added the v6 Автоматизация: PR продублируется в ветку v6 label Nov 5, 2024
@EldarMuhamethanov EldarMuhamethanov added the patch Автоматизация: PR продублируется в ветку последнего минорного релиза для выпуска патча label Nov 5, 2024
inomdzhon
inomdzhon previously approved these changes Nov 6, 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.

🙏

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.

💅

@EldarMuhamethanov EldarMuhamethanov merged commit 3661e98 into master Nov 6, 2024
28 checks passed
@EldarMuhamethanov EldarMuhamethanov deleted the e.muhamethanov/7835/autoplay-slides-gallery branch November 6, 2024 11:34
@vkcom-publisher
Copy link
Contributor

❌ Patch

Не удалось автоматически применить исправление на ветке 7.0-stable.

Дальнейшие действия выполняют контрибьютеры из группы @VKCOM/vkui-core

Чтобы изменение попало в ветку 7.0-stable, выполните следующие действия:

  1. Создайте новую ветку от 7.0-stable и примените изменения используя cherry-pick
git stash # опционально
git fetch origin 7.0-stable
git checkout -b patch/pr7877 origin/7.0-stable

git cherry-pick --no-commit 3661e98a0a3df99584a8d90623e240c44cde5427
git checkout HEAD **/__image_snapshots__/*.png
git diff --quiet HEAD || git commit --no-verify --no-edit
  1. Исправьте конфликты, следуя инструкциям из терминала
  2. Отправьте ветку на GitHub и создайте новый PR с веткой 7.0-stable (установка лейбла не требуется!)
git push --set-upstream origin patch/pr7877
gh pr create --base 7.0-stable --title "patch: pr7877" --body "- patch #7877"

vkcom-publisher pushed a commit that referenced this pull request Nov 6, 2024
* fix(Galery): fix autoPlay when dragging slides

* fix(HorizontalScroll): remove unused useEffect

* fix(Gallery): rm useImperativeHandler and return controls from hook

* fix(Gallery): rm import

* fix(useAutoPlay): use useCallback

* fix(useAutoPlay): rm import
EldarMuhamethanov added a commit that referenced this pull request Nov 6, 2024
* fix(Galery): fix autoPlay when dragging slides

* fix(HorizontalScroll): remove unused useEffect

* fix(Gallery): rm useImperativeHandler and return controls from hook

* fix(Gallery): rm import

* fix(useAutoPlay): use useCallback

* fix(useAutoPlay): rm import

(cherry picked from commit 3661e98)
@EldarMuhamethanov EldarMuhamethanov mentioned this pull request Nov 6, 2024
EldarMuhamethanov added a commit that referenced this pull request Nov 6, 2024
* fix(Galery): fix autoPlay when dragging slides

* fix(HorizontalScroll): remove unused useEffect

* fix(Gallery): rm useImperativeHandler and return controls from hook

* fix(Gallery): rm import

* fix(useAutoPlay): use useCallback

* fix(useAutoPlay): rm import

(cherry picked from commit 3661e98)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Автоматизация: PR продублируется в ветку последнего минорного релиза для выпуска патча v6 Автоматизация: PR продублируется в ветку v6
Projects
None yet
5 participants