Let a theme set the job-search report, and remember the choice (#340) #1082

Merged
tiagoagueda merged 1 commit from 340-report-themes into main 2026-10-29 09:51:05 +00:00
Owner

The report was drawn from one fixed template, so a plugin had no way to
offer a report theme. It is a theme kind now, ThemeKind.REPORT, set on the
report's document kind, and both the PDF the address hands back and the
one the errand files are drawn through themes.template_for.

Today's print template became documents/themes/base_report.html with
plain's stylesheet in plain/report.html, so somebody who never picks a
theme gets the report they always had; classic sets it in its serif. A
report theme is handed plain values built by reports.as_context (the
period, the cadence, what happened, the evidence rows without referrer or
agency, the sources, the industries, the person, the office and the
adviser) and never a model, plus document_language, document_direction,
document_title and csp_nonce. Industries are in the context; neither
shipped theme prints them. The CSV is unchanged.

The report's page offers the theme and the language beside the button.
The theme is remembered per person in the new Profile.document_themes
(JSON per kind; Profile.theme is the light/dark setting), which #341 and
#342 can share; a name nothing answers to draws in plain. The language
starts where a CV's does (profile, then instance) and the whole report,
labels included, is built inside it, by the page and the worker alike.
A GET may ask for either in its query and remembers nothing.

RenderedDocument gains a theme column: the theme that drew a filed report,
CV or letter. The account archive moves to format 77 and carries both
(document_themes in PROFILE_FIELDS, theme in SENT_FIELDS), each read back
as a claim.

Closes #340

Notes for review

  • Report themes: ThemeKind.REPORT. Today's report becomes the built-in plain report theme (the look is unchanged except overflow-wrap: anywhere), and classic gets one in the classic serif.
    • The view and the report_pdf errand both draw through reports.draw(), with a plain-values context (reports.as_context).
  • The choice:
    • The report form offers a theme and a report language.
    • The theme is remembered per person per kind, in Profile.document_themes (JSON, also for #341 and #342). The language isn't remembered.
    • An offered-only check applies: a posted theme that isn't offered is ignored.
  • Filed documents record their theme (RenderedDocument.theme), for CVs and letters too.
  • Numbering collisions to settle at landing:
    • Archive format 77 is also claimed by #878 (PR #1061) and #331 (PR #1080).
    • accounts 0049 is shared with #878.
    • Also new: documents 0031_rendereddocument_theme.
  • Not run: the browser accessibility walk on the report page, which has two new labelled selects. CI runs it.

🤖 Generated with Claude Code

The report was drawn from one fixed template, so a plugin had no way to offer a report theme. It is a theme kind now, ThemeKind.REPORT, set on the report's document kind, and both the PDF the address hands back and the one the errand files are drawn through themes.template_for. Today's print template became documents/themes/base_report.html with plain's stylesheet in plain/report.html, so somebody who never picks a theme gets the report they always had; classic sets it in its serif. A report theme is handed plain values built by reports.as_context (the period, the cadence, what happened, the evidence rows without referrer or agency, the sources, the industries, the person, the office and the adviser) and never a model, plus document_language, document_direction, document_title and csp_nonce. Industries are in the context; neither shipped theme prints them. The CSV is unchanged. The report's page offers the theme and the language beside the button. The theme is remembered per person in the new Profile.document_themes (JSON per kind; Profile.theme is the light/dark setting), which #341 and #342 can share; a name nothing answers to draws in plain. The language starts where a CV's does (profile, then instance) and the whole report, labels included, is built inside it, by the page and the worker alike. A GET may ask for either in its query and remembers nothing. RenderedDocument gains a theme column: the theme that drew a filed report, CV or letter. The account archive moves to format 77 and carries both (document_themes in PROFILE_FIELDS, theme in SENT_FIELDS), each read back as a claim. Closes #340 ## Notes for review - **Report themes:** `ThemeKind.REPORT`. Today's report becomes the built-in `plain` report theme (the look is unchanged except `overflow-wrap: anywhere`), and `classic` gets one in the classic serif. - The view and the `report_pdf` errand both draw through `reports.draw()`, with a plain-values context (`reports.as_context`). - **The choice:** - The report form offers a theme and a report language. - The theme is remembered per person per kind, in `Profile.document_themes` (JSON, also for #341 and #342). The language isn't remembered. - An offered-only check applies: a posted theme that isn't offered is ignored. - **Filed documents** record their theme (`RenderedDocument.theme`), for CVs and letters too. - **Numbering collisions to settle at landing:** - Archive format 77 is also claimed by #878 (PR #1061) and #331 (PR #1080). - `accounts 0049` is shared with #878. - Also new: `documents 0031_rendereddocument_theme`. - **Not run:** the browser accessibility walk on the report page, which has two new labelled selects. CI runs it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Let a theme set the job-search report, and remember the choice (#340)
All checks were successful
CI / Unit tests and coverage (Python 3.14) (push) Successful in 13m17s
CI / Checks: lint, migrations, catalogues, settings, built files (push) Successful in 3m12s
CI / Database tests on PostgreSQL (push) Successful in 4m13s
CI / Security audit (push) Successful in 1m10s
CI / Browser tests (Chromium) (push) Successful in 32m17s
Every Python / Unit tests (Python 3.12) (push) Successful in 13m20s
Every Python / Unit tests (Python 3.13) (push) Successful in 13m15s
CI / Security audit (pull_request) Successful in 1m6s
CI / Unit tests and coverage (Python 3.14) (pull_request) Successful in 13m3s
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Successful in 3m9s
CI / Database tests on PostgreSQL (pull_request) Successful in 4m15s
CI / Browser tests (Chromium) (pull_request) Successful in 31m46s
6153ec1b7c
The report was drawn from one fixed template, so a plugin had no way to
offer a report theme. It is a theme kind now, ThemeKind.REPORT, set on the
report's document kind, and both the PDF the address hands back and the
one the errand files are drawn through themes.template_for.

Today's print template became documents/themes/base_report.html with
plain's stylesheet in plain/report.html, so somebody who never picks a
theme gets the report they always had; classic sets it in its serif. A
report theme is handed plain values built by reports.as_context (the
period, the cadence, what happened, the evidence rows without referrer or
agency, the sources, the industries, the person, the office and the
adviser) and never a model, plus document_language, document_direction,
document_title and csp_nonce. Industries are in the context; neither
shipped theme prints them. The CSV is unchanged.

The report's page offers the theme and the language beside the button.
The theme is remembered per person in the new Profile.document_themes
(JSON per kind; Profile.theme is the light/dark setting), which #341 and
#342 can share; a name nothing answers to draws in plain. The language
starts where a CV's does (profile, then instance) and the whole report,
labels included, is built inside it, by the page and the worker alike.
A GET may ask for either in its query and remembers nothing.

RenderedDocument gains a theme column: the theme that drew a filed report,
CV or letter. The account archive moves to format 77 and carries both
(document_themes in PROFILE_FIELDS, theme in SENT_FIELDS), each read back
as a claim.

Closes #340

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tiagoagueda force-pushed 340-report-themes from 6153ec1b7c
All checks were successful
CI / Unit tests and coverage (Python 3.14) (push) Successful in 13m17s
CI / Checks: lint, migrations, catalogues, settings, built files (push) Successful in 3m12s
CI / Database tests on PostgreSQL (push) Successful in 4m13s
CI / Security audit (push) Successful in 1m10s
CI / Browser tests (Chromium) (push) Successful in 32m17s
Every Python / Unit tests (Python 3.12) (push) Successful in 13m20s
Every Python / Unit tests (Python 3.13) (push) Successful in 13m15s
CI / Security audit (pull_request) Successful in 1m6s
CI / Unit tests and coverage (Python 3.14) (pull_request) Successful in 13m3s
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Successful in 3m9s
CI / Database tests on PostgreSQL (pull_request) Successful in 4m15s
CI / Browser tests (Chromium) (pull_request) Successful in 31m46s
to 5f2adcb0ee
Some checks failed
CI / Browser tests (Chromium) (pull_request) Has been cancelled
CI / Unit tests and coverage (Python 3.14) (pull_request) Has been cancelled
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Has been cancelled
CI / Database tests on PostgreSQL (pull_request) Has been cancelled
CI / Security audit (pull_request) Has been cancelled
2026-10-29 09:46:45 +00:00
Compare
tiagoagueda force-pushed 340-report-themes from 5f2adcb0ee
Some checks failed
CI / Browser tests (Chromium) (pull_request) Has been cancelled
CI / Unit tests and coverage (Python 3.14) (pull_request) Has been cancelled
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Has been cancelled
CI / Database tests on PostgreSQL (pull_request) Has been cancelled
CI / Security audit (pull_request) Has been cancelled
to 696189096e
Some checks failed
CI / Unit tests and coverage (Python 3.14) (pull_request) Successful in 13m28s
CI / Checks: lint, migrations, catalogues, settings, built files (pull_request) Successful in 3m27s
CI / Database tests on PostgreSQL (pull_request) Successful in 4m28s
CI / Security audit (pull_request) Successful in 50s
CI / Browser tests (Chromium) (pull_request) Failing after 34m0s
2026-10-29 09:50:56 +00:00
Compare
tiagoagueda deleted branch 340-report-themes 2026-10-29 09:51:08 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo!1082
No description provided.