Skip to content

警告パネルをPiP表示の背面に配置#6090

Merged
TinyKitten merged 1 commit into
devfrom
feature/warning-panel-behind-pip
May 29, 2026
Merged

警告パネルをPiP表示の背面に配置#6090
TinyKitten merged 1 commit into
devfrom
feature/warning-panel-behind-pip

Conversation

@TinyKitten
Copy link
Copy Markdown
Member

@TinyKitten TinyKitten commented May 29, 2026

概要

Android の Picture in Picture 表示中に、警告パネルが PiP 表示より前面に出ないように配置順と zIndex を調整しました。

変更の種類

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

変更内容

  • Permitted で PiP 有効時のみ WarningPanelchildren より先に描画するようにしました。
  • WarningPanelbehindContent prop を追加し、PiP 有効時のみ前面用の高い zIndex を外しました。
  • 通常表示時は従来通り WarningPanel が前面に表示されます。

回帰リスク: 警告パネルの重なり順に限定した変更で、通常時の表示順は維持しています。PiP 有効時の警告パネル操作性は背面配置になるため、PiP 表示中は前面タップ対象になりません。

テスト

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

実行結果:

  • npm run lint: 成功
  • npm run typecheck: 成功
  • npm test: Windows PowerShell では npm script 内の TZ=UTC が解釈できず起動前に失敗
  • $env:TZ='UTC'; npx jest: 成功(158 suites / 1722 tests passed)

関連Issue

なし

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

未取得(Android PiP 環境での表示順調整のみ)

Summary by CodeRabbit

リリースノート

  • 改善
    • ピクチャー・イン・ピクチャー機能の有効時に、警告パネルの表示順序を最適化しました
    • 警告パネルのレイヤー制御を強化し、表示位置の柔軟性が向上しました

Review Change Stack

@TinyKitten TinyKitten self-assigned this May 29, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

📝 Walkthrough

Walkthrough

Picture-in-Picture モード時の WarningPanel の描画順を制御するプルリクエストです。WarningPanelbehindContent プロップを追加して z-index を動的に変更し、Permitted コンポーネントで Picture-in-Picture 状態を検出してパネルの配置順を切り替えるように実装しました。

Changes

Picture-in-Picture 時の WarningPanel 配置制御

Layer / File(s) Summary
WarningPanel レイアウト制御プロップ追加
src/components/WarningPanel.tsx
behindContent オプショナルプロップを追加し、既定値 false で z-index を条件式 behindContent ? 0 : 9999 に変更します。
Permitted での Picture-in-Picture 状態検出と WarningPanel 配置
src/components/Permitted.tsx
pictureInPictureAtom から active 状態を取得し、WarningPanelwarningPanel ローカル変数として組み立てます。Picture-in-Picture アクティブ時は children の前に、非アクティブ時は後に配置します。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

絵の中に絵が舞う季節
Picture-in-Picture の前後で
WarningPanel は器用に並ぶ
z-index の魔法で
コンテンツは優雅に踊る 🎬✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR のタイトルは変更内容をよく反映しており、PiP 表示時の警告パネル配置調整という主な変更を簡潔に説明しています。
Description check ✅ Passed PR の説明は必須セクション(概要、変更の種類、変更内容、テスト)をほぼ完全に満たしており、実装詳細やテスト結果も記載されています。
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/warning-panel-behind-pip

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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

@github-actions github-actions Bot added the react label May 29, 2026
@TinyKitten TinyKitten marked this pull request as ready for review May 29, 2026 21:31
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/components/Permitted.tsx (1)

626-634: 💤 Low value

パフォーマンス最適化: useMemo でメモ化を検討してください。

warningPanel 変数は毎レンダリング時に再作成されています。warningInfopictureInPictureActiveclearWarningInfo に依存しているため、useMemo でメモ化することでわずかなパフォーマンス向上が見込めます。

♻️ メモ化の提案
- const warningPanel =
-   warningInfo?.text && warningInfo?.level ? (
-     <WarningPanel
-       behindContent={pictureInPictureActive}
-       onPress={clearWarningInfo}
-       text={warningInfo.text}
-       warningLevel={warningInfo.level}
-     />
-   ) : null;
+ const warningPanel = useMemo(
+   () =>
+     warningInfo?.text && warningInfo?.level ? (
+       <WarningPanel
+         behindContent={pictureInPictureActive}
+         onPress={clearWarningInfo}
+         text={warningInfo.text}
+         warningLevel={warningInfo.level}
+       />
+     ) : null,
+   [warningInfo, pictureInPictureActive, clearWarningInfo]
+ );
🤖 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/Permitted.tsx` around lines 626 - 634, Wrap the warningPanel
JSX creation in React.useMemo to avoid rebuilding it every render: compute
warningPanel with useMemo(() => (warningInfo?.text && warningInfo?.level ?
<WarningPanel ... /> : null), [warningInfo, pictureInPictureActive,
clearWarningInfo]); keep the same props (behindContent={pictureInPictureActive},
onPress={clearWarningInfo}, text={warningInfo.text},
warningLevel={warningInfo.level}) and import/use React.useMemo if not already
present.
🤖 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.

Nitpick comments:
In `@src/components/Permitted.tsx`:
- Around line 626-634: Wrap the warningPanel JSX creation in React.useMemo to
avoid rebuilding it every render: compute warningPanel with useMemo(() =>
(warningInfo?.text && warningInfo?.level ? <WarningPanel ... /> : null),
[warningInfo, pictureInPictureActive, clearWarningInfo]); keep the same props
(behindContent={pictureInPictureActive}, onPress={clearWarningInfo},
text={warningInfo.text}, warningLevel={warningInfo.level}) and import/use
React.useMemo if not already present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 73d8057b-3052-479b-b352-a60fa319cc53

📥 Commits

Reviewing files that changed from the base of the PR and between ca381a4 and c8f03ed.

📒 Files selected for processing (2)
  • src/components/Permitted.tsx
  • src/components/WarningPanel.tsx

@TinyKitten TinyKitten merged commit f0e3f7c into dev May 29, 2026
7 checks passed
@TinyKitten TinyKitten deleted the feature/warning-panel-behind-pip branch May 29, 2026 21:34
@TinyKitten TinyKitten mentioned this pull request May 29, 2026
9 tasks
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