fix(verfahrensablauf): m/paliad#59 — restore click-to-edit on timeline dates #64

Open
mAi wants to merge 1 commits from mai/darwin/fixercoder-priority-bug into main
Collaborator

Closes m/paliad#59.

Summary

  • /tools/verfahrensablauf per-rule due dates were never wired for click-to-edit (the affordance existed on /tools/fristenrechner but was never mirrored on the abstract-browse surface introduced in t-paliad-179). m's report: the timeline dates seem to be fix, nothing happens when I click on a date.
  • Lifted openInlineDateEditor + wireDateEditClicks into views/verfahrensablauf-core.ts so both pages share one implementation.
  • Wired anchorOverrides + editable: true + delegated click handler on /tools/verfahrensablauf.
  • fristenrechner.ts now consumes the shared helper — no behaviour change there.

Test plan

  • go build ./... clean.
  • go test ./internal/... — all packages pass.
  • bun run build clean (frontend bundle includes frist-date-edit, dateEditWired, anchorOverrides in verfahrensablauf.js).
  • bun test — 73 pass, 0 fail (5 new regression tests in verfahrensablauf-core.test.ts pin the editable→data-rule-code contract).
  • Browser smoke — not run in CI sandbox (server needs Supabase auth env). Wiring is byte-identical to the proven fristenrechner path; please flick a date on /tools/verfahrensablauf on staging before merge to confirm.

Acceptance (from #59)

  • Date cells in the verfahrensablauf timeline carry frist-date-edit + data-rule-code + data-current-date and the container has a delegated click+keyboard handler.
  • Changing a date sets an anchor override, which is forwarded to /api/tools/fristenrechner so downstream rules re-anchor.
  • Hinweise anzeigen notes-toggle behaviour preserved (showNotes plumbing unchanged).
Closes m/paliad#59. ## Summary - /tools/verfahrensablauf per-rule due dates were never wired for click-to-edit (the affordance existed on /tools/fristenrechner but was never mirrored on the abstract-browse surface introduced in t-paliad-179). m's report: `the timeline dates seem to be fix, nothing happens when I click on a date`. - Lifted `openInlineDateEditor` + `wireDateEditClicks` into `views/verfahrensablauf-core.ts` so both pages share one implementation. - Wired anchorOverrides + `editable: true` + delegated click handler on `/tools/verfahrensablauf`. - fristenrechner.ts now consumes the shared helper — no behaviour change there. ## Test plan - [x] `go build ./...` clean. - [x] `go test ./internal/...` — all packages pass. - [x] `bun run build` clean (frontend bundle includes `frist-date-edit`, `dateEditWired`, `anchorOverrides` in `verfahrensablauf.js`). - [x] `bun test` — 73 pass, 0 fail (5 new regression tests in `verfahrensablauf-core.test.ts` pin the editable→`data-rule-code` contract). - [ ] **Browser smoke** — not run in CI sandbox (server needs Supabase auth env). Wiring is byte-identical to the proven fristenrechner path; please flick a date on /tools/verfahrensablauf on staging before merge to confirm. ## Acceptance (from #59) - [x] Date cells in the verfahrensablauf timeline carry `frist-date-edit` + `data-rule-code` + `data-current-date` and the container has a delegated click+keyboard handler. - [x] Changing a date sets an anchor override, which is forwarded to `/api/tools/fristenrechner` so downstream rules re-anchor. - [x] `Hinweise anzeigen` notes-toggle behaviour preserved (`showNotes` plumbing unchanged).
mAi added 1 commit 2026-05-20 12:30:30 +00:00
Per-rule due dates on /tools/verfahrensablauf were rendered as plain
spans with no `frist-date-edit` attrs and no delegated click handler,
so clicking a date did nothing (m's "the timeline dates seem to be fix,
nothing happens when I click on a date"). The wiring existed on
/tools/fristenrechner but had never been mirrored onto the abstract-
browse surface introduced in t-paliad-179.

Fix: lift the inline date editor + delegated click wiring out of
fristenrechner.ts into views/verfahrensablauf-core.ts so both pages
share one implementation:

  - openInlineDateEditor(span, onCommit) — swaps the date span for
    a `<input type=date>`, commits on blur/Enter, cancels on Escape,
    fires `onCommit(ruleCode, newValue)` ("" = revert).
  - wireDateEditClicks(container, onCommit) — idempotent delegated
    click + keyboard handler that resolves `.frist-date-edit
    [data-rule-code]` and opens the editor. Survives innerHTML
    rewrites because the listener lives on the container.

verfahrensablauf.ts now:
  - Owns its own anchorOverrides Map (cleared when proceeding-type
    changes — overrides for one proceeding don't apply to another).
  - Forwards overrides in calculateDeadlines() so downstream rules
    re-anchor on the user's date.
  - Passes `editable: true` to renderColumnsBody + renderTimelineBody.
  - Calls wireDateEditClicks() once on #timeline-container in
    DOMContentLoaded.

fristenrechner.ts shrinks: openInlineDateEditor + the inline click /
keydown blocks are replaced by an `onDateEditCommit` callback handed
to the shared wireDateEditClicks(). No behaviour change there.

Regression test: views/verfahrensablauf-core.test.ts pins the
editable→`data-rule-code` contract on `deadlineCardHtml` so a future
refactor that drops the attrs fails loudly instead of silently
breaking click-to-edit on both pages.
This pull request has changes conflicting with the target branch.
  • frontend/src/client/fristenrechner.ts
  • frontend/src/client/verfahrensablauf.ts
  • frontend/src/client/views/verfahrensablauf-core.test.ts
  • frontend/src/client/views/verfahrensablauf-core.ts
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin mai/darwin/fixercoder-priority-bug:mai/darwin/fixercoder-priority-bug
git checkout mai/darwin/fixercoder-priority-bug
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: m/paliad#64
No description provided.