Work-order codes no longer overlap (#42), Materials before Heat map (#44), 60 min idle for Admin and Clerical (#45)
ci / frontend (pull_request) Successful in 54s
ci / server (pull_request) Failing after 12m12s
ci / image (pull_request) Skipped
ci / e2e (pull_request) Skipped

- Traveler: each work-order line shrinks, then clips, to fit its own box; 18 pt gap between boxes
- Work orders tab: card text wraps inside the card, smaller work order, wider cards
- Packet tabs: Materials before Heat map
- Sessions: SESSION_DESK_MINUTES (60) for Admin and Clerical lock and sign-out; /me answers
  lock_minutes and the browser's idle lock follows it

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-21 13:16:26 -06:00
co-authored by Claude Opus 5.5
parent b0f6a09173
commit de5b361d85
14 changed files with 119 additions and 36 deletions
+20 -2
View File
@@ -30,7 +30,7 @@ def test_token_is_stored_only_as_hmac(pg_client: TestClient, pg_settings: Settin
def test_idle_lock_after_lock_minutes(pg_client: TestClient, pg_settings: Settings) -> None:
sign_in(pg_client, "clerk.clara")
sign_in(pg_client, "wh.wade")
_age(pg_settings, "UPDATE sessions SET last_seen_at = now() - interval '4 minutes'")
r = pg_client.get("/api/account")
assert r.status_code == 423 and r.json()["code"] == "locked"
@@ -60,7 +60,7 @@ def test_hidden_tab_locks_only_after_a_minute(pg_client: TestClient, pg_settings
def test_idle_signout_after_idle_minutes(pg_client: TestClient, pg_settings: Settings) -> None:
sign_in(pg_client, "clerk.clara")
sign_in(pg_client, "wh.wade")
_age(pg_settings, "UPDATE sessions SET last_seen_at = now() - interval '16 minutes'")
r = pg_client.get("/api/auth/me")
assert r.status_code == 401 and r.json()["code"] == "session_expired"
@@ -71,6 +71,24 @@ def test_idle_signout_after_idle_minutes(pg_client: TestClient, pg_settings: Set
assert ended == {"reason": "idle"}
def test_admin_and_clerical_get_desk_minutes(pg_client: TestClient, pg_settings: Settings) -> None:
# Issue #45: Admin and Clerical lock and sign out after 60 idle minutes, not 3 and 15
for login in ("clerk.clara", "clerk.leo", "admin.ann", "multi.mia"):
pg_client.cookies.clear()
sign_in(pg_client, login)
assert pg_client.get("/api/auth/me").json()["session"]["lock_minutes"] == 60
_age(pg_settings, "UPDATE sessions SET last_seen_at = now() - interval '59 minutes' WHERE revoked_at IS NULL")
assert pg_client.get("/api/account").status_code == 200, login
_age(pg_settings, "UPDATE sessions SET last_seen_at = now() - interval '61 minutes' WHERE revoked_at IS NULL")
r = pg_client.get("/api/auth/me")
assert r.status_code == 401 and r.json()["code"] == "session_expired", login
def test_shop_screens_keep_short_minutes(pg_client: TestClient, pg_settings: Settings) -> None:
sign_in(pg_client, "weld.andy")
assert pg_client.get("/api/auth/me").json()["session"]["lock_minutes"] == 3
def test_locked_session_does_not_stay_alive_by_polling(pg_client: TestClient, pg_settings: Settings) -> None:
sign_in(pg_client, "clerk.clara")
pg_client.post("/api/auth/lock")
+19
View File
@@ -0,0 +1,19 @@
"""Work-order text on the traveler stays inside its own box (issue #42). No database needed."""
from __future__ import annotations
def test_work_order_text_fits_its_box() -> None:
# Issue #42: long work-order text shrinks, then clips, instead of running over the next QR code
from reportlab.pdfbase.pdfmetrics import stringWidth
from packetstation.pdf.doc import font_of
from packetstation.pdf.traveler import fit_line
assert fit_line("L662001", 145, 12, bold=True) == ("L662001", 12)
for s, size, bold in [
("L662001/1-SUB-99999-EXTRA-LONG", 12, True),
("Lot 12 Seq 40 WELD-STALL-HYDROTEST-LONG-NAME", 8.5, False),
]:
text, z = fit_line(s, 145, size, bold=bold)
assert size * 0.7 <= z <= size and stringWidth(text, font_of(bold), z) <= 145