Project Timeline / Chart — inventor design pass (broader visualisation, vertical/horizontal, single/multi-column, colors, export) #35
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?
Source: m @ 2026-05-09 18:32:
Scope
This is a broader project-chart feature that goes beyond the SmartTimeline (which lives in the Verlauf tab on
/projects/<id>). The SmartTimeline (t-paliad-169) is the data substrate; this feature is a richer visualisation layer with:Layout options:
Visual customisation:
Export:
Surfaces:
/projects/<id>/chartor similarWhat the inventor must answer
chromedpor similar) — trade-offs.Files to read first
docs/design-smart-timeline-2026-05-08.md— the existing SmartTimeline design (your data substrate)frontend/src/client/views/shape-timeline.ts— current vertical render (~700 LoC after Slice 4)internal/services/projection_service.go— the data composition (returns{events, lanes})frontend/src/components/FilterBar*— the filter primitive (extends to chart filtering)frontend/src/client/views/format.ts— the date-formatter you'll likely reuseOutput
docs/design-project-chart-2026-05-09.md. End with DESIGN READY FOR REVIEW. NO IMPLEMENTATION. m gates the inventor → coder transition per project rules.Filed by maria/paliad-head per m's hire directive.
Inventor design filed — DESIGN READY FOR REVIEW
Doc:
docs/design-project-chart-2026-05-09.md(607 lines, commit8402002onmai/faraday/project-timeline-chart, pushed)TL;DR
Two renderers coexist; one substrate. Existing
shape-timeline.ts(vertical DOM/CSS) keeps powering the Verlauf-tab embed unchanged. Newshape-timeline-chart.ts(hand-rolled SVG, ~500 LoC) powers a new standalone/projects/{id}/chartpage in horizontal Gantt mode. Both consume the sameTimelineEvent[]+LaneInfo[]substrate fromprojection_service.go. No backend data work needed.Big calls
LaneInfo— no new lane axis defined here.default,kind-coded,track-coded,high-contrast,print). No per-user picker in v1.compact,standard,spacious) via[data-density]attr swap.XMLSerializer→ Blob;canvas.drawImage→ PNG;window.print()→ PDF). CSV/JSON/iCal server-side. Recommend NO chromedp for v1 — adds ~150 MB Chromium dep to Dokploy image with browser-print quality being good enough for lawyer-shareable PDFs.shape="timeline"): Slice 4, opt-in. Lossy (no projected rows in CV) but unlocks cross-project chart on the existing CV substrate.Phasing (4 sequential slices)
/chartpage + horizontal SVG renderer (no exports yet).shape="timeline"registration.Slice 1 is ~700 LoC frontend (new SVG renderer + page TSX + ~120 LoC CSS + 25 i18n keys) + ~50 LoC backend (page handler). Zero migrations.
12 open questions for m's gate
Q1–Q12 cover: default landing layout, embed-vs-standalone, chromedp rule-out, palette presets count, iCal scope, Custom Views priority, default date-range, mobile rule, etc. Each has my (inventor) pick + the reason.
Files implementer will touch (Slice 1)
Recommended implementer
Pattern-fluent Sonnet coder. Pre-Slice-1 sketch
layout(events, lanes, viewport)as a pure function with table-driven tests — that's where the math lives.Inventor (faraday) parks pending m's go/no-go.
— filed by faraday/paliad per
/mai-inventorshift.Slice 1 shipped — coder pass (tesla)
Branch:
mai/tesla/project-timeline-chart(pushed)Commits
What landed (Slice 1)
GET /projects/{id}/chart— static-file handler, visibility piggybacks on/api/projects/{id}/timeline.frontend/src/client/views/shape-timeline-chart.ts(~760 LoC incl. paint+mount). Purelayout(events, lanes, viewport)separated from DOM-mutatingpaint();mount(host, opts)returns a handle withrefresh/dispose/getLayout.layout()covering canvas geometry, pxPerDay math, today-rule clipping, lane stacking, mark bucketing bylane_id, out-of-range clipping, undated zone, mark-shape mapping, axis tick density. All green.--chart-*) on.smart-timeline-chartso Slice 3 can swap palettes via[data-palette=...]attribute without touching renderer./projects/{id}— opens chart in new tab (design §8.1).Verification
go build ./...cleanbun run buildclean (2182 keys; data-i18n scan clean)bun test src/client/views/shape-timeline-chart.test.ts→ 27/27 passgo test ./internal/handlers/...→ okInert controls in Slice 1 (Slice 3 wires them)
Edge cases flagged during impl
shape-timeline.tsand isn't wired into the chart host yet. Real flip lands when the vertical-toggle goes live (Slice 3 dep).GET /chartreturns 200 for any{id}. Same pattern as/projects/{id}(static file, client enforces auth via API). Means URL existence leaks "valid UUID shape" of the project id. Worth m's gate before Slice 2 export adds more surface (e.g. PDF download URL)./projects/{id}#event-{id}would need a new anchor target inprojects-detail. Deferred.datefield pile up atx = chartLeft - laneLabelWidth/4(left of canvas). Design §3.2 didn't pin this — choice is reversible if m prefers a separate dedicated gutter or bottom row.DESIGN READY FOR REVIEW → SLICE 1 READY FOR REVIEW
m gates the merge.
Slice 1 shipped to main: bdb3d8a (merge), preceded by b0a6b09 handler+route, ed4e731
layout()pure-fn + 27 table-driven tests, a3adb6bpaint()+mount()+ palette CSS tokens, 30f7031 page TSX + boot client + i18n + Verlauf link.What's live:
GET /projects/{id}/chart— standalone horizontal Gantt SVG.[Als Chart anzeigen ↗]link in the project Verlauf tab (opens in new tab per design §8.1).layout(events, lanes, viewport): ChartLayoutwith 27 table-driven tests covering ranges, tick generation, lane stacking, today-rule, undated rows.go build ./...clean,bun run buildclean, 27/27 tests pass.Faraday-design edge cases surfaced during impl (deferred to later slices or follow-ups):
/projects/{id}/chartURL; visibility is enforced when the client fetches/api/projects/{id}/timeline. URL existence leaks valid-id shape — same pattern as projects-detail.html, but worth tightening before Slice 2 export adds more surface.#event-{id}anchor on projects-detail would need a new anchor target — deferred.x = chartLeft - laneLabelWidth/4. Design §3.2 didn't pin this; choice is reversible if it bothers anyone.Next: m gates Slice 2 (palette picker + density toggle + export paths — SVG/PNG/CSV/JSON/iCal + browser-print PDF +
[Als Chart anzeigen ↗]from sidebar). Tesla stays parked on branch.Slice 2 shipped — coder pass (tesla)
Branch:
mai/tesla/project-timeline-chart(pushed, 5 commits ahead of main)Commits
What landed
GET /projects/{id}/chartresolves the project viaProjectService.GetByIDbefore serving — invisible / unknown ids return 404 + standard notfound chrome. Closes Slice 1 edge case.[data-palette="..."]; no repaint.?palette=…URL state.?density=…URL state.<details>/<summary>so it’s keyboard-accessible without JS. 6 outputs:XMLSerializerover an SVG clone with --chart-* tokens inlined viagetComputedStyleso standalone files paint correctly in image viewers.window.print()+@media printstylesheet (A4 landscape, palette forced to b&w, chrome hidden). No chromedp dep.GET /api/projects/{id}/timeline.ics(server-side, reusesinternal/services/caldav_ical.go). Only deadlines + appointments; projected/milestone explicitly skipped per faraday-Q6.Verification
go build ./...cleanbun run buildclean (2199 i18n keys; data-i18n scan clean)go test ./internal/...all packages ok (incl. 4 newFormatTimelineICScases + 1serveChartNotFoundtest)bun test src/client/views/shape-timeline-chart.test.ts27/27 passDeferred to Slice 3
Sidebar entry for active project (head Slice 2 item 5): the current Sidebar component reads only static config — there’s no per-page-context plumbing. Adding a project-scoped chip needs either a sidebar override mechanism or a separate contextual-action area; both are real refactors. The Slice 1 "Als Chart anzeigen ↗" link in the Verlauf tab already covers the discovery path. Sidebar entry pairs cleanly with Slice 3 (zoom + range + permalink state) since both are page-scoped UX work.
Edge cases flagged during impl
getComputedStyle— works for--chart-*colours but doesn’t inline density-derived geometry. Geometry is already baked into x/y/r attrs bylayout(), so this is intentional, not a leak.GetByIDtwice (once insideProjectionService.Forfor visibility, once for the X-WR-CALNAME title). Minor double-query; not worth a service refactor for one endpoint. Flagged for future opt.@pagerules; design §13 already documented "use Chrome for archival exports". No code change.SLICE 2 READY FOR REVIEW
m gates the merge.
Slice 2 shipped to main: 3ba5727 (merge).
Five atomic commits in order:
ProjectService.GetByID, ErrNotVisible → 404 + notfound chrome, never leaks 'valid id' shape).go build ./...clean,bun run buildclean, all chart tests green (27 layout-fn + 4 iCal + 1 visibility = 32 tests).Deferred from Slice 2 → Slice 3: Sidebar project-scoped 'Als Chart anzeigen' entry. The current Sidebar component reads only static config — adding a per-page contextual chip needs either a sidebar-override mechanism or a context-action area outside the sidebar. Both are real refactors. The Slice 1 link on the Verlauf tab still covers the discovery path; sidebar entry is nice-to-have.
Edge cases worth noting:
--chart-*tokens viagetComputedStyleso .svg files paint right in viewers without document-css context.GetByIDtwice (visibility check + title fetch). Minor double-query, flagged for future optimization.@pagerules — design §13 already documented 'use Chrome for archival exports'.Next: m gates Slice 3 (zoom + range chips + lane filter + permalink state + sidebar entry deferred from Slice 2).
Slice 3 shipped — coder pass (tesla)
Branch:
mai/tesla/project-timeline-chart(pushed, 5 commits ahead of main)Commits
What landed
?range=…[&from=…&to=…].onDataLoadedcallback (label/id only exist post-fetch). Hidden when projection has 0-1 lanes. URL state?lanes=id1,id2. Stale ids auto-drop on refresh; "everything off" collapses to "show all".🔗 Link kopierenbutton readswindow.location.hrefand writes it to clipboard (Clipboard API with execCommand fallback for older / file:// contexts). 1.8s flash on the button = no toast component needed.<a id="sidebar-project-chart-link">slot in Sidebar TSX, revealed bysidebar.ts.initProjectContextChartLink()when URL matches/projects/{uuid}/...but not the chart itself. Pure URL-parse — pages never touch the sidebar slot. Hidden on /projects (list), /projects/new, and the chart page itself./projects/{id}/historyexplicitly (Verlauf tab anchor). Label "Zurück zum Verlauf" matches the round-trip from the Slice 1 "Als Chart anzeigen ↗" affordance.Verification
go build ./...cleanbun run buildclean (2212 i18n keys)go test ./internal/...all packages okbun test src/client/views/shape-timeline-chart.test.ts27/27 passEdge cases flagged
setRange("all")re-application; the chip re-applies via the existing change handler.onDataLoadedcallback added toChartMountOpts.sidebar.ts, no body data-attribute or per-page handshake. Pages stay unaware of the sidebar slot.SLICE 3 READY FOR REVIEW
m gates the merge. Slice 4 next is Custom Views shape="timeline" integration.
Slice 3 shipped to main. Five atomic commits:
All tests green (32 = 27 chart-layout + 4 iCal + 1 visibility). Edge cases worth noting:
allrange derives bounds from loaded events on every repaint; adding a milestone reflows the canvas if you re-trigger setRange.Next: Slice 4 = Custom Views
shape=timelineintegration (faraday-Q7 explicit go/no-go after Slice 3 ships). Tesla parked.Slice 4 (FINAL) shipped — coder pass (tesla)
Branch:
mai/tesla/project-timeline-chart(pushed, 2 commits ahead of main)This is the last slice of the 4-slice roadmap. The original design doc roadmap is complete.
Commits
I combined the head's prescribed C2 + C3 (host + caveat tooltip) into one commit because the banner is meaningless without the timeline host markup — they ship as one user-visible surface. The optional C4 (cross-project lane aggregation) is built into C2's adapter — lane axis =
project_idwith first-seen ordering.What landed
ShapeTimelineenum added tointernal/services/render_spec.goalongside list/cards/calendar. NewTimelineConfigstruct persists palette/density/range_preset/range_from/range_to inuser_views.render_spec(jsonb) so reopening a saved CV-timeline view restores the same visual. Validator rejects unknown enum values + length-bounds ISO date strings.shape-timeline-cv.tsadapter (Custom Views host):deadline→kind="deadline"+deadline_id, status fromdetail.statusappointment→kind="appointment"+appointment_idproject_event→kind="milestone"+project_event_idapproval_request→ skipped (no chart-meaningful date)project_id(cross-project chart use case per §10); rows withoutproject_idcollapse to a synthetic"self"lane"open"(deadlines pull fromdetail.statuswhen present)ChartMountOpts.staticDataescape hatch on the existing renderer: when supplied, mount() skips the project-timeline fetch and paints from pre-loaded data. Lets the CV adapter reuse the entire Slice 1-3 surface (palette / density / range / lane filter / permalink) for free.ViewServicedoesn't run the calculator). Per design §13.4./viewstoolbar;views.tsdispatches torenderTimelineShapeand disposes the prior chart handle on shape flips to prevent listener leaks.Verification
go build ./...cleango test ./internal/...ok (incl. 9-caseTestRenderSpec_TimelineConfigValidates)bun run buildclean (2214 i18n keys, data-i18n scan clean)bun test src/client/views/56/56 pass (27 chart layout + 13 new CV adapter + 16 existing format/url-codec)Edge cases flagged
row.detail(appointment.approval_status, project_event.timeline_status).refresh()would hit/api/projects/cv/timeline(404). Not currently wired because CV pages don't expose a refresh affordance — if a future feature wants live-reload, the adapter would need to re-run the ViewService query instead.Slice 4 = roadmap complete
This wraps the 4-slice design-doc roadmap. Backlog (v2 nice-to-haves from §11.5): per-user palette picker beyond fixed presets, server-side PDF render via chromedp, live collaborative cursors / annotations, animations on zoom changes, hybrid layouts (compact-strip + detail-list), color-coding with custom user rules.
SLICE 4 READY FOR REVIEW
m gates the merge.
Slice 4 (FINAL) shipped. Two atomic commits:
C2+C3 merged into one commit (banner tightly-coupled to host). C4 (cross-project lane aggregation) baked into C2: lane axis = project_id with first-seen ordering, project_title || project_reference fallback labels.
go build ./...clean,bun run buildclean, 56/56 frontend tests.Lossy adapter contract (per design §13.4):
deadline→ kind=deadline+ deadline_id, status from detail.status (done/overdue) elseopen.appointment→ kind=appointment+ appointment_id, default status=open.project_event→ kind=milestone+ project_event_id.approval_request→ SKIPPED (no chart-meaningful date semantics).self, label = project_title || project_reference || truncated-uuid.ChartMountOpts.staticDataescape-hatch lets the CV adapter feed pre-loaded events directly into the same renderer. All Slice 1–3 features (palette / density / range / lane filter / permalink) work in the CV chart without extra wiring.TimelineConfigadded to backendRenderSpecpersists palette / density / range_preset / range_from / range_to inuser_views.render_specso reopening a saved CV-timeline restores the visual.Edge cases worth noting:
views.tsnow disposes the prior timeline chart handle on every shape flip (prevents resize-listener leaks between mounts).openfor milestones / appointments → uniform colour in CV chart. A future polish slice could extract per-kind status from row.detail (appointment.approval_status, project_event.timeline_status); for v1 the default is consistent.refresh()still hits/api/projects/cv/timeline— a placeholder URL that 404s. CV pages dont expose a refresh affordance today; the adapter would need to re-run the ViewService query if a future feature wants refresh-on-CV-timeline.Project Timeline / Chart roadmap COMPLETE — Slices 1–4 of
docs/design-project-chart-2026-05-09.mdall shipped. Issue stays open for m to close on review.