Commit Graph

242 Commits

Author SHA1 Message Date
redz1029 88848138d9 feat(programmer-tasks): loading states, confirmation & success dialogs
Day sheet dialogs (disapprove, justify): moved the async controller call
inside each dialog so loading state is owned there — button shows a
spinner and is disabled while the RPC is in flight; errors display inline
instead of via a snackbar after dialog close.

Detail screen (approve): added _approvingSheet bool; Approve button shows
CircularProgressIndicator while in flight. On success shows an AlertDialog
"Sheet Approved" with a check icon instead of silently updating state.

Approvals tab (bulk approve): upgraded post-approve feedback from a
snackbar to a success AlertDialog showing the count of approved sheets
and any skipped ones.

Day sheets tab (submit): added confirmation AlertDialog before the
existing submit flow so programmers don't accidentally submit mid-day.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 22:31:50 +08:00
redz1029 2946945ce3 fix(programmer-tasks): tab switching + help-given live data
Tab switching: _buildTabs was recreating TabController on every build
because `_tabs == tabs` compares List by reference identity, not content.
programmerTasksTabsFor() always returns a new list, so the guard was
always false, resetting the controller to initialIndex 0 on every tap.
Fixed by using listEquals from flutter/foundation.

Help given: computeProgrammerStats accumulated helpGivenThisMonth only
from approvedSnapshot rows, which only exist after admin approval.
Programmers who helped others but had pending sheets saw 0m indefinitely.
Fixed by adding helpGivenThisMonthProvider (FutureProvider.family) that
queries programmer_task_work_logs directly for the current Manila month,
and passing it as liveHelpThisMonthSec to computeProgrammerStats.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 22:25:25 +08:00
redz1029 4f60e23003 fix(approvals): show — instead of 0m·0 tasks for pending/disapproved sheets
approvedSnapshot is only populated at approval time; pending and disapproved
sheets had null snapshot so the card always displayed 0m · 0 tasks.

Now totalSecs/taskCount are passed as nullable params from the parent; the
card renders — when no snapshot is available yet.

Also accept camelCase 'daySheets' URL param in parseProgrammerTasksTab
alongside the existing hyphenated 'day-sheets' spelling.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 21:05:58 +08:00
redz1029 68817a70f0 fix(tabs): replace SingleTickerProviderStateMixin with TickerProviderStateMixin
_buildTabs creates a new TabController (new ticker) before disposing the
old one, so two tickers briefly coexist — SingleTickerProviderStateMixin
throws. TickerProviderStateMixin supports multiple concurrent tickers.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 19:55:56 +08:00
redz1029 9f2c14dc6b fix(report): remove dead null checks on non-nullable DaySheetRow.category
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 19:15:59 +08:00
redz1029 1101fb0a97 feat(report): accomplishment report dialog + entry points
Add AccomplishmentReportDialog with programmer/admin modes, date-range
filter (default this month), and include-unapproved toggle. Wire into
DaySheetsTab app-bar action, ApprovalsTab app-bar action, and
ProgrammerDrillDownScreen app-bar button.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 19:09:09 +08:00
redz1029 167e208ffa feat(report): accomplishment report PDF + shared PDF helpers
- lib/utils/pdf/pdf_letterhead.dart: PdfBrand with load(), letterhead(),
  theme(), and pageFooter() shared across CRMC PDF documents
- lib/widgets/pdf_preview_dialog.dart: showPdfPreviewDialog() with
  pdfrx PdfViewer.data preview, Print (Printing.layoutPdf) and
  Download (Printing.sharePdf) buttons
- lib/screens/programmer_tasks/report/accomplishment_report_pdf.dart:
  buildAccomplishmentReportPdf() — A4 MultiPage with letterhead, info
  box, accomplishment table, footnote, summary, signatures, page footer
- test/accomplishment_report_pdf_test.dart: 2 passing tests

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 18:55:45 +08:00
redz1029 87014d1656 fix(report): approverName uses only included days
Move reviewer tracking logic inside the non-empty rows guard in both
approved-only and include-unapproved modes. This ensures zero-row
approved sheets don't pollute the reviewer set, fixing the approverName
calculation to only consider reviewers from included ReportDays.

Add test: approved sheet with zero rows and different reviewer correctly
excluded from approver tracking.

All 9 tests passing.
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 18:47:18 +08:00
redz1029 f56a3057d4 feat(report): accomplishment report data builder
Implement AccomplishmentReportData and buildAccomplishmentReportData() for
generating programmer accomplishment reports. Supports both approved-only and
include-unapproved modes, with proper row filtering, day aggregation, metrics
calculation (totalSeconds, tasksCompleted, helpSeconds, secondsByCategory),
and approver tracking.

All 8 tests passing.
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 18:42:29 +08:00
redz1029 8209719928 fix(programmer): trim day sheet detail screen under 500 lines
Remove inline comment to bring file from 501 to 500 lines,
satisfying the 500-line cap.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 18:37:49 +08:00
redz1029 2585cce36d 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>
2026-09-28 18:29:28 +08:00
redz1029 5af0ce62d9 feat(notifications): day sheet notification types
Add daySheetId field to NotificationItem model (Brick-managed), extract
notificationTitle/notificationIcon to top-level testable functions, add
five day-sheet notification cases, and wire tap/banner routing for
day-sheet detail and approvals tab.
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 14:54:19 +08:00
redz1029 54ce528b02 feat(programmer): day sheets + approvals tabs
- day_sheet_snapshot_builder.dart: buildSnapshotForSheet (approved →
  stored snapshot, else live buildDayRows), groupSheetsByDate (descending
  keys), approvalCounts (pending/awaiting/approved)
- approvals_tab.dart: status filter chips, programmer dropdown,
  ReportDateFilter.controlled, date-grouped cards with Auto/Early/Round
  badges, checkbox multi-select, bulk Approve selected (n) flow
- day_sheets_tab.dart: Today card (live rows, total, status, Submit day),
  Needs your attention (disapproved), history with AppStatusSummaryRow
  All/Pending/Disapproved/Approved filter
- programmerTasksTabsFor: admin → [monitor, approvals, mine, all];
  programmer → [mine, all, daySheets]
- programmer_tasks_list_screen.dart: wire approvals + daySheets cases

Tests: 15 passing (day_sheet_tabs_test + programmer_tabs_test)

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 14:43:52 +08:00
redz1029 1fe9653bdf feat(programmer): day sheet detail screen
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 14:21:22 +08:00
redz1029 91fb023ef2 feat(reports): controlled ReportDateFilter
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 14:13:33 +08:00
redz1029 be16a3cd0d feat(programmer): dated work-log corrections
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 14:08:28 +08:00
redz1029 cc8d8ab8bf feat(programmer): day sheet providers + controller
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 14:00:29 +08:00
redz1029 20e95ffe37 feat(edge): day sheet digest push
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 13:50:31 +08:00
redz1029 e0dd3f6368 feat(db): day sheet RPCs, auto-submit cron, digest queue
Add submit_day_sheet, disapprove_day_sheet, justify_day_sheet,
approve_day_sheets (all SECURITY DEFINER, grant to authenticated)
and auto_submit_day_sheets (revoked from all client roles).

auto_submit_day_sheets:
  1. Reopens approved yesterday sheets for programmers whose timer
     was still running at end of day (amended event).
  2. Auto-promotes stale draft sheets to pending (auto_submitted event).
  3. Inserts day_sheet_digest notifications + scheduled_notifications
     (epoch=YYYYMMDD, ON CONFLICT DO NOTHING) for every admin.

Extends chk_at_least_one_ref on scheduled_notifications to allow
notify_type = 'day_sheet_digest' rows with no FK reference.

Registers pg_cron job 'programmer_day_sheet_autosubmit' at 16:05 UTC
(00:05 Asia/Manila) in a DO $$ EXCEPTION block.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-28 13:31:26 +08:00
redz1029 e2ff0140ef feat(db): programmer day sheets schema, triggers, RLS
Adds migration 20260927150000_add_programmer_day_sheets.sql:
- manila_today() stable helper (Asia/Manila timezone)
- programmer_day_sheets table with draft/pending/disapproved/approved status,
  unique(programmer_id, work_date), updated_at trigger, RLS
- programmer_day_sheet_events table with kind/body checks, cascade FK, RLS
- work_date column on programmer_task_work_logs (add, backfill, default, not null)
- ensure_day_sheet() SECURITY DEFINER; revoked from public/anon/authenticated
- BEFORE INSERT trigger validate_work_log_date (work_date_locked error code)
- AFTER INSERT trigger on work_logs → ensure_day_sheet
- AFTER INSERT trigger on activity_logs → ensure_day_sheet for assignee
- RLS SELECT policies (own sheet or admin; events through parent sheet)
- notifications.day_sheet_id FK column + partial index
- Add day sheets tables to supabase_realtime publication

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 22:51:41 +08:00
redz1029 e24083356f 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>
2026-09-27 22:43:28 +08:00
redz1029 7beb8e8713 feat(programmer): admin monitor tab + drill-down
- Add isStrictAdminProvider (role == 'admin' only)
- Add programmer_tasks_tabs.dart with ProgrammerTasksTab enum,
  programmerTasksTabsFor, parseProgrammerTasksTab, programmerTasksTabLabel
- Make ProgrammerTasksListScreen role-aware via initialTab param and
  programmerTasksTabsFor; admin sees Monitor/Mine/All tabs
- Add MonitorTab with AppStatusSummaryRow + responsive programmer grid
  (1/2/3 cols) + HelpPanel side/bottom
- Add ProgrammerMonitorCard with state pills (Working/Paused/Idle/On leave/Pass slip)
- Add HelpPanel ConsumerStatefulWidget with day stepper and help-edge rows
- Add ProgrammerDrillDownScreen (/programmer-tasks/programmers/:userId);
  non-admins see lock empty view
- Router: pass tab query param; add programmers/:userId before :id route
- Tests: 7/7 pass; analyze: 0 new issues

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 22:39:19 +08:00
redz1029 791653f45c fix(programmer): buildMonitorEntries accepts pre-computed leave/passSlip maps
Changed buildMonitorEntries signature to accept Map<String, LeaveOfAbsence> and Map<String, PassSlip> instead of List types, matching the spec requirement that callers pass pre-computed maps from activeLeaveByUser() and activePassSlipByUser().

- Updated function signature for both parameters
- Removed internal calls to activeLeaveByUser/activePassSlipByUser
- Updated state-determination to use direct map lookups
- Updated all test cases to pass computed maps
- All 19 tests passing
- No new analyzer issues

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 22:27:11 +08:00
redz1029 935ee670e7 feat(programmer): monitor view-model
Implements MonitorState enum, HelpEdge class, and buildMonitorEntries/buildHelpEdges functions for the monitor view model. Features include:

- MonitorState enum with values: working, paused, idle, onLeave, passSlip
- HelpEdge class for tracking help between programmers
- buildHelpEdges() to extract helped/helpedBy relationships from work logs
- ProgrammerMonitorEntry with current task tracking and duration calculations
- buildMonitorEntries() with proper state determination, task counting, and sorting

All tests passing. Sort order: working -> paused -> idle -> passSlip -> onLeave, then alphabetical by name.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 22:22:29 +08:00
redz1029 a7fd1e74f1 feat(programmer): dashboard stat tiles + badges
Add StatTiles and BadgesStrip widgets wired into ProgrammerDashboard.

StatTiles shows 2 tiles (focus + completed) when showSheetStats is false,
and 5 tiles (+ streak, first-pass approval, help given) when the viewing
user's role is programmer. BadgesStrip renders earned/locked chips in a
horizontal Wrap with tap-to-dialog detail.

Dashboard feeds todayFocus via buildDayRows/totalSeconds, leaveDays via
approvedLeaveDays, and sheets: const [] until Task 20 wires real data.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 22:13:43 +08:00
redz1029 0c99ef270d refactor: extract staff presence helpers
- Extract activeLeaveByUser, activePassSlipByUser, and approvedLeaveDays to staff_presence.dart utility module
- Replace inline indexing loops in dashboard_screen.dart with helper function calls
- Behavior unchanged, tests added covering all functions

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 22:04:17 +08:00
redz1029 9a40ffec81 fix(programmer): move clock ticker watch to dashboard parent
NowWorkingCard was watching clockTickerProvider but received pre-computed
Duration values from ProgrammerDashboard, which never rebuilt on ticks.
Move ref.watch(clockTickerProvider) to ProgrammerDashboard.build() so
the parent rebuilds every 30 s and passes fresh durations to the card.
Remove the now-unused clockTickerProvider watch (and its import) from
NowWorkingCard.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 21:59:01 +08:00
redz1029 29bcbcaa4d feat(programmer): Mine dashboard hero + task sections
Replace the Mine tab flat list with ProgrammerDashboard — a NowWorkingCard
hero (running task with Pause/Complete, or idle with nextUp Start), a
TODO stub for Task 8 stat tiles/badges, and collapsible TaskSections
(In progress, Paused, Not started always-visible; Completed/Cancelled
start collapsed with Show-all at 10+). groupTasksForDashboard excludes
other assignees and sorts completed/cancelled by terminal date desc.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 21:52:13 +08:00
redz1029 f8c3422715 refactor(programmer): shared task card driven by run states
Extract _TaskCard from the list screen into ProgrammerTaskCard, a
shared ConsumerWidget that reads programmerRunStatesProvider so the
paused-task pill and Start/Resume/Complete buttons are consistent
across any surface that embeds it.

Move the _complete body verbatim to completeProgrammerTaskWithConfirm
in programmer_task_actions.dart; the detail screen's _ActionBar now
calls the shared function.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 21:40:07 +08:00
redz1029 cdfeb954fd feat(programmer): day-sheet model + stats, streak and badges
Add ProgrammerDaySheet model with DaySheetStatus/DaySheetSnapshot,
computeProgrammerStats with streak, first-pass rate, approved totals,
hasCleanWeek, and tiered badge progress via computeBadges. 10 tests pass.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 21:27:03 +08:00
redz1029 ab82af119b feat(programmer): day activity data + run-state provider
Implements DayActivityData, fetchDayActivityData, computeRunStates,
clockTickerProvider, todayKeyProvider, programmerActivitySignalProvider,
programmerDayDataProvider, and programmerRunStatesProvider in
lib/providers/programmer_day_data_provider.dart.

Includes four passing tests in test/programmer_day_data_test.dart
covering run-state computation and day-scoped activity fetching.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 21:16:04 +08:00
redz1029 12842bfa12 fix(programmer): day rows — Delta JSON test + non-assignee row gate
- Add Delta JSON happy-path test case to deltaJsonToPlainText tests
- Fix double-row bug: notes-only assignee rows only when userId == assigneeId
- Remove dead code: tautological taskMap.containsKey check in loop
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 21:08:30 +08:00
redz1029 f9b8831c71 feat(programmer): day rows builder + work-log workDate
- Add workDate field to ProgrammerTaskWorkLog (defaults to Manila day of createdAt)
- Add deltaJsonToPlainText function to quill_field.dart for Delta/plain text conversion
- Implement buildDayRows function to generate day sheet rows with proper sorting
- Implement DaySheetRow serialization and deserialization
- Add comprehensive tests for day rows builder and workDate field
- Verify backward compatibility via existing programmer_task_ledger_test
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 21:04:23 +08:00
redz1029 f071cc722d fix(programmer): reassignment while paused must not open new segment
Capture whether segment was running before reassignment, and only reopen
for new assignee if it was. A paused task that gets reassigned should not
start accruing time for the new assignee until explicitly resumed.

Also add test: reassignment while paused does not open segment.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 20:57:55 +08:00
redz1029 6beb92d3c6 feat(programmer): per-day worked time split with assignee attribution
Implement daily time tracking and splitting for programmer tasks across
Manila midnights with proper assignee attribution, including support for
pauses, reassignments, and adjustments.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 20:53:49 +08:00
redz1029 dd6730f62d Add implementation plan: programmer oversight
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 18:22:05 +08:00
redz1029 7a319b6e16 Add design spec: programmer oversight (day-sheet approvals, monitor, report, dashboard)
Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 17:44:44 +08:00
redz1029 b307f66f2c Add PM extension (Projects, Work Logs, Comments) + Quill rich-text UI
Projects: Brick-backed model with list/detail screens and nav entry.
Work Logs: per-contributor time ledger, assignee running-clock +
helper logged minutes with Hours/Minutes input; pause-after-save and
helper-deduct prompts.
Comments: threaded comments with file attachments and Quill composer.
Detail screen: tabbed layout (Work Log / Comments / Activity),
editable title + description via edit dialog, Quill-rendered
descriptions with legacy plain-text fallback.
Create dialog: fixed-width (480px max), Quill description editor.
Shared QuillFieldEditor + QuillReadOnly widgets extracted for reuse.
RLS: hardened activity-log actor binding, immutable creator_id/
created_at triggers, SECURITY INVOKER visibility helper,
append-only work-log and scoped comment policies.
Brick migration for project_id FK on programmer_tasks.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-27 16:06:26 +08:00
redz1029 627645056b 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>
2026-09-27 01:13:33 +08:00
redz1029 e7706058b7 UI Phase 2: cosmetic leftovers — compact Profile photo card, fit Users table
- Profile Photo card: replace the tall centered avatar+buttons stack with a
  compact horizontal row (avatar left, caption + Upload/Camera buttons right),
  roughly halving the card height and reclaiming the dead vertical space.
- TasQColumn gains an optional `minWidth`; the adaptive table now sums per-column
  minimums instead of a flat 200 px each. User Management sets narrow widths on
  its short columns (Role/Offices/Status/Last active) so all six columns fit at
  desktop width without the horizontal scroll that was clipping the Status
  column. Other tables keep the 200 px default (unchanged).

Verified: flutter analyze lib clean; flutter build web green; visual QA
(Profile, User Management) in dark.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-26 23:35:19 +08:00
redz1029 4685430406 UI Phase 2: dogfood follow-ups — section headers, role terms, status semantics
Address the remaining concrete items flagged by the dogfood pass.

Section headers (→ AppSectionHeader, azure accent bar + uppercase):
- Attendance: "Today's Schedule", "Pass Slip History", and two "Pending
  Approvals" rows (were plain bold text / a manual tertiary accent bar).

User Management:
- Roles now display human-friendly labels (it_staff → "IT Staff", standard →
  "Standard", …) in the table cell, mobile tile and edit dropdown, instead of
  raw snake_case (Content/terminology consistency).
- _StatusBadge is now semantic via AppStatusColors: Active → success (green),
  Locked → danger (red), else neutral — previously everything was teal, so a
  Locked account read the same as an Active one.

Verified: flutter analyze lib clean; flutter build web green; visual QA
(Attendance, User Management) in dark.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-26 16:44:39 +08:00
redz1029 6bde8630d8 UI Phase 2 (L8): unify Profile section headers with AppSectionHeader
The Profile screen's card section titles used plain bold titleMedium text,
inconsistent with the cyber accent-bar section headers elsewhere. Convert
"Profile Photo", "Face Verification", "Account details", "Password" and
"Offices" to AppSectionHeader so they read the same as the rest of the app.

Verified: flutter analyze lib clean; flutter build web green; visual QA
(Profile) in dark.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-26 16:28:01 +08:00
redz1029 7716460363 UI Phase 2 (L4): ISR status-pill consistency + shared status-kind mapper
The IT Service Requests list tile still used the legacy StatusPill (violet
"DRAFT"); make it semantic like the detail header. Extract the ISR status ->
StatusKind mapping into a shared helper so list and detail stay in sync.

- New isr_status_kind.dart (public isrStatusKind); removed the private duplicate
  from the detail screen.
- _RequestTile now uses StatusPill.kind(isrStatusKind(status), ...).

(The request cards were already content-dense; no layout change needed.)
Verified: flutter analyze lib clean; flutter build web green.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-26 16:11:14 +08:00
redz1029 ab5d385325 UI Phase 2 (L7): tighten Reports chart grid layout
Reduce dead whitespace and align the Reports charts to the cyber card language.
Layout only — charts, data and PDF export untouched.

- report_card_wrapper.dart: flat tonal fill + hairline outline + token radius
  (was surfaceContainerLow + hard 16 radius, no border); uppercase telemetry
  card title to match section headers.
- status_charts.dart / request_distribution_charts.dart: donut charts now use a
  fixed 150px donut with an Expanded legend beside it (was an Expanded donut +
  cramped right legend, leaving a large central gap); card height 220 -> 180.

Verified: flutter analyze lib clean; flutter build web green; visual QA (Reports)
in dark.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-26 16:06:32 +08:00
redz1029 9f764150a2 UI Phase 2 (L0): shared layout primitives + chrome standardization
Extract four shared layout widgets from the best existing implementations and
adopt them across list/overview screens, deleting duplicated inline code.
Layout/consistency only — no behavior change.

New primitives (lib/widgets/):
- app_section_header.dart  — AppSectionHeader (azure accent bar + uppercase
  telemetry label; promoted from the dashboard's _sectionTitle).
- app_metric_card.dart     — AppMetricCard (uppercase label + mono value on a
  flat hairline surface; unifies KPI/stat tiles).
- app_status_summary.dart  — AppStatusSummaryRow/Item/Chip (dot + count + label,
  selectable; semantic AppStatusColors).
- app_filter_bar.dart      — AppFilterBar (responsive filter-row chrome).

Adopted / de-duplicated:
- Dashboard: _MetricCard now wraps AppMetricCard; section titles use
  AppSectionHeader (removed local _sectionTitle).
- Tickets / Tasks / ISR: three separate summary-chip implementations
  (_StatusSummaryCard x2, _SummaryChip) collapsed into AppStatusSummaryRow.
- Network Map overview: Sites/Devices tiles -> AppMetricCard (removed local
  _SummaryCard).
- Workforce: "Duty Schedules" header -> AppSectionHeader with trailing chip.

Verified: flutter analyze lib clean; flutter build web green; visual QA (tickets
+ ISR summary chips) in dark.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-26 15:42:26 +08:00
redz1029 57377b1b21 UI: Cyber/IT design overhaul with semantic status tokens (Material 3)
Re-theme TasQ with a refined enterprise "Cyber/IT" identity on Material 3.
Functionality is unchanged — only color/shape tokens and a few state widgets.

Foundation:
- Hand-tuned light + dark ColorSchemes (deep-slate surfaces, azure/teal/violet
  accents), tightened 12-16dp shape language, flat hairline-outlined cards.
- New AppStatusColors theme extension (success/warning/danger/info/neutral,
  per-brightness) replacing scattered raw Colors.green/orange/red/grey so status
  color is consistent and legible in dark mode.
- New TechChip mono primitive; StatusPill.kind; M3Card hairline variants;
  tightened AppSurfaces radii.

Per-screen:
- Tokenized status colors + radii across dashboard, tickets, tasks, IT service
  requests, attendance, whereabouts, network map, reports charts, auth, and
  shared/admin screens. Added _ticketStatusKind/_taskStatusKind/_isrStatusKind
  mappers so status carries meaning consistently.
- Fixed white pie-slice borders for dark mode; dropped ad-hoc dialog radius
  overrides in favor of the theme default. Categorical palettes (leave-type
  icons, team color picker, distribution charts) intentionally preserved.

Verified: flutter analyze lib clean; flutter build web green; visual QA in
light and dark (dashboard, tickets, attendance).

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-26 15:13:47 +08:00
redz1029 3cb980b629 QA hardening: security RLS fixes, Flutter 3.47.5 upgrade, UI/validation fixes
Security — enforce write authorization server-side (was UI/RPC-only):
- it_service_requests RLS: block cross-office read/edit + self-approve (QA-015)
- pass_slips RLS: owner can complete but not self-approve (QA-046)
- swap_requests RLS: scope select/update to participants + admin (QA-047)
- storage: tighten it_service_attachments + task_attachments write/delete (QA-027)
- admin_user_management edge function: allow programmers to manage users (QA-016)

Fixes:
- workforce generator "uncovered shifts" false alarms (QA-043/044)
- network-map VLAN + New-location dialog validation, disabled-until-valid (QA-048)
- de-flake time-of-day-dependent dashboard metrics test (QA-045)

Toolchain:
- upgrade to Flutter 3.47.5 / Dart 3.13.4; font_awesome_flutter 11.0.0,
  flutter_quill 11.6.0, pdfrx 2.6.5; clear resulting deprecations (QA-002)

analyze clean; 139 tests pass; web build succeeds. Report + evidence in docs/qa/.

Note: also carries the in-progress Brick model cleanup already present in the
working tree. QA-001 (AI keys public in the build) is deferred by owner decision.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-09-26 11:52:16 +08:00
redz1029 e49b52949c Fixed Edit Port Dialog on Network Map 2026-06-06 18:30:58 +08:00
redz1029 65a42039ee Enhanced Leave and Pass Slip UI/UX 2026-06-06 18:29:56 +08:00
redz1029 d813ee45a2 Network map enhancements and fixes 2026-06-05 16:42:56 +08:00