lazyflat/web/templates
EiSiMo eb66284172 enrichment: Haiku flat details + image gallery on expand
apply service
- POST /internal/fetch-listing: headless Playwright fetch of a listing URL,
  returns {html, image_urls[], final_url}. Uses the same browser
  fingerprint/profile as the apply run so bot guards don't kick in

web service
- New enrichment pipeline (web/enrichment.py):
  /internal/flats → upsert → kick() enrichment in a background thread
    1. POST /internal/fetch-listing on apply
    2. llm.extract_flat_details(html, url) — Haiku tool-use call returns
       structured JSON (address, rooms, rent, description, pros/cons, etc.)
    3. Download each image directly to /data/flats/<slug>/NN.<ext>
    4. Persist enrichment_json + image_count + enrichment_status on the flat
- llm.py: minimal Anthropic /v1/messages wrapper, no SDK
- DB migration v5 adds enrichment_json/_status/_updated_at + image_count
- Admin "Altbestand anreichern" button (POST /actions/enrich-all) queues
  backfill for all pending/failed rows; runs in a detached task
- GET /partials/wohnung/<id> renders _wohnung_detail.html
- GET /flat-images/<slug>/<n> serves the downloaded image

UI
- Chevron on each list row toggles an inline detail pane (HTMX fetch on
  first open, hx-preserve keeps it open across the 3–30 s polls)
- CSS .flat-gallery normalises image tiles to a 4/3 aspect with object-fit:
  cover so different source sizes align cleanly
- "analysiert…" / "?" chips on the list reflect enrichment_status

Config
- ANTHROPIC_API_KEY + ANTHROPIC_MODEL wired into docker-compose's web
  service (default model: claude-haiku-4-5-20251001)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 14:46:12 +02:00
..
_layout.html UX: alarm-status, ablehnen-button, annika-footer, map polish 2026-04-21 12:09:44 +02:00
_settings_account.html multi-user: users, per-user profiles/filters/notifications, tab UI, apply forensics 2026-04-21 10:52:41 +02:00
_settings_filter.html ui: WBS dropdown, decimal-room filters, segmented toggle, 'Final absenden' 2026-04-21 11:50:50 +02:00
_settings_notifications.html guard double-apply, hide error msg, wohnungen polish, bitwarden block 2026-04-21 14:20:31 +02:00
_settings_profil.html guard double-apply, hide error msg, wohnungen polish, bitwarden block 2026-04-21 14:20:31 +02:00
_settings_users.html guard double-apply, hide error msg, wohnungen polish, bitwarden block 2026-04-21 14:20:31 +02:00
_wohnung_detail.html enrichment: Haiku flat details + image gallery on expand 2026-04-21 14:46:12 +02:00
_wohnungen_body.html enrichment: Haiku flat details + image gallery on expand 2026-04-21 14:46:12 +02:00
base.html enrichment: Haiku flat details + image gallery on expand 2026-04-21 14:46:12 +02:00
bewerbung_detail.html settings: relabel dry-run, harder PM block, rework users page 2026-04-21 14:11:50 +02:00
bewerbungen.html settings: relabel dry-run, harder PM block, rework users page 2026-04-21 14:11:50 +02:00
einstellungen.html ui: slim 4-card strip, admin-only system log, HTMX apply, title cleanup 2026-04-21 11:25:59 +02:00
login.html ui: slim 4-card strip, admin-only system log, HTMX apply, title cleanup 2026-04-21 11:25:59 +02:00
logs.html per-step screenshot + html snapshots, matches-only list, full German UI, CSV export 2026-04-21 11:40:12 +02:00
wohnungen.html ui: slim 4-card strip, admin-only system log, HTMX apply, title cleanup 2026-04-21 11:25:59 +02:00