ChristopherJKoen commited on
Commit
e722874
·
1 Parent(s): cf17e86

Make category/priority badges adaptive

Browse files

Replace qualitative category labels with percentage-based labels (e.g. 100% Original Strength, 95-100% Original Strength, 75-95%, 50-75%, <50%). Replace the fixed badge width with dynamic sizing: measure text widths via pdf.stringWidth (Helvetica-Bold, size 10), add padding, clamp to min/max widths, and compute badge_gap so both badges stay centered. If badges overflow the content area, shrink the gap or scale badge widths to fit. Update label positions and roundedRect draws to use the computed cat_w/pr_w values and adjust minor layout constants for improved responsiveness and readability.

1 file changed +40 -15
server/app/services/pdf_reportlab.py+40-15