Commit Graph
610 Commits
Author SHA1 Message Date
g-butandClaude Sonnet 4.6 369dbf3bbe feat(i18n): wire it-hilfe edit and my-offers pages to translations
All hardcoded German strings replaced with t() calls. Fixed JSX parse
errors where Python replacement script had stripped closing > from
Heading opening tags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 13:31:17 +02:00
g-butandClaude Sonnet 4.6 e11de1e0c5 feat(i18n): wire marketplace checkout pages to translations (7 locales)
Checkout [listingId]/page.tsx and success/page.tsx had entirely hardcoded
German. Both are now wired to useTranslations('marketplace.checkout') and
'marketplace.checkout.success' respectively.

Translation keys added to marketplace.checkout.{delivery,address,payment,
summary,ownListing,success} across all 7 locales. Removes the last major
German-only flow from the critical purchase path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 13:20:04 +02:00
g-butandClaude Sonnet 4.6 c993123a0b fix(i18n): localize compact metrics labels — remove hardcoded German
getCompactMetrics() required a labels object instead of using hardcoded
German strings. Callers on homepage and transparenz page now supply labels
from translations using the new home.impact.compactMetrics.* keys (added
to all 7 locales). Metrics were displaying in German even for EN/FR/etc.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 13:14:46 +02:00
g-butandClaude Sonnet 4.6 578831c551 fix(a11y): WCAG AA contrast in footer + social proof heading
Footer: gray-400/gray-500 → gray-300 on bg-gray-900 (was ≈2.5:1, now
≈11:1). Fixes icons, legal nav links, extra address text, copyright.
Hover states updated to text-white for consistent visual feedback.

Homepage: adds "Unsere Wirkung" h2 heading to the social proof section
using existing impact.title/subtitle translation keys — fixes missing
section heading identified in design audit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 12:27:48 +02:00
g-butandClaude Sonnet 4.6 6a704dd299 feat(i18n): wire all static pages to translations across 7 locales
Removes hardcoded German strings from 44 pages/components, moving all
content into messages/*.json and wiring up useTranslations/getTranslations.

Pages covered: space, projects, revamped, transparenz, impressum, agb,
datenschutz, abos, mitglied-werden, get-involved (all sub-pages), services
(all sub-pages + open-source-solutions), sellers, techniker, workshops
(propose form + detail), marketplace errors, blog/services error boundaries.

Also fixes aiplacholder typo → aiPlaceholder in all 7 locale files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 12:14:52 +02:00
g-butandClaude Sonnet 4.6 cb9358bd15 fix(design): WCAG contrast, heading scale, DESIGN_TOKENS, a11y labels
- Footer: bump text-gray-400/500/600 → gray-300/400/500 (WCAG AA on dark bg)
- Skip link: fix focus color blue → green (brand consistency)
- PageHero: add variant="site" so h1 uses marketing type scale
- Homepage: add variant="site" to section h2s; wire action cards and
  community cards to DESIGN_TOKENS.iconBadges/buttons (SSOT); add
  underline to impact link (accessibility)
- NewsletterSignup: add sr-only <label> elements for name/email inputs
- AsSeenInLogos: replace hardcoded "Bekannt aus" with useTranslations;
  add home.asSeenIn.{heading,allCoverage} to all 7 locale files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 08:55:49 +02:00
g-butandClaude Sonnet 4.6 5fe00e91fe fix(i18n): wire FAQ and Support pages to translations (remove hardcoded German)
Both pages were hardcoded German. Translations already existed in all 7
locale message files — pages just weren't reading them.

- FAQ: reads groups from t.raw('groups'), metadata from t('meta.*')
- Support: reads pillars, promise items, CTAs from support namespace
- FAQSchema structured data now uses translated content
- Both get proper generateMetadata with locale-aware title/description

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 14:44:33 +02:00
g-butandClaude Sonnet 4.6 428d8dd9c4 feat(shop): product detail page + getInventoryProductByUuid
- New /shop/product/[uuid] page: image, price, condition badge,
  customer profiles, availability, trust badge, CTA to Shopware,
  related products grid
- Added getInventoryProductByUuid() to inventory-service
- Shop category and search pages now link to real product pages

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 14:30:32 +02:00
g-butandClaude Sonnet 4.6 2863ca51ae feat(shop): wire real inventory products into shop search page
Search results now fetch from the inventory service instead of
showing a 'coming soon' placeholder. Empty-state CTA preserved
when no products match the query.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 14:24:28 +02:00
g-butandClaude Sonnet 4.6 cc8be12ab7 feat(shop): wire real inventory products into category browse pages
Category pages now fetch and display actual products from the
inventory service instead of showing a 'coming soon' placeholder.
Shows product grid with image, brand, price, condition, quantity badge.
Falls back to empty-state CTA if no products in that category.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 14:18:21 +02:00
g-butandClaude Sonnet 4.6 e56354553f fix(pools): correct apiError call signature (error, message) in all pool routes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 13:58:33 +02:00
g-butandClaude Sonnet 4.6 b2d005e73e feat: Abo-Tauschbörse — subscription pool exchange MVP
Implements the mission-critical subscription sharing feature:
- GET/POST /api/pools — browse and create pools
- GET /api/pools/[id] — pool detail
- POST /api/pools/[id]/join — join a pool
- POST /api/pools/[id]/leave — leave a pool
- DELETE /api/pools/[id] — close pool (owner/superadmin)
- GET /api/pools/my — user's active memberships
- /[locale]/abos — browse/create UI with category filter,
  real-time join/leave, create modal with cost preview
- Added to navigation (Marktplatz section) with i18n across 7 locales
- Fix: useCallback missing 't' dep in it-hilfe page

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 13:52:12 +02:00
g-butandClaude Sonnet 4.6 32f400b940 fix: add canton filter to unified technician API and replace legacy proxy routes
Migration 064 adds the missing `canton` column to `repairer_profiles` (omitted
in 061 when helper_profiles was merged in), backfills from helper_profiles, and
rebuilds helper_profiles_v to expose the real column instead of NULL.

The canton filter in /api/technicians was silently ignored since 061 — any
frontend filter by Swiss canton returned all results. Now wired up.

Legacy routes /api/repairers and /api/it-hilfe/helpers reduced from 150-230
lines of duplicated query logic each to 30-line thin proxies that delegate to
/api/technicians and remap the response shape for backwards compatibility.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 13:26:00 +02:00
g-butandClaude Sonnet 4.6 b3b62bc391 feat(i18n): translate all nav sub-items across 7 locales
Added nameKey to all ~30 navigation sub-items and updated
MegaMenuContent to use useTranslations for locale-aware labels.
Added 35 new nav keys to de/en/fr/it/es/ja/ko message files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 13:06:50 +02:00
g-butandClaude Sonnet 4.6 1f675438ce fix(i18n): fix 500 crash from t.rich() misuse + translate nav labels
The homepage was crashing with "Functions are not valid as a child of
Client Components" because proServices.text used {link} (simple
interpolation) while the component called t.rich(), which expects
XML-style <link>label</link> tags and passes a render function.
next-intl returned the function itself as the replacement value,
causing React to throw.

Fix: convert {link} → <link>label</link> in all 7 locale files,
embedding the localized link label directly in the tag.

Also wire up nav label translations: add nameKey to all 6 top-level
nav items in navigation.tsx, add missing 'learn' key to all 7 locales,
and update NavItem to use useTranslations('nav') when nameKey is set.
The nav menu now shows translated labels (About, Services, Marketplace,
Learn, Get Involved, Contact) when switching locales.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 12:47:14 +02:00
g-butandClaude Sonnet 4.6 7b17a7de0d fix(lint): eliminate 145 of 146 no-html-link-for-pages warnings
Replaced internal <a href="/..."> with <Link> across all remaining files:
- NewsletterSignup.tsx (/support)
- MediaCoverageSection.tsx (/contact)
- involvement-page-layout.tsx (/get-involved/kontakt, /get-involved)
- about/hardcoded-content.tsx (/get-involved)
- admin/products/factsheet/page.tsx (/admin/products)

1 warning remains: intentional console.warn in i18n/request.ts
(documents fallback behavior for missing locale messages)

146 → 1 warning. TypeScript: 0 errors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 12:10:34 +02:00
g-butandClaude Sonnet 4.6 fbe0e05fca fix(lint): convert internal <a> tags to Next.js <Link> (partial)
Auto-fix resolved 2 of 144 no-html-link-for-pages warnings in
agb, datenschutz, impressum, DecisionOptionsEditor, ChecklistGroup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 11:30:51 +02:00
g-butandClaude Sonnet 4.6 dc1f8fae24 fix(audit): P0 fixes — i18n gaps, mobile locale switcher, live impact metrics
- Footer: wrap Öffnungszeiten, Mo/Di-Fr hours, and Transparenz link in t() calls
  — these appeared on every page in every locale as hardcoded German
- space/page.tsx: use OPENING_HOURS from org.ts instead of hardcoded '9-12 | 13-17'
  (SSOT fix — the hardcoded times also didn't match the actual org hours)
- MobileMenu: add LocaleSwitcher to footer so mobile users can switch locale
  (previously locale switching was desktop-only)
- Add footer.openingHours, openingHoursMonday, openingHoursTueFri, transparency,
  and nav.language keys to all 7 locale files (de/fr/en/it/es/ja/ko)
- ImpactStatsSection: fetch live stats from DB at render time instead of static
  estimates; falls back to org-numbers defaults if DB is unavailable
- New /api/stats/impact route: computes real device counts and CO2 savings
  by category using co2-impact.ts Fraunhofer IZM methodology
- AUDIT_REPORT.md: full 6-phase audit report (8.3/10 overall)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 11:28:23 +02:00
g-butandClaude Sonnet 4.6 60363b3a7f chore: remove TinaCMS, dead content, empty API stubs, siteConfig wrapper
- Delete tina/ directory (TinaCMS config — not in package.json, zero imports)
- Delete content/ directory (orphaned blog/page content from TinaCMS era)
- Delete public/admin/ (TinaCMS admin UI pointing at non-existent dev server)
- Delete empty API route stubs: shop/{products,health,orders,regions}/,
  admin/reviews/ (no route.ts files, zero references anywhere)
- Delete src/config/site.ts (pure wrapper re-exporting org.ts constants)
  — migrated Footer and contact-link to import directly from org.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 16:14:39 +02:00
g-butandClaude Sonnet 4.6 1ff34179e7 fix(ui): font, locale switcher, footer i18n, CSS override removal
- Add Inter font via next/font/google (was missing — browser fallback)
- Remove nuclear !important CSS block that overrode all letter-spacing,
  text-transform, white-space across entire site (was causing ugliness)
- LocaleSwitcher: replace 7 inline buttons with compact dropdown (shows
  current locale code + chevron, expands to labeled list)
- Footer: use useTranslations for all hardcoded German strings; nav items
  now use nameKey for proper locale switching
- error.tsx: use useTranslations instead of hardcoded German error text

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 15:16:42 +02:00
g-butandClaude Sonnet 4.6 8284cbf887 feat: add next-intl i18n — 7 locales (de/fr/en/it/es/ja/ko)
- Add next-intl v4.9.1 with App Router [locale] directory pattern
- German is SSOT; other locales fall back to German for missing keys
- All public pages moved to src/app/[locale]/ for locale-aware routing
- Non-locale routes (admin, auth, dashboard, profil) use AppShell for providers
- Root layout stripped to html/body shell; locale layout owns providers
- Middleware merges next-intl locale routing with existing CSRF/auth logic
- LocaleSwitcher added to desktop header; MobileMenu updated
- CommunityStats, NewsletterSignup, Header, MobileMenu use useTranslations
- 57 partial message files merged into de/fr/en locale JSONs
- Fix react-hooks/immutability in DecisionFormClient (setInitialStatus)
- TypeScript: 0 errors — ESLint: 0 errors

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 12:32:31 +02:00
g-butandClaude Sonnet 4.6 b197cd97c6 refactor: org name SSOT — replace hardcoded 'RevampIT'/'Revamp-IT' with ORG.name
- Footer.tsx: copyright notice uses ORG.name
- RegistrationWizard.tsx: welcome message uses ORG.name
- LoginForm.tsx: registration prompt uses ORG.name
- MembershipApplicationForm.tsx: success message uses ORG.name
- app/layout.tsx: SITE_TITLE/SITE_DESCRIPTION use ORG.name (was importing ORG but not using it)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 20:13:37 +02:00
g-butandClaude Sonnet 4.6 1669bae6cd refactor: eliminate final magic strings — APPROVAL_STATUS, OFFER_STATUS, REQUEST_STATUS
- getDashboardStats.ts: replace hardcoded 'pending' and 'open' with APPROVAL_STATUS.PENDING,
  REQUEST_STATUS.OPEN, REPAIRER_APPLICATION_STATUS.PENDING
- admin/approvals/page.tsx: replace 4x hardcoded 'pending' with APPROVAL_STATUS.PENDING
  (constant was already imported but unused)
- lib/dashboard/techniker.ts: replace 'pending' with OFFER_STATUS.PENDING
- repairer/apply/route.ts: replace 'unbekannt@example.com' placeholder with 'nicht angegeben'
- workshops/propose/route.ts: same fix

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 20:06:47 +02:00
g-butandClaude Sonnet 4.6 9f4f593f3b refactor: eliminate more magic strings — dispute, document verification, listing, decision status
New constants (SSOT):
- PAYMENT_DISPUTE_STATUS in config/payment-status.ts (opened/under_review/won/lost/cancelled)
- DOCUMENT_STATUS.INCOMPLETE added (was used in DB but missing from constant)

Consumers updated:
- admin/payments/dashboard/route.ts — PAYMENT_DISPUTE_STATUS.OPENED/LOST
- admin/documents/[id]/reject/route.ts — DOCUMENT_STATUS.INCOMPLETE
- admin/repairer-applications/route.ts — DOCUMENT_STATUS.PENDING (COALESCE default)
- lib/search/meilisearch.ts — LISTING_STATUS.ACTIVE (filter string)
- lib/services/seller-service.ts — LISTING_STATUS.ACTIVE/REMOVED (SQL filter)
- lib/reviews/create-review.ts — OFFER_STATUS.ACCEPTED, REVIEW_TARGET_TYPES, REVIEW_STATUS.PUBLISHED
- lib/dashboard/techniker.ts — REQUEST_STATUS.OPEN
- lib/services/decisions-comments.ts — DECISION_STATUS.DISCUSSION/VOTING (fixed type cast)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 19:48:55 +02:00
g-butandClaude Sonnet 4.6 74d9061a97 refactor: eliminate magic strings — inventory, donation, listing, report, decision status constants
New constants (SSOT):
- INVENTORY_ITEM_STATUS in config/marketplace-status.ts (available/reserved/sold/damaged/missing)
- MARKETPLACE_LISTING_PLATFORM in config/shop.ts (internal/external)
- DONATION_STATUSES.ARCHIVED added (was used in DB but missing from constant)

Consumers updated:
- erfassung/create-product.ts — INVENTORY_ITEM_STATUS.AVAILABLE, DONATION_STATUSES.RECORDED,
  MARKETPLACE_LISTING_PLATFORM.INTERNAL
- inventory/import-csv/route.ts — INVENTORY_ITEM_STATUS.AVAILABLE
- admin/intake/[id]/publish/route.ts — MARKETPLACE_LISTING_PLATFORM.INTERNAL
- admin/inventory-actions.ts — MARKETPLACE_LISTING_PLATFORM.INTERNAL
- admin/donations/[id]/route.ts — DONATION_STATUSES.ARCHIVED
- admin/marketplace/[id]/route.ts — LISTING_STATUS.REMOVED
- admin/marketplace/reports/[id]/route.ts — REPORT_STATUS.REVIEWED, LISTING_STATUS.REMOVED
- decisions-voting.ts — DECISION_STATUS.VOTING/CLOSED
- decisions-comments.ts — DECISION_STATUS.DISCUSSION/VOTING
- reviews/create-review.ts — REVIEW_TARGET_TYPES, REVIEW_STATUS, OFFER_STATUS
- dashboard/techniker.ts — REQUEST_STATUS.OPEN

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 19:37:00 +02:00
g-butandClaude Sonnet 4.6 577f2cf15b refactor: eliminate magic strings — availability, review target, payment transaction types
New constants (SSOT):
- REPAIRER_AVAILABILITY_TYPE in config/repairer-status.ts ('available'/'booked'/'blocked')
- PAYMENT_TRANSACTION_TYPE in config/payment-status.ts ('payment'/'refund'/etc.)

Consumers updated:
- repairers/[id]/availability/route.ts — REPAIRER_AVAILABILITY_TYPE.AVAILABLE/BOOKED
- repairers/[id]/book/route.ts — REPAIRER_AVAILABILITY_TYPE.BOOKED/AVAILABLE
- repairers/[id]/route.ts — REPAIRER_AVAILABILITY_TYPE.AVAILABLE
- marketplace/orders/[id]/review/route.ts — REVIEW_TARGET_TYPES.LISTING
- user/reviews/route.ts — REVIEW_TARGET_TYPES.REPAIRER/WORKSHOP (was sql template literals)
- appointments/[id]/pay/route.ts — PAYMENT_TRANSACTION_TYPE.PAYMENT
- admin/tax-reports/route.ts — PAYMENT_TRANSACTION_TYPE.PAYMENT (SQL template)
- payments-gateway.ts — PAYMENT_TRANSACTION_TYPE.PAYMENT
- ITHilfeReviewForm.tsx — REVIEW_TARGET_TYPES.IT_HILFE
- ListingReviews.tsx — REVIEW_TARGET_TYPES.LISTING
- useITHilfeDetail.ts — REVIEW_TARGET_TYPES.IT_HILFE

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 19:19:50 +02:00
g-butandClaude Sonnet 4.6 ab60de45a8 refactor: eliminate magic strings — MARKETPLACE_SELLER_TYPE + REPAIRER_PROFILE_TIER constants
- Add MARKETPLACE_SELLER_TYPE constant to config/marketplace.ts (SSOT)
- Add REPAIRER_PROFILE_TIER constant to config/repairer-status.ts (SSOT)
- Replace all hardcoded 'revampit'/'community' seller_type strings across:
  listings API, admin marketplace API, meilisearch search, marketplace page,
  admin ListingsTab, and marketplace schemas
- Replace all hardcoded 'professional'/'community' tier strings across:
  technicians routes and user/technician-profile route
- Widen SearchFilters.seller_type to string (schema already validates via enum)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 19:07:47 +02:00
g-butandClaude Sonnet 4.6 68d5654940 fix: replace all hardcoded status strings with SSOT constants
Eliminates magic string literals throughout API routes and services.
Every status comparison now uses the canonical constant from config/.

- WORKSHOP_INSTANCE_STATUS.SCHEDULED in workshops/register, send-reminders, proposals/approve
- REPAIRER_STATUS.ACTIVE in repairers/route, availability/route, book/route
- DECISION_STATUS.VOTING/CLOSED in cron/close-decisions, decisions/transition
- MEMBERSHIP_APPLICATION_STATUS.APPROVED in membership/apply
- DONATION_STATUSES.RECORDED in admin/donations
- PAYREXX_TRANSACTION_STATUS (new) in payrexx-client, payment-webhook, mock-redirect
  Defines all external Payrexx transaction status strings in one place
- WORKSHOP_PAYMENT_STATUS (new) in workshop-registration-status.ts
  Defines workshop-specific payment dimension status (not_required/pending/paid/refunded)
- PAYMENT_STATUS.REFUNDED/DISPUTED added to complete the enum
- WORKSHOP_REGISTRATION_STATUS.CONFIRMED replaces hardcoded 'confirmed' in webhook
- WORKSHOP_PAYMENT_STATUS.PAID/NOT_REQUIRED replace hardcoded strings in webhook

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 17:38:32 +02:00
g-butandClaude Sonnet 4.6 e3f647957d refactor: split email templates misc.ts into domain files + add error UI
- Split src/lib/email/templates/misc.ts (649 lines, 6 domains) into:
  newsletter.ts, blog.ts, reviews.ts, sellers.ts, content.ts, locations.ts
- Convert misc.ts to backward-compat barrel re-export
- Update templates/index.ts to import from domain files directly;
  adds previously missing blog status templates (Approved/Rejected/Published/ChangesRequested)
- Add error state + error UI to FinancesContent (was silently showing empty state)
- Add fetchError state + banner to it-hilfe/my/page.tsx (was swallowing fetch errors)
- Surface fetch errors in it-hilfe/my/offers/page.tsx fetchOffers (only withdraw had error UI)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 17:15:59 +02:00
g-butandClaude Sonnet 4.6 495bb5919f fix: replace hardcoded status strings with config constants
- it-hilfe/helper/matching-requests: use REQUEST_STATUS.OPEN
- admin/workshops/instances: use WORKSHOP_INSTANCE_STATUS.SCHEDULED
- workshops/register-with-payment: use WORKSHOP_INSTANCE_STATUS.SCHEDULED

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:52:20 +02:00
g-butandClaude Sonnet 4.6 fb6dcdb874 refactor: use apiSuccess/apiError helpers + SSOT member type labels
- stats/community route: replace NextResponse.json with apiSuccess/apiError
- dashboard/membership page: use MEMBERSHIP_TYPE_LABELS from config/membership-status
  instead of locally-defined duplicate mapping

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:39:41 +02:00
g-butandClaude Sonnet 4.6 0184238649 refactor: split god components + fix remaining hardcoded strings
## VotingPanel split (615 → ~160 lines)
Extract 6 voting method sections into focused components:
- voting/ConsentVote.tsx — consent response + rationale
- voting/ApprovalVote.tsx — approval (gallery + list modes)
- voting/DotVote.tsx — dot allocation (gallery + list modes)
- voting/ScoreVote.tsx — star scoring (gallery + list modes)
- voting/RankedChoiceVote.tsx — drag-to-rank ordering
- voting/SimpleMajorityVote.tsx — yes/no/abstain
- voting/DeadlineCountdown.tsx — countdown timer
- voting/OptionCard.tsx — shared gallery card
VotingPanel.tsx is now a pure orchestrator (~160 lines)

## DecisionFormClient split (746 → ~190 lines)
Extract form state and UI sections:
- useDecisionForm.ts — all state, handlers, API submit logic
- DecisionTypeSelector.tsx — decision type card grid
- DecisionOptionsEditor.tsx — option add/edit/remove
- ParticipantSelector.tsx — scope selector + invite list
- AdvancedSettings.tsx — voting method, quorum, blind voting
DecisionFormClient.tsx composes the above cleanly

## API route fixes
- locations/route.ts: migrate from manual auth() to withAuth middleware (GET + POST)
- listings/[id]/duplicate: use LISTING_STATUS.REMOVED constant (was 'removed')
- admin/listings/[id]/verify: use LISTING_STATUS.REMOVED constant (was 'removed')

## Lint
- scripts/lint-umlauts.sh: exclude 'statutenaenderung' (known DB slug, legitimate false positive)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:33:43 +02:00
g-butandClaude Sonnet 4.6 779de136ee refactor: SSOT/DRY overhaul — config-driven, god-file split, no hardcoded strings
## Schema god-file split (misc.ts → domain files)
- applications.ts: applications, membershipApplications
- org-numbers.ts: orgNumbers
- locations.ts: locations, locationApprovals, locationBookings
- tasks.ts: taskProjects, tasks, taskCompletions, taskAttentionFlags, taskRequests
- decisions.ts: decisions, decisionVotes, decisionComments
- protocols.ts: meetingProtocols, protocolActionLinks, protocolDecisionVotes, protocolDecisionOutcomes
- subscriptions.ts: subscriptionPools, poolMemberships, poolContributions, poolVotes
- misc.ts converted to backward-compat barrel (zero breaking changes)
- schema/index.ts updated to own canonical exports

## AI prompts god-file split (prompts.ts → subdirectory)
- prompts/shared.ts, erfassung.ts, content.ts, decisions.ts — prompts.ts is now a barrel

## New SSOT config files
- config/pagination.ts: named page-size constants (DEFAULT/PUBLIC/DENSE/SEARCH/FEED/INTAKE)
- config/map.ts: Leaflet tile URLs, marker icon options, map defaults
- config/membership-status.ts: MEMBERSHIP_APPLICATION_STATUS, MEMBERSHIP_TYPE constants
- config/repairer-status.ts: REPAIRER_STATUS, REPAIRER_APPLICATION_STATUS constants

## API route hardening
- membership approve/reject: use MEMBERSHIP_APPLICATION_STATUS constants in parameterized queries
- technicians, technician-profile: use REPAIRER_STATUS constants
- sellers, listings/report: use LISTING_STATUS.ACTIVE constant
- stats/community: parameterized status query (was string literal)
- invoices: add Zod validation schema (LineItemSchema + CreateInvoiceSchema)
- preferences: use validateBody + apiSuccess/apiError helpers
- search-index: use apiSuccess/apiError helpers
- payrexx-webhook: tighten dev-mode bypass (require no PAYREXX_INSTANCE)

## Map config SSOT
- LeafletMapInner imports tile URL, marker icons, and default center from config/map.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 16:13:23 +02:00
g-butandClaude Sonnet 4.6 cd942f2387 feat: ranked-choice voting, AI decision recommendations, membership dashboard
- VotingPanel/ResultsPanel: Borda ranked-choice voting method with drag-free
  reordering (move up/down arrows), Borda point calculation and results display
- AI prompts: decision assistant now recommends optimal voting method, type,
  participant scope, quorum, and category with reason field
- dashboard/membership: complete membership status page (type, payment status,
  benefits, member-since date, payment deadline countdown)
- migration 063: add participant_scope and ai_outcome_narrative to decisions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 15:29:18 +02:00
g-butandClaude Sonnet 4.6 3fef3a86c6 feat: checklist notes + quick-pass for device testing workflow
- ChecklistGroup: inline notes editor per checklist item (add/edit/preview)
  Shows note preview when collapsed, expands textarea on click
- useIntakeDetail: pass notes through to PATCH API; add markAllRequired()
  that batch-completes all uncompleted required items in parallel
- IntakeDetailView: "Alles in Ordnung" button in progress bar header
  visible only when checklist < 100%, marks all required items done in one click
- Wire markAllRequired through IntakeClient prop chain

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 15:15:14 +02:00
g-butandClaude Sonnet 4.6 4a327d5454 fix: close all modals on backdrop click (SSOT modal behavior)
Five modals had fixed overlays without onClick={onClose} on the backdrop,
meaning users had to find the X button to close them. Added backdrop click
handler + stopPropagation on inner content to match the base Modal component
pattern already used everywhere else.

Affected: InstanceFormModal, RequestChangesModal, RejectModal,
EditSubmissionModal, EditProposalModal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 14:50:10 +02:00
g-butandClaude Sonnet 4.6 7bde6f9896 feat: inline approve actions in dashboard queue + activity feed wiring
- Add server actions (approve blog, verify listing, approve repairer) in admin/actions/index.ts
- Add InlineActionButton client component with useTransition pending state
- Render inline action buttons in UnifiedQueue rows where applicable
- Extend DashboardStats with top-item queries to populate inline action targets
- Extend ActionItem type with optional inlineAction field
- Wire logActivity() fire-and-forget into approvals, IT-Hilfe, and erfassung routes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 14:45:21 +02:00
g-butandClaude Sonnet 4.6 86e664f9f0 feat: Phase 8 — Mobile nav, system health bar, a11y
- MobileBottomNav: fixed bottom bar (lg:hidden) with Heute/Aufgaben/Entscheide/Mehr
  tabs; Mehr opens the full sidebar; min-h-[56px] touch targets; aria-current
- AdminLayoutClient: mount MobileBottomNav, pb-20 on mobile to avoid content overlap
- Migration 0005: job_runs table for system health monitoring
- jobRuns Drizzle schema in misc.ts
- SystemHealthBar server component: shows amber notice when any job has failures
  in last 24h; silently returns null if table absent or all healthy
- SystemHealthBar wired into MonatsueberblickSection (always shown when expanded)
- UnifiedQueue aria-label already covers urgency+label+age+count (no change needed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 14:23:05 +02:00
g-butandClaude Sonnet 4.6 2ec21e49f4 feat: Phase 7 — Feedback Loop (delta metrics + activity feed)
- getDashboardStats: add 4 prev-month queries (parallel in same Promise.allSettled)
- MissionDelta type: devicesProcessed/devicesSold/itHilfeCompleted/workshopAttendees
- DashboardStats.delta: this month minus last month for each mission metric
- MissionMetrics: DeltaBadge component shows +N (green) / -N (red) / ±0 (grey)
- Migration: activity_feed table with actor_id, action, subject_type/id/label
- activityFeed Drizzle schema in misc.ts
- logActivity() helper — fire-and-forget, never throws
- TeamActivityFeed server component — last 10 events joined with users
- Monatsueberblick accepts children prop; 'lead' mode renders TeamActivityFeed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 14:15:23 +02:00
g-butandClaude Sonnet 4.6 21ec17a62a feat: Phase 6 — Role Segmentation (dashboard modes)
- Migration: add dashboard_mode column to users (coordinator/lead/volunteer)
- Update Drizzle schema, DbUser type, and mapUserToDbUser mapping
- Propagate dashboardMode through auth.ts JWT → session callbacks
- PATCH /api/me/preferences — update dashboardMode for current user
- DashboardModeToggle client component — pill-style switcher with optimistic state
- Monatsueberblick accepts defaultOpen prop; 'lead' mode defaults to expanded
- Dashboard greeting row shows mode toggle aligned right

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:57:59 +02:00
g-butandClaude Sonnet 4.6 671f05e0f5 feat: Phase 5 — Suspense streaming for admin dashboard
- Greeting renders at 0ms (no data dependency)
- VotingBanner and PersonalSection stream independently with their own queries
- UnifiedQueue, PermissionRequests, and Monatsüberblick share a single
  getDashboardStats() Promise — DB queried once, sections stream when resolved
- Skeleton fallbacks: BannerSkeleton, PersonalSectionSkeleton, UnifiedQueueSkeleton
- Collapsed sections (Monatsüberblick) use fallback={null} — no skeleton needed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:45:08 +02:00
g-butandClaude Sonnet 4.6 26f0f7a274 feat: Phase 4 — Command Bar (⌘K)
- Add CommandBar client component with Cmd+K/Ctrl+K global shortcut
- Native <dialog> element for accessibility (backdrop, focus trap, Esc)
- Fuzzy substring search across sections, users, decisions, and listings
- Hardcoded action commands: Gerät erfassen, Entscheidung, Protokoll, Dashboard
- Keyboard navigation: ↑↓ to move, Enter to navigate, Esc to close
- Search trigger button in top bar with ⌘K hint
- /api/admin/search-index endpoint (withAdmin, Promise.allSettled)
- Mount CommandBar in AdminLayoutClient between search and NotificationBell

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:40:05 +02:00
g-butandClaude Sonnet 4.6 ebdb732f7d fix: correct design violations in dashboard components
- CreateStrip: add Plus icon to header, bump touch targets to min-h-[44px]
- Monatsueberblick: use Heading level={2} (not raw span) for card header
- PersonalSection: extract TASK_LIMIT/SUBMISSION_LIMIT constants, add
  "Alle Einreichungen ansehen" link parallel to tasks, ArrowRight icon,
  space-y-2 spacing, eyebrow labels always shown
- VotingBanner: fix eyebrow to text-xs, CTA to py-2.5 min-h-[44px],
  standardize ArrowRight icon, Clock w-4 h-4

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:30:15 +02:00
g-butandClaude Sonnet 4.6 4a65bfca59 fix(dashboard): redesign components to match card system + Phase 2 personal context
Design fixes (Phase 0 components were inconsistent with the codebase's card system):
- UnifiedQueue: proper card header with Heading+icon, p-3 item rows matching
  ActionItemsSection, count badges at text-sm readable size, correct urgency colors
- CreateStrip: card wrapper with border-b header, text-sm pills with py-2 px-4,
  removes tiny unreadable text-xs layout
- Monatsueberblick: card-style toggle header with icon+Heading weight text,
  proper chevron rotation, consistent open/closed structure

Phase 2 — Personal context:
- VotingBanner: server component querying decisions where user is eligible voter
  and hasn't voted; shows teal banner with title, deadline countdown, CTA button;
  handles all 4 participant scopes (all_staff, board_only, all_members, invited)
- PersonalSection: server component showing assigned tasks (with overdue highlighting)
  and pending content submissions; both hidden when empty

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 13:19:41 +02:00
g-butandClaude Sonnet 4.6 8358a26fe7 feat(dashboard): Phase 0+1 — unified queue, create strip, collapsible metrics, sidebar zones
Restructures the admin dashboard to prioritize task clarity:
- Merged ActionItems + FulfillActions into a single "Wartet auf Bearbeitung" queue
  (no more seeing the same item twice in two different formats)
- Demoted "Erstellen" to a compact pill strip with no card wrapper
- Wrapped MissionMetrics + WeeklyActivity in a collapsible "Monatsüberblick"
  (collapsed by default, preference persisted in localStorage)
- Renamed sidebar zones: Angebot→Betrieb, Betrieb→Organisation, Übersicht→Heute

New components: UnifiedQueue, CreateStrip, Monatsueberblick, buildUnifiedQueue

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 12:57:29 +02:00
g-butandClaude Sonnet 4.6 cbbb676e68 feat: dashboard P3+P4 — fulfillment quick actions with badges, mission metrics
P3 — quick actions split into two rows:
- "Erledigen" (green, with count badge): Inserate prüfen, Blog-Einreichungen,
  IT-Hilfe zuweisen, Termine bestätigen, Techniker-Bewerbungen — only shown
  when count > 0, hidden entirely when queue is clear
- "Erstellen" (existing colour-coded buttons, lighter visual weight): kept below

P4 — StatsOverview replaced with MissionMetrics:
- 4 impact cards: Geräte erfasst / verkauft, IT-Hilfen abgeschlossen,
  Workshop-Teilnahmen — all scoped to current month, all linked to their section
- Reference stats (users, staff, technicians, listings) demoted to a compact
  single-line footer row so the data is still accessible without dominating

4 new parallel queries added to getDashboardStats (inventory processed/sold,
IT-Hilfe completed, workshop attended) — all within the existing Promise.allSettled

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 11:54:54 +02:00
g-butandClaude Sonnet 4.6 c20884c6c1 refactor: dashboard P0–P2 — parallel queries, noise removal, age context
P0 — backend: collapse 12 sequential DB round-trips into parallel Promise.allSettled;
add MIN(created_at) per category for oldest-item age; replace silent catch{} with
logger.warn so failures are visible; listings uses FILTER in single query

P1 — noise removal: drop "X Bereiche" from greeting (impl detail, not orientation);
remove "Keine offenen Berechtigungsanfragen" bottom banner (zero-state nobody reads);
hide WeeklyActivity section entirely when both values are zero (zeroes without trend
context are uninterpretable)

P2 — age context on action items: each row now shows how old the oldest unresolved
item is ("ältestes: vor 8 Tagen") in urgency-coloured text; urgency dots get
aria-hidden + link gets aria-label with urgency word ("Dringend"/"Ausstehend") for
screen readers; action list uses semantic <ul>/<li>

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 11:36:20 +02:00
g-butandClaude Sonnet 4.6 952e5d6122 fix: admin UX accessibility — responsive tables, touch targets, WCAG, a11y
Typography & hierarchy (cascades to all pages via admin-ui.ts SSOT):
- pageTitle: text-xl → text-2xl font-bold (stronger H1 anchor)
- meta/description: text-xs → text-sm (14px min per WCAG for body text)
- stat: add font-mono (consistent digit widths with tabular-nums)
- adminBtn: add disabled:cursor-not-allowed to action/warning/danger/ghost variants
- adminBtn.icon: w-8 h-8 → min-w/h-[2.75rem] for 44px WCAG touch targets

Pagination (used on every list page):
- Buttons: min-w/h-[2.75rem] for 44×44px WCAG 2.5.5 touch targets
- Mobile: hide page number buttons on xs, show "N / total" text instead
- Outer container: flex-wrap + gap-y-2 prevents overflow on narrow screens
- Ellipsis: proper aria-label="weitere Seiten", use … not ...

AdminFilterBar (used on every filterable page):
- Layout: flex-wrap → flex-col sm:flex-row — stacks properly on mobile
- Field widths: flex-1 min-w-48 → bounded flex-[0_1_220px] — dropdowns no
  longer stretch to 300px+ on desktop
- Labels: add htmlFor + matching id on every input/select (a11y: programmatic
  label association was missing)
- Focus states: add focus:border-blue-500 for better focus visibility

AdminSidebar:
- <nav>: add aria-label="Admin-Navigation" (landmark for screen readers)
- Group toggle buttons: add aria-expanded={isExpanded}
- Group labels: remove uppercase + tracking-widest → tracking-wide (more readable)
- Collapsed icons: w-4 h-4 → w-5 h-5 for easier recognition and touch

Responsive tables (protocols, tasks) — critical on mobile/small laptop:
- protocols: hide Teilnehmer + Workflow on mobile (md:table-cell)
- protocols: hide Typ on mobile (sm:table-cell)
- tasks: hide Typ + Zugewiesen on mobile/tablet (md:table-cell)
- tasks: hide Kategorie + Fällig + Erledigungen on mobile (sm:table-cell)
- All columns: whitespace-nowrap on date/status cells, max-w + truncate on title
- th headers: text-sm → text-xs font-semibold uppercase (standardised)
- Error-state "Seite neu laden": <a href=""> → <Link href="..."> (valid HTML)

Action button groups (workshops, locations):
- Row: flex → flex-col sm:flex-row with gap-4 — buttons stack below content
  on mobile instead of being squeezed into the same line
- Button wrapper: flex-wrap so buttons wrap rather than overflow

Reviews:
- Modal textarea border: border-gray-300 → border-gray-400 (WCAG AA contrast)
- Flag buttons: add min-h-[2.75rem] for 44px touch target
- Flag buttons: add aria-label (was title-only, invisible to screen readers)

AdminLayoutClient:
- Mobile overlay: bg-black/20 → bg-black/30 dark:bg-black/50 (visible in dark mode)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 11:27:58 +02:00
g-butandClaude Sonnet 4.6 2055d85127 feat: decisions — democratic voting for all members, rich UX, context field
- Open vote API to authenticated members (withAuth), eligibility enforced in service
- Dashboard voting pages: /dashboard/decisions + /dashboard/decisions/[id]
- Type-aware email dispatch: decision_voting → decisionVotingOpened template, etc.
- Email deep links point to /dashboard/decisions/:id (not admin list)
- decisionClosed email template added; deadline reminder cron fires 24h before expiry
- background field (DB migration + schema + CRUD + API + forms): separates "what we're deciding" from "why" — shown as collapsible Begründung section before the ballot
- Type picker redesigned: icons, mechanic description on select, responsive 1→2→3 col grid
- Voter page: participation progress bar vs quorum, time remaining, creator, scope badges
- Admin detail: background shown as collapsible <details> panel

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 11:17:41 +02:00
g-butandClaude Sonnet 4.6 c68c8cea0b fix: admin UX/UI overhaul — wrappers, dialogs, toasts, green CTAs, server search
Round 1 (critical/high):
- donations, protocols: wrap in AdminPageWrapper; fix protocol pagination with step filter
- settings: convert plain div section cards to <Link> components
- content: add AdminPageWrapper, remove dead "Neuer Inhalt" button
- workshops: replace confirm() with ConfirmDialog (warning variant + loading state);
  show inline validation error when rejection reason is empty
- locations: add AdminPageWrapper + ConfirmDialog (danger), loading states on actions
- reviews: add AdminPageWrapper; extract inline moderation into Modal;
  add visible text labels to flag buttons

Round 2 (medium/polish):
- workshops API: add server-side ilike search on title (q param)
- workshops page: wire search term to API, remove client-side filter
- AdminLayoutClient: install sonner Toaster (bottom-right, richColors, closeButton);
  fix sidebar collapse button visibility (hidden lg:flex, not xl:hidden)
- reviews: replace successMessage state with toast.success()
- protocols, tasks, locations: standardize primary CTA to green-600
- services: remove duplicate "Dienstleistung erstellen" CTA from Quick Actions
- tasks: fix icon colors text-red-300→text-red-400, text-gray-300→text-gray-400
- users, team: fix empty-state icon text-gray-300→text-gray-400

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-14 10:50:04 +02:00