feat: viewportのカンマ区切り複数指定に対応 - #7
Merged
Merged
Conversation
storycapは-Vを複数渡すと、2つ以上指定した場合のみ自動でファイル名に _WxH サフィックスを付ける仕様(単一指定時は従来通り)。これを利用し、 action.ymlのviewport inputをカンマ区切りで複数解釈するよう変更するだけで SP/PC両方の幅を同時に撮影・比較できるようにした。 - 単一viewport指定時: 挙動・ファイル名とも変更なし(既存baseline互換) - 複数viewport指定時: story名に_WxHサフィックスが付いた別ファイルとして 撮影・比較・レポートされる(main.mjs側の変更は不要、既存ロジックが そのままファイルパス単位で動作する) ローカルでstorycapを実際に実行し、単一/複数viewportそれぞれの ファイル名パターンを検証済み。
|
🎉 This PR is included in version 1.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
「もっと使ってもらうためには」の相談で決めた施策の3番目。SP/PC両方の幅を同時にVRT撮影・比較できるようにする。
変更内容
action.ymlのviewportinput をカンマ区切りで複数解釈するよう変更(storycap -Vを viewport ごとに渡す)_WxHサフィックスを付ける仕様のため、単一viewport指定時は挙動・ファイル名とも変更なし(既存baselineへの影響ゼロ)main.mjs側の変更は不要(story名がファイルパス単位でそのまま扱われるため、複数viewportも既存のbaseline比較/report生成ロジックがそのまま動く)examples/vrt-custom.yamlを更新動作確認
-V 390x844のみ)ではファイル名にサフィックスが付かないこと、複数viewport(-V 390x844 -V 1280x800)ではPrimary_390x844.png/Primary_1280x800.pngのように分かれることを確認actionlintOK (exit 0)🤖 Generated with Claude Code