Skip to content

fix(ux): Phase 4 — ?s= 注文の受取先開示・掟 8 の a11y 名修正・Lighthouse 対象拡大・SIWE uri 束縛・決済ログ日次分割 (10 件) - #431

Merged
cipherwebllc merged 1 commit into
mainfrom
fix/review5-phase4-a11y-ux
Sep 3, 2026
Merged

fix(ux): Phase 4 — ?s= 注文の受取先開示・掟 8 の a11y 名修正・Lighthouse 対象拡大・SIWE uri 束縛・決済ログ日次分割 (10 件)#431
cipherwebllc merged 1 commit into
mainfrom
fix/review5-phase4-a11y-ux

Conversation

@cipherwebllc

Copy link
Copy Markdown
Owner

背景

第 5 回全コードベースレビュー Phase 4 (a11y / UX / 観測)。実装 Opus 5 (worktree)・監査 Fable 5.1 (main へ rebase・full vitest・build・bundle 予算・実機スクショ)。

変更

  • D1 MobileOrderView: 印刷 QR (?s=・handle 無し) の注文ページに「受取先 0x1111…1111」と「この店舗情報は QR に含まれる申告です。受取先をご確認ください」を店名直下に表示 (@handle 経路は不変)。偽ステッカー QR への識別材料
  • D3 ?s= 注文でメモ欄が配信不能なのに表示されていた → handle + relay ON のときだけ表示
  • D4/D5 掟 8 違反 2 件: カート合計ボタンの aria-label 削除 (SR に点数・合計が聞こえる)・CopyableField を sr-only 併記に (hash の可視テキストが a11y 名に含まれる)
  • D6 .lighthouserc.json に /ja/checkout と /ja/scan を追加 (決済系ページが掟 8 のガード対象に。prod build で 200 を確認)
  • D7 @handle の meta description を stripControlChars + truncateGraphemes に (サロゲート分断防止)
  • D11 lucide アイコンを aria-hidden + sr-only ラベル
  • C11 認証必須 GET 5 本に Cache-Control: private, no-store
  • C12 lib/siwe.ts: SIWE の uri を domain と同じ許可リスト + https (localhost のみ http) で束縛
  • C2 /api/log/payment: errorMessage 500 字で切り詰め・日次キー openpay:payments:log:YYYYMMDD (TTL 400 日) を追加書込 (legacy キーは不変)・limiter を hashIp(clientIp) に

検証 (Fable 側)

  • typecheck / eslint green・full vitest 461 files / 9072 tests 全 pass
  • npm run build OK・bundle 予算据え置き (/pay 438/438・/tip 436/436)
  • 実機スクショ (mobile・/ja/order?s=): 受取先行と注記が店名直下に表示

公開文言 (merge 前に確認をお願いします・MobileOrder namespace)

  • viewReceiverLabel ja「受取先」/ en "Receiving address"
  • viewReceiverNotice ja「この店舗情報は QR に含まれる申告です。受取先をご確認ください」/ en "Shop details come from the QR itself. Please check the receiving address."

money-path 不変。

🤖 Generated with Claude Code

https://claude.ai/code/session_015CNMEwurCJNTrzvr2qypSd

…i 束縛・決済ログの日次分割

2026-09-02 コードレビュー Phase 4 (D1/D3/D4/D5/D6/D7/D11/C11/C12/C2)。

D1 (P1) MobileOrderView: 自己完結の ?s= 注文トークンは店名/アイコン/SNS/受取先を
QR 作成者が自由に書けるのに受取先が一切表示されなかった。handle が無い経路にだけ
shortAddress(config.receiver) と「QR に含まれる申告」である旨を出す。@handle 経路は不変。

D3 (P2) 注文メモは orderId (受注リレー + @handle) 経由でしか店主に届かないため、
?s= 注文では入力しても届かない。textarea を handle && env.enableOrderRelay で閉じる。

D4 (P2) MobileOrderCartBar: カートトグルの aria-label が可視テキスト (点数 + ラベル +
総額) を上書きしていた (WCAG 2.5.3 / 掟 8)。aria-label を外し a11y 名を可視テキストから
導出する (aria-expanded は維持)。

D5 (P2) CopyableField: button の aria-label が可視ハッシュを落としていた + 汎用要素
(span) への aria-label は無効 ARIA。両方外し、sr-only テキストで補う。

D6 (P2) .lighthouserc.json に /ja/checkout (e2e fixture 由来の静的 URL) と /ja/scan を追加。
どちらも認証・flag 不要で描画される。color-contrast は off のまま。

D7 (P2) @handle の meta description が bio.slice(0, 90) でサロゲートを割っていた。
stripControlChars + truncateGraphemes (既存 export) に置換。

D11 (P3) 店舗情報の lucide アイコンを aria-hidden にし、項目名を sr-only テキストへ。

C11 (P3) 認証必須 GET (handle / order feed / order token / order calls / freee status) の
成功応答に Cache-Control: private, no-store を付与。

C12 (P3) SIWE の uri が未検証だった。domain と同じ許可リスト + https (localhost のみ http)
を要求し、不一致は invalid_message で弾く。route は純粋コア呼び出しのままで変更なし。

C2 (P2) /api/log/payment: (1) errorMessage を 500 字で切詰め (拒否しない)、
(2) 日次パーティション openpay:payments:log:YYYYMMDD へ二重書き + TTL 400 日
(レガシー単一リストへの LPUSH は据え置き = export/stats 不変)、
将来 reader 用に lib/paymentLog へ paymentLogDailyKey / listPaymentLogKeys を追加、
(3) limiter key を hashIp(clientIp(req)) に変更 (IP_HASH_SECRET 未設定時のみ
従来の anonymizeIp に fallback・60/60 は不変)。

検証: typecheck / eslint(変更ファイル) / full vitest (461 files・9072 tests 全 pass) /
next build 成功。

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015CNMEwurCJNTrzvr2qypSd
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
openpay Ignored Ignored Preview Sep 3, 2026 4:57am UTC

Request Review

@cipherwebllc
cipherwebllc merged commit d815d61 into main Sep 3, 2026
6 checks passed
@cipherwebllc
cipherwebllc deleted the fix/review5-phase4-a11y-ux branch September 3, 2026 05:25
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