feat(web): dashboard ergonomic cu tab-uri, stepper import si microcopy uman (3.4)

Reorganizeaza interfata web pe trei principii, fara a atinge backend-ul de
trimitere (worker, mapping, idempotency, masina de stari neatinse):

- US-001 app/web/labels.py: modul pur stari tehnice -> text uman + clasa CSS
- US-002 bara status /_fragments/status: microcopy uman, defalcare blocate, scoped cont
- US-003 shell 6 tab-uri (Acasa/Import/Coada/Mapari/Cont/Nomenclator): deep-link
  ?tab=, panou activ randat server-side, fragmente inactive lazy, ARIA real
- US-004 stepper import 4 pasi (pur vizual; hx-target + csrf pastrate)
- US-005 Acasa onboarding checklist auto-bifat + colaps + empty states prietenoase

Reparat in cursul VERIFY/CLOSE: izolare teste (reset ratelimit._hits in fixturi),
regresie avertisment "cont in asteptare de activare" (re-introdus in bara status),
culori hardcodate -> variabile paleta. 434 teste pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-06-18 22:26:10 +00:00
parent ccd26115f8
commit 4a1d28749a
22 changed files with 1889 additions and 96 deletions

View File

@@ -47,9 +47,17 @@ def _body(**over):
def test_dashboard_renders_with_rar_state(client):
r = client.get("/")
assert r.status_code == 200
# worker neavand heartbeat -> stare RAR necunoscuta (worker oprit)
assert "worker oprit" in r.text
assert "Nomenclator RAR" in r.text
# Dupa US-003 bara de status e incarcata via HTMX (hx-trigger=load, every 15s)
assert "/_fragments/status" in r.text, "Dashboard-ul trebuie sa referenceze fragmentul de status"
# Fragmentul de status contine starea worker (eticheta umana, nu "worker oprit" brut)
rs = client.get("/_fragments/status")
assert rs.status_code == 200
# eticheta_worker(False) => "Trimitere automata: oprita" → fragmentul afiseaza "oprita"
assert "oprita" in rs.text or "Trimitere automata" in rs.text
# Tab-ul Nomenclator e accesat via /_fragments/nomenclator
rn = client.get("/_fragments/nomenclator")
assert rn.status_code == 200
assert "Nomenclator" in rn.text or "Cod" in rn.text or "OE-1" in rn.text
def test_nomenclator_fragment_lists_seed(client):
@@ -63,7 +71,8 @@ def test_nomenclator_fragment_lists_seed(client):
def test_submissions_fragment_empty_state(client):
r = client.get("/_fragments/submissions")
assert r.status_code == 200
assert "Coada e goala" in r.text
# US-005: empty state prietenos cu indemn la Import (nu mesajul tehnic vechi)
assert "Nicio trimitere" in r.text or "incepe cu Import" in r.text or "?tab=import" in r.text
# --------------------------------------------------------------------------- #