oficina / memoria Public

Pin estilo and home to their main merges

estilo #25 merged as f14458a and home #84 as ff16bf5, so the
connect-item fix now pins main rather than the branches: estilo
f14458a, home/connect and home/handoff ff16bf5. main is merged in too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 7fb47d980a219bac639cee1c8608c862cf38ebea parent 22f9ce2parent fe18ea2
7 files changed, +81 −22
  • go.mod +3 −3
  • go.sum +6 −6
  • internal/memoria/app.go +5 −0
  • internal/memoria/chrome.go +5 −3
  • internal/memoria/chrome_test.go +41 −7
  • internal/memoriatest/routes_test.go +7 −3
  • internal/memoriatest/vendored_test.go +14 −0

CI passed — run details

diff --git a/go.mod b/go.mod
index 41341c3..df95244 100644
--- a/go.mod
+++ b/go.mod
@@ -5,9 +5,9 @@ go 1.26
toolchain go1.26.5
require (
- amadan.net/oficina/estilo.git v0.0.0-20261024225503-1817c1c6c7ef
- amadan.net/oficina/home/connect v0.0.0-20261024225613-4d87d0031ed4
- amadan.net/oficina/home/handoff v0.0.0-20260908102137-481d2d57f489
+ amadan.net/oficina/estilo.git v0.0.0-20261024233714-f14458a4683c
+ amadan.net/oficina/home/connect v0.0.0-20261024233715-ff16bf56bc4d
+ amadan.net/oficina/home/handoff v0.0.0-20261024233715-ff16bf56bc4d
amadan.net/oficina/suite v0.0.0-20260905215529-60b01a8a0d6d
amadan.net/rastrillo/native/server v0.0.0-20260923173546-2a5d07b2c8d3
github.com/carlosframework/rastrillo v0.23.0
diff --git a/go.sum b/go.sum
index 40ebc90..393e0a1 100644
--- a/go.sum
+++ b/go.sum
@@ -1,9 +1,9 @@
-amadan.net/oficina/estilo.git v0.0.0-20261024225503-1817c1c6c7ef h1:c+0jDD33fLLQ0L4lOF7mYjEC6dbcIq1d3RGAAxGtXWo=
-amadan.net/oficina/estilo.git v0.0.0-20261024225503-1817c1c6c7ef/go.mod h1:4u0jNBtIdMLOsJyrScfqoEuYDJF7BBM3qM9YWbzt6aw=
-amadan.net/oficina/home/connect v0.0.0-20261024225613-4d87d0031ed4 h1:VN9QzOFXo0dir9A3lXKCgF0nTfnOs3edT1mgPk0z/Yc=
-amadan.net/oficina/home/connect v0.0.0-20261024225613-4d87d0031ed4/go.mod h1:ix81eFV87yE9f2SXiRuxYCVM4lAgTRC5YoQMiH3+TDk=
-amadan.net/oficina/home/handoff v0.0.0-20260908102137-481d2d57f489 h1:RPKtyry/71i06o8L+gjAaUyexbmG56kO1YPs601URAM=
-amadan.net/oficina/home/handoff v0.0.0-20260908102137-481d2d57f489/go.mod h1:YISpzFJ+iMgrM0rUL032OSzsAQbP4/nozvXLCCOcn1k=
+amadan.net/oficina/estilo.git v0.0.0-20261024233714-f14458a4683c h1:jPbFJwPi7lHe+UNe+Gbj0ivVsy+pLqMSq2EP2Xff/q0=
+amadan.net/oficina/estilo.git v0.0.0-20261024233714-f14458a4683c/go.mod h1:4u0jNBtIdMLOsJyrScfqoEuYDJF7BBM3qM9YWbzt6aw=
+amadan.net/oficina/home/connect v0.0.0-20261024233715-ff16bf56bc4d h1:9sVZBph2xUuejZt73DYaoCfoyvrvZCnuPHcyMsg562E=
+amadan.net/oficina/home/connect v0.0.0-20261024233715-ff16bf56bc4d/go.mod h1:ix81eFV87yE9f2SXiRuxYCVM4lAgTRC5YoQMiH3+TDk=
+amadan.net/oficina/home/handoff v0.0.0-20261024233715-ff16bf56bc4d h1:8RTZkLQnyxvH2g0RMovhN/m2LN9D8qb+kBfqdBeqq+s=
+amadan.net/oficina/home/handoff v0.0.0-20261024233715-ff16bf56bc4d/go.mod h1:YISpzFJ+iMgrM0rUL032OSzsAQbP4/nozvXLCCOcn1k=
amadan.net/oficina/suite v0.0.0-20260905215529-60b01a8a0d6d h1:x6Bq9+QzpFYAyV+zRzgyHwD/RmZ4Hy4biwtxK7CdaSs=
amadan.net/oficina/suite v0.0.0-20260905215529-60b01a8a0d6d/go.mod h1:Xgw0N+DBiDzkhQHm/nIhgumfaiMElDg/KIFD1OxTm5w=
amadan.net/rastrillo/native/server v0.0.0-20260923173546-2a5d07b2c8d3 h1:5EFx7BLJj/+G/rt8bTmeyMWVfF5s5Sns7ajTvX4w/I8=
diff --git a/internal/memoria/app.go b/internal/memoria/app.go
index 21ba6f9..1ee90ca 100644
--- a/internal/memoria/app.go
+++ b/internal/memoria/app.go
@@ -7,6 +7,7 @@ import (
"net/url"
"strings"
+ "amadan.net/oficina/estilo.git/brand"
"amadan.net/oficina/estilo.git/chrome"
"amadan.net/oficina/estilo.git/sky"
"amadan.net/oficina/estilo.git/theme"
@@ -192,6 +193,10 @@ func App(d *db.DB, origin string, sealer *seal.Sealer, logger *slog.Logger) (*ht
// literal for the same reason; TestSkyRouteIsEstilosPrefix keeps it
// equal to sky.Prefix.
mux.Handle("GET /static/estilo/sky/v1/", sky.Handler())
+ // The app switcher's tile icons (estilo brand), public and
+ // sessionless like the sky. A literal for the same reason;
+ // TestBrandRouteIsEstilosPrefix keeps it equal to brand.Prefix.
+ mux.Handle("GET /static/estilo/brand/", brand.Handler())
mux.Handle("/", r)
return mux, a, nil
}
diff --git a/internal/memoria/chrome.go b/internal/memoria/chrome.go
index ad29825..0e10d02 100644
--- a/internal/memoria/chrome.go
+++ b/internal/memoria/chrome.go
@@ -268,9 +268,10 @@ func (a *app) offersHomeLink(r *http.Request, v viewer) bool {
}
// switcher is the app switcher, or nil when no hub directory is
-// configured. It shows "All apps" alone and no tiles (Paul's §13 answer 2):
-// a tile today still costs an assertion exchange through the directory
-// session.
+// configured: the suite's six apps as tiles, each at its own host under
+// the directory's (estilo's chrome.SuiteApps), with Memoria marked
+// current, then "All apps". The tile icons are served by brand.Handler,
+// mounted in app.go.
func (a *app) switcher() *chrome.Switcher {
if a.home == nil || a.directory == "" {
return nil
@@ -278,6 +279,7 @@ func (a *app) switcher() *chrome.Switcher {
return &chrome.Switcher{
Label: "Oficina apps",
CurrentLabel: "(this app)",
+ Apps: chrome.SuiteApps(a.directory, "memoria"),
AllApps: estilomenu.Item{Href: a.directory + "/", Label: "All apps"},
}
}
diff --git a/internal/memoria/chrome_test.go b/internal/memoria/chrome_test.go
index 92bb12a..a66f801 100644
--- a/internal/memoria/chrome_test.go
+++ b/internal/memoria/chrome_test.go
@@ -20,17 +20,51 @@ import (
assertioncrypto "amadan.net/rastrillo/rastrillo/crypto"
)
-// §6: the switcher is "All apps" alone (Paul's §13 answer 2), to the hub
-// directory, and only when Home names one. No directory, no switcher.
-func TestTheSwitcherIsAllAppsOnly(t *testing.T) {
+// §6: the switcher appears only when Home names a hub directory. It shows
+// the suite's six apps as tiles, each at its own host under the
+// directory's, with Memoria the one current tile, and "All apps" to the
+// directory below a divider. No directory, no switcher. The tiles' icons
+// are served to a request carrying no cookies at all.
+func TestTheSwitcherShowsTheSuite(t *testing.T) {
f := newHomeRouterFixtureDir(t, "https://directory.example.test")
+ icon := httptest.NewRecorder()
+ f.handler.ServeHTTP(icon, httptest.NewRequest("GET", homeTestOrigin+"/static/estilo/brand/calls.svg", nil))
+ if icon.Code != http.StatusOK || !strings.Contains(icon.Body.String(), "<svg") {
+ t.Errorf("a tile's icon, asked for with no cookies, is %d", icon.Code)
+ }
f.local(t)
b := f.do("GET", "/", "").Body.String()
- if !strings.Contains(b, "<details estilo-switcher") || !strings.Contains(b, `href="https://directory.example.test/"`) || !strings.Contains(b, ">All apps<") {
- t.Errorf("the bar has no All apps switcher to the directory:\n%s", b)
+ start := strings.Index(b, "<details estilo-switcher")
+ if start < 0 {
+ t.Fatalf("the bar has no switcher:\n%s", b)
+ }
+ panel := b[start:]
+ panel = panel[:strings.Index(panel, "</details>")]
+ grid, allApps, ok := strings.Cut(panel, "<hr>")
+ if !ok || !strings.Contains(allApps, `href="https://directory.example.test/"`) || !strings.Contains(allApps, ">All apps<") {
+ t.Errorf("the switcher does not offer All apps to the directory below the tiles:\n%s", panel)
+ }
+ var tiles []string
+ for _, tile := range strings.Split(grid, "<a estilo-switcher-app ")[1:] {
+ tiles = append(tiles, tile[:strings.Index(tile, "</a>")])
+ }
+ slugs := []string{"docs", "sheets", "slides", "calendar", "memoria", "calls"}
+ names := []string{"Docs", "Sheets", "Slides", "Calendar", "Memoria", "Calls"}
+ if len(tiles) != len(slugs) {
+ t.Fatalf("%d tiles, want %d:\n%s", len(tiles), len(slugs), grid)
+ }
+ for i, slug := range slugs {
+ head := `href="https://` + slug + `.directory.example.test/"`
+ if slug == "memoria" {
+ head += ` aria-current="true"`
+ }
+ head += `><img src="/static/estilo/brand/` + slug + `.svg" alt="" width="32" height="32"><span>` + names[i]
+ if !strings.HasPrefix(tiles[i], head) {
+ t.Errorf("tile %d = %s, want it to start %s", i, tiles[i], head)
+ }
}
- if strings.Contains(b, "estilo-switcher-app") {
- t.Error("the switcher shows app tiles; R2 shows All apps alone")
+ if strings.Count(grid, "aria-current") != 1 || !strings.Contains(tiles[4], "<span estilo-visually-hidden> (this app)</span>") {
+ t.Errorf("Memoria is not the one current tile:\n%s", grid)
}
g := newHomeRouterFixture(t)
g.local(t)
diff --git a/internal/memoriatest/routes_test.go b/internal/memoriatest/routes_test.go
index 1501722..580af25 100644
--- a/internal/memoriatest/routes_test.go
+++ b/internal/memoriatest/routes_test.go
@@ -67,9 +67,13 @@ func TestNoUndeclaredRoutes(t *testing.T) {
// the same bargain as the font. TestSkyRouteIsEstilosPrefix
// keeps the literal equal to sky.Prefix.
"GET /static/estilo/sky/v1/": true,
- "/": true,
- "/auth/": true,
- "POST /signout": true,
+ // The app switcher's tile icons: public artwork again.
+ // TestBrandRouteIsEstilosPrefix keeps the literal equal to
+ // brand.Prefix.
+ "GET /static/estilo/brand/": true,
+ "/": true,
+ "/auth/": true,
+ "POST /signout": true,
}
// Router method -> index of the pattern argument. Handle, HandleFunc,
// Mount and Route bind every method, so they read as ANY.
diff --git a/internal/memoriatest/vendored_test.go b/internal/memoriatest/vendored_test.go
index aef4e7b..1fc4c65 100644
--- a/internal/memoriatest/vendored_test.go
+++ b/internal/memoriatest/vendored_test.go
@@ -2,6 +2,7 @@ package memoriatest
import (
"amadan.net/oficina/estilo.git/base"
+ "amadan.net/oficina/estilo.git/brand"
"amadan.net/oficina/estilo.git/busy"
"amadan.net/oficina/estilo.git/chrome"
estilomenu "amadan.net/oficina/estilo.git/menu"
@@ -105,6 +106,19 @@ func TestSkyRouteIsEstilosPrefix(t *testing.T) {
}
}
+// app.go mounts the switcher's tile icons at a literal pattern, for the
+// same reason as the sky. This keeps it equal to estilo's brand.Prefix,
+// which chrome.SuiteApps builds every tile's icon path from.
+func TestBrandRouteIsEstilosPrefix(t *testing.T) {
+ src, err := os.ReadFile(filepath.Join("..", "memoria", "app.go"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ if !bytes.Contains(src, []byte(`"GET `+brand.Prefix+`"`)) {
+ t.Errorf("app.go does not mount the brand icons at %s", brand.Prefix)
+ }
+}
+
// The sign-in door (estilo chrome's estilo-signin and friends) is styled
// by chrome.css and sky.css, vendored into static/ so they are served
// fingerprinted like every other stylesheet. Pinned to the estilo this