Skip to content

feat(UsersStack): tokenized#2661

Merged
SevereCloud merged 2 commits intomasterfrom
SevereCloud/issue2588
Jun 8, 2022
Merged

feat(UsersStack): tokenized#2661
SevereCloud merged 2 commits intomasterfrom
SevereCloud/issue2588

Conversation

@SevereCloud
Copy link
Copy Markdown
Contributor

@SevereCloud SevereCloud commented Jun 3, 2022

Чеклист перевода компонента на vkui-tokens

  • В стилях компонента не осталось платформенных селекторов
  • Если в стилях встречаются токены из Appearance, то их нужно не удалять, а дополнять фоллбэком на соответствующий токен из vkui-tokens
  • В tsx компонента не осталось логики, которая зависит от платформы
  • Компонент добавлен в src/tokenized/index.ts (в src/index.ts он так же должен быть)
  • Имя компонента добавлено в массив из styleguide/tokenized.js

Изменения

  • Переделал фотографии с использованием svg
    • возможно пофиксится [Bug][UsersStack] Перекрытие элементов #2000 (необходим пример для воспроизведения)
    • переписал маску с использованием дуг(вместо кривых Безье)
    • добавлена обводка(через css не смог реализовать)

Снимок экрана 2022-06-07 в 13 33 09

  • Для среднего размера появился счетчик
Скриншотный тест


@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Jun 3, 2022

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 1c7372e:

Sandbox Source
VKUI - default example Configuration

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 3, 2022

size-limit report 📦

Path Size
JS 257.25 KB (-0.04% 🔽)
JS (gzip) 76.22 KB (-0.5% 🔽)
JS (brotli) 64.21 KB (-0.52% 🔽)
JS, unstable 29.56 KB (0%)
CSS 270.08 KB (-0.25% 🔽)
CSS (gzip) 37.95 KB (-0.21% 🔽)
CSS (brotli) 30.78 KB (-0.21% 🔽)
CSS, unstable 942 B (0%)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 3, 2022

👀 Styleguide deployed

See the styleguide for this PR at https://vkcom.github.io/VKUI/pull/2661/

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 3, 2022

Fails
🚫
● UsersStack › android › light

New snapshot was not written. The update flag must be explicitly passed to write a new snapshot.

 + This is likely because this test is run in a continuous integration (CI) environment in which snapshots are not written by default.

  205 |               </ConfigProvider>
  206 |             )
> 207 |           ).toMatchImageSnapshot(matchScreenshot);
      |             ^
  208 |         });
  209 |       });
  210 |     });

  at _callee$ (../src/testing/e2e/utils.tsx:207:13)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
  at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:274:22)
  at Generator.prototype.<computed> [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
  at asyncGeneratorStep (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
  at _next (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)

● UsersStack › ios › light

New snapshot was not written. The update flag must be explicitly passed to write a new snapshot.

 + This is likely because this test is run in a continuous integration (CI) environment in which snapshots are not written by default.

  205 |               </ConfigProvider>
  206 |             )
> 207 |           ).toMatchImageSnapshot(matchScreenshot);
      |             ^
  208 |         });
  209 |       });
  210 |     });

  at _callee$ (../src/testing/e2e/utils.tsx:207:13)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
  at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:274:22)
  at Generator.prototype.<computed> [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
  at asyncGeneratorStep (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
  at _next (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)

● UsersStack › vkcom › light

New snapshot was not written. The update flag must be explicitly passed to write a new snapshot.

 + This is likely because this test is run in a continuous integration (CI) environment in which snapshots are not written by default.

  205 |               </ConfigProvider>
  206 |             )
> 207 |           ).toMatchImageSnapshot(matchScreenshot);
      |             ^
  208 |         });
  209 |       });
  210 |     });

  at _callee$ (../src/testing/e2e/utils.tsx:207:13)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
  at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:274:22)
  at Generator.prototype.<computed> [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
  at asyncGeneratorStep (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
  at _next (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
🚫
● RichCell › android › light

Expected image to match or be a close match to snapshot but was 0.14872854750941816% different from snapshot (1137 differing pixels).
See diff for details: /home/runner/work/VKUI/VKUI/__diff_output__/richcell-android-light-1-diff.png

  205 |               </ConfigProvider>
  206 |             )
> 207 |           ).toMatchImageSnapshot(matchScreenshot);
      |             ^
  208 |         });
  209 |       });
  210 |     });

  at _callee$ (../src/testing/e2e/utils.tsx:207:13)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
  at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:274:22)
  at Generator.prototype.<computed> [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
  at asyncGeneratorStep (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
  at _next (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
      at runMicrotasks (<anonymous>)

● RichCell › ios › light

Expected image to match or be a close match to snapshot but was 0.14872854750941816% different from snapshot (1137 differing pixels).
See diff for details: /home/runner/work/VKUI/VKUI/__diff_output__/richcell-ios-light-1-diff.png

  205 |               </ConfigProvider>
  206 |             )
> 207 |           ).toMatchImageSnapshot(matchScreenshot);
      |             ^
  208 |         });
  209 |       });
  210 |     });

  at _callee$ (../src/testing/e2e/utils.tsx:207:13)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
  at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:274:22)
  at Generator.prototype.<computed> [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
  at asyncGeneratorStep (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
  at _next (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)

● RichCell › vkcom › light

Expected image to match or be a close match to snapshot but was 0.046465014577259475% different from snapshot (561 differing pixels).
See diff for details: /home/runner/work/VKUI/VKUI/__diff_output__/richcell-vkcom-light-1-diff.png

  205 |               </ConfigProvider>
  206 |             )
> 207 |           ).toMatchImageSnapshot(matchScreenshot);
      |             ^
  208 |         });
  209 |       });
  210 |     });

  at _callee$ (../src/testing/e2e/utils.tsx:207:13)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
  at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:274:22)
  at Generator.prototype.<computed> [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
  at asyncGeneratorStep (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
  at _next (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
🚫
● ModalCard mobile › ios › light w_2

Expected image to match or be a close match to snapshot but was 1.1021548072850487% different from snapshot (8327 differing pixels).
See diff for details: /home/runner/work/VKUI/VKUI/__diff_output__/modalcard-mobile-ios-light-w_2-1-diff.png

  205 |               </ConfigProvider>
  206 |             )
> 207 |           ).toMatchImageSnapshot(matchScreenshot);
      |             ^
  208 |         });
  209 |       });
  210 |     });

  at _callee$ (../src/testing/e2e/utils.tsx:207:13)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
  at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:274:22)
  at Generator.prototype.<computed> [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
  at asyncGeneratorStep (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
  at _next (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)

● ModalCard mobile › android › light w_2

Expected image to match or be a close match to snapshot but was 1.1112875900042354% different from snapshot (8396 differing pixels).
See diff for details: /home/runner/work/VKUI/VKUI/__diff_output__/modalcard-mobile-android-light-w_2-1-diff.png

  205 |               </ConfigProvider>
  206 |             )
> 207 |           ).toMatchImageSnapshot(matchScreenshot);
      |             ^
  208 |         });
  209 |       });
  210 |     });

  at _callee$ (../src/testing/e2e/utils.tsx:207:13)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
  at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:274:22)
  at Generator.prototype.<computed> [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
  at asyncGeneratorStep (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
  at _next (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)

● ModalCard tablet › ios › light w_3

Expected image to match or be a close match to snapshot but was 0.004102454337899544% different from snapshot (69 differing pixels).
See diff for details: /home/runner/work/VKUI/VKUI/__diff_output__/modalcard-tablet-ios-light-w_3-1-diff.png

  205 |               </ConfigProvider>
  206 |             )
> 207 |           ).toMatchImageSnapshot(matchScreenshot);
      |             ^
  208 |         });
  209 |       });
  210 |     });

  at _callee$ (../src/testing/e2e/utils.tsx:207:13)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
  at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:274:22)
  at Generator.prototype.<computed> [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
  at asyncGeneratorStep (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
  at _next (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)

● ModalCard tablet › android › light w_3

Expected image to match or be a close match to snapshot but was 0.004102454337899544% different from snapshot (69 differing pixels).
See diff for details: /home/runner/work/VKUI/VKUI/__diff_output__/modalcard-tablet-android-light-w_3-1-diff.png

  205 |               </ConfigProvider>
  206 |             )
> 207 |           ).toMatchImageSnapshot(matchScreenshot);
      |             ^
  208 |         });
  209 |       });
  210 |     });

  at _callee$ (../src/testing/e2e/utils.tsx:207:13)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
  at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:274:22)
  at Generator.prototype.<computed> [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
  at asyncGeneratorStep (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
  at _next (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)

● ModalCard › vkcom › light

Expected image to match or be a close match to snapshot but was 0.004053901615920435% different from snapshot (69 differing pixels).
See diff for details: /home/runner/work/VKUI/VKUI/__diff_output__/modalcard-vkcom-light-1-diff.png

  205 |               </ConfigProvider>
  206 |             )
> 207 |           ).toMatchImageSnapshot(matchScreenshot);
      |             ^
  208 |         });
  209 |       });
  210 |     });

  at _callee$ (../src/testing/e2e/utils.tsx:207:13)
  at tryCatch (../node_modules/regenerator-runtime/runtime.js:45:40)
  at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:274:22)
  at Generator.prototype.<computed> [as next] (../node_modules/regenerator-runtime/runtime.js:97:21)
  at asyncGeneratorStep (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
  at _next (../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
Warnings
⚠️

8 changed screenshots found — review & update them via "Update Screenshots" action before merging.

Changed screenshots

modalcard-mobile-android-light-w_2-1
modalcard-mobile-ios-light-w_2-1
modalcard-tablet-android-light-w_3-1
modalcard-tablet-ios-light-w_3-1
modalcard-vkcom-light-1
richcell-android-light-1
richcell-ios-light-1
richcell-vkcom-light-1

Code coverage

lines3788 / 482778.47%
statements3857 / 491978.41%
functions840 / 105179.92%
branches3175 / 447570.94%
branchesTrue0 / 0100.00%

Generated by 🚫 dangerJS against d558d15

@SevereCloud SevereCloud marked this pull request as draft June 3, 2022 19:47
@SevereCloud SevereCloud force-pushed the SevereCloud/issue2588 branch from bf0b3a8 to 170bce8 Compare June 7, 2022 10:15
@SevereCloud SevereCloud marked this pull request as ready for review June 7, 2022 11:06
...restProps
} = props;
export const UsersStack = ({
photos = [],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не совсем про токенизацию, но: может, поменяем этот проп на src а photos задепрекейтим? Для консистентности будет хорошо (на src работает GridAvatar, например).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хм, а это нормально что мы там используем src и пихаем внутрь массив?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот меня тоже напрягает этот момент, я бы использовала srcSet скорее, он как раз массив принимает. Но он тоже про другое. При этом хочется унифицировать название между компонентами.

@SevereCloud SevereCloud force-pushed the SevereCloud/issue2588 branch from 9404f81 to a814104 Compare June 7, 2022 13:35
@SevereCloud SevereCloud force-pushed the SevereCloud/issue2588 branch from a814104 to d558d15 Compare June 7, 2022 18:54
@SevereCloud
Copy link
Copy Markdown
Contributor Author

Дизайн ревью ✅ (by @Zaycevq)

@SevereCloud SevereCloud merged commit 37fbc79 into master Jun 8, 2022
@SevereCloud SevereCloud deleted the SevereCloud/issue2588 branch June 8, 2022 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Токенизировать UsersStack

3 participants