- 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]>
20 lines
808 B
Python
20 lines
808 B
Python
"""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
|