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>
4 files changed,
+53
−20
go.mod+3 −3go.sum+6 −6internal/sheets/chrome.go+4 −3internal/sheets/chrome_test.go+40 −8
CI passed — run details
diff --git a/go.mod b/go.mod| index 7844413..707f028 100644 |
| --- a/go.mod |
| +++ b/go.mod |
| @@ -3,9 +3,9 @@ module amadan.net/oficina/sheets |
| go 1.25.0 |
| 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/rastrillo/rastrillo v0.27.1-0.20261006204347-fb806a287060 |
| github.com/carlosframework/rastrillo v0.23.0 |
| github.com/chromedp/cdproto v0.0.0-20250724212937-08a3db8b4327 |
diff --git a/go.sum b/go.sum| index 0ba9045..a703876 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/rastrillo/native/server v0.0.0-20260923173546-2a5d07b2c8d3 h1:5EFx7BLJj/+G/rt8bTmeyMWVfF5s5Sns7ajTvX4w/I8= |
| amadan.net/rastrillo/native/server v0.0.0-20260923173546-2a5d07b2c8d3/go.mod h1:ZaaxeE278dJltdrLwmwpxUjQ5wuKzqDAVSNRet+WupY= |
| amadan.net/rastrillo/rastrillo v0.27.1-0.20261006204347-fb806a287060 h1:K2PXcCKfm+AYrqgH1ea6cNsFs4sN7MKLvq+uBY11NZE= |
diff --git a/internal/sheets/chrome.go b/internal/sheets/chrome.go| index e9fdf96..50a4519 100644 |
| --- a/internal/sheets/chrome.go |
| +++ b/internal/sheets/chrome.go |
| @@ -233,9 +233,9 @@ func (a *App) offersHomeLink(r *http.Request, address string) 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 Sheets marked |
| +// current, then "All apps". |
| func (a *App) switcher() *chrome.Switcher { |
| if a.directory == "" { |
| return nil |
| @@ -243,6 +243,7 @@ func (a *App) switcher() *chrome.Switcher { |
| return &chrome.Switcher{ |
| Label: "Oficina apps", |
| CurrentLabel: "(this app)", |
| + Apps: chrome.SuiteApps(a.directory, "sheets"), |
| AllApps: estilomenu.Item{Href: a.directory + "/", Label: "All apps"}, |
| } |
| } |
diff --git a/internal/sheets/chrome_test.go b/internal/sheets/chrome_test.go| index 720aac6..0d43943 100644 |
| --- a/internal/sheets/chrome_test.go |
| +++ b/internal/sheets/chrome_test.go |
| @@ -151,9 +151,10 @@ func TestTheSignedOutCorner(t *testing.T) { |
| } |
| } |
| -// §6: the switcher shows only when Home names a hub directory, and then |
| -// holds "All apps" alone (Paul's §13 answer 2) — no tiles yet. |
| -func TestTheSwitcherIsAllAppsOnly(t *testing.T) { |
| +// §6: the switcher shows only when Home names a hub directory. It holds |
| +// the suite's six apps as tiles at their hosts under the directory's, |
| +// with Sheets marked current, and "All apps" below a divider. |
| +func TestTheSwitcherShowsTheSuite(t *testing.T) { |
| app, cookies := signIn(t) |
| if body := page(t, app, cookies, "/sheets").Body.String(); strings.Contains(body, "estilo-switcher") { |
| t.Error("a standalone instance shows a switcher; there is no directory to switch through") |
| @@ -161,13 +162,44 @@ func TestTheSwitcherIsAllAppsOnly(t *testing.T) { |
| f := newHomeFixtureWith(t, "https://oficina.example.com") |
| f.local(t, signedInAddress) |
| body := f.request(t, "GET", "/sheets", nil, false).Body.String() |
| - for _, want := range []string{`<details estilo-switcher name="estilo-menus">`, `aria-label="Oficina apps"`, `<a estilo-menu-item href="https://oficina.example.com/"><span estilo-menu-label>All apps</span></a>`} { |
| - if !strings.Contains(body, want) { |
| - t.Errorf("the switcher lacks %s", want) |
| + if !strings.Contains(body, `aria-label="Oficina apps"`) { |
| + t.Error("the switcher is not labelled Oficina apps") |
| + } |
| + start := strings.Index(body, `<details estilo-switcher name="estilo-menus">`) |
| + if start < 0 { |
| + t.Fatal("no switcher", body) |
| + } |
| + panel := body[start:] |
| + panel = panel[:strings.Index(panel, "</details>")] |
| + grid, allApps, ok := strings.Cut(panel, "<hr>") |
| + if !ok || !strings.Contains(allApps, `<a estilo-menu-item href="https://oficina.example.com/"><span estilo-menu-label>All apps</span></a>`) { |
| + t.Error("the switcher does not offer All apps below the tiles", panel) |
| + } |
| + var tiles []string |
| + for _, tile := range strings.Split(grid, "<a estilo-switcher-app ")[1:] { |
| + tiles = append(tiles, tile[:strings.Index(tile, "</a>")]) |
| + } |
| + want := []string{"docs", "sheets", "slides", "calendar", "memoria", "calls"} |
| + names := []string{"Docs", "Sheets", "Slides", "Calendar", "Memoria", "Calls"} |
| + if len(tiles) != len(want) { |
| + t.Fatalf("%d tiles, want %d: %s", len(tiles), len(want), grid) |
| + } |
| + for i, slug := range want { |
| + head := `href="https://` + slug + `.oficina.example.com/"` |
| + if slug == "sheets" { |
| + 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.Count(grid, "aria-current") != 1 || !strings.Contains(tiles[1], "<span estilo-visually-hidden> (this app)</span>") { |
| + t.Error("Sheets is not the one current tile", grid) |
| } |
| - if strings.Contains(body, "estilo-switcher-app") { |
| - t.Error("the switcher renders app tiles before Home's /apps/<slug> hop is ready") |
| + // Every tile's icon is served here, publicly: no cookies at all. |
| + if rec := do(t, app, httptest.NewRequest(http.MethodGet, "/static/estilo/brand/calls.svg", nil)); rec.Code != http.StatusOK { |
| + t.Errorf("a tile's icon is %d", rec.Code) |
| } |
| } |