fix(workstate): normalisation du work-state pour éviter l'onglet Work vide

Normalise l'état Work pour empêcher l'affichage d'un onglet Work vide.

QA VERT : tsc --noEmit exit 0 ; vitest run 42 fichiers / 407 tests passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 09:27:52 +02:00
parent fb501d10e5
commit 3e1e5536cc
5 changed files with 259 additions and 47 deletions

View File

@ -9,9 +9,11 @@ import { invoke } from "@tauri-apps/api/core";
import type { ProjectWorkState } from "@/domain";
import type { WorkStateGateway } from "@/ports";
import { normalizeProjectWorkState } from "./workStateNormalization";
export class TauriWorkStateGateway implements WorkStateGateway {
getProjectWorkState(projectId: string): Promise<ProjectWorkState> {
return invoke<ProjectWorkState>("get_project_work_state", { projectId });
async getProjectWorkState(projectId: string): Promise<ProjectWorkState> {
const state = await invoke<unknown>("get_project_work_state", { projectId });
return normalizeProjectWorkState(state);
}
}