refactor(tools): #176 B 案 PR 5a — ConfigConverter + QrReader + JanCode inline style 撤去 - #283
Merged
Merged
Conversation
Phase 0: spec / plan 配置 + global.css @layer components に QrReader <video> 要素用 .qr-video-preview class 1 件を追加。 PR 1〜4 で導入済の class (caption, body-emphasis, text-default, text-muted, text-on-primary, text-error, text-error-text, text-primary, text-link-color, text-warning, bg-default, bg-subtle, bg-surface, bg-error-tint, bg-warning-tint, border-default, border-input, alert-success, alert-error, btn-link-plain, summary-no-marker, hover-bg-subtle 等) を再利用するため 新規 class は最小限 1 件のみ。JanCode の <summary> hover は PR 4 既存の .hover-bg-subtle を再利用 (新規不要)。 Phase 1 (sonnet 並列 × 3 Track) で ConfigConverter / QrReader / JanCode の migration を進める。Race 回避のため subagent は commit せず、 Phase 1.5 で親 Opus が順次 commit する運用 (PR 4 で確立)。 ref: docs/projects/issue-176-b-plan-progress.md Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
inline style 11 件を @layer components の class + Tailwind utility に置換。 変換元/変換先ラベルを `caption text-muted min-w-10` に集約、警告メッセージ カードを `border border-warning bg-warning-tint` で表現、schema toggle ボタンを `caption text-link-color btn-link-plain` で構成、arrow rotation を `rotate-90` Tailwind 標準で表現、kbd を `caption text-muted font-mono` に置換、検証結果カードは既存 .alert-success / .alert-error 利用。 import { caption, colors } from '@/utils/styles' を削除。 ref: docs/superpowers/specs/2026-05-07-issue-176-b5a-config-qr-jan-design.md §1 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…le-level スタイル定数解体 inline style 11 件 + module-level スタイル定数 4 個 (rescanButtonStyle / startCameraButtonStyle / stopCameraButtonStyle / uploadLabelStyle) を 全て解体し、@layer components の class + Tailwind utility に置換。 カメラ起動ボタンを bg-primary text-on-primary、停止ボタンを border-error bg-error-tint text-error で表現。<video> 要素は新規 .qr-video-preview class で黒背景を維持、display 切替は Tailwind hidden クラスで表現。 file input は Tailwind sr-only に置換 (a11y 同等以上)。 uploadLabelStyle(false) 呼び出しがないことを事前確認の上、 disabled 分岐は削除 (YAGNI)。 URL 警告カードは border border-warning bg-warning-tint、URL 開くボタンは border border-warning bg-default で構成。 import { caption, colors } from '@/utils/styles' を削除。 React named import (React.ChangeEvent) は維持。 ref: docs/superpowers/specs/2026-05-07-issue-176-b5a-config-qr-jan-design.md §2 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ry hover を CSS に移行 inline style 9 件を @layer components の class + Tailwind utility に置換。 e.currentTarget.style.background mutation (onMouseEnter/onMouseLeave で hover bg を直接書き換え) 2 件を削除し、PR 4 既存の .hover-bg-subtle class で hover 挙動を CSS で表現。 結果カードを border border-default bg-surface、完成コードの文字間隔を tracking-[0.1em] arbitrary value、計算過程 <details> を border border-default + <summary> を caption font-bold text-muted summary-no-marker hover-bg-subtle で構成。バーコードプレビュー wrapper を border border-default bg-default。 memory feedback_tailwind_v4_layer_variant.md: hover:bg-subtle variant は @layer components 手書き class に効かないため、専用 .hover-bg-subtle class (PR 4 で導入済) を再利用。 import { bodyEmphasis, caption, colors } from '@/utils/styles' を削除。 ref: docs/superpowers/specs/2026-05-07-issue-176-b5a-config-qr-jan-design.md §3 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ConfigConverter.tsx / QrReader.tsx / JanCode.tsx の inline style 撤去完了に伴い progressive migration tracker に追加 (21 → 24 件)。 ref: docs/superpowers/specs/2026-05-07-issue-176-b5a-config-qr-jan-design.md §5 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
PR 3-4 経験を踏まえ merge 待ちの間も SoT を current 化する運用。 更新内容: - 進捗状況テーブル: PR 5a を 🔄 PR open + #283 link に変更 - 着手済 PR 履歴: PR 5a (#283) section を追加 - 新規 class .qr-video-preview の 1 件のみ - JanCode hover は PR 4 既存 .hover-bg-subtle 再利用 - QrReader module-level スタイル定数 4 個全削除 - subagent 非 commit 運用 2 回目、安定運用確認 ref: #283 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
🖼️ Visual Regression Test 結果
|
Owner
Author
レビュー: #176 B 案 PR 5a3 ファイル (ConfigConverter / QrReader / JanCode) の inline style + CSSOM hover mutation 撤去を、既存 class group (PR 1〜4 で導入) と Tailwind v4 auto-utility で完結させた surgical migration。新規 CSS class は ✅ 正しさ・regression risk
|
This was referenced May 7, 2026
self-review NIT 2 件を follow-up issue 化したが、issue 本文に 「PR 5b / PR 6 で検討」と書いただけでは future session が GitHub 全 issue 一覧を grep しないと想起できないため、SoT 側に 3 箇所の参照を追加して discoverability を担保: 1. 着手済 PR 履歴 PR 5a (#283) section に self-review NIT follow-up を追記 2. follow-up issue 処理タイミング表に #284 / #285 行を追加 (タイトルも「PR 5a」を含む形に更新) 3. PR 6 必須チェックリスト末尾の follow-up 系 issue list に 「PR 5a (#283) 由来: #284 / #285」エントリを追加 これにより PR 5b / PR 6 着手時に SoT を読めば PR 5a の NIT が自動的に視野に入る。 ref: #283 ref: #284 ref: #285 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
fumtas1k
enabled auto-merge (squash)
May 7, 2026 11:56
7 tasks
fumtas1k
added a commit
that referenced
this pull request
May 7, 2026
PR 3-5a 経験を踏まえ merge 待ちの間も SoT を current 化する運用。 更新内容: - 進捗状況テーブル: - PR 5a を ✅ merged + #283 link に更新 (PR 5a merge 後に未反映だった) - PR 5b を 🔄 PR open + #286 link に変更 - 着手済 PR 履歴: PR 5b (#286) section を追加 - 新規 class 追加なし (PR 1〜5a 資産で 100% カバー) - JsonCsv の dead import 発見・削除 - ulid-generator.spec.ts CSP gate 化で #262 close 条件達成 - #234 19 spec チェックリストで該当 2 件消込 - subagent 非 commit 運用 3 回目、安定運用確認 - infra/feature 分離の例外判断を spec で記録 - ulid-generator.spec.ts 表記訂正: 「新設」→「既存 spec の refactor + 陽性対照追加」(調査結果、既存 spec として存在を確認) - PR 5 分割設計メモ: UlidGenerator 行を「E2E 新設」→「E2E gate 化」、 JsonXml 行を「要追加調査」→「import 不在 = alignItems のみ で color 不使用」に訂正 - PR 6 必須チェックリスト末尾: - PR 5b (#286) を follow-up 対象に追加 - #262 を「PR 5b (#286) で close 済」に更新 - #281 を「PR 5b 完了 — 後続 PR or #280 着手時に併設候補」に - PR 5b 由来 follow-up 起票なしを明記 ref: #286 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
fumtas1k
added a commit
that referenced
this pull request
May 7, 2026
…or E2E CSP gate 化 (#262 close) (#286) * chore(spec): #176 B 案 PR 5b spec / plan 追加 Phase 0: spec / plan 配置のみ (global.css への追加なし、PR 1〜5a の class 資産で 100% カバー)。 スコープ: - migration: Base64Codec (2) + JsonCsv (1 + dead import) + JsonXml (1) + QrCode (7) + UlidGenerator (2) = 計 13 inline style 撤去 - zero-style 登録: QrTicket (root) + UrlEncoder の MIGRATED_FILES 追加 - E2E gate 拡張: tests/e2e/ulid-generator.spec.ts を withProductionCsp 化 + 陽性対照メタテスト 1 件追加 (#262 close) 進行: Phase 1 (sonnet 並列 × 3 Track) で Track A (alignItems 系小物 3 ファイル + JsonCsv dead import) / Track B (QrCode + UlidGenerator) / Track C (ulid-generator E2E refactor) を並列実装。Race 回避のため subagent は commit せず、Phase 1.5 で親 Opus が順次 commit する 運用 (PR 4 / 5a 継承)。 ref: docs/projects/issue-176-b-plan-progress.md Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * refactor(tools): #176 B 案 PR 5b — Base64Codec + JsonCsv + JsonXml inline style 撤去 inline style 4 件 (Base64: 2 / JsonCsv: 1 / JsonXml: 1) + JsonCsv の dead import (caption / colors を import するが本文で未使用) を撤去。 - Base64: 形式ラベルを `caption text-muted`、wrapper alignItems を `items-start` (Tailwind 標準) に置換。 - JsonCsv: wrapper alignItems を `items-start` に置換、本文で使われて いない `import { caption, colors }` を削除。 - JsonXml: wrapper alignItems を `items-start` に置換。styles.ts import はもとから不在 (alignItems のみで color 不使用)。 新規 class 追加なし、PR 1〜5a 既存資産でカバー。 ref: docs/superpowers/specs/2026-05-07-issue-176-b5b-rest-tools-and-ulid-e2e-design.md §1〜§3 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(tools): #176 B 案 PR 5b — QrCode + UlidGenerator inline style 撤去 inline style 9 件 (QrCode: 7 / UlidGenerator: 2) を撤去し、 @layer components の意味クラス + Tailwind utility に置換。 - QrCode: 誤り訂正レベル/プレビュー/復元率を caption / body-emphasis / text-default / text-muted で表現。プレビューカード wrapper を border border-default overflow-hidden、header を bg-subtle border-b border-default、SVG 描画コンテナを bg-default w-50 h-50 (200x200px) で構成。data-testid="qr-code-container" は維持。 - UlidGenerator: ULID 先頭 10 文字の primary 強調を .text-primary (PR 2)、件数表示ヘッダーを body-emphasis text-default で表現。 両ファイルから import { ... } from '@/utils/styles' を削除。 ref: docs/superpowers/specs/2026-05-07-issue-176-b5b-rest-tools-and-ulid-e2e-design.md §4〜§5 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(e2e): #176 B 案 PR 5b — ulid-generator.spec.ts を withProductionCsp 化 + 陽性対照メタテスト追加 (#262 partial) PR #278 で導入された withProductionCsp ラッパで既存 5 件を包み、 ulid-generator ページに本番相当の CSP を注入した状態で E2E 検証を 行うように refactor。test.beforeEach は削除し、各 test が withProductionCsp(browser, '/tools/ulid-generator', async (page) => {...}) の 1 行で hydration 待ち + assertNoViolations 自動呼出を 内包する形式に統一 (uuid-v7.spec.ts と同 pattern)。 末尾に陽性対照メタテスト 1 件を追加: browser.newContext() で新規 context を作り applyProductionCsp 直接利用の inline pattern で 意図的な CSP 違反 (外部 origin <script src>) を発生させ、 guard.violations.length が増えることを expect.poll で確認する。 helper 改修時の保険 (memory feedback_positive_control_for_gates.md)。 uuid-v7 (PR 3 で対応済) + ulid-generator (本 PR) で「generator ページ全体に CSP gate」が成立し、#262 close 条件達成。 #234 の 19 spec チェックリストでも該当 2 件を消込。 ref: docs/superpowers/specs/2026-05-07-issue-176-b5b-rest-tools-and-ulid-e2e-design.md §7 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * test(migration): MIGRATED_FILES に PR 5b 対象 7 件追加 (5 migration + 2 zero-style) Base64Codec / JsonCsv / JsonXml / QrCode / UlidGenerator の inline style 撤去完了 + QrTicket (root) / UrlEncoder の zero-style 登録 (PR 6 で 全件 glob 化する前の検出網に乗せる) で progressive migration tracker に 7 件追加 (24 → 31 件)。 QrTicket (root) / UrlEncoder はもとから style={{ ヒット数 0、コード 変更不要。MIGRATED_FILES に追加することで PR 6 で await glob('src/components/**/*.tsx') 等で全件カバー化したときの delta を真の migration 対象 (まだ手付かずのファイル) のみに絞れる。 ref: docs/superpowers/specs/2026-05-07-issue-176-b5b-rest-tools-and-ulid-e2e-design.md §5〜§6 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * docs(progress): #176 B 案 PR 5b (#286) の状態と特記事項を反映 + ulid spec 表記訂正 PR 3-5a 経験を踏まえ merge 待ちの間も SoT を current 化する運用。 更新内容: - 進捗状況テーブル: - PR 5a を ✅ merged + #283 link に更新 (PR 5a merge 後に未反映だった) - PR 5b を 🔄 PR open + #286 link に変更 - 着手済 PR 履歴: PR 5b (#286) section を追加 - 新規 class 追加なし (PR 1〜5a 資産で 100% カバー) - JsonCsv の dead import 発見・削除 - ulid-generator.spec.ts CSP gate 化で #262 close 条件達成 - #234 19 spec チェックリストで該当 2 件消込 - subagent 非 commit 運用 3 回目、安定運用確認 - infra/feature 分離の例外判断を spec で記録 - ulid-generator.spec.ts 表記訂正: 「新設」→「既存 spec の refactor + 陽性対照追加」(調査結果、既存 spec として存在を確認) - PR 5 分割設計メモ: UlidGenerator 行を「E2E 新設」→「E2E gate 化」、 JsonXml 行を「要追加調査」→「import 不在 = alignItems のみ で color 不使用」に訂正 - PR 6 必須チェックリスト末尾: - PR 5b (#286) を follow-up 対象に追加 - #262 を「PR 5b (#286) で close 済」に更新 - #281 を「PR 5b 完了 — 後続 PR or #280 着手時に併設候補」に - PR 5b 由来 follow-up 起票なしを明記 ref: #286 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * review fix: QrCode 200x200px を arbitrary value で固定 + PR 6 glob 化後の MIGRATED_FILES 削除を明記 レビュー指摘 #1 (要対応): QrCode SVG 描画コンテナの w-50 h-50 を w-[200px] h-[200px] (arbitrary value) に変更。 w-50 h-50 は Tailwind v4 の `--spacing: 0.25rem` 下で 12.5rem に 展開され、ブラウザ root font-size が 16px のときのみ 200px になる。 ユーザが a11y 設定で root font-size を変更している場合 (例: 20px) は 250px に拡大されてしまい、原実装の固定 200px (`width: '200px'`, `height: '200px'`) と厳密に等価ではない。 arbitrary value w-[200px] h-[200px] は build 時静的 CSS となるため CSP-safe (PR 5a の `max-w-[400px]` と同 pattern)。固定 200px の 原意図を保持。 レビュー指摘 #3 (進捗 doc): PR 6 必須チェックリストの「MIGRATED_FILES を glob 化」項目に「glob 化後 array 自体は削除する (二重管理を避ける)」 を明示。 レビュー指摘 #2 (陽性対照 URL `.invalid` 化) は nit で reviewer 自身も skip 可と明言。3 spec (uuid-v7 / config-converter / ulid-generator) の一貫性を保つため本 PR では現状維持、別 PR で 3 箇所統一を検討。 検証: - astro check: 0 errors, 0 warnings - vitest: 731 passed (43 files) - e2e qr-code (5 件) + ulid-generator (6 件) 全 pass ref: #286 (comment) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced May 7, 2026
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.
概要
#176B 案バッチの PR 5a。ConfigConverter.tsx(11 件) +QrReader.tsx(11 件) +JanCode.tsx(9 件) の JSX inline style + JanCode 内e.currentTarget.style.X = Y形式の CSSOM 直接 mutation 2 件 (<summary>のonMouseEnter/onMouseLeavehover state) を@layer componentsの意味クラス + Tailwind utility に置換する。PR 5 全体 (9 ツール) を 5a (大物 3 つ) と 5b (残り + ulid-generator E2E + #262 close) に分割した前半。
docs/superpowers/specs/2026-05-07-issue-176-b5a-config-qr-jan-design.mddocs/superpowers/plans/2026-05-07-issue-176-b5a-config-qr-jan.mddocs/projects/issue-176-b-plan-progress.md主要な変更
src/styles/global.css追加 class (1 件のみ).qr-video-preview(QrReader<video>専用、background: #000)JanCode
<summary>hover は PR 4 で導入された.hover-bg-subtleを再利用 (新規不要)。PR 1〜4 で導入済の class (
caption/body-emphasis/text-default/text-muted/text-on-primary/text-error/text-error-text/text-primary/text-link-color/text-warning/bg-default/bg-subtle/bg-surface/bg-error-tint/bg-warning-tint/border-default/border-input/alert-success/alert-error/btn-link-plain/summary-no-marker/hover-bg-subtle) で 95% 以上をカバー。ConfigConverter.tsx(11 件 → 0)caption text-muted min-w-10で表現border border-warning bg-warning-tint(Tailwind auto-utility 利用).btn-link-plain(PR 1.5) +text-link-colorで構成、arrow rotation はrotate-90Tailwind 標準.alert-success/.alert-error(PR 2) を利用import { caption, colors } from '@/utils/styles'を削除QrReader.tsx(11 件 → 0、module-level 定数 4 個解体)rescanButtonStyle/startCameraButtonStyle/stopCameraButtonStyle/uploadLabelStyle) を全削除し className 化<video>要素をw-full max-w-[400px] rounded-lg qr-video-previewで構成、display 切替は Tailwindhiddenbg-primary+.text-on-primary、停止ボタンはborder-error bg-error-tint text-errorsr-onlyに置換 (a11y 同等以上)uploadLabelStyle(false)呼び出しがないことを事前確認の上、disabled 分岐削除 (YAGNI)border border-warning bg-warning-tint、URL 開くリンクはborder border-warning bg-defaultimport { caption, colors } from '@/utils/styles'を削除 (React named import は維持)JanCode.tsx(9 件 + 2 hover refactor → 0)onMouseEnter/onMouseLeaveでe.currentTarget.style.background = ...していた 2 件 (計算過程<summary>) を削除し、PR 4 既存の.hover-bg-subtle(CSS:hover表現) で代替tracking-[0.1em]arbitrary valueborder border-default bg-surface/border border-default bg-defaultで構成<details>/<summary>marker 非表示は PR 4 既存.summary-no-markerを再利用import { bodyEmphasis, caption, colors } from '@/utils/styles'を削除Race 回避運用 (PR 4 で確立した運用継承)
PR 3 で sonnet 並列 dispatch 時に commit 結合 race が発生 → PR 4 で「subagent 非 commit」運用を初採用 → 成功。本 PR では 2 回目運用として継承:
git add/git commitを実行しない結果: commit message と内容が完全一致、prettier 巻き込みも親が制御。
CSSOM hover refactor (memory
feedback_tailwind_v4_layer_variant.md適用)JanCode の
<summary>hover を Tailwindhover:bg-subtlevariant ではなく PR 4 で導入された専用.hover-bg-subtleclass で表現。これは Tailwind v4 で@layer components内の手書き class に対してhover:variant が CSS rule を生成しない silent regression を回避するため。検証ログ (親 Opus 直接実行)
npm run test全 pass (migration test 24 件 × 2 + 陽性対照 3 件 = 51 件 pass 含む、合計 626 passed | 1 skipped)npx astro check→ 0 errors, 0 warnings, 10 hints (本 PR 無関係)npm run test:e2e全 pass (config-converter / qr-reader / jan-code 含む)aria-*/role=/data-testid=/htmlFor=削除行 = reformat 行移動のみ、現コードで存在確認済)grep -c "style={{"= 0 / 0 / 0)grep -E "\.style\.[a-zA-Z]+\s*="で setProperty 以外 = 0)_headers/astro.config.mjs/src/utils/styles.ts未変更)VRT
visual-regression.ymlで baseline 比較 (non-required check)。意図的差分があれば PR ブランチでupdate-visual-baseline.ymlをworkflow_dispatchtrigger。特に確認すべき差分点:
<video>のdisplay: none→hiddenクラス、初期状態で video が描画されないことposition: absolute視覚消去 →sr-only(clip + margin -1) で同等の不可視性<summary>hover 時の bg 変化 (CSSOM mutation 撤去後も.hover-bg-subtleで bg 変化が見える)rotate-90で 90 度回転 (transition-duration 200ms)コミット粒度
関連