From 40add96f3a6920b4509ded0bb6099c02e8d11463 Mon Sep 17 00:00:00 2001 From: Rijad Zuzo Date: Sun, 15 Feb 2026 23:59:56 +0100 Subject: [PATCH] Show exact entity target in sync repair route --- docs/progress.md | 1 + lib/features/sync/sync_view.dart | 45 ++++++++++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/docs/progress.md b/docs/progress.md index 1396121..b09dca1 100644 --- a/docs/progress.md +++ b/docs/progress.md @@ -33,6 +33,7 @@ Added direct repair navigation from rejected sync items: - `giftIdea`/`eventIdea` -> Ideas - `reminderRule` -> Reminders - keeps existing payload inspect + requeue/dismiss actions + - opened repair screen now shows exact `entityType:entityId` focus banner Validation for this milestone: diff --git a/lib/features/sync/sync_view.dart b/lib/features/sync/sync_view.dart index 0d297e7..84bbcd3 100644 --- a/lib/features/sync/sync_view.dart +++ b/lib/features/sync/sync_view.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:relationship_saver/core/config/app_theme.dart'; import 'package:relationship_saver/features/ideas/ideas_view.dart'; @@ -525,6 +526,8 @@ class _SyncViewState extends ConsumerState { MaterialPageRoute( builder: (BuildContext context) => _EntityResolveScreen( title: _titleForEntityType(matched.entityType), + entityType: matched.entityType, + entityId: matched.entityId, child: view, ), ), @@ -565,16 +568,54 @@ class _SyncViewState extends ConsumerState { } class _EntityResolveScreen extends StatelessWidget { - const _EntityResolveScreen({required this.title, required this.child}); + const _EntityResolveScreen({ + required this.title, + required this.entityType, + required this.entityId, + required this.child, + }); final String title; + final String entityType; + final String entityId; final Widget child; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text(title)), - body: child, + body: Column( + children: [ + Container( + width: double.infinity, + padding: const EdgeInsets.fromLTRB(16, 12, 16, 12), + color: const Color(0xFFEAF7FB), + child: Wrap( + spacing: 8, + runSpacing: 8, + crossAxisAlignment: WrapCrossAlignment.center, + children: [ + Text('Focus: $entityType:$entityId'), + TextButton.icon( + onPressed: () async { + await Clipboard.setData( + ClipboardData(text: '$entityType:$entityId'), + ); + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Entity ID copied.')), + ); + } + }, + icon: const Icon(Icons.copy_rounded), + label: const Text('Copy'), + ), + ], + ), + ), + Expanded(child: child), + ], + ), ); } }