feat(tickets): ajoute les pièces jointes sur tickets (#108)

Stockage flat côté ticket + métadonnées d'attachments, lecture exposée côté
backend/MCP, et UI minimale de liste/ajout dans TicketDetail. Traverse le
domaine (Issue, ports), l'application (usecases + assistant de ticket), les
adaptateurs infra/MCP (issues store, orchestrateur), les DTO backend/web-
server/app-tauri, et le frontend (domain/ports/adapters/hooks/UI).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-29 11:08:45 +02:00
parent 2692b9cc03
commit 8158057b1d
34 changed files with 1722 additions and 102 deletions

View File

@ -45,6 +45,8 @@ export interface TicketDetailViewModel {
priority?: Ticket["priority"];
}) => Promise<boolean>;
saveCarnet: (carnet: string) => Promise<boolean>;
attachFile: () => Promise<boolean>;
markAttachmentSummarized: (attachmentId: string) => Promise<boolean>;
link: (targetRef: string, kind: TicketLinkKind) => Promise<boolean>;
unlink: (targetRef: string, kind?: TicketLinkKind) => Promise<boolean>;
assign: (agentId: string, assigned: boolean) => Promise<boolean>;
@ -193,6 +195,26 @@ export function useTicketDetail(
[run, gateway, projectId, ref],
);
const attachFile: TicketDetailViewModel["attachFile"] = useCallback(async () => {
if (!system) return false;
try {
const path = await system.pickFile();
if (!path) return false;
return run((version) => gateway.addAttachment(projectId, ref, path, version));
} catch (e) {
setError(describe(e));
return false;
}
}, [system, run, gateway, projectId, ref]);
const markAttachmentSummarized: TicketDetailViewModel["markAttachmentSummarized"] = useCallback(
(attachmentId) =>
run((version) =>
gateway.markAttachmentSummarized(projectId, ref, attachmentId, version),
),
[run, gateway, projectId, ref],
);
const link: TicketDetailViewModel["link"] = useCallback(
(targetRef, kind) =>
run((version) => gateway.link(projectId, ref, targetRef, kind, version)),
@ -243,6 +265,8 @@ export function useTicketDetail(
refresh,
updateFields,
saveCarnet,
attachFile,
markAttachmentSummarized,
link,
unlink,
assign,