KB-4F8F
M002-WCR-UI Report
6 min read Revision 1
reportm002workflow-modulesupervisor-uigovernance
M002-WCR-UI Report
Date: 2026-03-03 PR: #426 PR URL: https://github.com/Huyen1974/web-test/pull/426 Status: OPEN, CI GREEN, waiting user review/merge
Scope
Build supervisor-facing Workflows UI on top of M-002 Phase 2A foundation:
- Extend existing Directus schema only (no new collections)
- Add Workflows navigation + list/detail pages
- Add Process Registry, Workflow Matrix, and WCR Intake UI
- Keep Phase 1/2A workflow viewer/modeler foundation intact
Schema Changes
Applied via DOT only on cloud Directus.
workflows added fields
process_code(string, unique)sort(integer)parent_workflow_id(self FK -> workflows.id)level(integer, default 1)
workflow_steps added fields
trigger_in_text(text, nullable)trigger_out_text(text, nullable)
Evidence
dot-schema-workflows-ensure --cloudcreatedprocess_code,sort,parent_workflow_id,level, and self relationworkflows.parent_workflow_id -> workflowsdot-schema-workflow-governance-ensure --cloudcreatedworkflow_steps.trigger_in_textandworkflow_steps.trigger_out_text- Directus current state after apply:
workflows= 14 fieldsworkflow_steps= 16 fieldsworkflow_step_relations= 8 fields
Data Updates
Updated existing workflow #1 in Directus:
process_code = WF-001sort = 1level = 1parent_workflow_id = null
Updated all 10 workflow #1 steps with supervisor-readable trigger text derived from live relations, including migrated AI review block steps.
Examples:
Review Task.trigger_in_text = "Sau khi Task Submitted hoan thanh"Approved?.trigger_out_text = "→ Approved hoac → Rejected"Pass?.trigger_out_text = "→ Approve hoac → Request Changes"
Components Created
New components
web/components/modules/workflow-module/partials/ProcessRegistryView.vueweb/components/modules/workflow-module/partials/WorkflowMatrixView.vueweb/components/modules/workflow-module/partials/WcrIntakePanel.vue
New pages/routes
web/pages/knowledge/workflows/index.vue->/knowledge/workflowsweb/pages/knowledge/workflows/[id].vue->/knowledge/workflows/:id
New server APIs
web/server/api/workflows/registry.get.tsweb/server/api/workflows/[id]/matrix.get.tsweb/server/api/workflows/[id]/change-requests.get.ts
Modified integration files
web/components/navigation/TheHeader.vueweb/composables/useWorkflows.tsweb/server/utils/directusService.tsweb/types/workflows.tsweb/types/workflow-dsl.tsdot/bin/dot-schema-workflows-ensuredot/bin/dot-schema-workflow-governance-ensure
UI Behavior Delivered
Registry page
- Pagination: 25 items/page
- Search: title + process_code
- Filters: status + level
- Tree render: grouped by
parent_workflow_id, indented bylevel - Step count shown per workflow
Detail page
- Header shows workflow code, title, description, level, status
- Tabs:
Bang buoc-> WorkflowMatrixViewSo do BPMN-> existing WorkflowViewerDe xuat thay doi-> WcrIntakePanel
- Existing CommentModule is preserved when workflow has
task_id
WCR intake
- Natural-language description input
change_typedropdown- optional
position_context - existing WCR list + status badge + detail view
Validation
Local code validation
pnpm typecheck-> PASSpnpm build-> PASS- Existing pre-existing build warnings remain:
- PostCSS/SVGO warning for
.bg-checkerboardSVG data URL - Large chunk warnings
- PostCSS/SVGO warning for
Cloud/schema validation
- DOT dry-run matched expected 6 new fields only
- DOT apply completed successfully on cloud Directus
- Directus item verify confirmed workflow #1 metadata and step trigger fields were persisted
Git / CI validation
- Branch:
feat/m002-wcr-ui - Commit:
ebacf87(feat: add workflow supervisor UI) - PR:
#426 mergeStateStatus = CLEAN- Final PR checks snapshot: SUCCESS
Nuxt 3 CIbuildTerraform DeployQuality GateTerraform DeployPass GateTerraform DeployE2E Smoke TestCritical File Guardrequired-docs-guardFirebase Deploydeploy step
Before / After Evidence
Before
- No top-level
Workflowsnavigation item - No
/knowledge/workflowsroute workflowshad noprocess_code/sort/parent_workflow_id/levelworkflow_stepshad no supervisor-readable trigger text fields
After
Workflowsadded to main navigation in app code- Supervisor registry/detail routes added
- Workflow #1 labeled
WF-001 - Workflow #1 matrix can display persisted
trigger_in_text/trigger_out_text - WCR intake panel available from workflow detail page
Known Deferrals
- TD-060: max-3-level hierarchy not yet enforced by Directus Flow/hook
- TD-061: matrix row -> BPMN node highlight not implemented to avoid changing WorkflowViewer core logic in this mission
Notes
- No new collection was created
- No raw SQL or migration files were used
- CommentModule was not modified
- DSL backend and WorkflowViewer core logic were not changed
- Local page-level curl verification from ephemeral
nuxt devcould not be completed reliably in this sandbox; functional confidence is based on typecheck, production-like build, live Directus schema/data verification, and PR CI green