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

[4.2]ウィンドウ幅が630px未満の場合, 画像サイズが崩れるのを修正 #5456

Merged
merged 2 commits into from
Jul 21, 2022

Conversation

nanasess
Copy link
Contributor

概要(Overview・Refs Issue)

closes #5449

方針(Policy)

  • 商品一覧は、width, height 属性を削除しても CLS のスコア低下が軽微なので、 width, height 属性を削除する
  • 商品詳細は、CSS の transform を使用して、元のサイズ近くまで変形させた後に width, height 属性を削除する

実装に関する補足(Appendix)

テスト(Test)

画像が崩れず、CLSのスコアが0.1未満になっていることを確認

商品詳細
image

商品一覧
image

相談(Discussion)

マイナーバージョン互換性保持のための制限事項チェックリスト

  • 既存機能の仕様変更はありません
  • フックポイントの呼び出しタイミングの変更はありません
  • フックポイントのパラメータの削除・データ型の変更はありません
  • twigファイルに渡しているパラメータの削除・データ型の変更はありません
  • Serviceクラスの公開関数の、引数の削除・データ型の変更はありません
  • 入出力ファイル(CSVなど)のフォーマット変更はありません

レビュワー確認項目

  • 動作確認
  • コードレビュー
  • E2E/Unit テスト確認(テストの追加・変更が必要かどうか)
  • 互換性が保持されているか
  • セキュリティ上の問題がないか
    • 権限を超えた操作が可能にならないか
    • 不要なファイルアップロードがないか
    • 外部へ公開されるファイルや機能の追加ではないか
    • テンプレートでのエスケープ漏れがないか

Cumulative Layout Shift(CLS)の影響を受けないよう transform で正しいサイズ付近まで変形させる
商品一覧は width, height が無くてもCumulative Layout Shift(CLS)のスコ
ア低下は軽微なため
@codecov-commenter
Copy link

Codecov Report

Merging #5456 (477cb8f) into 4.2 (3c6c26a) will increase coverage by 24.47%.
The diff coverage is n/a.

@@              Coverage Diff              @@
##                4.2    #5456       +/-   ##
=============================================
+ Coverage     53.02%   77.49%   +24.47%     
- Complexity     6166     6247       +81     
=============================================
  Files           466      468        +2     
  Lines         20959    21004       +45     
=============================================
+ Hits          11113    16278     +5165     
+ Misses         9846     4726     -5120     
Flag Coverage Δ
E2E 49.48% <ø> (-0.01%) ⬇️
Unit 76.99% <ø> (+65.66%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Eccube/EventListener/ExceptionListener.php 83.67% <0.00%> (-4.09%) ⬇️
src/Eccube/Service/CsvImportService.php 71.96% <0.00%> (-1.96%) ⬇️
.../Eccube/Stream/Filter/SjisToUtf8EncodingFilter.php 80.64% <0.00%> (ø)
src/Eccube/Stream/Filter/ConvertLineFeedFilter.php 100.00% <0.00%> (ø)
src/Eccube/Twig/Extension/EccubeExtension.php 82.35% <0.00%> (+0.98%) ⬆️
src/Eccube/Util/CacheUtil.php 82.85% <0.00%> (+1.42%) ⬆️
...ntroller/Admin/Setting/Shop/DeliveryController.php 81.81% <0.00%> (+1.70%) ⬆️
src/Eccube/Entity/Member.php 85.56% <0.00%> (+2.06%) ⬆️
...Eccube/Controller/Admin/Content/FileController.php 87.13% <0.00%> (+2.07%) ⬆️
...ntroller/Admin/Customer/CustomerEditController.php 95.34% <0.00%> (+2.32%) ⬆️
... and 187 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c6c26a...477cb8f. Read the comment docs.

@chihiro-adachi chihiro-adachi added this to the 4.2.0 milestone Jul 21, 2022
@chihiro-adachi
Copy link
Contributor

@nanasess
ありがとうございます。修正確認しました。

@chihiro-adachi chihiro-adachi merged commit 27b3131 into EC-CUBE:4.2 Jul 21, 2022
@nanasess nanasess deleted the fix-imagesize branch October 3, 2022 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants