Skip to content

fix(desktop): カスタム通知音の削除確認をカスタムダイアログ化#265

Merged
MocA-Love merged 2 commits into
mainfrom
fix/262-delete-ringtone-dialog
Apr 17, 2026
Merged

fix(desktop): カスタム通知音の削除確認をカスタムダイアログ化#265
MocA-Love merged 2 commits into
mainfrom
fix/262-delete-ringtone-dialog

Conversation

@MocA-Love
Copy link
Copy Markdown
Owner

@MocA-Love MocA-Love commented Apr 17, 2026

概要

Closes #262

カスタム通知音の削除時に表示されるダイアログが、OS / ブラウザのデフォルト確認ダイアログ (window.confirm) になっていたため、リネーム時と同じ shadcn の Dialog コンポーネントで統一する。

変更点

  • DeleteRingtoneDialog を新規追加(Cancel / Delete ボタン構成、destructive バリアント)
  • RingtonesSettingshandleDeleteCustom を window.confirm から新ダイアログ表示に置換
  • 削除中はボタンをローダー付きで disable、エラー時はメッセージを表示

テスト計画

  • カスタム通知音カードのメニュー → Delete でアプリ内ダイアログが開く
  • Cancel でダイアログが閉じ、削除されない
  • Delete で削除され、選択中だった場合は別の通知音に切り替わる
  • 削除中はボタンが disable になりローダーが表示される

Summary by CodeRabbit

リリースノート

  • 新機能
    • カスタム着信音削除時の確認フローを改善。ブラウザの標準確認ダイアログから専用の確認ダイアログに変更し、削除エラーメッセージをダイアログ内に表示するようになりました。

OS デフォルトの window.confirm ではなく、リネームと同じ Dialog コンポーネントで
削除確認 UI を提供する。

Closes #262
@MocA-Love
Copy link
Copy Markdown
Owner Author

@codex review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

Warning

Rate limit exceeded

@MocA-Love has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 24 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 54 minutes and 24 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b786ec8d-700a-4dd7-acf0-cfe24eacafc4

📥 Commits

Reviewing files that changed from the base of the PR and between 7085c2d and 5aaa414.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/RingtonesSettings/components/DeleteRingtoneDialog/DeleteRingtoneDialog.tsx
📝 Walkthrough

Walkthrough

リングトーン削除時の確認フローをネイティブダイアログからカスタムUIコンポーネント DeleteRingtoneDialog に置き換えました。新たにダイアログ表示状態とエラー状態を管理し、削除ハンドラーを変更してエラー表示機能を追加しました。

Changes

コホート / ファイル(s) サマリー
削除ダイアログの新規作成
DeleteRingtoneDialog/DeleteRingtoneDialog.tsx, DeleteRingtoneDialog/index.ts
削除確認用の専用UIコンポーネントを新規実装。ダイアログの表示制御、エラーメッセージ表示、確認・キャンセルボタン機能を備え、送信中の状態を管理。
リングトーン設定での削除フロー改善
RingtonesSettings.tsx
削除ボタンのクリック時にダイアログを開く流れに変更。削除確認時のハンドラーを分離し、エラー状態の管理を追加。ネイティブ確認ダイアログから新規ダイアログコンポーネントに統合。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 ウサギが飛び出た、新しいダイアログ!
ネイティブな確認じゃなく、ぴかぴかのUI
エラーメッセージもにっこり表示
削除もスムーズ、デザインも最高!
🎨✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR タイトルはカスタム通知音の削除ダイアログをカスタム化する変更を明確に示しており、実装内容と完全に一致しています。
Description check ✅ Passed PR の説明は必須セクション(概要、変更点、テスト計画)を含み、目的と実装内容が詳細かつ明確に記載されています。
Linked Issues check ✅ Passed 実装は issue #262 の要件(window.confirm をカスタムダイアログに置換してリネーム時と同じ shadcn Dialog に統一)を完全に満たしています。
Out of Scope Changes check ✅ Passed すべての変更は issue #262 のスコープ内に収まっており、DeleteRingtoneDialog コンポーネント追加と RingtonesSettings の統合のみです。

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/262-delete-ringtone-dialog

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

@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 (2)
apps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/RingtonesSettings/components/DeleteRingtoneDialog/DeleteRingtoneDialog.tsx (1)

29-31: handleConfirm ラッパーの必要性

現状 handleConfirmonConfirm() を単に await しているだけで、エラーハンドリングや追加処理を行っていません。onClick={handleConfirm}onClick={() => { void onConfirm(); }} または直接 onConfirm を渡す形でも等価です。ラッパーを残すなら将来の拡張ポイントであることをコメントで示すとより意図が明確になります。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/RingtonesSettings/components/DeleteRingtoneDialog/DeleteRingtoneDialog.tsx`
around lines 29 - 31, The handleConfirm wrapper currently only awaits
onConfirm() without adding behavior; either remove handleConfirm and pass
onConfirm directly to the onClick handler (or use onClick={() => { void
onConfirm(); }}) or keep handleConfirm but add a brief comment above it
explaining it's an explicit extension point for future error handling/extra
logic; update the component to use the chosen approach and ensure references to
handleConfirm and onConfirm in the JSX are adjusted accordingly.
apps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/RingtonesSettings/RingtonesSettings.tsx (1)

500-510: 送信中のダイアログ外クローズ抑止の検討

isSubmitting 中でも Esc キーやオーバーレイクリックで onOpenChange(false) が発火し、削除処理進行中にダイアログが閉じて deleteError もクリアされてしまいます。Cancel ボタンは disabled にしているので、挙動の一貫性のためにも送信中の閉じ操作は抑止するのが安全です。RenameRingtoneDialog / YouTubeImportDialog も同様のパターンなので、合わせて検討してもよいかもしれません。

💡 提案 (例)
 			<DeleteRingtoneDialog
 				open={deleteDialogOpen}
 				onOpenChange={(open) => {
+					if (!open && deleteCustomRingtone.isPending) return;
 					setDeleteDialogOpen(open);
 					if (!open) setDeleteError(null);
 				}}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/RingtonesSettings/RingtonesSettings.tsx`
around lines 500 - 510, The DeleteRingtoneDialog can be closed via overlay click
or Esc while a delete is in progress which also clears deleteError; update the
onOpenChange handling so attempts to close (open === false) are ignored when
deleteCustomRingtone.isPending is true (i.e., keep deleteDialogOpen true and do
not call setDeleteError(null) while submitting), or alternatively add and pass
dialog props (e.g., disableBackdropClick/disableEscapeKeyDown or a modal
blocking prop) from RingtonesSettings into DeleteRingtoneDialog so it cannot be
dismissed during isSubmitting; apply the same pattern to RenameRingtoneDialog
and YouTubeImportDialog for consistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@apps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/RingtonesSettings/components/DeleteRingtoneDialog/DeleteRingtoneDialog.tsx`:
- Around line 29-31: The handleConfirm wrapper currently only awaits onConfirm()
without adding behavior; either remove handleConfirm and pass onConfirm directly
to the onClick handler (or use onClick={() => { void onConfirm(); }}) or keep
handleConfirm but add a brief comment above it explaining it's an explicit
extension point for future error handling/extra logic; update the component to
use the chosen approach and ensure references to handleConfirm and onConfirm in
the JSX are adjusted accordingly.

In
`@apps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/RingtonesSettings/RingtonesSettings.tsx`:
- Around line 500-510: The DeleteRingtoneDialog can be closed via overlay click
or Esc while a delete is in progress which also clears deleteError; update the
onOpenChange handling so attempts to close (open === false) are ignored when
deleteCustomRingtone.isPending is true (i.e., keep deleteDialogOpen true and do
not call setDeleteError(null) while submitting), or alternatively add and pass
dialog props (e.g., disableBackdropClick/disableEscapeKeyDown or a modal
blocking prop) from RingtonesSettings into DeleteRingtoneDialog so it cannot be
dismissed during isSubmitting; apply the same pattern to RenameRingtoneDialog
and YouTubeImportDialog for consistency.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 75f01e98-0a54-4b09-87a9-28a7eda3afbf

📥 Commits

Reviewing files that changed from the base of the PR and between 9efd241 and 7085c2d.

📒 Files selected for processing (3)
  • apps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/RingtonesSettings/RingtonesSettings.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/RingtonesSettings/components/DeleteRingtoneDialog/DeleteRingtoneDialog.tsx
  • apps/desktop/src/renderer/routes/_authenticated/settings/ringtones/components/RingtonesSettings/components/DeleteRingtoneDialog/index.ts

CodeRabbit レビュー対応:
- 送信中の Esc / オーバーレイクリックでダイアログが閉じないようガード
- 不要な handleConfirm ラッパーを除去し onConfirm を直接呼び出す
@MocA-Love MocA-Love merged commit 04bc1ba into main Apr 17, 2026
6 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.

[bug] ダイアログのデザイン

1 participant