feat(ui): interactive decision-block viewer + inline editor on case page #57
Reference in New Issue
Block a user
Delete Branch "feat/decision-blocks-viewer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
סיכום
מוסיף טאב "ההחלטה" בדף התיק — תצוגה אינטראקטיבית של 12 הבלוקים עם עריכה inline שנשמרת ל-DB.
הבעיה שנפתרה: תוכן הבלוקים נשמר ב-DB (ע"י סוכנים) אך לא ניתן היה לצפות בו בלי להוריד DOCX. עכשיו הוא נגיש ישירות בדף התיק.
שינויים
Backend (
web/app.py):GET /api/cases/{n}/decision-blocks— מחזיר 12 בלוקים (כולל ריקים), ממוזגים מ-BLOCK_CONFIG+decision_blocksDB. כוללsource_of_truthו-active_draft_path.PUT /api/cases/{n}/decision-blocks/{block_id}— שמירת עריכה inline דרךblock_writer.save_block_content. מתריע (לא חוסם) כשקיים DOCX פעיל.Frontend:
src/lib/api/decision-blocks.ts— hooks מוקלדים (useDecisionBlocks,useSaveBlock)src/components/cases/decision-blocks-panel.tsx— accordion של 12 בלוקים; תצוגה עםMarkdown, עריכה עם שמירה on-blur (דפוסChairEditor)BLOCK_LABELSב-feedback.tsהורחב מ-7 → 12 בלוקיםcases/[caseNumber]/page.tsx— טאב "ההחלטה" חדשבדיקה
npm run lint— ללא שגיאות בקבצים החדשיםnpm run build— עובר בהצלחהcurl https://legal-ai.../api/cases/8137-24/decision-blocksצריך להחזיר את תוכן בלוק י'Adds a new "ההחלטה" tab to the case detail page showing all 12 decision blocks with rendered markdown content and inline editing that saves back to the DB via two new FastAPI endpoints. Backend (web/app.py): - GET /api/cases/{n}/decision-blocks — returns all 12 blocks (empty ones included) merged from BLOCK_CONFIG + decision_blocks table. Exposes source_of_truth ("docx"|"blocks") and active_draft_path. - PUT /api/cases/{n}/decision-blocks/{block_id} — inline save via block_writer.save_block_content; warns (does not block) when an active DOCX draft exists. Frontend: - src/lib/api/decision-blocks.ts — typed hooks (useDecisionBlocks, useSaveBlock) following the cases.ts hand-written-module pattern. - src/components/cases/decision-blocks-panel.tsx — accordion of 12 blocks; view mode renders Markdown component; edit mode is a textarea with on-blur save (derived from ChairEditor pattern, setState-during- render for re-sync to avoid effect cascade). - BLOCK_LABELS in feedback.ts extended from 7 → 12 blocks. - cases/[caseNumber]/page.tsx — new "ההחלטה" tab wired to the panel. No DB migration required — decision_blocks + active_draft_path exist. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>