fix: use dialog context in delete confirmation to prevent shell nav pop

Navigator.pop(outerContext) inside a showDialog builder resolves to the
ShellRoute's nested navigator instead of the root navigator where the
dialog lives, popping the conversations route and showing a black screen.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-06 18:33:04 -04:00
parent 79dce1a01c
commit 6ea268bf58
@@ -99,15 +99,15 @@ class ConversationsTabScreen extends ConsumerWidget {
BuildContext context, WidgetRef ref, int id, String title) async { BuildContext context, WidgetRef ref, int id, String title) async {
final ok = await showDialog<bool>( final ok = await showDialog<bool>(
context: context, context: context,
builder: (_) => AlertDialog( builder: (dialogContext) => AlertDialog(
title: const Text('Delete conversation?'), title: const Text('Delete conversation?'),
content: Text('"$title" will be permanently deleted.'), content: Text('"$title" will be permanently deleted.'),
actions: [ actions: [
TextButton( TextButton(
onPressed: () => Navigator.pop(context, false), onPressed: () => Navigator.pop(dialogContext, false),
child: const Text('Cancel')), child: const Text('Cancel')),
FilledButton( FilledButton(
onPressed: () => Navigator.pop(context, true), onPressed: () => Navigator.pop(dialogContext, true),
child: const Text('Delete')), child: const Text('Delete')),
], ],
), ),