Repository navigation
iOSでプリセット名モーダルがキーボード表示時に画面外に押し出されるバグを修正 - #5572
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughSavePresetNameModalで、表示時のiOS向けフォーカス挙動を追加しました。モーダルがvisibleになったとき、iOSではモーダルアニメーションとキーボード回避レイアウト完了後に300ms遅延でTextInputにフォーカスし、アンマウント時にタイマーをクリアします。TextInputのautoFocus条件をiOS以外に変更しました。 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/SavePresetNameModal.tsx (1)
112-118: iOS 向けの遅延フォーカス処理は適切です。モーダルアニメーション完了後にフォーカスを設定するアプローチは、KeyboardAvoidingView との競合を避ける有効な解決策です。
ただし、
300というマジックナンバーについて、モーダルアニメーション完了を待つ意図であることをコメントで明記すると、将来のメンテナンス性が向上します。♻️ コメント追加の提案
if (Platform.OS === 'ios') { + // モーダルアニメーション完了後にフォーカスを設定し、 + // KeyboardAvoidingView がコンテンツを押し出すのを防ぐ const timer = setTimeout(() => { textInputRef.current?.focus(); }, 300); return () => clearTimeout(timer); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/SavePresetNameModal.tsx` around lines 112 - 118, Add an inline comment above the iOS-specific setTimeout block in SavePresetNameModal (the Platform.OS === 'ios' branch around the setTimeout that calls textInputRef.current?.focus()) explaining that the 300ms delay is intentionally chosen to wait for the modal animation/KeyboardAvoidingView to finish before focusing the input; optionally note that it may be adjusted per platform/animation changes so future maintainers understand it's not arbitrary.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/components/SavePresetNameModal.tsx`:
- Around line 112-118: Add an inline comment above the iOS-specific setTimeout
block in SavePresetNameModal (the Platform.OS === 'ios' branch around the
setTimeout that calls textInputRef.current?.focus()) explaining that the 300ms
delay is intentionally chosen to wait for the modal
animation/KeyboardAvoidingView to finish before focusing the input; optionally
note that it may be adjusted per platform/animation changes so future
maintainers understand it's not arbitrary.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 133b781b-59c3-463e-b81d-a5271f0206c6
📒 Files selected for processing (1)
src/components/SavePresetNameModal.tsx
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Summary
SavePresetNameModalを開くと、autoFocusによりキーボードが即座に表示され、KeyboardAvoidingView(behavior="padding")がモーダルコンテンツを画面外に押し出してバックドロップだけが残るバグを修正autoFocusをiOSでは無効化し、モーダルアニメーション完了後(300ms後)に手動でtextInputRef.current?.focus()を呼ぶことでキーボード表示タイミングを遅延Test plan
autoFocusが動作することを確認🤖 Generated with Claude Code
Summary by CodeRabbit