Skip to content

L0: IME × controlled input パターンを規約格上げ(CLAUDE.md / sensors / IOS-SAFARI-NOTES) - #39

Merged
samejima-ai merged 1 commit into
mainfrom
claude/docs-uncontrolled-input-rule
May 18, 2026
Merged

L0: IME × controlled input パターンを規約格上げ(CLAUDE.md / sensors / IOS-SAFARI-NOTES)#39
samejima-ai merged 1 commit into
mainfrom
claude/docs-uncontrolled-input-rule

Conversation

@samejima-ai

Copy link
Copy Markdown
Owner

背景

直前の PR #37 (SearchBar) で、docs/IOS-SAFARI-NOTES.md §1 に既に明文化されていた「IME × controlled input は壊れる」パターンの再発が発覚した。事例集レベルの記述だけでは新規 input を追加するたびに踏み抜くリスクが残るため、L0 として規約レベルへ格上げする。

並走して提示した「中: スクロール容器 × 座標系規約」「低: PATTERNS.md 整備」「却下: 自動テスト強化」のうち、コスト最小・効果最大の「高」のみを本 PR スコープとする。

変更内容

CLAUDE.md

  • 「## コーディング規約」: ユーザー入力 input/textarea は uncontrolled (defaultValue) パターンを既定とする旨を追加。理由(iOS Safari IME 競合)/ 外部値流し込みの推奨パターン(key 再マウント or ref imperative)/ 例外条件(type="number" 等の非 IME 入力)を併記
  • 「## 禁止事項」: IME を伴う controlled 入力パターンを明示禁止に追加(docs/IOS-SAFARI-NOTES.md §1 へ cross-reference)

sensors/inferential.md

  • §5「技術パターン整合チェック(CLAUDE.md 規約照合)」を新設。L1 自己検証で新規 input が uncontrolled になっているか、controlled へ後退させていないか、外部値流し込みが key/ref パターンになっているかを目視確認する 3 項目を配置

docs/IOS-SAFARI-NOTES.md

検証 (§7.4 自己検証)

  • broken reference: cross-references(CLAUDE.mddocs/IOS-SAFARI-NOTES.mdsensors/inferential.md §5)はいずれも実在の見出しを指す
  • DONT 自己照合: 追加した規約は DONT.md と矛盾しない(むしろ「常設ボタンを増やす変更は早いを損ねる」等と同じ「踏み抜きパターン抑止」方向)
  • scaffold smoke test: コード未変更のため再実行不要、ただし npm run lint / npm test (228 件) は通過確認済
  • 受け入れ基準: SPEC/DONT/REGIME いずれにも変更なし、既存実装との整合維持

SPEC 整合

  • SPEC.md / DONT.md / REGIME.md: 変更なし
  • 既存実装(SearchBar / MemoField / FloatingEditor / StockNameEditInput / ストック追加 input)はすべて既に uncontrolled パターンで規約適合済み
  • 新たな技術依存・パッケージ追加なし

https://claude.ai/code/session_01NwewRBjFDBUN6Xgn8TJMDK


Generated by Claude Code

PR #37 (SearchBar) が docs/IOS-SAFARI-NOTES.md §1 で明文化されていた
controlled input × iOS Safari IME の禁忌パターンを再発した件を受け、
事例集レベルから規約レベルへ格上げする。

- CLAUDE.md「コーディング規約」: ユーザー入力 input/textarea は
  uncontrolled (`defaultValue`) パターンを既定とする旨を明記。
  外部値流し込みの推奨パターン(key 再マウント / ref imperative)と
  例外条件(type="number" 等の非 IME 入力)も併記
- CLAUDE.md「禁止事項」: IME を伴う controlled 入力パターンを明示禁止に追加
- sensors/inferential.md §5「技術パターン整合チェック」を新設し、
  L1 自己検証で新規 input が uncontrolled になっているかを目視確認する経路を確立
- docs/IOS-SAFARI-NOTES.md §1 冒頭に規約格上げ済みの cross-reference を追加し、
  「該当箇所(修正済み)」に SearchBar (PR #37) を追記、履歴に PR #37 を追加

SPEC.md / DONT.md / REGIME.md 変更なし。新たな技術依存追加なし。
typecheck / lint / 228 tests 全て通過。

https://claude.ai/code/session_01NwewRBjFDBUN6Xgn8TJMDK
Copilot AI review requested due to automatic review settings May 18, 2026 14:25
@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cookpato Ready Ready Preview, Comment May 18, 2026 2:25pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documentation-only PR promoting the "IME × controlled input" anti-pattern from a case-study note to a project-wide convention, after a recurrence in PR #37 (SearchBar). Adds rule entries in CLAUDE.md (coding rules + prohibitions), a new L1 self-check section in sensors/inferential.md, and cross-reference/history updates in docs/IOS-SAFARI-NOTES.md. No code changes.

Changes:

  • Add uncontrolled-input default rule and explicit prohibition of controlled IME inputs in CLAUDE.md, with cross-reference to iOS Safari notes.
  • New §5 in sensors/inferential.md listing 3 visual-check items for input-pattern compliance.
  • Add upgrade banner, SearchBar entry, and 2026-05-18 history line in docs/IOS-SAFARI-NOTES.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
CLAUDE.md Adds uncontrolled-input rule under coding rules and matching prohibition entry.
sensors/inferential.md Adds §5 technical-pattern compliance checklist for input UIs.
docs/IOS-SAFARI-NOTES.md Adds rule-promotion callout, SearchBar entry to fixed list, and history entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@samejima-ai
samejima-ai merged commit 18ad50b into main May 18, 2026
3 checks passed
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.

3 participants