The compiled stylesheet is three utilities behind, and the report page is missing two #164
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Postulo/postulo#164
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Observation
The
stylesjob rebuilds the stylesheet and fails on the diff:What happened
All three come from the report templates added in #56 (
b2afbfb5). The stylesheet was lastrebuilt in
078be627(#125), and nothing between them rebuilt it. Reproduced locally bybuilding to a scratch file: exactly these three, nothing else.
mt-5—report.html, the Show this period button, which relies on it to line up withthe labelled controls beside it.
lg:grid-cols-2—report.html, the two tallies (Where they were found, What kind ofemployer), which are meant to sit side by side on a wide screen.
border-collapse— not a class anybody wrote. It is the declarationborder-collapse: collapse;inside the inline<style>ofreport_print.html, whichTailwind's scanner reads as a candidate utility. It is harmless: the PDF carries its own
stylesheet and never loads
app.css.So this is a visible defect, not only a red job. On any instance running 0.3.0 as it stands,
the report's button sits out of line and the two tallies stack on a wide screen, because those
classes do nothing. It is the failure #125's
test_the_spans_are_written_out_rather_than_assemblednames — a class it never sees is a classit never compiles, silently — but the other way round: the class was seen, and the compiled file
was never regenerated.
Why it passed before pushing
The check exists only in CI. The local definition of done in
CLAUDE.mdis ruff, pytest, thebrowser suite and the catalogue checks.
npm run build:cssis mentioned ("the compiled CSS iscommitted") but is not on that list. No pre-commit hook or test compares the committed file with
a fresh build, and the #125 test checks three particular spans and nothing else.
What fixing it is
npm run build:cssand commit. Then close the gap that let this through, which is the partworth deciding:
CLAUDE.md— add the build to Before saying a change is done. Cheap, and relies onmemory.
files:to templates,assets/andstatic/js, whichrebuilds and fails on a diff. It would have caught this, but it needs Node on every
contributor's machine — the thing CI installs in a container precisely so nobody else has to.
npxis available and skips otherwise. It catches thisfor anybody who runs the suite.
Probably the first, plus one of the other two.
Worth being careful about
border-collapsecomes back on every build for as long as the print template's inline CSScontains that phrase. That is the scanner behaving correctly rather than a bug, and worth knowing
so nobody "fixes" it by editing
app.cssby hand. If the noise matters, Tailwind v4 (3.3 isinstalled) can exclude paths from the scan with
@source not. The templates the stylesheet neverstyles are exactly the PDF ones —
documents/themes/*andreport_print.html— and leaving themout would also stop their CSS turning into utilities.
Classification
Bug. Blocks CI, and so the 0.3.0 release.
Done in
2acc2ee4. Thestylesjob has passed on every run that reached it since, 271 to 276.What was wrong
The report arrived without a stylesheet rebuild, so its Show this period button sat out of line and its two tallies stacked on a wide screen:
mt-5andlg:grid-cols-2compiled to nothing. The rebuild puts both back.The phantom third class led to the real problem: what compiled depended on more than the interface. There were three leaks.
@import "tailwindcss" source(none)and one@source "../../src/postulo"fix that.border-collapseappeared when I built to a scratch file. It is fixed with@source not "../../src/postulo/static/css".border-collapse: collapse;among it. They never load this stylesheet, so they are out of the scan, as you suggested (@source notfordocuments/themesandreport_print.html).With the scan fixed, 24 utilities nothing used have gone, every physical one among them. Each was checked unused under
src/postulobefore it went. A build is now byte-identical wherever it is written.Your three options for closing the gap
CLAUDE.md: done.npm run build:cssis on the checklist, andCONTRIBUTING.mdsays the suite catches a stale stylesheet oncenpm cihas run.tests/test_stylesheet.pyrebuilds into a temporary file and compares it with the committed one, using the CLInpm ciinstalls, never one fetched to run a test. It skips wherenode_modulesis absent, which includes CI's test job; thestylesjob covers it there. Two more tests there hold the scan to the interface and keep physical utilities out of the compiled file.Worth knowing
#165 changed the stylesheet three times after this. Each rebuild went through the new comparison, and CI's
stylesjob agreed with the result.