oficina / estilo Public

chrome: SuiteApps, the switcher's six app tiles open

On branch feat/switcher-tiles

🤖 Branch feat/switcher-tiles at 0e4003429d577cf282f3ba4932b6c8560fc091ce.

Paul asked: "Can the 'All apps' dropdown just be a list of apps rather than a dropdown with a single-item list?"

The switcher template already drew a grid of tiles above an <hr> and "All apps"; every app passed AllApps only. This adds the one place the suite's tiles are built.

API (package chrome)

func SuiteApps(directory, current string) []SwitcherApp
  • directory is the app's hub directory origin (its HOME_DIRECTORY_ORIGIN, e.g. https://oficina.works). Each app's href is <scheme>://<slug>.<directory host>/, so nothing is hard-coded per app or per environment.
  • Tiles, in order: Docs, Sheets, Slides, Calendar, Memoria, Calls (the six registered with id.oficina.works; Fichas, Mail and Files deliberately absent). Names are product names, the same in every locale.
  • Icon is brand.Path(slug); callers must mount brand.Handler().
  • current is the caller's slug (Calls passes calls); that tile gets Current, so the template adds aria-current="true" and the hidden "(this app)".
  • A directory that is not an absolute http(s) origin returns nil, so the panel stays "All apps" alone.

CSS. Three 5.5rem tiles hung from the trigger ran off the inline start at 320px (−42px in Chromium), and sooner with the wider signed-out "Sign in" corner. Below 30rem the panel now spans the bar (inset-inline: 0.5rem), as menubar panels already do, with three equal columns. Measured in Chromium and WebKit at 320, 390 and 1280, signed in and signed out: panel inside the viewport at every width, three columns, two rows of six.

Tests. chrome/suite_test.go: derivation from the directory (incl. port and trailing slash), unknown current marks nothing, non-origin directories give nil, and a full render asserting grid-then-<hr>-then-All-apps, six tiles in order, and exactly one aria-current with the hidden label on the right tile.

make test green locally (GOTOOLCHAIN=go1.26.5).

App branches (feat/switcher-tiles in docs, sheets, slides, calendar, memoria, meet) pin this branch commit until it merges; they will need re-pinning to the main commit after the merge.

Not merged, not deployed. Review pending.

🤖 Hub CI: passed at 0e4003429d577cf282f3ba4932b6c8560fc091ce.

🤖 Review only, from a detached scratch worktree under /tmp/switcher-review-21a32889; whole branch compared with freshly fetched origin/main. No source edits, commits, pushes or merges. Reviewer: GPT-6-Astra (Codex), reviewing for session 21a32889.

Reviewed head 0e4003429d577cf282f3ba4932b6c8560fc091ce against a264aa5b9540467707a1081d5310a459b7f68297.

VERDICT: APPROVE-WITH-NITS — ready to merge. No P0, P1 or P2 findings.

  1. Note — optional API hardening, chrome/suite.go:32–40: reject unsupported/non-DNS hosts before prepending the app label, and add cases to suite_test.go. Direct probes currently give SuiteApps("https://[::1]", "docs")[0].Href == "https://docs.[::1]/" and https://:443 produces https://docs.:443/. These are unusable destinations and do not meet the documented origin contract. This is nonblocking: all six production callers obtain the directory from startup configuration; Docs' validatedDirectory and the other apps' connect.DecodeCredentials require canonical HTTPS DNS origins and reject these inputs. No request-controlled origin or attacker-influenced href path was found. Credential, backslash, encoded-separator, path/query and non-HTTP scheme probes were rejected.

The fixed app order, stable product names, per-call tile slice, unknown-current behavior, calls slug, same-origin brand paths and port preservation are consistent with the API. The tests exercise both the constructed values and rendered markup. The existing template uses ordinary links, decorative alt="" icons, one aria-current="true", and the supplied hidden current label; All apps follows an actual separator.

Shared-component browser verification used HTML rendered by the actual estilo branch templates and CSS: Chromium and WebKit, all six current-app states, signed in and signed out, at 320, 390 and 1280px (72 layouts). All passed: three columns/two rows, no horizontal overflow, loaded icons, targets above 24px and reachable by pointer. Keyboard opening, link order, Escape/focus return, accessible names and scriptless opening passed; WebKit link navigation used macOS Option-Tab.

Validation: GOTOOLCHAIN=go1.26.5 make test passed. Hub CI passed at the reviewed head. The six consumer pins all resolve to this commit; repin consumers to the resulting estilo main commit after the shared change merges, as already documented in their discussions.