wohnungen: drive list info from LLM JSON, tidy header

- Each row's info line now uses the enrichment JSON (rooms, size_sqm,
  rent_total/rent_cold, wbs_required/wbs_type). When enrichment is still
  running we show "Infos werden abgerufen…", on failure "Fehler beim
  Abrufen der Infos"; the scraper fields are no longer rendered in the list
- Move the admin backfill button to the header row as a compact
  "Anreichern (N)" that only appears when there's pending/failed work,
  so it's findable right next to "X gefunden"
- Countdown wobble: new .countdown class forces tabular-nums + 4.2em
  min-width, so neighbours stop shifting every second
- Dot spacing: pull "·" out into its own .sep span so flex gap applies
  on both sides symmetrically

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
EiSiMo 2026-04-21 14:57:11 +02:00
parent eb66284172
commit e0ac869425
4 changed files with 65 additions and 19 deletions

View file

@ -479,6 +479,23 @@ def flats_needing_enrichment(limit: int = 100) -> list[sqlite3.Row]:
).fetchall())
def enrichment_counts() -> dict:
row = _conn.execute(
"""SELECT
COUNT(*) AS total,
SUM(CASE WHEN enrichment_status = 'ok' THEN 1 ELSE 0 END) AS ok,
SUM(CASE WHEN enrichment_status = 'pending' THEN 1 ELSE 0 END) AS pending,
SUM(CASE WHEN enrichment_status = 'failed' THEN 1 ELSE 0 END) AS failed
FROM flats"""
).fetchone()
return {
"total": int(row["total"] or 0),
"ok": int(row["ok"] or 0),
"pending": int(row["pending"] or 0),
"failed": int(row["failed"] or 0),
}
# ---------------------------------------------------------------------------
# Applications
# ---------------------------------------------------------------------------