feat(ux): import compact + preview format Trimiteri + navigatie + scoatere auto_send (5.11)

8 stories TDD (echipa Sonnet, lead orchestreaza). US-001 scoate hold-ul auto_send din mapare
(has_no_auto_send->False, simbol pastrat; cod rezolvat->queued). US-002 scoate bifa auto_send
din UI. US-003 preview pas 3 in format .tabel-trimiteri (STARI_PREVIEW + nota_umana_preview,
fara repr Python; view-model prez). US-004 filtre layout/stil ca referinta + buton Custom.
US-005 navigatie Trimiteri/Mapari sub contoare pe toate paginile. US-006 import <details> nativ
colapsabil. US-007 post-commit reveal (OOB _coada/_status + HX-Trigger). US-008 auto-refresh
dupa actiuni (nudge eliminat).

VERIFY context curat PASS (8/8). /code-review high: 3 buguri reparate (tab nav la self-refresh,
pill Custom valori stale, nota_umana_preview precedenta needs_mapping). 934 passed, 1 skipped.
Backend trimitere + schema NEATINSE.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-06-26 15:16:28 +00:00
parent 412102b9b1
commit 283299ff20
34 changed files with 3079 additions and 389 deletions

View File

@@ -1,11 +1,8 @@
"""Teste US-007 (PRD 3.6): bifa "auto-send" devine un comutator cu doua stari,
etichetat pe COADA (nu pe trimitere).
"""Teste US-007 (PRD 3.6) actualizate dupa US-002 (PRD 5.11).
Framing decis la poarta autoplan (UC-A): "Pune automat in coada" / "Tine pentru
verificare". NU "Automat/Manual" (risc de send-safety peste declaratii ireversibile).
`name="auto_send"` pastrat cu semantica de prezenta (checkbox value="true"):
bifat -> auto_send True, nebifat -> absent -> False. Zero atingere backend, identic
cu ambele parsere existente (`Form(bool)` la /mapari si `bool(form.get())` la preview).
US-002: macro autosend_toggle neutralizat (intoarce string gol).
Checkbox-ul name=auto_send a fost scos din UI. Coloanele DB raman.
Testele de UI verifica ABSENTA toggle-ului; testele de backend (stocare DB) raman.
"""
from __future__ import annotations
@@ -94,38 +91,34 @@ def client(monkeypatch):
def _macro_html(checked: bool = True, form_id: str = "") -> str:
"""Randeaza direct macro-ul comutatorului, izolat de restul paginii."""
"""Randeaza direct macro-ul, izolat de restul paginii."""
from app.web.routes import templates
mod = templates.env.get_template("_macros.html").make_module({})
return str(mod.autosend_toggle(form_id=form_id, checked=checked))
# --- markup / copy ---
# --- markup: macro neutralizat dupa US-002 ---
def test_comutator_coada_prezent():
"""5.5 (supersede framing 3.6): comutator etichetat Auto/Manual, compact.
Send-safety pastrata prin tooltip/Ajutor (Manual = tine pentru verificare; nimic nu
pleaca la RAR pana confirmi). Semantica de prezenta name=auto_send nealterata."""
"""US-002: macro autosend_toggle neutralizat -> output gol (fara checkbox)."""
html = _macro_html()
assert "name=\"auto_send\"" in html and 'value="true"' in html
assert "Auto" in html and "Manual" in html, "ambele stari etichetate"
assert "verificare" in html, "sensul de verificare manuala trebuie pastrat (tooltip/ajutor)"
assert "trimite" not in html.lower(), "fara cuvantul 'trimite' izolat in eticheta"
assert "auto-send" not in html, "jargonul 'auto-send' trebuie inlocuit"
assert 'name="auto_send"' not in html, "US-002: checkbox auto_send scos din UI"
assert html.strip() == "", f"macro neutralizat trebuie sa intoarca string gol, got: {html!r}"
def test_eticheta_scoped_pe_operatie():
"""Microcopy scoped pe operatie (NU global)."""
"""US-002: macro neutralizat -> nicio eticheta scoped."""
html = _macro_html()
assert "aceasta operatie" in html
assert "aceasta operatie" not in html
assert html.strip() == ""
def test_default_pune_automat():
"""Default = "Pune automat in coada" (mirror la checkbox-ul `checked` de azi)."""
"""US-002: macro neutralizat intoarce gol indiferent de parametrul checked."""
html_default = _macro_html(checked=True)
assert "checked" in html_default
assert html_default.strip() == ""
html_off = _macro_html(checked=False)
assert "checked" not in html_off, "starea stocata False nu trebuie bifata (H4)"
assert html_off.strip() == ""
# --- comportament (zero atingere backend) ---
@@ -161,7 +154,7 @@ def test_tine_pentru_verificare_mapeaza_auto_send_false(client):
# --- prezent in AMBELE locuri (mapari tab + panou preview) ---
def test_comutator_in_tab_mapari(client):
"""Tabul Mapari (de-rezolvat) foloseste comutatorul de coada, nu jargonul vechi."""
"""US-002: tabul Mapari nu mai contine checkbox auto_send (macro neutralizat)."""
from app.db import get_connection
import json
acct = _create_account_user("tm@test.com")
@@ -179,13 +172,12 @@ def test_comutator_in_tab_mapari(client):
_login(client, "tm@test.com")
resp = client.get("/?tab=mapari")
assert resp.status_code == 200
# 5.5: comutatorul compact Auto/Manual e prezent in tabul Mapari
assert 'name="auto_send"' in resp.text
assert "Manual" in resp.text and "Auto" in resp.text
assert 'name="auto_send"' not in resp.text, "US-002: checkbox auto_send scos din UI"
assert "In coada" not in resp.text, "US-002: coloana 'In coada' scoasa"
def test_comutator_in_panou_preview(client):
"""Panoul de mapare din preview are si el comutatorul + caption (azi lipsea caption)."""
"""US-002: panoul de mapare din preview nu mai contine checkbox auto_send."""
_create_account_user("pp@test.com")
_seed_nomenclator("R-FRANE")
_login(client, "pp@test.com")
@@ -211,6 +203,5 @@ def test_comutator_in_panou_preview(client):
})
assert r.status_code == 200
assert "OP-NEMAPAT" in r.text, "operatia nemapata trebuie sa apara in panoul de mapare"
# 5.5: comutatorul compact Auto/Manual e prezent si in panoul de mapare din preview
assert 'name="auto_send"' in r.text
assert "Manual" in r.text and "Auto" in r.text
assert 'name="auto_send"' not in r.text, "US-002: checkbox auto_send scos din preview"
assert "In coada automat" not in r.text, "US-002: eticheta 'In coada automat' scoasa"