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
/// re-watched whenever the day changes.
class HelpPanel extends ConsumerStatefulWidget {
const HelpPanel({super.key});
const HelpPanel({super.key, this.profileNames = const {}});
final Map<String, String> profileNames;
@override
ConsumerState<HelpPanel> createState() => _HelpPanelState();
@@ -125,8 +127,9 @@ class _HelpPanelState extends ConsumerState<HelpPanel> {
separatorBuilder: (_, _) => const Divider(height: 1),
itemBuilder: (context, i) {
final e = edges[i];
final helperName = e.helperId;
final assigneeName = e.assigneeId;
final names = widget.profileNames;
final helperName = names[e.helperId] ?? e.helperId;
final assigneeName = names[e.assigneeId] ?? e.assigneeId;
final timeStr = TimeOfDay.fromDateTime(e.at).format(context);
return Padding(
padding: const EdgeInsets.symmetric(vertical: 6),
@@ -112,6 +112,7 @@ class MonitorTab extends ConsumerWidget {
final grid = _ProgrammerGrid(
entries: entries,
profileNames: profileNames,
width: sideBySide ? width - 320 : width,
);
@@ -123,7 +124,7 @@ class MonitorTab extends ConsumerWidget {
const SizedBox(width: 12),
SizedBox(
width: 300,
child: const HelpPanel(),
child: HelpPanel(profileNames: profileNames),
),
],
)
@@ -133,7 +134,7 @@ class MonitorTab extends ConsumerWidget {
const SizedBox(height: 16),
SizedBox(
height: 340,
child: const HelpPanel(),
child: HelpPanel(profileNames: profileNames),
),
],
);
@@ -161,10 +162,12 @@ class MonitorTab extends ConsumerWidget {
class _ProgrammerGrid extends StatelessWidget {
const _ProgrammerGrid({
required this.entries,
required this.profileNames,
required this.width,
});
final List<ProgrammerMonitorEntry> entries;
final Map<String, String> profileNames;
final double width;
@override
@@ -198,6 +201,7 @@ class _ProgrammerGrid extends StatelessWidget {
final entry = entries[i];
return ProgrammerMonitorCard(
entry: entry,
profileNames: profileNames,
onTap: () =>
context.go('/programmer-tasks/programmers/${entry.programmer.id}'),
);
@@ -41,10 +41,12 @@ class ProgrammerMonitorCard extends StatelessWidget {
super.key,
required this.entry,
required this.onTap,
this.profileNames = const {},
});
final ProgrammerMonitorEntry entry;
final VoidCallback onTap;
final Map<String, String> profileNames;
@override
Widget build(BuildContext context) {
@@ -155,7 +157,7 @@ class ProgrammerMonitorCard extends StatelessWidget {
for (final e in entry.helped)
_HelpRow(
prefix: 'Helped →',
name: e.assigneeId,
name: profileNames[e.assigneeId] ?? e.assigneeId,
task: e.taskTitle,
minutes: e.minutes,
cs: cs,
@@ -164,7 +166,7 @@ class ProgrammerMonitorCard extends StatelessWidget {
for (final e in entry.helpedBy)
_HelpRow(
prefix: 'Helped by ←',
name: e.helperId,
name: profileNames[e.helperId] ?? e.helperId,
task: e.taskTitle,
minutes: e.minutes,
cs: cs,