carlos / platform Public

console: keep the shared header unchanged; scope print hiding to the DPA record

The record page put class="no-print" on the shared console <header>, which
broke every test that reads the header markup. The header is back to
main's bytes. The record page's content now sits in a .dpa-record wrapper
and the print rule hides body:has(.dpa-record) > header, so only that page
prints without the header. The page's buttons keep .no-print. The
styleguide entry says so, and the demo claim page digests are retaken for
the CSS the branch adds to the chrome.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 47926fe7ab2dfd1d47197c498806aadad3729dd6 parent 661e91c
4 files changed, +28 −22
  • docs/console-styleguide.md +7 −4
  • internal/console/demo_claim_footer_test.go +12 −13
  • internal/console/templates/console_chrome.html +6 −3
  • internal/console/templates/dpa_record.html +3 −2

Intent

Human

<task-notification> <task-id>bqggkt32y</task-id> <tool-use-id>toolu_01PvpDqjFfze8Kv2HV2rwqi5</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/260ddc60-0dfc-4cf8-8857-7688d6275097/tasks/bqggkt32y.output</output-file> <status>completed</status> <summary>Background command "Wait for CI on the branch tip" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>abbb725d12a7c470e</task-id> <tool-use-id>toolu_01Bwiejvxeays5PASaDXiPXP</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/260ddc60-0dfc-4cf8-8857-7688d6275097/tasks/abbb725d12a7c470e.output</output-file> <status>completed</status> <summary>Agent "Fix CI failures on the branch" is waiting on its own background work</summary> <note>This agent stopped with background work of its own still running. It may resume on its own when that work completes or reports, and the same task-id notifies again if it does; the result below may be interim.</note> <result>I'll wait for the monitor notification.</result> <usage><subagent_tokens>109676</subagent_tokens><tool_uses>65</tool_uses><duration_ms>2476010</duration_ms></usage> </task-notification>

diff --git a/docs/console-styleguide.md b/docs/console-styleguide.md
index 858d66a18..64b7a3d95 100644
--- a/docs/console-styleguide.md
+++ b/docs/console-styleguide.md
@@ -343,12 +343,15 @@ setting is a settings row.
### Keeping chrome off the paper
A page meant to be printed (the data processing agreement record) hides
-what is not the document: the console header carries `no-print`, and so
-does any row of buttons or links on the page. The class changes nothing on
-screen; in print it removes the element.
+what is not the document. Its content sits in a `.dpa-record` wrapper, and
+while that wrapper is on the page, print drops the console header; the
+shared header markup does not change. Any row of buttons or links on the
+page carries `no-print`. Neither changes anything on screen.
```html
-<p class="no-print"><button type="button" onclick="window.print()">Print this record</button></p>
+<div class="dpa-record">
+ <p class="no-print"><button type="button" onclick="window.print()">Print this record</button></p>
+</div>
```
### Variable rows and the save bar
diff --git a/internal/console/demo_claim_footer_test.go b/internal/console/demo_claim_footer_test.go
index e7a35e790..12cb75d85 100644
--- a/internal/console/demo_claim_footer_test.go
+++ b/internal/console/demo_claim_footer_test.go
@@ -13,21 +13,20 @@ import (
// The digests are the claim page with no footer, retaken when the page itself,
// its script or the console chrome's CSS changes (the script tag carries the
-// asset hash; last: transfers in added input[type=password] and
-// input[type=tel] to the base field rule and .fields.transfer-code to the
-// chrome). With neither item configured (or both invalid) the page is these
-// exact bytes.
-const demoClaimFooterBaseStyleHash = "'sha256-7q3zbfiuptyu4TrodShxHjIorWpZHCDE1Ttybl1oBa0='"
+// asset hash; last: DPA acceptance added the .agreement and .dpa-form rules
+// and the record page's print rule to the chrome). With neither item
+// configured (or both invalid) the page is these exact bytes.
+const demoClaimFooterBaseStyleHash = "'sha256-nECyReA/YEKxWdPN2ahtGWIzuoFG22ItWsPKbWJJhoE='"
var demoClaimFooterBaseDigests = map[string]string{
- "template-zero": "6b418048663c40f00c749a0202a8e3752b6b0fcf820b606ca59fdf8e6253f430",
- "template-missing": "78679223a3719d79fd0cabc02539a65d47c64e3b149707937ac502461ffa614d",
- "template-error": "71583ddb81e8a03df60c344ce5173516af22e643eebd16b0cc3638416604854a",
- "template-claimed": "272af385f1a1d3b2acf7a870e4cca9babd1ef2925c05a80eb4cac0f11a92fd6a",
- "template-proof": "1d0628158086c3e7809e178abe6b0bb967f156941870df3857b4f3d072c9aee4",
- "error-page": "a604db285dc57fa714752792c1785d8bf15b74fefb7be04fef7df9defae8874c",
- "get-claim": "439774122013c11d9fabd124cba894656bcfbda1d64b0ddf319dc545e91f09a0",
- "get-kept": "1001a4196bda860b1dd5e31ae348593d1a0a1935676710197cdbc2c816c59329",
+ "template-zero": "57c8ddea0ffdfe22e4a892c83a25b6cb114a7832b62b4d1f74a1663fd5842bb8",
+ "template-missing": "3b9907da0d577be8bea7c92fbac5335d5b6262c15009d29204ad013882591571",
+ "template-error": "3a1585cf9176d270b121bb0607efcbd16f6358d068b1687317fe5ecacc85898c",
+ "template-claimed": "85c80eeccb1d5a9ac7d5a952967edbe196a939b6002b2c305b7656b008b4634f",
+ "template-proof": "24a4cf6eed5f9dd6af9c0f90abfbcda215ea7ae4276765b95c52810eb799c50c",
+ "error-page": "8e07cf83b5ed60c2925d429e59a4e438747087696fd4cb821902c54dcf538145",
+ "get-claim": "81101275122972f29568e3defd3bf1cbf517041e4c8aeb631f31ee005d11d0eb",
+ "get-kept": "7864711d49975f2bcc20b4a95d6c774eb3864eecb730b97b75fae9e80029ac3e",
}
const (
diff --git a/internal/console/templates/console_chrome.html b/internal/console/templates/console_chrome.html
index ea9418ea0..b6730b013 100644
--- a/internal/console/templates/console_chrome.html
+++ b/internal/console/templates/console_chrome.html
@@ -254,8 +254,11 @@
.dpa-form .error { margin: 0.3rem 0 0; }
.dpa-form button { margin: 1.25rem 0 0.5rem; }
/* Printing a record page (dpa_record.html): the console header and the
- page's buttons stay off the paper. */
- @media print { .no-print { display: none !important; } }
+ page's buttons stay off the paper. The header is hidden only on a page
+ holding a .dpa-record, so the shared header markup stays as it is. */
+ @media print {
+ .no-print, body:has(.dpa-record) > header { display: none !important; }
+ }
.settings-layout {
display: grid; grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr);
gap: 2.5rem; align-items: start;
@@ -1209,7 +1212,7 @@
}
{{end}}
-{{define "console_header"}}<header class="no-print">
+{{define "console_header"}}<header>
{{if .Account}}
<details class="switcher" id="switcher">
<summary>
diff --git a/internal/console/templates/dpa_record.html b/internal/console/templates/dpa_record.html
index d68807b3b..28374f22a 100644
--- a/internal/console/templates/dpa_record.html
+++ b/internal/console/templates/dpa_record.html
@@ -1,5 +1,6 @@
{{define "dpa_record"}}{{template "top" .}}
-{{with .DPARecord}}<div class="pagehead">
+{{with .DPARecord}}<div class="dpa-record">
+<div class="pagehead">
<p class="eyebrow">Account · {{$.Account.Name}}</p>
<h1>Data processing agreement</h1>
<p class="lede">The record of what was accepted, and by whom.</p>
@@ -20,5 +21,5 @@
<a class="btn btn-secondary" href="{{.SettingsURL}}">Back to settings</a></p>
{{else}}<p>No agreement is in force yet. You can accept one in account settings.</p>
<p class="no-print"><a class="btn btn-secondary" href="{{.SettingsURL}}">Back to settings</a></p>
-{{end}}{{end}}
+{{end}}</div>{{end}}
{{template "bottom" .}}{{end}}