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(Panel): Add mode #6678

Merged
merged 7 commits into from
Mar 19, 2024
Merged

feat(Panel): Add mode #6678

merged 7 commits into from
Mar 19, 2024

Conversation

mendrew
Copy link
Contributor

@mendrew mendrew commented Mar 11, 2024


  • e2e-тесты

Описание

Добавляем новое свойство mode для Panel, по аналогии с Group.
Подразумевается использование вместе с Group, чтобы точечно задавать стиль card для Group с верным фоном, а не только для всего макета, как можно делать сейчас со свойством layout из AppRoot.

Изменения

  • убрали прозрачность фона у Panel в режиме адаптивности regular. Не очень понятна причина по которой это раньше было добавлено. Судя по 71e1293, это связано со многоколоночным режимом, но что именно пытались решить не понятно, точнее не понятно актуально ли это сейчас или нет.
    Пока же, судя по коду, с прозрачностью фон становится идентичным тому, который задаёт AppRoot по стилям из common.css.
    .vkui--sizeX-regular {
    background: var(--vkui--color_background);
    }
    @media (--sizeX-regular) {
    .vkui--sizeX-none {
    background: var(--vkui--color_background);
    }
    }

    То есть замена прозрачности на явные токены, которые идентичны AppRoot, визуально для приложений ничего не меняет, но у прощает css.

Тем не менее это затронуло скриншотные тесты в Playwright в dark режиме. Должно быть потому, что AppRootWrapper имеет немного другой фон и без прозрачности цвет Panel в скриншотах стал отличаться.

background: 'var(--playwright-background)',

--playwright-background: black;

На скриншоте слева фон черный #000000, а справа #0a0a0a
Untitled

Copy link
Contributor

github-actions bot commented Mar 11, 2024

size-limit report 📦

Path Size
JS 356.5 KB (+0.05% 🔺)
JS (gzip) 108.8 KB (+0.08% 🔺)
JS (brotli) 89.88 KB (+0.12% 🔺)
JS import Div (tree shaking) 1.43 KB (0%)
CSS 260.94 KB (+0.01% 🔺)
CSS (gzip) 34.19 KB (+0.01% 🔺)
CSS (brotli) 27.77 KB (+0.04% 🔺)

Copy link

codesandbox-ci bot commented Mar 11, 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 Mar 11, 2024

e2e tests

Playwright Report

Copy link
Contributor

github-actions bot commented Mar 11, 2024

👀 Docs deployed

Commit c96d514

Copy link

codecov bot commented Mar 11, 2024

Codecov Report

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

Project coverage is 82.26%. Comparing base (39192cc) to head (c96d514).
Report is 26 commits behind head on master.

Files Patch % Lines
packages/vkui/src/components/Panel/Panel.tsx 85.71% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6678      +/-   ##
==========================================
+ Coverage   82.24%   82.26%   +0.01%     
==========================================
  Files         331      331              
  Lines       10270    10288      +18     
  Branches     3439     3445       +6     
==========================================
+ Hits         8447     8463      +16     
- Misses       1823     1825       +2     
Flag Coverage Δ
unittests 82.26% <85.71%> (+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.

Because in any case it ends up as background of root.
We just use same background we have for the root defined
in the common.css for the layout.

Remove transparency to avoid questions about why it needs here.
@mendrew mendrew marked this pull request as ready for review March 14, 2024 13:47
@mendrew mendrew requested a review from a team as a code owner March 14, 2024 13:47
@mendrew mendrew marked this pull request as draft March 14, 2024 13:47
@mendrew mendrew marked this pull request as ready for review March 14, 2024 14:01
SevereCloud
SevereCloud previously approved these changes Mar 14, 2024
@BlackySoul
Copy link
Contributor

Скриншоты че т сильно выросли, там они точно нужны со всеми вариациями?)
Мейби отдельно нагенерим с mode? 🤔

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.

👍


вот эти скриншоты выглядят странно 🤔

image image

@mendrew
Copy link
Contributor Author

mendrew commented Mar 15, 2024

Скриншоты че т сильно выросли, там они точно нужны со всеми вариациями?) Мейби отдельно нагенерим с mode? 🤔

Нужна именно вариация mode + sizeX. Переместил тесты в отдельный плейграунд, а то тут в куче уже непонятно становится.
b4552b4

@mendrew mendrew marked this pull request as ready for review March 15, 2024 11:34
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.

🤝

@mendrew mendrew merged commit 1985d66 into master Mar 19, 2024
47 checks passed
@mendrew mendrew deleted the mendrew/feat/6607/Panel/add-mode branch March 19, 2024 10:00
@mendrew mendrew modified the milestone: v6.1.0 Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants