fix(programmer): resolve profile names in monitor help chips

Pass profileNames Map<String, String> from MonitorTab down to
ProgrammerMonitorCard and HelpPanel; use profileNames[id] ?? id
at all help-chip and help-edge row render sites so full names
display instead of raw UUIDs.

Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
2026-09-27 22:43:28 +08:00
parent 7beb8e8713
commit e24083356f
3 changed files with 16 additions and 7 deletions
@@ -16,7 +16,9 @@ final _dateFmt = DateFormat('EEE, MMM d');
/// displayed day is independent of the parent; the family provider is /// displayed day is independent of the parent; the family provider is
/// re-watched whenever the day changes. /// re-watched whenever the day changes.
class HelpPanel extends ConsumerStatefulWidget { class HelpPanel extends ConsumerStatefulWidget {
const HelpPanel({super.key}); const HelpPanel({super.key, this.profileNames = const {}});
final Map<String, String> profileNames;
@override @override
ConsumerState<HelpPanel> createState() => _HelpPanelState(); ConsumerState<HelpPanel> createState() => _HelpPanelState();
@@ -125,8 +127,9 @@ class _HelpPanelState extends ConsumerState<HelpPanel> {
separatorBuilder: (_, _) => const Divider(height: 1), separatorBuilder: (_, _) => const Divider(height: 1),
itemBuilder: (context, i) { itemBuilder: (context, i) {
final e = edges[i]; final e = edges[i];
final helperName = e.helperId; final names = widget.profileNames;
final assigneeName = e.assigneeId; final helperName = names[e.helperId] ?? e.helperId;
final assigneeName = names[e.assigneeId] ?? e.assigneeId;
final timeStr = TimeOfDay.fromDateTime(e.at).format(context); final timeStr = TimeOfDay.fromDateTime(e.at).format(context);
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 6), padding: const EdgeInsets.symmetric(vertical: 6),
@@ -112,6 +112,7 @@ class MonitorTab extends ConsumerWidget {
final grid = _ProgrammerGrid( final grid = _ProgrammerGrid(
entries: entries, entries: entries,
profileNames: profileNames,
width: sideBySide ? width - 320 : width, width: sideBySide ? width - 320 : width,
); );
@@ -123,7 +124,7 @@ class MonitorTab extends ConsumerWidget {
const SizedBox(width: 12), const SizedBox(width: 12),
SizedBox( SizedBox(
width: 300, width: 300,
child: const HelpPanel(), child: HelpPanel(profileNames: profileNames),
), ),
], ],
) )
@@ -133,7 +134,7 @@ class MonitorTab extends ConsumerWidget {
const SizedBox(height: 16), const SizedBox(height: 16),
SizedBox( SizedBox(
height: 340, height: 340,
child: const HelpPanel(), child: HelpPanel(profileNames: profileNames),
), ),
], ],
); );
@@ -161,10 +162,12 @@ class MonitorTab extends ConsumerWidget {
class _ProgrammerGrid extends StatelessWidget { class _ProgrammerGrid extends StatelessWidget {
const _ProgrammerGrid({ const _ProgrammerGrid({
required this.entries, required this.entries,
required this.profileNames,
required this.width, required this.width,
}); });
final List<ProgrammerMonitorEntry> entries; final List<ProgrammerMonitorEntry> entries;
final Map<String, String> profileNames;
final double width; final double width;
@override @override
@@ -198,6 +201,7 @@ class _ProgrammerGrid extends StatelessWidget {
final entry = entries[i]; final entry = entries[i];
return ProgrammerMonitorCard( return ProgrammerMonitorCard(
entry: entry, entry: entry,
profileNames: profileNames,
onTap: () => onTap: () =>
context.go('/programmer-tasks/programmers/${entry.programmer.id}'), context.go('/programmer-tasks/programmers/${entry.programmer.id}'),
); );
@@ -41,10 +41,12 @@ class ProgrammerMonitorCard extends StatelessWidget {
super.key, super.key,
required this.entry, required this.entry,
required this.onTap, required this.onTap,
this.profileNames = const {},
}); });
final ProgrammerMonitorEntry entry; final ProgrammerMonitorEntry entry;
final VoidCallback onTap; final VoidCallback onTap;
final Map<String, String> profileNames;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -155,7 +157,7 @@ class ProgrammerMonitorCard extends StatelessWidget {
for (final e in entry.helped) for (final e in entry.helped)
_HelpRow( _HelpRow(
prefix: 'Helped →', prefix: 'Helped →',
name: e.assigneeId, name: profileNames[e.assigneeId] ?? e.assigneeId,
task: e.taskTitle, task: e.taskTitle,
minutes: e.minutes, minutes: e.minutes,
cs: cs, cs: cs,
@@ -164,7 +166,7 @@ class ProgrammerMonitorCard extends StatelessWidget {
for (final e in entry.helpedBy) for (final e in entry.helpedBy)
_HelpRow( _HelpRow(
prefix: 'Helped by ←', prefix: 'Helped by ←',
name: e.helperId, name: profileNames[e.helperId] ?? e.helperId,
task: e.taskTitle, task: e.taskTitle,
minutes: e.minutes, minutes: e.minutes,
cs: cs, cs: cs,