feat(programmer): sheet-driven stats, monitor status, drill-down history

- Wire daySheetsForUserProvider(userId) into ProgrammerDashboard so
  computeProgrammerStats/computeBadges receive real sheet data instead of
  the placeholder const <ProgrammerDaySheet>[].
- Monitor tab: watch allDaySheetsProvider and build sheetStatusByUser map
  for today; pass it to buildMonitorEntries; add "Sheets pending" chip
  (pending + disapproved today) to the summary row.
- ProgrammerDrillDownScreen: add _RecentDaySheetsPanel below the dashboard
  showing the last 10 sheets (date + status pill) with tap-to-daySheetDetail.
- DaySheetDetailScreen (T17 gaps): replace const [] liveRows with
  programmerDayDataProvider(sheet.workDate) built rows for non-approved
  sheets; fix _onApprove timer check to filter only the sheet programmer's
  own tasks (QN-1).
- Add test/programmer_drill_down_test.dart (3 tests, all passing).

Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
2026-09-28 18:29:28 +08:00
parent 5af0ce62d9
commit 2585cce36d
5 changed files with 289 additions and 29 deletions
@@ -7,6 +7,7 @@ import '../../../models/programmer_task.model.dart';
import '../../../providers/leave_provider.dart';
import '../../../providers/profile_provider.dart';
import '../../../providers/programmer_day_data_provider.dart';
import '../../../providers/programmer_day_sheets_provider.dart';
import '../../../providers/programmer_tasks_provider.dart';
import '../../../utils/app_time.dart';
import '../../../utils/programmer_daily_time.dart';
@@ -43,6 +44,9 @@ class ProgrammerDashboard extends ConsumerWidget {
final now = ref.watch(clockTickerProvider).valueOrNull ?? AppTime.now();
final sheetsAsync = ref.watch(daySheetsForUserProvider(userId));
final sheets = sheetsAsync.valueOrNull ?? const <ProgrammerDaySheet>[];
final tasks = tasksAsync.valueOrNull ?? const [];
final profileById = <String, Profile>{
for (final p in profilesAsync.valueOrNull ?? <Profile>[]) p.id: p,
@@ -75,7 +79,7 @@ class ProgrammerDashboard extends ConsumerWidget {
userId: userId,
now: now,
tasks: tasks,
sheets: const <ProgrammerDaySheet>[],
sheets: sheets,
leaveDays: leaveDays,
todayFocus: todayFocus,
);