refactor: align detail views with dense console ui
This commit is contained in:
@@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
Standalone Next.js admin frontend for the virtual try-on workflow.
|
Standalone Next.js admin frontend for the virtual try-on workflow.
|
||||||
|
|
||||||
|
## UI Direction
|
||||||
|
|
||||||
|
- Shared admin shell uses a compact dense-console layout instead of wide hero-card framing.
|
||||||
|
- `orders`, `reviews`, and `workflows` prioritize toolbar + table + detail patterns for desktop operators.
|
||||||
|
- Review detail keeps image inspection on the left and grouped decision actions on the right.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- Node.js 20+
|
- Node.js 20+
|
||||||
@@ -82,8 +88,6 @@ Real integration pages:
|
|||||||
|
|
||||||
Placeholder or transitional pages:
|
Placeholder or transitional pages:
|
||||||
|
|
||||||
- `/orders`
|
|
||||||
- `/workflows`
|
|
||||||
- `/libraries/models`
|
- `/libraries/models`
|
||||||
- `/libraries/scenes`
|
- `/libraries/scenes`
|
||||||
- `/libraries/garments`
|
- `/libraries/garments`
|
||||||
|
|||||||
@@ -24,6 +24,34 @@ type WorkflowAssetUriField =
|
|||||||
| "result_uri"
|
| "result_uri"
|
||||||
| "source_uri";
|
| "source_uri";
|
||||||
|
|
||||||
|
type WorkflowLookupSource =
|
||||||
|
| Pick<
|
||||||
|
WorkflowListItemDto,
|
||||||
|
| "order_id"
|
||||||
|
| "workflow_id"
|
||||||
|
| "workflow_type"
|
||||||
|
| "workflow_status"
|
||||||
|
| "current_step"
|
||||||
|
| "failure_count"
|
||||||
|
| "review_task_status"
|
||||||
|
| "revision_count"
|
||||||
|
| "pending_manual_confirm"
|
||||||
|
| "updated_at"
|
||||||
|
>
|
||||||
|
| Pick<
|
||||||
|
WorkflowStatusResponseDto,
|
||||||
|
| "order_id"
|
||||||
|
| "workflow_id"
|
||||||
|
| "workflow_type"
|
||||||
|
| "workflow_status"
|
||||||
|
| "current_step"
|
||||||
|
| "review_task_status"
|
||||||
|
| "revision_count"
|
||||||
|
| "pending_manual_confirm"
|
||||||
|
| "updated_at"
|
||||||
|
| "steps"
|
||||||
|
>;
|
||||||
|
|
||||||
const WORKFLOW_ASSET_URI_FIELDS = new Set<WorkflowAssetUriField>([
|
const WORKFLOW_ASSET_URI_FIELDS = new Set<WorkflowAssetUriField>([
|
||||||
"asset_uri",
|
"asset_uri",
|
||||||
"candidate_uri",
|
"candidate_uri",
|
||||||
@@ -94,21 +122,14 @@ function adaptWorkflowStep(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function adaptWorkflowLookupItem(
|
export function adaptWorkflowLookupItem(workflow: WorkflowLookupSource): WorkflowLookupItemVM {
|
||||||
workflow: Pick<
|
const failureCount =
|
||||||
WorkflowStatusResponseDto | WorkflowListItemDto,
|
"failure_count" in workflow
|
||||||
| "order_id"
|
? workflow.failure_count
|
||||||
| "workflow_id"
|
: "steps" in workflow
|
||||||
| "workflow_type"
|
? workflow.steps.filter((step) => step.step_status === "failed").length
|
||||||
| "workflow_status"
|
: 0;
|
||||||
| "current_step"
|
|
||||||
| "failure_count"
|
|
||||||
| "review_task_status"
|
|
||||||
| "revision_count"
|
|
||||||
| "pending_manual_confirm"
|
|
||||||
| "updated_at"
|
|
||||||
>,
|
|
||||||
): WorkflowLookupItemVM {
|
|
||||||
return {
|
return {
|
||||||
orderId: workflow.order_id,
|
orderId: workflow.order_id,
|
||||||
workflowId: workflow.workflow_id,
|
workflowId: workflow.workflow_id,
|
||||||
@@ -117,7 +138,7 @@ export function adaptWorkflowLookupItem(
|
|||||||
statusMeta: getOrderStatusMeta(workflow.workflow_status),
|
statusMeta: getOrderStatusMeta(workflow.workflow_status),
|
||||||
currentStep: workflow.current_step,
|
currentStep: workflow.current_step,
|
||||||
currentStepLabel: getWorkflowStepMeta(workflow.current_step).label,
|
currentStepLabel: getWorkflowStepMeta(workflow.current_step).label,
|
||||||
failureCount: workflow.failure_count,
|
failureCount,
|
||||||
reviewTaskStatus: workflow.review_task_status,
|
reviewTaskStatus: workflow.review_task_status,
|
||||||
revisionCount: workflow.revision_count,
|
revisionCount: workflow.revision_count,
|
||||||
pendingManualConfirm: workflow.pending_manual_confirm,
|
pendingManualConfirm: workflow.pending_manual_confirm,
|
||||||
|
|||||||
Reference in New Issue
Block a user