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(Cell/SimpleCell/MiniInfoCell/RichCell): Use spacing size tokens #7033

Merged
merged 4 commits into from
Jul 16, 2024

Conversation

mendrew
Copy link
Contributor

@mendrew mendrew commented Jun 19, 2024


  • Unit-тесты
  • e2e-тесты
  • Дизайн-ревью

Описание

Заменяем константы отступов на токены системы расстояний.

Токены системы расстояний из vkui-tokens:
https://github.com/VKCOM/vkui-tokens/blob/2222b5b2208df9ea2d1f8d449e683f34696c6cd4/src/themeDescriptions/base/vk.ts#L730-L741

Вопросы

1.

Стоит ли нам заменять на токены отступы в режиме removable такие как 44px и 48px?

/* размер removable icon */
padding-inline-end: 44px;

padding-inline: 48px var(--vkui--size_base_padding_horizontal--regular);

Так как у нас нет соответствующих токенов для таких размеров, то можно было бы использовать сложение имеющихся токенов, например
вместо 44px писать calc(var(--vkui--spacing_size_3xl) + var(--vkui--spacing_size_4xl))
а вместо 48px писать calc(var(--vkui--spacing_size_4xl) * 2)

Ответ: в данном случае оставим как есть, потому что тут не расстояние а размер иконки, и не хотелось бы, что это поехало при изменении токенов расстояний.

2.

У RichCell есть нестандартный отступ у группы bottom - 5px. Оставим как есть или может быть в дизайне до 6px увеличим?

.RichCell__bottom {
margin-block-start: 5px;
}

Ответ: решили использовать --vkui--spacing_size_s (6px) для того чтобы всё привести к единой системе.

Copy link
Contributor

github-actions bot commented Jun 19, 2024

size-limit report 📦

Path Size
JS 374.73 KB (0%)
JS (gzip) 114.66 KB (0%)
JS (brotli) 94.03 KB (0%)
JS import Div (tree shaking) 1.42 KB (0%)
CSS 300.61 KB (+0.19% 🔺)
CSS (gzip) 38.35 KB (+0.19% 🔺)
CSS (brotli) 30.86 KB (+0.12% 🔺)

Copy link

codesandbox-ci bot commented Jun 19, 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 Jun 19, 2024

e2e tests

⚠️ Some screenshots were failed. See Playwright Report.

Playwright Report

Copy link
Contributor

github-actions bot commented Jun 19, 2024

👀 Docs deployed

Commit 3989c6c

Copy link

codecov bot commented Jun 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.07%. Comparing base (5924c47) to head (3989c6c).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7033   +/-   ##
=======================================
  Coverage   84.07%   84.07%           
=======================================
  Files         359      359           
  Lines       10909    10909           
  Branches     3591     3591           
=======================================
  Hits         9172     9172           
  Misses       1737     1737           
Flag Coverage Δ
unittests 84.07% <ø> (ø)

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.

@mendrew mendrew changed the title feat(Cell/SimpleCell/MiniInfoCell) Use spacing size tokens feat(Cell/SimpleCell/MiniInfoCell): Use spacing size tokens Jun 20, 2024
@mendrew mendrew added this to the v6.2.0 milestone Jun 20, 2024
@mendrew mendrew self-assigned this Jun 20, 2024
@mendrew mendrew changed the title feat(Cell/SimpleCell/MiniInfoCell): Use spacing size tokens feat(Cell/SimpleCell/MiniInfoCell/RichCell): Use spacing size tokens Jun 20, 2024
@mendrew mendrew marked this pull request as ready for review June 20, 2024 10:10
@mendrew mendrew requested a review from a team as a code owner June 20, 2024 10:10
@mendrew mendrew requested a review from a team June 20, 2024 10:10
inomdzhon
inomdzhon previously approved these changes Jun 20, 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.

👍


Ответы на вопросы:

  1. Вообще можно было бы комбинировать, но боюсь, что и читать сложнее станет, и конечному пользователю будет переопределять сложнее. Предлагаю пока оставить как есть.
  2. @VKCOM/vkui-design ?

@mendrew mendrew modified the milestones: v6.2.0, v6.3.0 Jun 27, 2024
@mendrew mendrew force-pushed the mendrew/spacing-token/Cell/MiniInfoCell/SimpleCell branch from 0a4afbd to caf76a8 Compare June 28, 2024 07:24
inomdzhon
inomdzhon previously approved these changes Jun 28, 2024
@vkcom-publisher vkcom-publisher added the pr-needs-work Автоматизация: PR автоматически закроется через 14 дней при отсутствии активности label Jul 6, 2024
@vkcom-publisher
Copy link
Contributor

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

@mendrew mendrew reopened this Jul 15, 2024
@mendrew mendrew force-pushed the mendrew/spacing-token/Cell/MiniInfoCell/SimpleCell branch from b993feb to 3989c6c Compare July 15, 2024 09:53
@vkcom-publisher vkcom-publisher removed the pr-needs-work Автоматизация: PR автоматически закроется через 14 дней при отсутствии активности label Jul 15, 2024
@mendrew mendrew requested review from inomdzhon and a team July 16, 2024 13:46
@inomdzhon inomdzhon merged commit 2a863c6 into master Jul 16, 2024
1 check passed
@inomdzhon inomdzhon deleted the mendrew/spacing-token/Cell/MiniInfoCell/SimpleCell branch July 16, 2024 17:07
@vkcom-publisher
Copy link
Contributor

v6.3.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants