Skip to content

フィードバックモーダルのデザインを刷新 - #6624

Merged
TinyKitten merged 3 commits into
devfrom
feature/redesign-feedback-modal
Aug 9, 2026
Merged

TinyKitten merged 3 commits into
devfrom
feature/redesign-feedback-modal

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Aug 9, 2026 •

Copy link
Copy Markdown
Member

概要

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • NewReportModal のデザインを刷新(src/components/NewReportModal.tsx)
    • ヘッダーにアクセントカラーのチャットアイコンバッジを追加
    • 入力欄を塗り背景 + 角丸に変更し、フォーカス時にアクセント色ボーダーを表示
    • 文字数下限までの進捗を示すアニメーション付きプログレスバーと、到達時のチェックマーク付き「送信可能」表示を追加
    • 注意書きをシールドアイコン付きのインフォボックス化
    • ボタンを横幅いっぱいの2分割配置に変更
    • モーダルの flex: 1 をやめてコンテンツに沿った高さに変更
    • LEDテーマでは角丸なし・白ボーダー・モノクロ調に統一(従来はLEDでも角丸が付いていた)
    • 送信中は入力欄を編集不可に変更
  • NewReportModal のレンダーテストを新規追加(src/components/NewReportModal.test.tsx、7ケース)
  • CodeRabbit レビュー対応
    • キーボード解除用 Pressable に accessible={false} を指定し、子の入力欄・ボタンを個別にフォーカス可能に
    • ステータス文字色を #777 → #767676 に変更し WCAG AA (4.5:1) を満たすコントラストに
    • LEDテーマ分岐のテストケースを追加

テスト

  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

関連Issue

スクリーンショット(任意)

Summary by CodeRabbit

  • 新機能

    • 新規レポート入力モーダルに、入力文字数に応じた進捗バーと残り文字数表示を追加しました。
    • 送信可能状態を分かりやすく表示し、送信中は入力を編集できないようにしました。
    • 入力フォーカス時の表示や、通常テーマ・LEDテーマ向けのデザインを改善しました。
    • モーダル内にアイコンを追加しました。
  • テスト

    • 入力、送信、破棄確認、送信中の状態など、モーダルの主要な動作を検証するテストを追加しました。

@TinyKitten TinyKitten self-assigned this Aug 9, 2026
@github-actions github-actions Bot added the react label Aug 9, 2026
@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f4cc77e1-6526-47b2-a07b-5424d2f4d51e

📥 Commits

Reviewing files that changed from the base of the PR and between a77777e and eafecd3.

📒 Files selected for processing (1)
  • src/components/NewReportModal.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/NewReportModal.test.tsx

📝 Walkthrough

Walkthrough

NewReportModal にアイコン、文字数進捗、テーマ別スタイル、入力フォーカス状態、送信状態を追加しました。表示、入力、破棄、送信中の動作をテストで検証します。

Changes

NewReportModal 更新

Layer / File(s) Summary
表示構成とテーマ別スタイル
src/components/NewReportModal.tsx
アイコン付きヘッダー、入力欄、進捗バー、警告表示、ボタンを追加しました。通常テーマとLEDテーマのスタイルを分けました。
入力状態と送信フロー
src/components/NewReportModal.tsx, src/components/NewReportModal.test.tsx
入力フォーカス、文字数進捗、送信可能状態、送信中の編集不可状態を追加しました。入力文字数、送信、即時閉じる処理、破棄確認、LEDテーマの入力欄をテストします。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Poem

白ウサギ、進捗バーをぴょんと描く
入力が増えて、送信へ進む
LEDの枠もきらりと光る
破棄の確認、そっと見守る
テストの足跡、月まで続く

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed タイトルはNewReportModalの主要変更であるデザイン刷新を明確かつ簡潔に示しています。
Description check ✅ Passed 説明はテンプレートの主要セクションを含み、変更内容とテスト結果を具体的に記載しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/redesign-feedback-modal

Comment @coderabbitai help to get the list of available commands.

@TinyKitten

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (4)
src/components/NewReportModal.tsx (2)

167-174: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

アンマウント時にアニメーションを停止してください。

この effect は Animated.timing(...).start() を呼びますが、クリーンアップを返しません。useNativeDriver: false のため、アニメーションは JS 側で駆動します。モーダルを閉じた直後や依存値が連続で変化した場合、前のアニメーションが残ります。クリーンアップで stop() を呼ぶと、この残留を防げます。

♻️ 提案する修正
   useEffect(() => {
-    Animated.timing(progressAnim, {
+    const animation = Animated.timing(progressAnim, {
       toValue: Math.min(charCount / descriptionLowerLimit, 1),
       duration: 200,
       // NOTE: width をアニメーションするため native driver は使えない
       useNativeDriver: false,
-    }).start();
+    });
+    animation.start();
+    return () => animation.stop();
   }, [charCount, descriptionLowerLimit, progressAnim]);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/NewReportModal.tsx` around lines 167 - 174, Update the
useEffect managing progressAnim so it retains the animation returned by
Animated.timing(...).start() and returns a cleanup function that calls stop() on
it, ensuring the JS-driven animation is stopped on unmount or before
dependencies change.

238-248: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

テーマ依存スタイルの定義が StyleSheet.create と JSX に分散しています。 どちらの箇所も、テーマごとの外観値を JSX のインラインオブジェクトで指定するため、静的スタイル側の指定が重複または無効化されます。テーマ別の静的スタイルを StyleSheet.create にまとめると、参照が安定し、外観値の確認箇所が1つになります。

  • src/components/NewReportModal.tsx#L238-L248: modalViewLED と modalViewDefault を StyleSheet.create に定義し、isLEDTheme ? styles.modalViewLED : styles.modalViewDefault に置き換えてください。
  • src/components/NewReportModal.tsx#L74-L84: styles.textInput の borderRadius: 12 を削除してください。JSX 側(Line 291)の borderRadius: isLEDTheme ? 0 : 12 が常に上書きします。同様に textInputLED と textInputDefault を切り出すと、色と角丸の指定を1箇所に集約できます。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/NewReportModal.tsx` around lines 238 - 248, In
src/components/NewReportModal.tsx lines 238-248, define the theme-specific modal
styles as modalViewLED and modalViewDefault within StyleSheet.create, then
replace the inline conditional with styles.modalViewLED or
styles.modalViewDefault. In lines 74-84, remove borderRadius from
styles.textInput and split the theme-specific text input styling into
textInputLED and textInputDefault so color and radius values are defined in one
place; update the JSX usage accordingly.
src/components/NewReportModal.test.tsx (2)

106-119: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

破棄を選択した後に onClose が呼ばれることを検証してください。

このテストは showDialog の第3引数を expect.any(Array) としか照合しません。破棄ボタンの onPress が onClose を呼ぶ経路は未検証です。この経路は入力内容を捨てる分岐であり、退行するとユーザーはモーダルを閉じられません。渡されたボタン配列から destructive の項目を取り出して実行すると、この経路を保護できます。

💚 提案する追記
     expect(showDialog).toHaveBeenCalledWith(
       'confirmDiscardTitle',
       'confirmDiscardMessage',
       expect.any(Array)
     );
     expect(onClose).not.toHaveBeenCalled();
+
+    const buttons = showDialog.mock.calls[0][2];
+    const discardButton = buttons.find(
+      (button: { style?: string }) => button.style === 'destructive'
+    );
+    expect(discardButton).toBeDefined();
+
+    act(() => {
+      discardButton.onPress();
+    });
+    expect(onClose).toHaveBeenCalledTimes(1);
   });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/NewReportModal.test.tsx` around lines 106 - 119, Update the
test around the showDialog call in the “入力済みで閉じると破棄確認ダイアログを表示し、即時にはonCloseを呼ばない”
case to capture its button-array argument, locate the destructive discard
action, invoke its onPress handler, and assert that onClose is then called.
Preserve the existing assertions that the dialog appears and onClose is not
called before discard.

11-14: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

jotai のモジュール全体モックは壊れやすいです。

このモックは useAtomValue と atom だけを提供します。NewReportModal またはその子コンポーネントが将来 useAtom、useSetAtom、Provider を使うと、テストは undefined is not a function で失敗します。実モジュールを展開してから必要な部分だけ置換すると、この破損を防げます。

♻️ 提案する修正
-jest.mock('jotai', () => ({
-  useAtomValue: jest.fn(() => false),
-  atom: jest.fn((initialValue) => initialValue),
-}));
+jest.mock('jotai', () => ({
+  ...jest.requireActual('jotai'),
+  useAtomValue: jest.fn(() => false),
+}));
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/NewReportModal.test.tsx` around lines 11 - 14, Update the
jotai mock in NewReportModal tests to preserve the real module exports and
override only useAtomValue and atom with the test behavior. This keeps useAtom,
useSetAtom, Provider, and any future jotai APIs available to NewReportModal and
its children.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/NewReportModal.test.tsx`:
- Line 12: Update the NewReportModal tests to cover the isLEDTheme=true branch
by overriding the mocked useAtomValue with mockReturnValue(true) in a dedicated
test, and assert the LED-specific styling behavior for disabled corner rounding,
white borders, and monochrome colors. Keep the existing false-theme coverage
intact.

In `@src/components/NewReportModal.tsx`:
- Line 222: Update mutedTextColor in the non-LED theme branch to use `#767676` or
a darker value, ensuring sufficient contrast against the white background while
leaving the LED theme color unchanged.
- Line 257: Update the Pressable wrapping the keyboard-dismiss touch handling in
NewReportModal to set accessible to false, preserving its existing
Keyboard.dismiss onPress behavior while keeping the child TextInput and Button
controls individually accessible.

---

Nitpick comments:
In `@src/components/NewReportModal.test.tsx`:
- Around line 106-119: Update the test around the showDialog call in the
“入力済みで閉じると破棄確認ダイアログを表示し、即時にはonCloseを呼ばない” case to capture its button-array
argument, locate the destructive discard action, invoke its onPress handler, and
assert that onClose is then called. Preserve the existing assertions that the
dialog appears and onClose is not called before discard.
- Around line 11-14: Update the jotai mock in NewReportModal tests to preserve
the real module exports and override only useAtomValue and atom with the test
behavior. This keeps useAtom, useSetAtom, Provider, and any future jotai APIs
available to NewReportModal and its children.

In `@src/components/NewReportModal.tsx`:
- Around line 167-174: Update the useEffect managing progressAnim so it retains
the animation returned by Animated.timing(...).start() and returns a cleanup
function that calls stop() on it, ensuring the JS-driven animation is stopped on
unmount or before dependencies change.
- Around line 238-248: In src/components/NewReportModal.tsx lines 238-248,
define the theme-specific modal styles as modalViewLED and modalViewDefault
within StyleSheet.create, then replace the inline conditional with
styles.modalViewLED or styles.modalViewDefault. In lines 74-84, remove
borderRadius from styles.textInput and split the theme-specific text input
styling into textInputLED and textInputDefault so color and radius values are
defined in one place; update the JSX usage accordingly.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d150ddbd-709f-4254-9e79-a68d419e3744

📥 Commits

Reviewing files that changed from the base of the PR and between 13d733a and aa0fe3e.

📒 Files selected for processing (2)
  • src/components/NewReportModal.test.tsx
  • src/components/NewReportModal.tsx

Comment thread src/components/NewReportModal.test.tsx Resolved
Comment thread src/components/NewReportModal.tsx Resolved
Comment thread src/components/NewReportModal.tsx Resolved
@TinyKitten

Copy link
Copy Markdown
Member Author

Fixes Applied Successfully

Fixed 2 file(s) based on 3 CodeRabbit feedback item(s).

Files modified:

  • src/components/NewReportModal.tsx(Pressable に accessible={false} を追加 / mutedTextColor を #767676 に変更)
  • src/components/NewReportModal.test.tsx(LEDテーマ分岐のテストケースを追加)

Commit: a77777e8d

The latest autofix changes are on the feature/redesign-feedback-modal branch.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/NewReportModal.test.tsx`:
- Around line 132-142:
LEDテーマの入力欄スタイルを検証するテストで、既存のスタイルアサーションにborderColorが白(#fff)であることも追加確認してください。対象はrenderModalで取得したinputのスタイル検証です。
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dcd8766b-35e1-4f43-be8f-6353e8006d48

📥 Commits

Reviewing files that changed from the base of the PR and between aa0fe3e and a77777e.

📒 Files selected for processing (2)
  • src/components/NewReportModal.test.tsx
  • src/components/NewReportModal.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/NewReportModal.tsx

Comment thread src/components/NewReportModal.test.tsx Resolved
@TinyKitten

Copy link
Copy Markdown
Member Author

Fixes Applied Successfully

Fixed 1 file(s) based on 1 CodeRabbit feedback item(s).

Files modified:

  • src/components/NewReportModal.test.tsx(LEDテーマテストのアサーションに非フォーカス時の borderColor を追加。提案の #fff はフォーカス時の値のため、実値 rgba(255, 255, 255, 0.4) で検証)

Commit: eafecd396

The latest autofix changes are on the feature/redesign-feedback-modal branch.

@TinyKitten
TinyKitten merged commit 74739bd into dev Aug 9, 2026
5 checks passed
@TinyKitten
TinyKitten deleted the feature/redesign-feedback-modal branch August 9, 2026 05:10
This was referenced Aug 9, 2026
@TinyKitten

Copy link
Copy Markdown
Member Author

#4064

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant