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(ScrollSaver): Add component to save scroll position of elements with scroll box #6011

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

mendrew
Copy link
Contributor

@mendrew mendrew commented Oct 20, 2023


  • Unit-тесты
  • e2e-тесты
  • Дизайн-ревью
  • Документация фичи

Описание

Добавлен новый компонент-обёртка ScrollSaver и его разновидности: хук useScrollSaver и ScrollSaverWithoutChildren.
Основная цель компонента ScrollSaver сохранять позицию скролла дочернего элемента при переходах между View и Panel.

Изменения

@github-actions github-actions bot added the v5 Автоматизация: PR продублируется в ветку v5 label Oct 20, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2023

size-limit report 📦

Path Size
JS 333.76 KB (+0.3% 🔺)
JS (gzip) 102.03 KB (+0.39% 🔺)
JS (brotli) 84.21 KB (+0.35% 🔺)
JS import Div (tree shaking) 2.71 KB (0%)
CSS 255.23 KB (0%)
CSS (gzip) 33.57 KB (0%)
CSS (brotli) 27.25 KB (0%)

@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2023

e2e tests

Playwright Report

@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2023

👀 Docs deployed

Commit 722ea95

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 20, 2023

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.

Latest deployment of this branch, based on commit 805c715:

Sandbox Source
VKUI TypeScript Configuration

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Attention: 55 lines in your changes are missing coverage. Please review.

Comparison is base (c913f62) 82.00% compared to head (805c715) 79.40%.

❗ Current head 805c715 differs from pull request most recent head 722ea95. Consider uploading reports for the commit 722ea95 to get more accurate results

Files Patch % Lines
.../vkui/src/components/ScrollSaver/useScrollSaver.ts 13.15% 33 Missing ⚠️
.../src/components/ScrollSaver/ScrollSaverContext.tsx 35.71% 9 Missing ⚠️
packages/vkui/src/hooks/usePatchChildrenRef.ts 0.00% 7 Missing ⚠️
...es/vkui/src/components/ScrollSaver/ScrollSaver.tsx 57.14% 3 Missing ⚠️
...components/ScrollSaver/ScrollSaverWithCustomRef.ts 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6011      +/-   ##
==========================================
- Coverage   82.00%   79.40%   -2.61%     
==========================================
  Files         327      309      -18     
  Lines       10149    10272     +123     
  Branches     3418     3616     +198     
==========================================
- Hits         8323     8156     -167     
- Misses       1826     2116     +290     
Flag Coverage Δ
unittests 79.40% <21.42%> (-2.61%) ⬇️

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.

@github-actions github-actions bot added the pr-needs-work Автоматизация: PR автоматически закроется через 14 дней при отсутствии активности label Oct 31, 2023
Copy link
Contributor

github-actions bot commented Nov 8, 2023

PR закрыт из-за отсутствия активности в течение последних 14 дней. Если это произошло по ошибке или изменения все ещё актуальны, откройте PR повторно.

@github-actions github-actions bot closed this Nov 8, 2023
@mendrew mendrew reopened this Nov 10, 2023
@mendrew mendrew added the no-stale Добавляет PR в исключения для автоматического закрытия label Nov 10, 2023
ScrollSaver is a component-wrapper which expects children
and search for the ref in the children props

ScrollSaverWithoutChildren is a component that receives ref from the
outside as elementRef prop to support dynamic scroll control.

useScrollSaver is a hook that allows to use scroll saver using hook.
Expects ref as a prop to control scroll position
Use arguments in the hook
@mendrew mendrew force-pushed the mendrew/feat/3750/add-component-scroll-saver branch from 805c715 to 722ea95 Compare January 25, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-stale Добавляет PR в исключения для автоматического закрытия pr-needs-work Автоматизация: PR автоматически закроется через 14 дней при отсутствии активности v5 Автоматизация: PR продублируется в ветку v5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Компонент ScrollSaver
1 participant