Skip to content

refactor(tools): #176 B 案 PR 5a — ConfigConverter + QrReader + JanCode inline style 撤去 - #283

Merged
fumtas1k merged 7 commits into
developfrom
feature/issue-176-b5a-config-qr-jan
May 7, 2026
Merged

refactor(tools): #176 B 案 PR 5a — ConfigConverter + QrReader + JanCode inline style 撤去#283
fumtas1k merged 7 commits into
developfrom
feature/issue-176-b5a-config-qr-jan

Conversation

@fumtas1k

@fumtas1k fumtas1k commented May 7, 2026

Copy link
Copy Markdown
Owner

概要

#176 B 案バッチの 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/onMouseLeave hover state) を @layer components の意味クラス + Tailwind utility に置換する。

PR 5 全体 (9 ツール) を 5a (大物 3 つ) と 5b (残り + ulid-generator E2E + #262 close) に分割した前半。

  • spec: docs/superpowers/specs/2026-05-07-issue-176-b5a-config-qr-jan-design.md
  • plan: docs/superpowers/plans/2026-05-07-issue-176-b5a-config-qr-jan.md
  • バッチ進捗: docs/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 利用)
  • schema toggle ボタンを既存 .btn-link-plain (PR 1.5) + text-link-color で構成、arrow rotation は rotate-90 Tailwind 標準
  • 検証結果カードは既存 .alert-success / .alert-error (PR 2) を利用
  • 新規 class 追加なし
  • import { caption, colors } from '@/utils/styles' を削除

QrReader.tsx (11 件 → 0、module-level 定数 4 個解体)

  • module-level スタイル定数 4 個 (rescanButtonStyle / startCameraButtonStyle / stopCameraButtonStyle / uploadLabelStyle) を全削除し className 化
  • <video> 要素を w-full max-w-[400px] rounded-lg qr-video-preview で構成、display 切替は Tailwind hidden
  • カメラ起動ボタンは Tailwind auto-utility bg-primary + .text-on-primary、停止ボタンは border-error bg-error-tint text-error
  • 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 は維持)

JanCode.tsx (9 件 + 2 hover refactor → 0)

  • onMouseEnter/onMouseLeavee.currentTarget.style.background = ... していた 2 件 (計算過程 <summary>) を削除し、PR 4 既存の .hover-bg-subtle (CSS :hover 表現) で代替
  • 完成コード文字間隔は tracking-[0.1em] arbitrary value
  • 結果カード / バーコードプレビュー wrapper を border border-default bg-surface / border border-default bg-default で構成
  • 計算過程 <details>/<summary> marker 非表示は PR 4 既存 .summary-no-marker を再利用
  • 新規 class 追加なし
  • import { bodyEmphasis, caption, colors } from '@/utils/styles' を削除

Race 回避運用 (PR 4 で確立した運用継承)

PR 3 で sonnet 並列 dispatch 時に commit 結合 race が発生 → PR 4 で「subagent 非 commit」運用を初採用 → 成功。本 PR では 2 回目運用として継承:

  • subagent は ファイル編集 + self-verification (vitest, astro check) のみ 実施
  • subagent は git add / git commit を実行しない
  • 親 Opus が Phase 1.5 で 1 ファイルずつ stage + commit (3 commit、各 1 ファイル変更)

結果: commit message と内容が完全一致、prettier 巻き込みも親が制御。

CSSOM hover refactor (memory feedback_tailwind_v4_layer_variant.md 適用)

JanCode の <summary> hover を Tailwind hover:bg-subtle variant ではなく PR 4 で導入された専用 .hover-bg-subtle class で表現。これは 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 含む)
  • a11y 退化なし (aria-* / role= / data-testid= / htmlFor= 削除行 = reformat 行移動のみ、現コードで存在確認済)
  • inline style 残存ゼロ (grep -c "style={{" = 0 / 0 / 0)
  • CSSOM mutation 残存ゼロ (grep -E "\.style\.[a-zA-Z]+\s*=" で setProperty 以外 = 0)
  • PR 6 スコープ未侵害 (_headers / astro.config.mjs / src/utils/styles.ts 未変更)

VRT

visual-regression.yml で baseline 比較 (non-required check)。意図的差分があれば PR ブランチで update-visual-baseline.ymlworkflow_dispatch trigger。

特に確認すべき差分点:

  • QrReader <video>display: nonehidden クラス、初期状態で video が描画されないこと
  • QrReader file input: position: absolute 視覚消去 → sr-only (clip + margin -1) で同等の不可視性
  • JanCode <summary> hover 時の bg 変化 (CSSOM mutation 撤去後も .hover-bg-subtle で bg 変化が見える)
  • ConfigConverter schema toggle arrow: rotate-90 で 90 度回転 (transition-duration 200ms)

コミット粒度

<SHA> test(migration): MIGRATED_FILES に PR 5a 対象 3 件追加
<SHA> refactor(tools): #176 B 案 PR 5a — JanCode.tsx inline style 撤去 + summary hover を CSS に移行
<SHA> refactor(tools): #176 B 案 PR 5a — QrReader.tsx inline style 撤去 + module-level スタイル定数解体
<SHA> refactor(tools): #176 B 案 PR 5a — ConfigConverter.tsx inline style 撤去
<SHA> chore(spec): #176 B 案 PR 5a spec / plan / global.css foundation

関連

fumtas1k and others added 6 commits May 7, 2026 20:28
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>
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

🖼️ Visual Regression Test 結果

  • Status: ✅ 全 36 件 pass
  • Workflow run: 25494224609
  • Artifact (diff 画像 / playwright-report): 上記 workflow run の Artifacts セクションから download

diff が 意図的な visual 変更の場合: Update Visual Regression Baseline workflow を本 PR ブランチで workflow_dispatch trigger して baseline を更新。
diff が 意図しない regression の場合: 該当変更を fix。
本 check は required ではないため fail のままでも merge は可能(reviewer 判断)。

@fumtas1k

fumtas1k commented May 7, 2026

Copy link
Copy Markdown
Owner Author

レビュー: #176 B 案 PR 5a

3 ファイル (ConfigConverter / QrReader / JanCode) の inline style + CSSOM hover mutation 撤去を、既存 class group (PR 1〜4 で導入) と Tailwind v4 auto-utility で完結させた surgical migration。新規 CSS class は .qr-video-preview 1 件のみで、scope 越境 (_headers / astro.config.mjs / src/utils/styles.ts) なしを確認。総合的に高品質で approve 相当。以下、観点別の所見。


✅ 正しさ・regression risk

  • 参照先 class の存在チェック: 本 PR で使用する 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-subtlesrc/styles/global.css の grep で全件存在確認 (line 151〜537)。Tailwind auto-utility (bg-primary / border-warning / border-error / text-warning) も @theme--color-* token (line 22〜93) から正しく生成可能。
  • <video> の display 切替 (QrReader L131-138): 旧 display: block ↔ none → 新 '' ↔ hidden。Tailwind v4 Preflight が video, canvas, ... { display: block } を baseline として設定するため、active 時の class なしでも display: block が維持され、inline 化による baseline strut の regression は発生しない。OK。
  • sr-only への置換 (QrReader L156-161): 旧 position:absolute; w/h:1; opacity:0; pointer-events:none → 新 sr-only (clip + margin -1)。pointer-events:none 喪失は、width:1px; height:1px clip 下では実用上クリック不能、かつキーボード focus は依然可能で a11y 改善側。問題なし。
  • .summary-no-marker の Safari 対応: 旧 inline listStyle:'none' のみ → 新 class が list-style:none + ::-webkit-details-marker { display:none } を併設 (global.css:508-513)。Safari の disclosure triangle 抑止が改善されており 微改善
  • CSSOM hover → CSS :hover 移行: JanCode <summary>onMouseEnter/Leavee.currentTarget.style.background = ... していた 2 件が .hover-bg-subtle (:hover 擬似クラス) に置換。React の re-render を介さない CSS native hover に変わり、SSR / hydration mismatch リスクも消滅。Tailwind v4 @layer componentshover: variant 非対応 silent regression (memory feedback_tailwind_v4_layer_variant.md) を、専用 :hover 同梱 class で正しく回避している。
  • transition-colors 削除の影響: JanCode <summary>transition-colors (Tailwind utility) を削除したが、.hover-bg-subtle 自体が transition: background-color 0.15s を内包 (global.css:533) しているため、視覚的に等価。OK。
  • border + alert-success/alert-error の組み合わせ (ConfigConverter L207-214): .alert-success / .alert-errorborder-color のみ定義 (border-width/style 無し)。よって border Tailwind utility (1px solid) との併記が必要、という意図は正しく機能する。

⚠️ 軽微な気付き (NIT — blocking ではない)

  • min-w-10 (ConfigConverter L137,146): ラベルの最小幅 2.5rem を Tailwind utility で表現。原 inline minWidth:'2.5rem' と数値は一致するが、「変換元」「変換先」(2 文字) の visual alignment 用なら、より意味の伝わる inline-block min-w-[2.5rem] か新規 .label-prefix 専用 class でも良い。現状で OK、PR 6 cleanup 時に類似パターンが他ツールでも出るなら集約検討余地。
  • px arbitrary value tracking-[0.1em] (JanCode L101): 単発利用なので arbitrary で妥当。@theme 拡張するほどではない。
  • QrReader カメラ起動/停止ボタンの utility 列挙: それぞれ 8〜9 class の長い className が並ぶ。同じ「primary action button / danger action button」パターンが他ツールでも出るなら、後続 PR で .btn-action--primary / .btn-action--danger の variant 拡張 (現 --dangerbg:transparent なので、本 PR の bg-error-tint 派は新 variant 必要) を検討してもよい。本 PR でやる必要はない
  • qr-video-preview の literal #000: token 化せず PR 4 .jwt-json-value パターンを継承する旨が global.css コメントに明記されており妥当。背景色が「カメラ起動失敗時のフォールバック」として黒固定で意味を持つので token 化しない判断は正しい。

🔒 セキュリティ

  • 本 PR は presentation 層のみ (className 置換 + CSS class 追加) で、innerHTML / dangerouslySetInnerHTML / DOMParser / URL parsing / file validation のロジック面は一切変更されていない。新規 attack surface なし。
  • QrReader URL 警告ブロックの <a target="_blank">rel="noopener noreferrer" を維持 (L194)。tabnabbing 防止 OK。
  • File input の accept="image/*"validateFile() 経由のバリデーションも維持。
  • スコープ外 (_headers / CSP) 不変更を PR description に明示済み。OK

♿ アクセシビリティ

  • aria-expanded / aria-controls / aria-hidden / aria-label / aria-live / role="status" / role="alert" / htmlFor / data-testid を全て保持していることを diff レベルで確認。
  • file input の sr-only 化により、screen reader からは依然 input として認識可能 (旧 pointer-events:none より a11y 的には改善)。
  • JanCode <summary>cursor-pointer 維持。
  • 警告系 (bg-warning-tint + text-warning) のコントラスト比は global.css コメント (line 58: amber-800: amber-600 は白背景で WCAG AA 不合格) で WCAG AA 担保済を継承。

⚡ パフォーマンス

  • QrReader: module-level React.CSSProperties 定数 4 個 (約 60 行) を全削除。bundle 微減。
  • JanCode: onMouseEnter/onMouseLeave 2 件削除で React re-render 削減 + JS handler binding 削減。
  • 全体として静的 className のみになり、runtime CSS object spread コスト消滅。

🧪 テスト

  • inline-style-migration.test.ts への 3 件追加で style={{ / \.style\.X = の regex assertion が新ファイルにも適用される。陽性対照 3 件 (詐欺パターン検出 + setProperty 許容) が同ファイル内に既存で、tracker 自体の信頼性も担保済。
  • E2E (config-converter / qr-reader / jan-code) と unit + astro check の親 Opus 直接実行ログを description に明記。memory feedback_subagent_verification_trust.md の懸念解消 OK。
  • VRT は non-required check で baseline 比較。description に確認すべき差分点 4 項目を列挙済で reviewer 視点で扱いやすい。

📐 PR 運用 / commit 粒度

  • 5 commit (test 追記 + 3 ファイル個別 + foundation) で各 commit 1 ファイル化、subagent 非 commit 運用 (PR 4 で確立) を継承。race 回避効果が確認されている方針の踏襲で妥当。
  • spec/plan 約 1900 行を同 PR に同梱しているが、project の superpowers methodology (docs/superpowers/specs/..., docs/superpowers/plans/...) として一貫しており、コード実体 50 行のレビューは独立して可能 (docs は参照リファレンス)。memory feedback_pr_size.md の "10 commit / 500 行で分割検討" は コード実体の閾値で、本 PR のコード実体は遥かに下回る。OK
  • --base develop 明示、a11y 削除なし、E2E pre-PR 実行と shared-agent-rules / playbook の commander checklist を全項目満たしている。

結論

Approve 推奨。surgical で意図が明確、過去 PR の運用知見 (subagent 非 commit / hover 専用 class / aria 保護 / spec-plan 同梱) を全て踏襲。指摘事項は全て NIT で blocking なし。後続 PR 5b / PR 6 (flip + cleanup) の foundation としても問題なし。

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
fumtas1k enabled auto-merge (squash) May 7, 2026 11:56
@fumtas1k
fumtas1k merged commit 46abcb5 into develop May 7, 2026
3 checks passed
@fumtas1k
fumtas1k deleted the feature/issue-176-b5a-config-qr-jan branch May 7, 2026 11:57
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>
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.

1 participant