mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-10-21 07:41:28 +02:00
The first cut was rejected outright, and fairly. Four things were wrong. The running head and foot sat 1.4mm from the physical sheet: vertical-align:top on the @top-* margin boxes pins text to the paper, not to the text block. They now hang off the block with RUNNING_CLEAR of air on the inside edge. Severity was five saturated hues, restated by every theme and slightly different in each. It is now one reserved ramp defined once, light rather than heavy, with lightness carrying the rank so it survives deuteranopia; it clears the CVD and normal-vision floors all-pairs on white paper. A dark page picks up the dark restep automatically, so a dark theme carries no severity block at all. shared/utils/color.py converts through OKLCH, so a theme names one colour and the document derives the wash a badge sits on and the ink that sits on the wash — every badge clears 7:1, including one from a theme a user uploads. Badges are pills, never saturated slabs, and never inline-flex, which WeasyPrint lays out as a block so the badge stretched its whole column. Mono is for machine values now — hostnames, evidence, hashes. Labels, table headers and the running head are the body face, and uppercase_labels finally does something: the CSS had hard-coded uppercase and ignored the token. Prose fills the text column, justified and hyphenated, instead of sitting in a narrow measure with dead space beside it. Chapters still start a new page, but a document may now ask them to run on, and the page estimate knows the difference: 52 pages against 52, and 48 against 48. Two defects the redesign surfaced: the risk summary never passed the variables its own template reads, so that severity table had always printed empty; and the standalone HTML export had no margins at all, because @page geometry does not apply on screen. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AW5pitnosX8LEFEYxH8gFS
46 lines
2.3 KiB
HTML
46 lines
2.3 KiB
HTML
{% import 'macros.html' as m with context %}
|
|
{% if first_run %}
|
|
<div class="callout callout--quiet">This is the first run recorded for {{ ctx.data.subject }}. Nothing is reported as new, because there is nothing to compare against. The next run will report its difference from this one.</div>
|
|
{% else %}
|
|
<p class="block muted small">Compared against the run of {{ previous.completed_at|date('%d %b %Y') }}. A dimension the previous run did not produce is left out, because a change cannot be measured against an absence.</p>
|
|
|
|
<table class="table block">
|
|
<thead><tr><th>Dimension</th><th class="num" style="width:24mm">Appeared</th><th class="num" style="width:26mm">Went away</th></tr></thead>
|
|
<tbody>
|
|
{% for row in rows %}
|
|
<tr><td>{{ row.label }}</td><td class="num">{{ row.added|num }}</td><td class="num">{{ row.gone|num }}</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
{% for row in rows %}
|
|
{% if row.added_sample or row.gone_sample %}
|
|
<div class="sub">
|
|
<div class="label block">{{ row.label }}</div>
|
|
{% if row.added_sample %}
|
|
<p class="small"><strong>New</strong></p>
|
|
<div class="chips block">{% for item in row.added_sample %}<span class="chip">{{ item|clip(48) }}</span>{% endfor %}{% if row.added > row.added_sample|length %}<span class="chip chip--solid">+{{ (row.added - row.added_sample|length)|num }} more</span>{% endif %}</div>
|
|
{% endif %}
|
|
{% if row.gone_sample %}
|
|
<p class="small"><strong>No longer present</strong></p>
|
|
<div class="chips">{% for item in row.gone_sample %}<span class="chip">{{ item|clip(48) }}</span>{% endfor %}{% if row.gone > row.gone_sample|length %}<span class="chip chip--solid">+{{ (row.gone - row.gone_sample|length)|num }} more</span>{% endif %}</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
{% if new_findings %}
|
|
<div class="sub">
|
|
<div class="label block">Findings this run reported first</div>
|
|
<table class="table table--fixed">
|
|
<thead><tr><th style="width:18mm">Severity</th><th>Weakness</th><th style="width:56mm">Location</th></tr></thead>
|
|
<tbody>
|
|
{% for finding in new_findings %}
|
|
<tr><td>{{ m.sev(finding.severity) }}</td><td class="wrap">{{ finding.name }}</td><td class="micro mono-break wrap">{{ finding.matched_at|clip(70) }}</td></tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|