feat(compose): עורך-12-בלוקים כטאב-ברירת-מחדל ב-/compose (קטגוריה B #1)
All checks were successful
G12 Leak-Guard / leak-guard (pull_request) Successful in 4s
Lint — undefined names / undefined-names (pull_request) Successful in 10s

יישור /compose למוקאפ 03-case-workspace (הכרעת חיים: המוקאפ נכון). ה-main
הופך לרצועת-2-טאבים:
- "עורך הבלוקים" (ברירת-מחדל) — שימוש-חוזר ב-DecisionBlocksPanel הקיים
  (12 בלוקים, סטטוס, ספירת-מילים, עורך-inline על parchment, שמירה PUT).
- "עמדות וטענות" — עורך-העמדות/טענות הקיים (SubsectionCard/ChairEditor),
  הועבר כמות-שהוא לטאב.

הגייטינג שונה: העמוד נטען לפי caseQuery (לא analysis), כך שעורך-הבלוקים
מוצג גם כשטרם בוצע ניתוח; ענפי-ה-analysis (pending/not-found/error/data)
עברו לתוך טאב-העמדות. band + rail (מסמכים/פסיקה/השלמה) ללא שינוי.

אין שינוי-backend — GET/PUT decision-blocks + useDecisionBlocks/useSaveBlock
כבר קיימים. מאושר דרך שער-העיצוב (מוקאפ 03 עודכן עם רצועת-הטאבים).

Invariant: G2 — שימוש-חוזר ב-DecisionBlocksPanel, ללא מסלול-עריכת-בלוקים מקביל.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 03:54:29 +00:00
parent b4cb0a69c3
commit 9826995c12

View File

@@ -9,7 +9,9 @@ import { Button } from "@/components/ui/button";
import { Skeleton } from "@/components/ui/skeleton";
import { SubsectionCard } from "@/components/compose/subsection-card";
import { PrecedentsSection } from "@/components/compose/precedents-section";
import { DecisionBlocksPanel } from "@/components/cases/decision-blocks-panel";
import { Markdown } from "@/components/ui/markdown";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { useCase, type CaseStatus } from "@/lib/api/cases";
import { useResearchAnalysis } from "@/lib/api/research";
import { useCasePrecedents } from "@/lib/api/precedents";
@@ -257,7 +259,7 @@ export default function ComposePage({
{parties && <p className="text-ink-soft text-sm mt-2">{parties}</p>}
</div>
{analysis.isPending ? (
{caseQuery.isPending ? (
<Card className="bg-surface border-rule shadow-sm">
<CardContent className="px-6 py-5 space-y-3">
<Skeleton className="h-6 w-48" />
@@ -266,6 +268,32 @@ export default function ComposePage({
<Skeleton className="h-32 w-full" />
</CardContent>
</Card>
) : (
/* ── Two-column workspace: tabbed main editor + 320px side rail ──── */
<div className="grid gap-6 lg:grid-cols-[1fr_320px] items-start">
{/* MAIN — block editor (default) + chair positions, as tabs (mockup 03) */}
<div className="min-w-0">
<Tabs defaultValue="blocks" dir="rtl">
<TabsList className="bg-rule-soft/60">
<TabsTrigger value="blocks">עורך הבלוקים</TabsTrigger>
<TabsTrigger value="positions">עמדות וטענות</TabsTrigger>
</TabsList>
{/* Tab 1 — the 12-block decision editor (reused DecisionBlocksPanel) */}
<TabsContent value="blocks" className="mt-5">
<DecisionBlocksPanel caseNumber={caseNumber} />
</TabsContent>
{/* Tab 2 — chair positions on the analyst's threshold-claims + issues */}
<TabsContent value="positions" className="mt-5">
{analysis.isPending ? (
<Card className="bg-surface border-rule shadow-sm">
<CardContent className="px-6 py-5 space-y-3">
<Skeleton className="h-6 w-48" />
<Skeleton className="h-4 w-96" />
<Skeleton className="h-32 w-full" />
</CardContent>
</Card>
) : isNotFound ? (
<Card className="bg-surface border-rule shadow-sm">
<CardContent className="px-6 py-12 text-center space-y-3">
@@ -286,10 +314,7 @@ export default function ComposePage({
</CardContent>
</Card>
) : analysis.data ? (
/* ── Two-column workspace: main editor list + 320px side rail ──────── */
<div className="grid gap-6 lg:grid-cols-[1fr_320px] items-start">
{/* MAIN — the block/subsection editor list */}
<div className="space-y-6 min-w-0">
<div className="space-y-6">
{/* Threshold claims */}
{analysis.data.threshold_claims &&
analysis.data.threshold_claims.length > 0 && (
@@ -366,6 +391,10 @@ export default function ComposePage({
</Card>
)}
</div>
) : null}
</TabsContent>
</Tabs>
</div>
{/* SIDE RAIL — documents · attached precedents · finish-and-transfer */}
<aside className="space-y-4 lg:sticky lg:top-4">
@@ -421,7 +450,7 @@ export default function ComposePage({
/>
</aside>
</div>
) : null}
)}
</AppShell>
);
}