Commit Graph

150 Commits

Author SHA1 Message Date
m
05623b673a Merge: polish batch — i18n + departments + 404 chrome (t-paliad-037) 2026-04-26 00:38:14 +02:00
m
3111c7440a fix(polish): i18n leaks, untranslated labels, /api/departments 500, 404 chrome (t-paliad-037)
Four bugs from tests/smoke-auth-2026-04-25.md.

Bug 4 — Dashboard activity log leaked raw i18n keys. Root cause was a mix
of three issues:
  - Go services wrote German event_types (frist_created, termin_*,
    projekt_*, notiz_created, checkliste_*) — no matching i18n key.
  - i18n.ts only had keys for legacy `akte_*` types, none for what was
    actually being written.
  - The dashboard renderer always rendered `e.title` (a static label like
    "Project angelegt") as a trailing detail, duplicating the action verb.
    Old `akte_created` rows had English titles ("Akte created") that
    bled into German output.

Switched all event_type writes to English (deadline_*, appointment_*,
project_*, note_created, checklist_*, deadlines_imported). Moved dynamic
text out of `title` into `description` for status_changed and
deadlines_imported so the static label/description split is consistent.
Added i18n keys for both new English types AND legacy German types so
historical project_events rows render cleanly. Dashboard now prefers
description over title; falls back to title only for events with no
i18n match (defensive for any unknown legacy kinds).

Bug 5 — /deadlines and /appointments matter-filter dropdowns showed raw
keys `fristen.filter.project.all` / `termine.filter.project.all`. The
client TS referenced English-prefix keys that didn't exist; the existing
keys use `fristen.filter.akte.*` / `termine.filter.akte.*`. Updated the
client refs to match the existing keys (kept i18n key namespace stable
to avoid touching every other reference).

Bug 6 — /api/departments?include=members returned 500. Reproduced via
curl: ListWithMembers (and ListMembers) used `LEFT JOIN paliad.users` on
a member.user_id that FKs auth.users — pre-onboarding members produced
NULL u.email/display_name/office/role, which sqlx can't scan into the
non-pointer string fields. Switched both to INNER JOIN; unonboarded
members are skipped (correct UX — without a profile there's nothing to
render anyway).

Bug 9 — Bare `404 page not found` on unknown auth-gated paths
(/whatsnew, /search, /settings/notifications, etc). Added a chromed 404
page (frontend/src/notfound.tsx) with sidebar + friendly card + "back
to dashboard" CTA, plus a catch-all handler on the protected mux that
serves it with HTTP 404 (and JSON 404 for /api/* misses). Anonymous
visitors keep being redirected to /login by the auth middleware before
the catch-all runs, so no separate marketing-shell variant needed.

Verification:
- go build ./... + go vet ./... + go test ./... clean
- bun run build clean (notfound.html + notfound.js produced)
- Visual checks pending after deploy
2026-04-26 00:36:33 +02:00
m
fc8275288a Merge: SummaryCounts db tags (t-paliad-036) 2026-04-25 23:44:56 +02:00
m
4bc23958ee fix(services): add db tags to SummaryCounts so sqlx maps this_week (et al.)
Bug 1 (smoke-auth-2026-04-25.md) had a third symptom beyond the RLS
function bodies and the visibilityPredicate `::uuid[]` issue:
/api/deadlines/summary and /api/appointments/summary returned 500 with
`sqlx: missing destination name this_week in *services.SummaryCounts`.

Cause: SummaryCounts (deadline) and AppointmentSummaryCounts had only
`json:` tags. sqlx falls back to the lower-cased field name when no `db:`
tag is present, so `ThisWeek` mapped to `thisweek` — but the SQL aliases
the column as `AS this_week`. Adding `db:"this_week"` (and matching tags
for the other fields) lets sqlx find the destination.

Verified by hitting both endpoints; previously 500 → now expected 200.
2026-04-25 23:44:52 +02:00
m
144a08d409 Merge: visibilityPredicate sqlx ::uuid[] fix (t-paliad-036) 2026-04-25 23:43:11 +02:00
m
1f9c4d0296 fix(services): use CAST(...AS uuid[]) in visibilityPredicate (sqlx ::uuid[] bug)
Bug 1 in tests/smoke-auth-2026-04-25.md (/api/projects, /api/deadlines,
/api/appointments returning HTTP 500) had a second root cause beyond the
RLS function bodies fixed in 021: sqlx v1.4.0's named-parameter parser
strips one colon from `::uuid[]` while compiling `:user_id` / `:role`
placeholders, producing invalid SQL `:uuid[]` that Postgres rejects with
`syntax error at or near ":"`. The bug was masked by the earlier
`relation "paliad.projekte" does not exist` error.

Replacing `::uuid[]` with the equivalent SQL-standard `CAST(... AS uuid[])`
sidesteps the parser issue without changing semantics. Verified with a
small repro: `sqlx.Named` no longer corrupts the cast.

Only `visibilityPredicate` (the named-bind variant) is affected — the
positional and `?`-placeholder variants don't go through `sqlx.Named`.
2026-04-25 23:43:06 +02:00
m
5c887df5fa Merge: urgent RLS function-body fix after rename (t-paliad-036) 2026-04-25 23:38:18 +02:00
m
0c382b6f69 fix(db): rewrite RLS function bodies after rename (021) — restores /api/projects
Migration 020 renamed paliad.can_see_projekt → can_see_project (and
notiz_is_visible → note_is_visible) via ALTER FUNCTION but never rewrote
the bodies. On production the bodies still queried paliad.projekte /
projekt_teams / fristen / termine / projekt_events — all of which were
dropped or renamed in 018+020. Every RLS-enforced read against the new
English tables exploded with `relation "paliad.projekte" does not exist`,
breaking /api/projects, /api/deadlines, /api/appointments etc.

Same problem for the trigger functions paliad.projekte_sync_path() and
paliad.projekte_rewrite_subtree() — kept their German names and German
bodies; the triggers on paliad.projects still pointed at them.

Migration 021:
  * DROP FUNCTION ... CASCADE drops can_see_project / note_is_visible
    along with their 21 dependent RLS policies (whose names were still
    German on prod: projekte_*, projekt_teams_*, fristen_all, termine_*,
    parteien_all, dokumente_all, projekt_events_all, notizen_all,
    checklist_instances_*).
  * Recreates the two functions with English bodies + English parameter
    names and rebuilds every dependent policy under its canonical
    English name (matching migration 018).
  * Drops the German trigger functions/triggers on paliad.projects and
    recreates them as projects_sync_path / projects_rewrite_subtree.

Idempotent on a fresh DB (where everything is already English): the
CASCADE drops the same policies and the recreate produces an identical
end state.

Verified by running the up.sql in BEGIN/ROLLBACK against the actual
youpc prod Postgres — 21 policies dropped, 21 recreated, function
bodies now reference paliad.projects / project_teams / etc.

Refs: tests/smoke-auth-2026-04-25.md (Bug 3, root cause for Bugs 1+2).
2026-04-25 23:37:51 +02:00
m
50a1dae357 Merge: authenticated production smoke report (t-paliad-034) 2026-04-25 23:26:14 +02:00
m
0d0ba6ee1d test(smoke): authenticated production smoke report (t-paliad-034)
Logged-in smoke test against paliad.de as the seeded test admin
(tester@hlc.de). Login flow + every gated route exercised; 17
screenshots and 10 prioritised bugs filed.

Top finding: paliad.can_see_project() still references the renamed-away
projekte/projekt_teams tables, which 500s every RLS-touching endpoint
(/api/projects, /api/deadlines, /api/appointments and the project-detail
page render). Two of today's three new shipments — project tree and
reminder service — cannot be exercised end-to-end as a result. Team
directory works modulo a stray /api/departments?include=members 4xx/5xx.
2026-04-25 23:21:37 +02:00
m
14d5706a5e Merge: anon 401 cleanup + CLAUDE.md auth-gate clarification (t-paliad-035) 2026-04-25 23:11:10 +02:00
m
83d5973dd6 fix(sidebar): omit changelog badge for anon visitors + clarify CLAUDE.md auth gate (t-paliad-035)
The marketing landing (`/`) renders the same Sidebar as protected pages, so
`initChangelogBadge()` was firing `GET /api/changelog/unseen-count` on every
anon visit and getting 401. Cosmetic noise + wasted round-trip.

Add an `authenticated` prop to Sidebar (defaults to true, no behavior change
on protected pages) and pass `false` from `renderIndex()`. The badge `<a>`
is omitted server-side; the existing `if (!badge) return` guard in
sidebar.ts naturally skips the fetch when the element is absent — no
client change needed.

Also append a clarifying note under the env-var table in .claude/CLAUDE.md:
"work without DB" doesn't mean "ungated for anon". The knowledge-platform
routes (Kostenrechner, Glossar, etc.) are still behind the auth gate; only
`/`, `/login`, `/logout`, and `/assets/*` are public. Misread by the smoke
tester briefer; spelled out now to prevent recurrence.
2026-04-25 23:09:36 +02:00
m
0ad2e86945 Merge: production smoke report + register Playwright MCP (t-paliad-033) 2026-04-25 23:02:25 +02:00
m
761e350261 test(smoke): production smoke report + register Playwright MCP (t-paliad-033)
Anonymous-surface smoke test of paliad.de — all 11 legacy DE→EN redirects,
9 gated routes, /login form, and / marketing landing healthy. Two minor
findings noted in the report (knowledge platform is auth-gated contrary
to brief expectation; anon / fires a 401 on /api/changelog/unseen-count).
Authenticated flows untested — needs follow-up worker with creds.

Also registers @playwright/mcp in .mcp.json so future smoke runs can use
the /mai-tester skill's mcp__playwright__* tools directly instead of
falling back to a bunx script.
2026-04-25 23:01:48 +02:00
m
21415ce941 Merge: fix reminder_service SQL alias mismatch (t-paliad-032) 2026-04-25 13:40:30 +02:00
m
d4abfb7299 fix(reminders): align SQL aliases with renamed struct tags
The German→English rename (t-paliad-025) renamed the projects table and
ReminderService struct fields, but the SQL aliases in sendPerFrist /
sendWeekly still spelled `frist_title`, `akte_aktenzeichen`, and
`akte_title`. sqlx.SelectContext could not map them to the
`deadline_title` / `project_reference` / `project_title` `db:` tags, so
every hourly reminder scan returned a "missing destination name" error
and emails silently stopped going out.

This commit:
* renames struct fields AkteAktenzeichen/AkteTitle on fristReminderRow
  and weeklyRow to ProjectReference/ProjectTitle and updates the `db:`
  tags to project_reference / project_title.
* rewrites the SELECT aliases (deadline_title, project_reference,
  project_title) to match.
* propagates the new keys through deliverFristReminder /
  deliverWeekly into the email template data and renames the matching
  variables in deadline_reminder.html and deadline_weekly.html.
* updates mail_service_test.go fixtures to the new keys.
* adds TestSendPerFrist_ScansCleanly — a live-DB regression test
  (skips without TEST_DATABASE_URL) that seeds a project + deadline
  and asserts sendPerFrist / sendWeekly scan without error, so a
  future tag/alias drift fails CI instead of going silent.
2026-04-25 13:32:57 +02:00
m
c4e6d0eeef Merge: team directory browse (t-paliad-029) 2026-04-25 13:25:42 +02:00
m
9c96446bbe Merge: project tree visualization (t-paliad-028) 2026-04-25 13:25:39 +02:00
m
28d747e656 feat(team): browsable team directory grouped by office or department (t-paliad-029)
Adds /team page that lists every onboarded Paliad user, grouped by office
(default) or by department, with a free-text search and per-office filter
pills. Each card shows display name, role, primary office (with any
additional offices), department tag, and a mailto: link.

Backend:
- /api/users now also returns additional_offices (column was already on the
  model + DB; just missing from the SELECT list).
- /api/departments?include=members returns each department enriched with
  its lead user snapshot and the full member list — single fetch for the
  "by department" grouping.
- New page handler /team behind the onboarding gate.

Frontend:
- frontend/src/team.tsx + frontend/src/client/team.ts (new) for the page
  shell and client-side rendering / filtering.
- New "Team" entry in the Übersicht sidebar group with a users icon.
- DE/EN i18n keys (nav.team, team.*).
- Team-specific CSS for cards, group headers, avatars, and badges.
2026-04-25 13:22:17 +02:00
m
aafbfbbf12 feat(projects): interactive tree view of project hierarchy (t-paliad-028)
- Backend: GET /api/projects/tree returns the full visible project tree as
  nested JSON with embedded children, open/overdue deadline counts per
  node — visibility-scoped via the existing predicate, single round-trip.
- Frontend: new project-tree.ts module renders a collapsible, indented tree
  with type icons (client/litigation/patent/case/project), status badges,
  deadline-count chips and chevron toggles. Top two levels expand by
  default; deeper nodes start collapsed. Expansion state persists in
  sessionStorage so toggling list/tree keeps user choices.
- Wired to /projects via the existing Ansicht select (Liste/Baum/Wurzeln);
  dedicated tree container coexists with the flat-list table.
- New i18n keys (de/en) + tree styles in global.css (lime accent on hover).
2026-04-25 13:22:16 +02:00
m
c893027457 fix: add error logging to writeServiceError + missing log import 2026-04-23 01:27:08 +02:00
m
881bc98eb1 Merge: comprehensive build repair — rename mismatch fixes 2026-04-23 01:26:03 +02:00
m
34194aedd5 fix(rename): align TSX element IDs, REST endpoints, and migration 020 with English rename
Three rename leftovers from t-paliad-025 fixed in one shot:

1. TSX/TS element ID mismatches — every page that worked via getElementById was
   broken because the client TS was renamed (e.g. project-title) but the TSX
   still used the German id (akte-title), so $() / getElementById would throw
   "missing element". Renamed `akte-*` → `project-*`, `termin-akte-*` →
   `termin-project-*`, `frist-akte-*` → `frist-project-*`, `new-instance-akte`
   → `new-instance-project`, `frist-filter-akte` → `frist-filter-project`,
   `termin-filter-akte` → `termin-filter-project` across all affected TSX.

2. Migration 020 idempotency — every ALTER TABLE/FUNCTION/COLUMN now lives in
   a DO $$…EXCEPTION WHEN undefined_table/column/function THEN NULL block.
   Production already has English names (manually patched), and the rewritten
   migration 018 creates English names directly on a fresh DB; the old
   non-defensive 020 would have failed in both scenarios. Down migration
   wrapped the same way for symmetry.

3. PostgREST endpoint names — `checklists_feedback` and `courts_feedback`
   referenced tables that don't exist; migration 020 renames the source
   tables to `checklist_feedback` / `court_feedback` (singular, matching
   `link_feedback`). Handlers now point at those. `glossary_suggestions`
   reverts to `glossar_suggestions` — that table lives in the shared public
   schema (pre-paliad era) and is not under our migration control.

Verified: go build / go vet / go test / bun run build all clean. Migration 020
dry-runs clean against current production state inside a transaction.
2026-04-23 01:00:31 +02:00
m
2131fdbf55 fix(db): rename remaining German columns (frist_id, termin_type, akten_event_id) 2026-04-23 00:36:46 +02:00
m
01de3f736b fix: update all script src references from German to English filenames
knuth's rename changed TS/TSX filenames but left <script src> tags
pointing at old German JS names (akten-neu.js, fristen.js, termine.js,
glossar.js, einstellungen.js, gerichte.js, checklisten.js). These 404'd
in production.
2026-04-23 00:32:22 +02:00
m
edad61478d fix(db): add column renames (projekt_id → project_id) to migration 020 2026-04-23 00:26:42 +02:00
m
544149114c fix: resolve leftover merge conflict markers in sidebar.ts 2026-04-23 00:24:13 +02:00
m
a2d90be72d fix(db): add migration 020 — rename German tables to English
knuth's rename (t-paliad-025) changed all Go code and URLs to English
but forgot the DB migration. Production tables still German (fristen,
termine, projekte etc.) while code references English names (deadlines,
appointments, projects). This caused reminder_service to fail with
'relation paliad.deadlines does not exist'.
2026-04-23 00:21:54 +02:00
m
9705290f3d Merge: Agenda — upcoming deadlines + appointments timeline
# Conflicts:
#	frontend/src/styles/global.css
2026-04-23 00:04:37 +02:00
m
f25113abe0 Merge: What's New changelog with sidebar badge
# Conflicts:
#	frontend/src/client/sidebar.ts
#	frontend/src/components/Sidebar.tsx
#	frontend/src/styles/global.css
2026-04-23 00:04:22 +02:00
m
b13065b61a Merge: global search across all content 2026-04-23 00:03:58 +02:00
m
0d6c58a337 feat(agenda): unified timeline of deadlines + appointments across projects
t-paliad-030. Adds `/agenda` — a single page that merges every visible
deadline and appointment into a day-grouped timeline, the third overview
surface alongside Dashboard and the per-resource lists.

- AgendaService: merges paliad.deadlines + paliad.appointments, gated by
  the same team-membership predicate used everywhere else; personal
  appointments stay creator-only. Items are sorted by date and tagged
  with urgency (overdue / today / tomorrow / this_week / later) so the
  client can apply the traffic-light colours without re-deriving buckets.
- GET /api/agenda?from&to&types and GET /agenda with the same server-side
  hydration pattern as /dashboard (JSON payload spliced into the shell so
  the timeline paints on first frame).
- Frontend: agenda.tsx + client/agenda.ts render a day-grouped timeline
  with type/range chips; filters round-trip through the URL.
- Sidebar entry under "Übersicht"; DE+EN i18n across all new keys.
2026-04-22 23:38:03 +02:00
m
9bb9f0c3df feat(search): global search across projects, deadlines, appointments, glossary, courts, checklists, links, users
Adds a sidebar-wide search bar (t-paliad-026) that hits a single GET
/api/search?q=... endpoint returning grouped results. Static content
(glossary, courts, link hub, checklist templates) is scanned in memory
against the curated Go slices; DB content (projects, deadlines,
appointments, checklist instances, users) is visibility-gated through
the same predicates the normal list endpoints use.

Frontend: new sidebar.ts-owned controller debounces 200ms, renders a
grouped dropdown, supports "/" to focus, Escape/arrows/Enter for
navigation, mobile-full-width overlay, and highlights matches.
2026-04-22 23:36:10 +02:00
m
94e2fc0024 feat(changelog): What's New page with sidebar badge
Adds a hardcoded changelog (internal/changelog) served via
GET /api/changelog and /api/changelog/unseen-count?since=<iso>, a
/changelog page that renders entries newest-first, and a sidebar
"Neuigkeiten" link with a lime badge showing the count of unseen
entries since the caller's last visit (localStorage stamp).

- internal/changelog: Entry struct, 11 pre-populated entries covering
  everything shipped so far (Dashboard, Projects/Deadlines/Appointments,
  CalDAV, Checklists v2, Glossary, Courts, Invitations, Settings,
  Paliad rename, and the changelog itself).
- Handler: public via auth-gated protected mux. Lexicographic string
  compare treats YYYY-MM-DD entries and ISO 8601 cutoffs symmetrically.
- Sidebar: new sidebar-changelog link before the Einladen button; the
  badge is populated by a fetch on every page load, suppressed on
  /changelog itself to avoid flash, and cleared on visit by stamping
  localStorage in changelog.ts's DOMContentLoaded handler.
- i18n: DE + EN keys for nav, page chrome, and tag labels.
- Unit tests for sort order, copy semantics, and same-day cutoff.

Task: t-paliad-027
2026-04-22 23:34:52 +02:00
m
b06a040e2b Merge: rename all German system names to English (tables, URLs, types, services) 2026-04-20 18:18:27 +02:00
m
d20cf8deef fix(routes): register legacy 301 redirects on outer mux
Unauthenticated bookmark hits on old German URLs (/akten, /fristen, …)
should 301 to the new English path directly. Previously the redirects
lived under the auth middleware, so bookmarked URLs triggered a 302 →
/login → (after login) → 301 round-trip. Registering them on the outer
mux gives the expected one-hop 301.
2026-04-20 17:45:56 +02:00
m
caf319e7ee refactor(rename): frontend TSX + client TS files, fetch URLs, nav hrefs
t-paliad-025 Phase 3 — frontend rename pass:

File renames (git mv, preserving history):
  frontend/src/
    akten.tsx               → projects.tsx
    akten-neu.tsx           → projects-new.tsx
    akten-detail.tsx        → projects-detail.tsx
    fristen.tsx             → deadlines.tsx
    fristen-neu.tsx         → deadlines-new.tsx
    fristen-detail.tsx      → deadlines-detail.tsx
    fristen-kalender.tsx    → deadlines-calendar.tsx
    termine.tsx             → appointments.tsx
    termine-neu.tsx         → appointments-new.tsx
    termine-detail.tsx      → appointments-detail.tsx
    termine-kalender.tsx    → appointments-calendar.tsx
    einstellungen.tsx       → settings.tsx
    checklisten*.tsx        → checklists*.tsx
    gerichte.tsx            → courts.tsx
    glossar.tsx             → glossary.tsx

  frontend/src/client/ — same renames, plus notizen.ts → notes.ts.

Render exports renamed (renderAkten → renderProjects, renderFristen →
renderDeadlines, …). build.ts rewired to new names.

Client-side changes:
* fetch() API paths: /api/projekte → /api/projects, /api/fristen →
  /api/deadlines, /api/termine → /api/appointments, /api/notizen →
  /api/notes, /api/gerichte → /api/courts, /api/glossar → /api/glossary,
  /api/dezernate → /api/departments, /api/parteien → /api/parties,
  /api/checklisten → /api/checklists. Legacy /api/akten aliases removed.
* Navigation href/template strings: /akten → /projects, /fristen →
  /deadlines, /termine → /appointments, /einstellungen → /settings,
  /notizen → /notes, /checklisten → /checklists, /gerichte → /courts,
  /glossar → /glossary. Nested paths /neu → /new, /verlauf → /events,
  /kinder → /children, /kalender → /calendar, /dokumente → /documents.
* Interface names in client TS: Frist → Deadline, Termin → Appointment,
  Notiz → Note, Partei → Party, Akte → Project, ProjektMini → ProjectMini,
  Dezernat → Department, DezernatMitglied → DepartmentMember.
* JSON wire-format keys follow backend: projekt_id → project_id, akte_id
  → project_id, frist_id → deadline_id, termin_id → appointment_id,
  akten_event_id → project_event_id, dezernat_id → department_id,
  termin_type → appointment_type.

Go handlers (projects_pages.go, deadlines_pages.go, appointments_pages.go,
checklists.go, courts.go, glossary.go) serve the correctly-named HTML
files from dist/.

Kept German (user-facing i18n + product names):
* i18n keys/strings (src/client/i18n.ts) — DE labels and their keys
* Product names: fristenrechner, kostenrechner, gebuehrentabellen

Build verified: go build / vet / test clean; bun run build clean;
dist/ contains all 26 English-named HTML pages.
2026-04-20 17:44:45 +02:00
m
49c6bc75ca refactor(rename): handler functions, routes, legacy 301 redirects
Second rename pass closing the backend cleanup:

* handler functions (handleListProjekte, handleCreateFrist, …) renamed
  to English equivalents so every symbol in the handler package matches
  the URL/entity it serves.
* services.FristStatusFilter + filter constants renamed to
  DeadlineStatusFilter / DeadlineFilterOverdue etc.
* services.TerminListFilter / TerminCalDAVPusher / TerminSummaryCounts
  renamed to AppointmentListFilter / AppointmentCalDAVPusher /
  AppointmentSummaryCounts.
* GlossarTerm/GlossarSuggestion/glossarTerms → Glossary*.
* CourtsFeedback/CourtsResponse (formerly Gerichte*).
* handlers.Services.{Projekt,Parteien,Frist,Termin,Notiz,Dezernat} →
  {Project,Party,Deadline,Appointment,Note,Department}; dbServices
  struct + consumers likewise.
* email templates: {{.FristURL}} → {{.DeadlineURL}}, {{.FristenURL}} →
  {{.DeadlinesURL}}.
* links.go category IDs: gerichte → courts.
* cmd/server/main.go local vars: projektSvc/terminSvc/dezernatSvc →
  projectSvc/appointmentSvc/departmentSvc.

Routes:
* removed all /api/akten alias routes (API clients use /api/projects now).
* removed /api/akten/*/deadlines, /*/notes, /*/parties, /*/appointments,
  /*/checklists, /*/events, /*/summary alias variants.
* new internal/handlers/redirects.go registers 301 Moved Permanently
  redirects for every legacy German GET path: /akten, /projekte, /fristen,
  /termine, /notizen, /einstellungen, /checklisten, /dezernate, /parteien,
  /gerichte, /glossar. Sub-paths + query strings are preserved so old
  bookmarks keep working.

Kept in German (product names, per task spec):
* /tools/fristenrechner, /tools/kostenrechner, /tools/gebuehrentabellen
* FristenrechnerService / KostenrechnerService types
* User.Dezernat + paliad.users.dezernat free-text legacy column (separate
  from the new paliad.departments entity).

go build / vet / test clean.
2026-04-20 17:40:55 +02:00
m
3faec6c526 refactor(rename): German→English for backend (tables, types, services, handler files)
t-paliad-025 — Phase 1: backend rename.

Migrations 018+019 rewritten from scratch with English table/column
names throughout. Since v2 schema (018/019) has never been applied to
youpc prod DB, this is a clean replacement — not an ALTER RENAME chain.
Pre-existing German tables (parteien, fristen, termine, dokumente,
akten_events, notizen) are renamed inline in 018 via ALTER TABLE … RENAME
TO alongside the akte_id → project_id column rewrite.

Renames applied:
  projekte            → projects
  projekt_teams       → project_teams
  projekt_events      → project_events (via akten_events → project_events)
  fristen             → deadlines
  termine             → appointments
  parteien            → parties
  notizen             → notes
  dezernate           → departments
  dezernat_mitglieder → department_members
  dokumente           → documents
  can_see_projekt     → can_see_project
  notiz_is_visible    → note_is_visible
  akte_id  / frist_id / termin_id / akten_event_id → project_id /
    deadline_id / appointment_id / project_event_id
  termin_type → appointment_type

Go types + services renamed:
  Projekt / ProjektService / ProjektEvent / ProjektTeamMember
  Frist / FristService / FristWithProjekt
  Termin / TerminService / TerminWithProjekt / TerminType
  Notiz / NotizService / ChecklistInstanceWithProjekt
  Dezernat / DezernatService / DezernatMitglied
  Partei / Parteien / ParteienService

Files renamed (git mv):
  internal/services/{projekt,frist,termin,notiz,dezernat,parteien}_service.go
    → {project,deadline,appointment,note,department,party}_service.go
  internal/handlers/{projekte,fristen,fristen_pages,termine,termine_pages,
    notizen,dezernate,akten_pages,gerichte,glossar,checklisten}.go
    → {projects,deadlines,deadlines_pages,appointments,appointments_pages,
       notes,departments,projects_pages,courts,glossary,checklists}.go
  internal/checklisten/ → internal/checklists/
  internal/db/migrations/018_projekte_v2.* → 018_projects_v2.*
  internal/db/migrations/019_seed_dezernate_from_user_text.*
    → 019_seed_departments_from_user_text.*

User-facing i18n strings (DE/EN labels) stay untouched. Product names
Fristenrechner / Kostenrechner / Gebührentabellen stay German.

Build + vet + tests clean.
2026-04-20 17:35:38 +02:00
m
fb401c63c0 docs: update CLAUDE.md — English system language, project hierarchy, team-based visibility 2026-04-20 17:24:18 +02:00
m
eb6de16e88 Merge: point .mcp.json at youpc Supabase for next session 2026-04-20 17:17:59 +02:00
m
51b16a6a41 chore(mcp): point Supabase MCP at youpc (${YOUPC_SUPABASE_AUTH})
Paliad prod data lives on the youpc Supabase (100.99.98.201:11833,
search_path=paliad,public), not on the flexsiebels Supabase that
${SUPABASE_AUTH} resolves to. Next session will pick this up on load
and can run schema work against the correct DB.
2026-04-20 17:17:38 +02:00
m
79889a2b83 Merge: remove Billing-Referenz UI + add Notizen (description) field 2026-04-20 17:17:18 +02:00
m
bde4b57099 feat: remove billing reference UI + add Notizen (description) field at every level
1. **Remove Billing-Referenz from the client create form.** Per m: the field stays
   in the DB (projekte.billing_reference column) but no longer in the UI. Dropped
   the input + label from akten-neu.tsx, the payload write from akten-neu.ts, and
   the projekte.field.billing_reference i18n keys (DE + EN).

2. **Add a Notizen (Notes) free-text field to project create + detail at every level.**
   Uses the existing projekte.description column (added in migration 018 — nullable
   text). Not to be confused with the polymorphic Notizen feature (threaded notes
   per projekt/frist/termin), which stays as-is.

   - akten-neu.tsx: textarea (rows=4) inserted above the Status select, rendered
     for every type (not type-conditional). akten-neu.ts: payload.description set
     on submit when non-empty.
   - akten-detail.tsx: new description block between header + tabs with
     akte-description-display (read) + akte-description-edit (textarea, edit mode).
     Edit/save flow on initTitleEdit extended to also PATCH description. Batch PATCH:
     only sends keys that actually changed.
     renderHeader() populates both, tags the wrapper data-empty=1 when nothing set
     (CSS can hide when empty if desired).
   - i18n: projekte.field.description / projekte.field.description.placeholder /
     projekte.detail.description.heading in DE (Notizen) + EN (Notes).

go build/vet/test + bun run build all clean.
2026-04-20 17:14:11 +02:00
m
ff1c5ceb0e fix(checklisten): consistent button sizing — Feedback uses outline variant of btn-cta-lime 2026-04-20 17:07:08 +02:00
m
59e1cb1445 Merge: i18n fallback fix + missing projekte.* translations 2026-04-20 17:06:38 +02:00
m
449075deaf fix(i18n): preserve default HTML text when key missing + add all projekte.* keys
Root cause: applyTranslations() in client/i18n.ts unconditionally overwrote
textContent/placeholder/title with t(key), and t() falls back to the raw key
name when no translation exists. Result: every projekte.* data-i18n attr in
the v2 pages rendered the literal key string ('projekte.heading',
'projekte.subtitle', ...) because I shipped the pages with new i18n keys
without adding the translations.

Two fixes, both in client/i18n.ts:

1. **Fallback behaviour**: applyTranslations() now uses a new internal
   tOrEmpty(key) that returns '' when the key is missing in DE and EN,
   and the call site only overwrites the DOM when the lookup yielded a
   real value. Missing keys no longer clobber the author-provided default
   text. This is belt-and-braces for any future page that ships a key
   before its translation does.

2. **Missing translations added**: ~90 projekte.* keys for DE and EN,
   covering the list page (projekte.heading/subtitle/new/search/filter.*/
   view.*/col.*/empty.*/unavailable), the create form (projekte.neu.*,
   projekte.field.*, projekte.cancel/submit/error.*), and the detail page
   (projekte.detail.title/back/loading/notfound/edit/save, tab.* for all
   eight tabs, verlauf.*, team.form.*/col.*, kinder.*, parteien.*
   form/role/col/empty, fristen.*, termine.*, checklisten.*, delete.*).

go build/vet/test + bun run build all clean.
2026-04-20 17:06:21 +02:00
m
adb0ce2c9d fix(modals): add padding to .modal-card — content no longer flush to edges 2026-04-20 17:05:53 +02:00
m
746bced30b Merge: projekte-detail v2 + tree view + per-Dezernat member manager (t-paliad-024 follow-ups)
- akten-detail.tsx rewritten as v2 shell: breadcrumb, type chip, ClientMatter with
  ancestor inheritance, netDocuments link, Team tab (direct+inherited), children tab.
- Tree view mode in Projekte list (depth-indented by path).
- Per-Dezernat member management panel in settings (add/remove with typeahead).
- i18n DE+EN coverage for all new keys.

Branch mai/cronus/projekte-detail-v2 @ 7e0c063.
2026-04-20 15:35:39 +02:00
m
7e0c06342b feat: projekte-detail rewrite + tree view + per-Dezernat member manager (follow-ups)
**akten-detail.tsx rewrite (now projekte-detail-shaped):**
- Removed office-chip, firmwide-chip (v2 no longer uses them).
- Added type-chip, ClientMatter display (inherits via ancestors when absent),
  netDocuments external link.
- Breadcrumb nav above header, populated from /api/projekte/{id}/ancestors.
- New 'Untergeordnet' tab with children list from /kinder endpoint;
  'Untervorhaben anlegen' link pre-fills parent via ?parent=<id>.
- New 'Team' tab: lists direct + inherited members (inheritance badge
  shows ancestor title), remove button gated on self-or-partner/admin,
  add form with user typeahead and role picker.
- akten-detail.ts: Akte interface rewritten (reference/type/parent_id/
  path/client_number/matter_number/netdocuments_url/court/case_number).
  parseAkteID now accepts both /projekte/{id} and /akten/{id}. New loaders
  loadAncestors/loadChildren/loadTeam/loadUserList. TabId extended with
  'team' and 'kinder'.
- akten-neu.ts: applyParentFromQueryString pre-fills parent picker when
  navigated from a projekt's 'Untervorhaben anlegen' link, auto-switches
  type from 'client' to 'case'.

**Tree view in Projekte list:**
- Third view mode 'tree' alongside flat/roots. Sorts filtered rows by
  path (ancestors precede descendants); depth-indented title cell with
  ↳ branch glyph based on depthOf(path).

**Per-Dezernat member manager:**
- einstellungen Dezernat tab 'Verwalten' button now toggles an inline
  manage panel per Dezernat (expanded row below the admin table row).
- Panel shows current members with per-row remove (confirm dialog).
- Add-member form with user typeahead against /api/users, posts to
  /api/dezernate/{id}/members.
- Wires once per Dezernat (data-wired guard); reloads My Dezernat on
  any membership change.

i18n: DE + EN keys for dezernat.manage_heading/loading/no_members/
add_member*/add/remove/confirm_remove/error.user_required and for every
projekte.type.* / projekte.team.role.* / projekte.team.direct /
projekte.team.inherited.hint / projekte.view.tree / projekte.detail.team.*
/ projekte.detail.clientmatter.inherited.

go build/vet/test + bun run build all clean.
2026-04-20 15:35:01 +02:00