Add Programmer Tasks module (work-log + time tracking)

Separate feature for the `programmer` role to record dev work by category,
distinct from the IT help-desk `tasks` feature. Modeled on the IT Service
Requests pattern (Brick offline-first model -> Riverpod stream/controller ->
list/detail screens); seed of a future Project Management workflow.

- programmer_tasks + programmer_task_activity_logs (category enum, RLS,
  realtime) via supabase migration
- single assignee, self-logged or lead-assigned; assign/reassign logged
- pause-on-switch: starting a task while another runs prompts to pause the
  running one, keeping one active task per user for accurate time attribution
- worked-duration math shared with help-desk tasks via a generic core in
  task_duration.dart (existing callers unchanged)
- list distinguishes running vs paused with a per-task Resume shortcut
- accessible dialog labels; route /programmer-tasks + nav gated to admin/programmer
- unit/widget tests: controller lifecycle, duration math, pause-switch dialog

Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
2026-09-27 01:13:33 +08:00
parent e7706058b7
commit 627645056b
18 changed files with 3214 additions and 20 deletions
+8
View File
@@ -460,6 +460,13 @@ List<NavSection> _buildSections(String role) {
icon: Icons.task_outlined,
selectedIcon: Icons.task,
),
if (role == 'admin' || role == 'programmer')
NavItem(
label: 'Programmer Tasks',
route: '/programmer-tasks',
icon: Icons.developer_mode_outlined,
selectedIcon: Icons.developer_mode,
),
NavItem(
label: 'IT Service Requests',
route: '/it-service-requests',
@@ -715,6 +722,7 @@ String _routeToTitle(String location) {
'/attendance' => 'Attendance',
'/tickets' => 'Tickets',
'/tasks' => 'Tasks',
'/programmer-tasks' => 'Programmer Tasks',
'/it-service-requests' => 'IT Service Requests',
'/network-map' => 'Network Map',
'/notifications' => 'Notifications',