oficina / home Public

Home: the chrome is the system UI face, and links or preloads no webfont

Brings in estilo main 260f98c, which sets --rst-font to the system UI
stack and drops Onest: on Paul's ruling (2026-10-24/25) the chrome must
never flash, and no loading strategy got Onest into WebKit without a
frame of invisible text (estilo AGENTS.md row 9).

- Pin estilo at 260f98c, from 0b4d92c. The eleven commits between also
  bring the rail account, the destructive menu row, the switcher's
  phone width, the bar title's iOS zoom fix, SuiteApps and the door
  copy's {app}/{link} tokens. Home uses none of the new options, and the
  door's words are unchanged, so the typeface is the one visible change.
- The front page (static/site/index.html) and the layout no longer
  preload onest-latin.woff2 or link fonts/v1/fonts.css; the fontsCSS and
  fontPreload template helpers are gone.
- estilo's font handler stays mounted on both origins, so a page cached
  before this still resolves its stylesheet (and credits keep listing
  Onest while the file is served).
- TestColdLoadPreloadsTheMarksAndNoWebfont replaces
  TestColdLoadPreloadsTheFontAndMarks: the marks are still preloaded;
  the front page and id.* sign-in as served, and every template and
  site page as source, may not name estilo's font path, preload a font
  or link a font file; v1's two files still answer on both origins. It
  failed on the old pages before the links went. page_test's
  fonts.css assertion is dropped for the same reason.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 7f23a891a5d55d7f7ac85fd179fd3050954c2f28 parent 87d607e
9 files changed, +92 −34
  • go.mod +1 −1
  • go.sum +2 −2
  • internal/home/calma.go +6 −8
  • internal/home/origins_test.go +2 −1
  • internal/home/page.go +6 −5
  • internal/home/page_test.go +0 −4
  • internal/home/shared_chrome_test.go +72 −7
  • internal/home/static/site/index.html +0 −2
  • internal/home/templates/layout.html +3 −4

CI passed — run details

diff --git a/go.mod b/go.mod
index d47d8c2..73e8581 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.25.0
toolchain go1.26.5
require (
- amadan.net/oficina/estilo.git v0.0.0-20261001084202-0b4d92c3dc16
+ amadan.net/oficina/estilo.git v0.0.0-20261025200559-260f98c42e2d
amadan.net/oficina/home/dashboard v0.0.0-20261024234842-3774eb68f816
amadan.net/oficina/home/handoff v0.0.0-20260908102137-481d2d57f489
amadan.net/oficina/home/roster v0.0.0-20260908123429-74dda570e0cf
diff --git a/go.sum b/go.sum
index e2d6c6b..3904a7c 100644
--- a/go.sum
+++ b/go.sum
@@ -1,7 +1,7 @@
amadan.net/carlos/platform.git/launchctx v0.0.0-20260911135504-fb577f96f7d1 h1:RxwIRojWcVtwSdNAjtdz7y1bxHLh3GUgqT1TrXVKpyM=
amadan.net/carlos/platform.git/launchctx v0.0.0-20260911135504-fb577f96f7d1/go.mod h1:6fBmMWgtESLFXZURzu/HyRXM0vyLuo4+XGGdKuZ+wao=
-amadan.net/oficina/estilo.git v0.0.0-20261001084202-0b4d92c3dc16 h1:F5v3x25dEj1rJNnBm71G7shN+fM+T2actUlaGPvoeH8=
-amadan.net/oficina/estilo.git v0.0.0-20261001084202-0b4d92c3dc16/go.mod h1:4u0jNBtIdMLOsJyrScfqoEuYDJF7BBM3qM9YWbzt6aw=
+amadan.net/oficina/estilo.git v0.0.0-20261025200559-260f98c42e2d h1:p9+01xRdBD7s1viTINgQ6XoDD5ghOxYubD7FNcjhBTw=
+amadan.net/oficina/estilo.git v0.0.0-20261025200559-260f98c42e2d/go.mod h1:4u0jNBtIdMLOsJyrScfqoEuYDJF7BBM3qM9YWbzt6aw=
amadan.net/oficina/home/dashboard v0.0.0-20261024234842-3774eb68f816 h1:AFDuOio0MxNxN9ZWVc3lul1QHkNjNUCO56kXpe/Fw3I=
amadan.net/oficina/home/dashboard v0.0.0-20261024234842-3774eb68f816/go.mod h1:+7xsX+QyVFrKy5gDAGh+FZ5+75z4CibWTL0wl9DWAw0=
amadan.net/oficina/home/handoff v0.0.0-20260908102137-481d2d57f489 h1:RPKtyry/71i06o8L+gjAaUyexbmG56kO1YPs601URAM=
diff --git a/internal/home/calma.go b/internal/home/calma.go
index 8ea1a3c..34eb125 100644
--- a/internal/home/calma.go
+++ b/internal/home/calma.go
@@ -24,8 +24,6 @@ var homeFuncs = map[string]any{
// v links a stylesheet or picture by its content version (assetversion.go).
"v": versioned,
"suiteSky": func() sky.View { return sky.For(sky.SuiteSeed) },
- // Onest's stylesheet, under estilo's versioned prefix.
- "fontsCSS": func() string { return theme.FontPrefix + "fonts.css" },
// The door's words and tab titles are estilo's (chrome.English), the
// one copy set every app's door speaks, so the hub's door cannot
// drift from theirs. Home draws its own templates, so it reads the
@@ -55,9 +53,6 @@ var homeFuncs = map[string]any{
}
return v
},
- // Onest's file, preloaded so a cold first load paints in it rather
- // than swapping in after (r3 C4).
- "fontPreload": func() string { return theme.FontPrefix + "onest-latin.woff2" },
}
// doorView is estilo-door-open's data (chrome/templates/signin.html).
@@ -99,9 +94,12 @@ var hopPages = map[string]bool{
"docs_continue.html": true,
}
-// mountCalma serves the Calma pieces Home's pages link: Onest, the sky's
-// layers and stylesheet, and Home's own few rules for placing it. Public
-// on both origins; every handler here serves a closed set.
+// mountCalma serves the Calma pieces Home's pages link: the sky's layers
+// and stylesheet, and Home's own few rules for placing it. Public on both
+// origins; every handler here serves a closed set. It also keeps estilo's
+// retired v1 Onest files answering, so a page cached before the chrome
+// moved to the system face (estilo AGENTS.md row 9) still resolves its
+// stylesheet; no page links them.
func mountCalma(r chi.Router) {
r.Handle(theme.FontPrefix+"*", theme.FontHandler())
r.Handle(sky.Prefix+"*", sky.Handler())
diff --git a/internal/home/origins_test.go b/internal/home/origins_test.go
index c5631bf..fc7c728 100644
--- a/internal/home/origins_test.go
+++ b/internal/home/origins_test.go
@@ -19,7 +19,8 @@ var sharedPublicPaths = []string{
"/healthz", "/static/tokens.css", "/static/theme.css",
"/static/brand/icon.svg", "/static/brand/icon-32.png", "/static/brand/apple-touch-icon.png", "/static/brand/brand.css", "/static/brand/LICENSE.lucide", "/static/brand/docs.svg", "/static/brand/sheets.svg", "/static/brand/slides.svg", "/static/brand/calendar.svg", "/static/brand/calls.svg", "/static/brand/memoria.svg",
"/static/brand/fichas.svg", "/static/brand/mail.svg", "/static/brand/files.svg",
- // Calma: Onest, the sky and its stylesheet, and Home's rules for placing it.
+ // Calma: the sky and its stylesheet, Home's rules for placing it, and
+ // estilo's retired v1 Onest files, still served for old pages.
"/static/estilo/fonts/v1/*", "/static/estilo/sky/v1/*", "/static/estilo/sky.css", "/static/calma.css",
"/static/busy.css", "/static/busy.js",
"/static/site/home.css", "/static/site/apps.css",
diff --git a/internal/home/page.go b/internal/home/page.go
index e22ef60..e41c60c 100644
--- a/internal/home/page.go
+++ b/internal/home/page.go
@@ -22,11 +22,12 @@ var siteFS embed.FS
// user input to escape — so it is served as bytes, with no template step
// standing between the file and the response.
//
-// It is drawn in Calma, the suite's look: estilo's theme and Onest, the
-// sky behind the hero, and each app's own colour from estilo's ring
-// (appsCSS). Everything it links is on this origin; SecurityPolicy's
-// `default-src 'self'` already admits the fonts and pictures, and the
-// stylesheets are covered by `style-src 'self'`.
+// It is drawn in Calma, the suite's look: estilo's theme in the system
+// UI face (no webfont; estilo AGENTS.md row 9), the sky behind the hero,
+// and each app's own colour from estilo's ring (appsCSS). Everything it
+// links is on this origin; SecurityPolicy's `default-src 'self'` already
+// admits the pictures, and the stylesheets are covered by
+// `style-src 'self'`.
//
// Everything the page points at has to exist. The app links go to the six
// live app hosts; there is no sign-up form, because there is no route that
diff --git a/internal/home/page_test.go b/internal/home/page_test.go
index b43de74..3e72921 100644
--- a/internal/home/page_test.go
+++ b/internal/home/page_test.go
@@ -7,7 +7,6 @@ import (
"testing"
"amadan.net/oficina/estilo.git/sky"
- "amadan.net/oficina/estilo.git/theme"
)
// TestFrontPageLineBreaksKeepTheirSpace: an earlier hero hid its <br> on
@@ -43,7 +42,4 @@ func TestFrontPageRendersEstilosSky(t *testing.T) {
t.Errorf("front page lacks the %s layer (%s)", layer.Name, layer.Tone)
}
}
- if !bytes.Contains(indexPage, []byte(`"`+theme.FontPrefix+`fonts.css"`)) {
- t.Errorf("front page does not link %sfonts.css", theme.FontPrefix)
- }
}
diff --git a/internal/home/shared_chrome_test.go b/internal/home/shared_chrome_test.go
index 8d9890a..e6c3118 100644
--- a/internal/home/shared_chrome_test.go
+++ b/internal/home/shared_chrome_test.go
@@ -4,10 +4,14 @@ import (
"net/http"
"net/http/httptest"
"net/url"
+ "os"
+ "path"
+ "path/filepath"
"regexp"
"strings"
"testing"
+ "amadan.net/oficina/estilo.git/theme"
"amadan.net/oficina/home/internal/home/sealtest"
)
@@ -444,17 +448,21 @@ func TestHopKeepsTheSkyPlaceholder(t *testing.T) {
}
}
-// A cold first load paints the mark and Onest at once (r3 C4): the font
-// and the brand pictures are preloaded, on the front page and every page
-// in the layout.
-func TestColdLoadPreloadsTheFontAndMarks(t *testing.T) {
+// A cold first load paints with the mark at once (r3 C4): the brand
+// pictures are preloaded, on the front page and every page in the
+// layout. And it paints in the system UI face with no webfont to wait
+// for or swap in: Paul, 2026-10-25, "There should never be a flash of
+// unstyled text. Ever." (estilo AGENTS.md row 9). Onest used to be
+// preloaded here; no page links or preloads it, or any font file, now.
+// estilo's v1 files stay mounted (mountCalma) so a page cached before
+// this still resolves its stylesheet.
+func TestColdLoadPreloadsTheMarksAndNoWebfont(t *testing.T) {
f := newMountedChooser(t)
- font := `<link rel="preload" href="/static/estilo/fonts/v1/onest-latin.woff2" as="font" type="font/woff2" crossorigin>`
front := chromeGet(f.p.directory.Router(), directoryOrigin+"/", acceptHTML).Body.String()
signin := chromeGet(f.p.credential.Router(), Origin+"/signin", acceptHTML).Body.String()
for name, body := range map[string]string{"front page": front, "id.* sign in": signin} {
- if !strings.Contains(body, font) {
- t.Errorf("%s: Onest is not preloaded", name)
+ for _, why := range chromeWebfonts(body) {
+ t.Errorf("%s %s", name, why)
}
if !strings.Contains(body, `<link rel="preload" href="/static/brand/icon.svg?v=`) {
t.Errorf("%s: the Oficina mark is not preloaded", name)
@@ -465,4 +473,61 @@ func TestColdLoadPreloadsTheFontAndMarks(t *testing.T) {
t.Errorf("front page: %s's mark is not preloaded", app)
}
}
+
+ // Every page's source, whichever route draws it: the layout's
+ // templates and the front page.
+ pages := 0
+ for _, glob := range []string{"templates/*.html", "static/site/*.html"} {
+ names, err := filepath.Glob(glob)
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, p := range names {
+ b, err := os.ReadFile(p)
+ if err != nil {
+ t.Fatal(err)
+ }
+ pages++
+ for _, why := range chromeWebfonts(string(b)) {
+ t.Errorf("%s %s", p, why)
+ }
+ }
+ }
+ if pages < 15 {
+ t.Fatalf("read only %d page sources; the scan would pass vacuously", pages)
+ }
+
+ // The retired files still answer, on both origins, for old pages.
+ for origin, h := range map[string]http.Handler{directoryOrigin: f.p.directory.Router(), Origin: f.p.credential.Router()} {
+ for _, file := range []string{"fonts.css", "onest-latin.woff2"} {
+ if rec := chromeGet(h, origin+theme.FontPrefix+file, ""); rec.Code != http.StatusOK {
+ t.Errorf("GET %s%s%s = %d; keep estilo's font handler mounted for old pages", origin, theme.FontPrefix, file, rec.Code)
+ }
+ }
+ }
+}
+
+var (
+ linkTag = regexp.MustCompile(`(?is)<link\b[^>]*>`)
+ asFont = regexp.MustCompile(`(?i)\bas\s*=\s*["']?font\b`)
+ fontFile = regexp.MustCompile(`(?i)\.(woff2?|ttf|otf|eot)\b`)
+)
+
+// chromeWebfonts names each way html would download a font for the
+// chrome: estilo's font path at any version, a <link> that preloads a
+// font or names a font file, or a face declared inline.
+func chromeWebfonts(html string) []string {
+ var found []string
+ if dir := path.Dir(strings.TrimSuffix(theme.FontPrefix, "/")) + "/"; strings.Contains(html, dir) {
+ found = append(found, "names estilo's webfont path "+dir)
+ }
+ for _, tag := range linkTag.FindAllString(html, -1) {
+ if asFont.MatchString(tag) || fontFile.MatchString(tag) {
+ found = append(found, "links or preloads a font: "+tag)
+ }
+ }
+ if strings.Contains(strings.ToLower(html), "@font-face") {
+ found = append(found, "declares a font face inline")
+ }
+ return found
}
diff --git a/internal/home/static/site/index.html b/internal/home/static/site/index.html
index 2bbbbf3..cc4ef76 100644
--- a/internal/home/static/site/index.html
+++ b/internal/home/static/site/index.html
@@ -5,7 +5,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Oficina</title>
<meta name="description" content="Oficina is a fast, lightweight office suite that values your privacy. Docs, Sheets, Slides, Calendar, Calls and Memoria, in the browser and as native Mac apps.">
-<link rel="preload" href="/static/estilo/fonts/v1/onest-latin.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/static/brand/icon.svg" as="image" type="image/svg+xml">
<link rel="preload" href="/static/brand/docs.svg" as="image" type="image/svg+xml">
<link rel="preload" href="/static/brand/sheets.svg" as="image" type="image/svg+xml">
@@ -16,7 +15,6 @@
<link rel="icon" type="image/png" sizes="32x32" href="/static/brand/icon-32.png">
<link rel="icon" type="image/svg+xml" href="/static/brand/icon.svg">
<link rel="apple-touch-icon" sizes="180x180" href="/static/brand/apple-touch-icon.png">
-<link rel="stylesheet" href="/static/estilo/fonts/v1/fonts.css">
<link rel="stylesheet" href="/static/theme.css">
<link rel="stylesheet" href="/static/estilo/sky.css">
<link rel="stylesheet" href="/static/site/apps.css">
diff --git a/internal/home/templates/layout.html b/internal/home/templates/layout.html
index a3493f5..cc18c18 100644
--- a/internal/home/templates/layout.html
+++ b/internal/home/templates/layout.html
@@ -4,16 +4,15 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{block "title" .}}Oficina{{end}}</title>
-{{/* A cold first load paints in Onest and with the mark (r3 C4): both are
- fetched before the stylesheets that name them are parsed. */}}
-<link rel="preload" href="{{fontPreload}}" as="font" type="font/woff2" crossorigin>
+{{/* A cold first load paints with the mark (r3 C4): it is fetched before
+ the stylesheets that name it are parsed. No webfont: the chrome is the
+ system UI face, so it never flashes (estilo AGENTS.md row 9). */}}
<link rel="preload" href="{{v "/static/brand/icon.svg"}}" as="image" type="image/svg+xml">
<link rel="icon" type="image/png" sizes="32x32" href="{{v "/static/brand/icon-32.png"}}">
<link rel="icon" type="image/svg+xml" href="{{v "/static/brand/icon.svg"}}">
<link rel="apple-touch-icon" sizes="180x180" href="{{v "/static/brand/apple-touch-icon.png"}}">
{{/* The spec's order (shared-chrome §0.5): tokens, theme, brand, estilo's
base, menu and chrome, then the sky and Home's own rules last. */}}
-<link rel="stylesheet" href="{{fontsCSS}}">
<link rel="stylesheet" href="{{v "/static/tokens.css"}}">
<link rel="stylesheet" href="{{v "/static/theme.css"}}">
<link rel="stylesheet" href="{{v "/static/brand/brand.css"}}">