oficina / estilo Public

chrome: smart door review fixes (Fable, discussion 37)

- The brand-hiding rule never hides a child holding the heading, and is
  marked for deletion in the bump that adopts HideBrand.
- The screen's heading is one step more specific than rastrillo's door
  heading and restates the door's size, so link order never decides it.
- estilo-signin-screen-title draws nothing when Unavailable, as the
  screen does; tested.
- Forget's button falls back to English's words at render time
  (ForgetForm.Text) when a copy set leaves it empty; tested.
- The stand-in fixture records the rastrillo commit it was checked
  against (dbadd9a0) and where the contract test belongs (Docs, step 6).
- unchanged_test's hash comment no longer reads as main at f6d5605.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 2c7a5c997b439496d04e3fc69df1bdbb50130381 parent 26f66aa
6 files changed, +60 −17
  • chrome/chrome.css +8 −4
  • chrome/chrome.go +9 −0
  • chrome/screen_test.go +18 −2
  • chrome/templates/signin.html +4 −3
  • chrome/testdata/signin-stand-in.html +12 −1
  • chrome/unchanged_test.go +9 −7

CI passed — run details

CI log
=== modcache ===
all modules verified
=== vet ===
CGO_ENABLED=0 go vet ./...
CGO_ENABLED=0 go vet -tags browser ./...
=== fmt ===
=== build ===
CGO_ENABLED=0 go build -buildvcs=false ./...
=== go-test ===
CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/estilo.git/base	0.004s
ok  	amadan.net/oficina/estilo.git/brand	0.003s
ok  	amadan.net/oficina/estilo.git/busy	0.008s
ok  	amadan.net/oficina/estilo.git/callui	0.009s
ok  	amadan.net/oficina/estilo.git/chrome	0.997s
?   	amadan.net/oficina/estilo.git/cmd/oficina-notices	[no test files]
ok  	amadan.net/oficina/estilo.git/colophon	0.030s
ok  	amadan.net/oficina/estilo.git/credits	0.011s
ok  	amadan.net/oficina/estilo.git/credits/catalog	0.003s
ok  	amadan.net/oficina/estilo.git/desk	0.004s
ok  	amadan.net/oficina/estilo.git/googleimport	0.156s
ok  	amadan.net/oficina/estilo.git/homeconnect	0.006s
ok  	amadan.net/oficina/estilo.git/internal/lint	0.006s
?   	amadan.net/oficina/estilo.git/internal/tokencheck	[no test files]
ok  	amadan.net/oficina/estilo.git/menu	0.009s
ok  	amadan.net/oficina/estilo.git/savestatus	0.105s
ok  	amadan.net/oficina/estilo.git/sky	0.029s
ok  	amadan.net/oficina/estilo.git/theme	0.009s
diff --git a/chrome/chrome.css b/chrome/chrome.css
index ed1c9b6..e6aa01b 100644
--- a/chrome/chrome.css
+++ b/chrome/chrome.css
@@ -305,11 +305,15 @@
controls are rastrillo's own. The partial is reached by structure, not
by its rst- names, which are rastrillo's to style (AGENTS.md,
Vocabulary): its card is a <section> of two children, the brand column
- then the door, and the brand is hidden only while there are two, so a
- partial that draws no brand (HideBrand) keeps its door. */
+ then the door. The brand is hidden only while there are two, and never
+ a child holding the heading, so a partial that draws no brand
+ (HideBrand) keeps its door. Delete the hiding rule in the rastrillo
+ bump that adopts HideBrand. The heading restates the door's own size
+ one step more specific than rastrillo's door heading, so the order the
+ stylesheets are linked in never decides it. */
[estilo-signin-screen] > section { display: block; inline-size: auto; max-inline-size: none; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
-[estilo-signin-screen] > section > :first-child:not(:only-child) { display: none; }
-[estilo-signin-screen] h1 { margin-block-end: 2px; }
+[estilo-signin-screen] > section > :first-child:not(:only-child):not(:has(h1)) { display: none; }
+[estilo-signin] [estilo-signin-screen] h1 { margin: 0 0 2px; font-size: 1.75rem; font-weight: 620; letter-spacing: -0.02em; line-height: 1.15; }
/* Signed out: "Forget me on this device", a quiet text button under Sign
in, drawn as the smart door's small controls are (medium weight, the
muted ink that darkens on hover, a touch smaller than body text, a soft
diff --git a/chrome/chrome.go b/chrome/chrome.go
index e6cbf5b..aa5f2a1 100644
--- a/chrome/chrome.go
+++ b/chrome/chrome.go
@@ -346,6 +346,15 @@ type ForgetForm struct {
Hidden []Hidden
}
+// Text is the button's words: Label, or English's when a copy set left it
+// empty, so the button is never drawn without a name.
+func (f ForgetForm) Text() string {
+ if f.Label == "" {
+ return English.Forget
+ }
+ return f.Label
+}
+
// SignInNotice is the data of estilo-signin-sent and estilo-signed-out,
// and of any other notice drawn as the door (the Keymail hand-off, the
// hub's account pages). For the door's own two, build it with Sent or
diff --git a/chrome/screen_test.go b/chrome/screen_test.go
index 670fb80..2c4ff4d 100644
--- a/chrome/screen_test.go
+++ b/chrome/screen_test.go
@@ -99,7 +99,8 @@ func TestTheSmartDoorDrawsTheScreenInTheDoor(t *testing.T) {
func TestTheSmartDoorHasOneBrand(t *testing.T) {
src := string(CSS())
for _, want := range []string{
- "[estilo-signin-screen] > section > :first-child:not(:only-child) { display: none; }",
+ "[estilo-signin-screen] > section > :first-child:not(:only-child):not(:has(h1)) { display: none; }",
+ "[estilo-signin] [estilo-signin-screen] h1 { margin: 0 0 2px; font-size: 1.75rem;",
"[estilo-signin-screen] > section { display: block; inline-size: auto; max-inline-size: none; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }",
} {
if !strings.Contains(src, want) {
@@ -129,7 +130,7 @@ func TestTheSmartDoorDrawsNothingWhenUnavailable(t *testing.T) {
if h := renderScreen(t, "estilo-signin-screen", docsScreen(st)); strings.TrimSpace(h) != "" {
t.Errorf("%s: drew %q", name, h)
}
- if h := renderScreen(t, "estilo-signin-screen-title", docsScreen(st)); name == "nil" && h != "" {
+ if h := renderScreen(t, "estilo-signin-screen-title", docsScreen(st)); h != "" {
t.Errorf("%s: a title %q", name, h)
}
}
@@ -199,3 +200,18 @@ func TestSignedOutOffersForget(t *testing.T) {
t.Error("chrome.css does not draw Forget as a quiet text button")
}
}
+
+// A copy set that leaves Forget empty still draws a named button: the
+// label falls back to English's at render time.
+func TestForgetIsNeverUnnamed(t *testing.T) {
+ c := English
+ c.Forget = ""
+ n := SignInNotice{Icon: "/i.svg", App: "Docs", Copy: &c}.SignedOut("/signin").Forgetting("/auth/forget", "")
+ if h := render(t, "estilo-signed-out", n); !strings.Contains(h, `<button rst-btn="ghost" type="submit">Forget me on this device</button>`) {
+ t.Error("an empty Forget drew an unnamed button", h)
+ }
+ n.Forget = &ForgetForm{Action: "/auth/forget"}
+ if h := render(t, "estilo-signed-out", n); !strings.Contains(h, ">Forget me on this device</button>") {
+ t.Error("a ForgetForm with no Label drew an unnamed button", h)
+ }
+}
diff --git a/chrome/templates/signin.html b/chrome/templates/signin.html
index 4b030b4..a89fc4d 100644
--- a/chrome/templates/signin.html
+++ b/chrome/templates/signin.html
@@ -72,8 +72,9 @@
{{/* estilo-signin-screen-title: the screen's tab title, rastrillo's
"signin-title" for the same state and the same name, so the title and
- the heading always say the same thing. Data: chrome.SignInScreen. */}}
-{{define "estilo-signin-screen-title"}}{{with .State}}{{template "signin-title" (dict "State" $.State "Brand" (dict "Name" $.App) "L" $.L)}}{{end}}{{end}}
+ the heading always say the same thing; nothing when the screen draws
+ nothing. Data: chrome.SignInScreen. */}}
+{{define "estilo-signin-screen-title"}}{{with .State}}{{if not .Unavailable}}{{template "signin-title" (dict "State" $.State "Brand" (dict "Name" $.App) "L" $.L)}}{{end}}{{end}}{{end}}
{{/* estilo-signin-sent: replaces the form once a link has been sent. Link
goes back to the form, keeping the return. Data: chrome.SignInNotice. */}}
@@ -103,7 +104,7 @@
{{- range .Hidden}}
<input type="hidden" name="{{.Name}}" value="{{.Value}}">
{{- end}}
- <button rst-btn="ghost" type="submit">{{.Label}}</button>
+ <button rst-btn="ghost" type="submit">{{.Text}}</button>
</form>
{{- end}}
{{template "estilo-door-close"}}{{end}}
diff --git a/chrome/testdata/signin-stand-in.html b/chrome/testdata/signin-stand-in.html
index 89210ba..2f207bc 100644
--- a/chrome/testdata/signin-stand-in.html
+++ b/chrome/testdata/signin-stand-in.html
@@ -5,7 +5,18 @@
partial's outer shape (the rst-signin card, its brand column, then the
door) and the rule that an unavailable state draws nothing, and it
writes back the keys it was handed, so a test can see what estilo
- passes. The real partial is the apps' to render. */}}
+ passes. The real partial is the apps' to render.
+
+ Checked against rastrillo feat/smart-door at dbadd9a0 (2026-11-20):
+ the real partial's card is a <section rst-signin> of exactly two
+ children, the brand column then the door, which is what chrome.css's
+ structural rules rely on. This stand-in can drift from it silently,
+ and estilo must not depend on rastrillo's new module to check. The
+ contract test belongs where both modules meet: the first app to adopt
+ estilo-signin-screen (Docs, smart-door step 6) renders it over
+ rastrillo's sign-in states and asserts that
+ [estilo-signin-screen] > section has exactly two children, brand then
+ door. */}}
{{define "signin"}}{{$s := .State}}{{if not $s.Unavailable}}<section rst-signin aria-labelledby="rst-signin-heading">
<div rst-signin-brand>{{with .Brand.Mark}}<div rst-signin-mark>{{.}}</div>{{end}}<p rst-signin-name>{{.Brand.Name}}</p></div>
<div rst-signin-door="one-way" data-stand-in-l="{{.L}}" data-stand-in-preview="{{.Preview}}" data-stand-in-hide-brand="{{.HideBrand}}">
diff --git a/chrome/unchanged_test.go b/chrome/unchanged_test.go
index 8962be4..6a86205 100644
--- a/chrome/unchanged_test.go
+++ b/chrome/unchanged_test.go
@@ -70,14 +70,16 @@ func TestABarWithoutSlotsIsByteForByteUnchanged(t *testing.T) {
// added sits after it, and main's rules before it are untouched.
const barStackMarker = "\n/* ── Bar stack"
-// mainCSS is the sha256 of chrome.css on main at f6d5605 (and of menu.css,
-// which bar-stack does not touch). A change to the bar's own rules for
-// every app is a design decision: make it deliberately, and update these
-// with the reason in the commit. Last updated on feat/smart-door: the
-// door's rules only (the footer slot removed; the smart door and the
-// signed-out page's Forget added), no bar rule.
+// mainChromeCSS is the sha256 of chrome.css before the bar-stack marker,
+// and mainMenuCSS of menu.css; both were first recorded from main at
+// f6d5605, when bar-stack began. A change to the bar's own rules for every
+// app is a design decision: make it deliberately, and update these with
+// the reason in the commit. chrome.css's was last updated on
+// feat/smart-door, for the door's rules only (the footer slot removed;
+// the smart door and the signed-out page's Forget added): no bar rule
+// changed.
const (
- mainChromeCSS = "1fe15a4dee594222db73269d53ce049a303e48ef1d00f8ae44c947a6671fb4e4"
+ mainChromeCSS = "7191f4df53e675cc6920eb9efd84393e68e696c4ee8fae818bbb56c058ed1cfb"
mainMenuCSS = "6b3435a18591d20ad62b40df3e64e159b501f9d1c183b2f42aa32b4faa9c0669"
)