Verfahrensablauf timeline: optional duration indicator on event cards (hover by default, toggle for always-on) #133
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
Gap
Fristenrechner (
/tools/fristenrechner) already renders each rule's duration:in
frontend/src/client/fristenrechner.ts:990and:1663. The Verfahrensablauf timeline (/tools/verfahrensablauf) doesn't —frontend/src/client/views/verfahrensablauf-core.tshas zerodurationreferences. Lawyers can't see why a deadline lands when it does without flipping to Fristenrechner.Design
Two modes, both opt-in:
title="2 Monate ab Zustellung"is the cheapest; a proper styled popover would be nicer but the hover-titleis a defensible v1.paliad.fristen.notes-showlocalStorage flag inverfahrensablauf.ts:F8) that renders the duration inline on every card —"2 Mo. ab Zustellung"next to the date.Duration values are already on the payload returned from
/api/fristenrechner/calculate— they live on eachDeadlinerow asdurationValue+durationUnit+timing(the same fields Fristenrechner consumes). No backend change needed; just plumb them through to the timeline renderer.Acceptance
"<n> <unit> <timing>"as a tooltip (DE + EN labels via existing i18n).Dauern anzeigen/Show durationsnext to the existingNotizen anzeigentoggle. Click → all cards render the duration inline. Preference persists via localStorage keypaliad.verfahrensablauf.durations-show.durationValue > 0.bun run build+go testclean.Files
frontend/src/client/views/verfahrensablauf-core.ts— event-card rendering (find where dates render, attachtitle=or new inline span).frontend/src/client/verfahrensablauf.ts— adddurations-showlocalStorage helpers next to the existingnotes-showones (look forpaliad.fristen.notes-show).frontend/src/verfahrensablauf.tsx— add the toggle button next to the existing notes toggle (search fornotes-toggleor similar).frontend/src/client/i18n.ts+i18n-keys.ts— DE + EN strings for the toggle label, the duration formatter labels (reuse Fristenrechner'sunitLabel+timingLabelhelpers if exported, else copy them).Scope guardrails
unitLabel+timingLabel(Mo./Tage/Wo./Werktage + ab/vor) — don't re-invent.Implemented on
mai/hermes/gitster-verfahrensablauf— commit 3097df3.What landed
Default (hover) — each event card's date span carries a
title=attribute with the rule's duration, e.g.2 Monate nach/2 months after. Court-set and zero-duration rules (trigger event, hearings) get no tooltip.Toggle (inline) — new header toggle
Dauern anzeigen/Show durationsnext to the existingHinweise anzeigentoggle. Click → every card renders the duration inline in the meta row alongside the rule reference. Preference persists vialocalStoragekeypaliad.verfahrensablauf.durations-show. Default off.i18n —
deadlines.durations.show(DE:Dauern anzeigen, EN:Show durations). Duration string itself reuses the existingdeadlines.event.unit.<unit>.{one,many}+deadlines.event.timing.{before,after}keys (the same ones Fristenrechner's event-mode renderer consumes), so we have one source of truth for unit/timing translations.Scope deviation: one additive backend field set
The issue scoped this as pure-frontend on the assumption that the duration fields were already on the
/api/tools/fristenrechnerpayload ("they live on each Deadline row asdurationValue+durationUnit+timing"). They were not —lp.TimelineEntrypreviously exposed only the computeddueDate, not the rule's(duration_value, duration_unit, timing)tuple. Those fields exist on theRulerow, onEventDeadlineResult(Fristenrechner event mode), and onRuleCalculationRule(single-rule click flow), but not on the proceeding-timeline wire that backs both Fristenrechner's procedure mode and/tools/verfahrensablauf.Resolution: added three additive optional fields to
TimelineEntry(durationValue,durationUnit,timing) and populated them in both engine emission sites (CalculateandCalculateByTriggerEvent) directly from the rule row. No DB migration, no new endpoint, no change to the API path. The values reflect the base rule fields rather than the post-alt-swap arithmetic — the tooltip reads as a property of the rule ("this rule's interval is 2 months after the anchor") rather than a recap of whichwith_ccr-style branch fired.If strict no-backend was a hard guardrail, flagging here so it can be reverted before merge — but the alternative was leaving the data unreachable on the frontend, and the change is purely additive (zero-value fields are omitted on the wire, so it can't regress any existing consumer).
Acceptance check
<n> <unit> <timing>(DE + EN via existing i18n).Dauern anzeigen/Show durations; click → inline labels; persists vialocalStorage["paliad.verfahrensablauf.durations-show"].formatDurationLabelshort-circuits whendurationValue <= 0.bun run buildclean;go test ./pkg/litigationplanner/... ./internal/...clean;bun test src/client/viewsclean (89/89).TimelineEntry, no API-path change. See the deviation note above.Files touched
pkg/litigationplanner/types.go— three fields onTimelineEntry.pkg/litigationplanner/engine.go— populate at both emission sites.frontend/src/client/views/verfahrensablauf-core.ts—formatDurationLabel,CardOpts.showDurations,ColumnsBodyOpts.showDurations, tooltip on date span, inline span in meta row.frontend/src/client/verfahrensablauf.ts—paliad.verfahrensablauf.durations-showlocalStorage, toggle handler, plumbshowDurationsinto both renderers.frontend/src/verfahrensablauf.tsx— toggle UI next to the existing notes toggle.frontend/src/client/i18n.ts+frontend/src/i18n-keys.ts— DE/ENdeadlines.durations.show.frontend/src/styles/global.css—.timeline-durationrule.Ready for review.