Merge pull request 'fix(arguments): route "חשב טיעונים" through the legal-analyst agent' (#326) from worktree-fix-aggregate-btn into main
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 41s
G12 Leak-Guard / leak-guard (push) Successful in 4s
Lint — undefined names / undefined-names (push) Successful in 10s

This commit was merged in pull request #326.
This commit is contained in:
2026-06-20 18:20:48 +00:00
5 changed files with 231 additions and 40 deletions

View File

@@ -190,12 +190,27 @@ export function LegalArgumentsPanel({ caseNumber }: LegalArgumentsPanelProps) {
const handleAggregate = (force: boolean) => {
aggregate.mutate(force, {
onSuccess: () => {
toast.success(
force
? "הופעלה חזרה חישוב טיעונים (force). יסתיים תוך דקה."
: "הופעל חישוב טיעונים. רענן בעוד דקה.",
);
onSuccess: (result) => {
switch (result.status) {
case "queued":
toast.success(
force
? "נשלח לאנליטיקאי לחישוב מחדש. התוצאה תופיע תוך כמה דקות — רענן את הדף."
: "נשלח לאנליטיקאי. החישוב רץ ברקע; התוצאה תופיע תוך כמה דקות — רענן את הדף.",
);
break;
case "no_claims":
case "exists":
toast.info(result.message);
break;
case "skipped":
toast.warning(
`לא ניתן להפעיל אוטומטית (${result.reason}). הרץ ידנית מ-Claude Code: mcp__legal-ai__aggregate_claims_to_arguments`,
);
break;
default:
toast.success("הבקשה נשלחה.");
}
},
onError: (e) => toast.error(`שגיאה: ${(e as Error).message}`),
});