Vereine Ablage, Akte und Vorgang in einem Navigationsbaum mit Fokus und Nachladen.
Deploy Development / deploy (push) Successful in 39s
Test Suite / pytest-backend (push) Successful in 5m24s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 21s

Der Baum Meine Ablage steht jetzt auch auf den Seiten von Akte und Vorgang und ersetzt die Spalte Struktur. Ein Klick öffnet den Eintrag und klappt seine Struktur auf: Überblick, Kapitel und Unterkapitel, Unterakten, Vorgänge und Teilvorgänge. Der Pfad bleibt offen, die aktuelle Zeile ist hervorgehoben und nach dem Neuladen stimmt der Fokus wieder. Ein Vorgang steht unter jeder Akte, in der er liegt, und unter Vorgänge; ein Klick unter einer Akte öffnet ihn in diesem Aktenkontext. So wechselt man direkt von Vorgang zu Vorgang. Kapitel anlegen und verschieben geht im Baum.

Die Struktur eines Knotens kommt aus neuen schlanken Endpunkten (cases und matters outline), die nur Lesbares liefern, und wird beim Aufklappen einmal nachgeladen. Die Zweispaltenansicht mit dem Lesebereich beginnt erst, wenn neben dem Baum genug Platz bleibt.

Im Browser gegen die lokale Umgebung durchgespielt (Akte, Vorgang unter der Akte, Wechsel zwischen Vorgängen, Kapitel anlegen, Neuladen, Vorgang ohne Akte, Handy, Hell und Dunkel). Die Backend-Suite läuft mit 149 Tests grün, der Frontend-Build und 37 Node-Tests ebenfalls.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-10-22 12:11:36 +02:00
1 parent 322ad491c1
commit 5f60e1fe40
15 files changed
+688 -471

No files matched your search

+21 -1
View File
@@ -8,11 +8,12 @@ from fastapi import APIRouter, Depends
from fastapi.responses import JSONResponse
from psycopg import Connection
from app.access.policy import parse_query_context, require_case, require_matter
from app.access.roles import room_role
from app.api.deps import Principal, get_conn, get_principal
from app.api.schemas import BatchShareIn
from app.core.errors import forbidden
from app.library import case_items, matter_items, room_contents, room_effect
from app.library import case_items, case_outline, matter_items, matter_outline, room_contents, room_effect
from app.ops import share_with_room
router = APIRouter()
@@ -97,3 +98,22 @@ def share_many(
"access": body.access,
"effect": room_effect(conn, room_id, principal.account_id, body.access),
}
@router.get("/api/v1/cases/{case_id}/outline")
def case_outline_view(case_id: UUID, principal: Principal = Depends(get_principal), conn: Connection = Depends(get_conn)):
case, _rights = require_case(conn, principal.account_id, case_id, "read")
return JSONResponse(case_outline(conn, principal.account_id, case), headers=_NO_STORE)
@router.get("/api/v1/matters/{matter_id}/outline")
def matter_outline_view(
matter_id: UUID,
context_kind: str | None = None,
context_id: str | None = None,
principal: Principal = Depends(get_principal),
conn: Connection = Depends(get_conn),
):
context = parse_query_context(context_kind, context_id)
matter, _rights = require_matter(conn, principal.account_id, matter_id, context, "read")
return JSONResponse(matter_outline(conn, principal.account_id, matter, context), headers=_NO_STORE)
+45 -1
View File
@@ -20,7 +20,7 @@ from app.access.policy import (
matter_rights,
room_name,
)
from app.present import case_summary, matter_summary
from app.present import _chapters, _matter_tree, case_summary, matter_summary
def shared_rooms(conn, kind: str, resource_id: UUID) -> list[dict]:
@@ -124,3 +124,47 @@ def room_effect(conn, room_id: UUID, actor: UUID, access: str) -> list[dict]:
}
)
return effect
def case_outline(conn, actor: UUID, case: dict) -> dict:
"""What the navigation tree shows below a case. Only readable entries; no bindings or texts."""
chapters = _chapters(conn, "case", case["id"], case.get("content_order") or "position", case.get("content_order_dir") or "asc")
subcases = []
for row in conn.execute(
"SELECT * FROM cases WHERE parent_case_id = %s AND deleted_at IS NULL ORDER BY title, id",
(case["id"],),
).fetchall():
if case_rights(conn, actor, row).read:
subcases.append({"id": str(row["id"]), "title": row["title"], "status": row["record_status"]})
linked = []
for link in conn.execute(
"""
SELECT m.* FROM matter_case_links l JOIN matters m ON m.id = l.matter_id
WHERE l.case_id = %s AND m.deleted_at IS NULL ORDER BY m.title, m.id
""",
(case["id"],),
).fetchall():
if matter_rights(conn, actor, link, Ctx("case", case["id"])).read:
linked.append(link)
return {
"kind": "case",
"id": str(case["id"]),
"chapters": chapters,
"subcases": subcases,
"matters": _matter_tree(conn, actor, case["id"], linked),
}
def matter_outline(conn, actor: UUID, matter: dict, context: Ctx | None) -> dict:
"""What the navigation tree shows below a matter: its chapters and its readable Teilvorgänge."""
chapters = _chapters(
conn, "matter", matter["id"], matter.get("content_order") or "position", matter.get("content_order_dir") or "asc"
)
children = []
for row in conn.execute(
"SELECT * FROM matters WHERE parent_matter_id = %s AND deleted_at IS NULL ORDER BY title, id",
(matter["id"],),
).fetchall():
if matter_rights(conn, actor, row, context).read:
children.append({"id": str(row["id"]), "title": row["title"], "status": row["record_status"]})
return {"kind": "matter", "id": str(matter["id"]), "chapters": chapters, "submatters": children}