Refresh console styling and mobile navigation
Squashed from console-fiesta-depth into main.
33 files changed,
+2,033
−143
docs/superpowers/plans/2026-10-30-console-protection-tab-copy.md+1 −1internal/console/accountfleet.go+1 −0internal/console/accountindex.go+27 −0internal/console/accountindex_test.go+42 −0internal/console/appnav_test.go+0 −3internal/console/assets_test.go+31 −0internal/console/authcli.go+1 −1internal/console/billingchange.go+1 −0internal/console/billingseats.go+1 −0internal/console/claim_invariant_fixtures_test.go+4 −0internal/console/claim_invariant_probes_read_test.go+5 −0internal/console/fleets.go+1 −0internal/console/icons.go+4 −0internal/console/icons_test.go+2 −20internal/console/mobilenav.go+252 −0internal/console/mobilenav_test.go+364 −0internal/console/ownership.go+1 −0internal/console/perfwalk_test.go+3 −0internal/console/planlapse_keep.go+1 −0internal/console/remotemetrics_test.go+1 −1internal/console/server.go+10 −1internal/console/server_test.go+36 −4internal/console/static/fiesta/LICENSE+373 −0internal/console/static/fiesta/VERSION+10 −0internal/console/templates/app_overview.html+1 −1internal/console/templates/appnav.html+3 −10internal/console/templates/apps.html+42 −9internal/console/templates/fiesta.html+425 −0internal/console/templates/layout.html+304 −91internal/console/templates/navindex.html+17 −0internal/console/testdata/claim-routes.txt+4 −0internal/provision/console_fiesta_census_test.go+64 −0internal/provision/plan9_b8_census_test.go+1 −1
CI cancelled β superseded by a newer push — run details
landed from console-fiesta-depth
diff --git a/docs/superpowers/plans/2026-10-30-console-protection-tab-copy.md b/docs/superpowers/plans/2026-10-30-console-protection-tab-copy.md| index 09737a4d8..4c75b3884 100644 |
| --- a/docs/superpowers/plans/2026-10-30-console-protection-tab-copy.md |
| +++ b/docs/superpowers/plans/2026-10-30-console-protection-tab-copy.md |
| @@ -38,7 +38,7 @@ The rules (the same as the analytics on-ramp deck, |
| | id | where | old | new | checked by | status | |
| | --- | --- | --- | --- | --- | --- | |
| -| PT-C01 | templates/appnav.html (tab) | (new) | Protection | gate | approved | |
| +| PT-C01 | mobilenav.go (shared tab and mobile navigation label) | (new) | Protection | gate | approved | |
| | PT-C02 | templates/app_protection.html (watching headline) | (new) | In the last {days} days, {caught} requests to this app looked like attacks. Protection is recording them and letting them through while we check it never stops a real visitor. | TestProtectionTabRendersHeadline | approved | |
| | PT-C03 | templates/app_protection.html (blocking headline) | (new) | In the last {days} days, protection blocked {blocked} requests to this app. | TestProtectionTabBlockingHeadline | approved | |
| | PT-C04 | templates/app_protection.html (mixed headline) | (new) | In the last {days} days, protection blocked {blocked} requests to this app and recorded {watched} more. | TestProtectionTabMixedHeadline | approved | |
diff --git a/internal/console/accountfleet.go b/internal/console/accountfleet.go| index da3644d7c..c7dadcccc 100644 |
| --- a/internal/console/accountfleet.go |
| +++ b/internal/console/accountfleet.go |
| @@ -255,5 +255,6 @@ func (s *Server) handleFleetBYO(w http.ResponseWriter, r *http.Request) { |
| p := s.accountPage(w, r, addr, raw, acct, role) |
| p.Title = "Bring your own fleet" |
| p.ActiveNav = "fleet" |
| + p.mobileParentSection("fleet") |
| s.render(w, http.StatusOK, "fleet_byo", p) |
| } |
diff --git a/internal/console/accountindex.go b/internal/console/accountindex.go| new file mode 100644 |
| index 000000000..69e14d25c |
| --- /dev/null |
| +++ b/internal/console/accountindex.go |
| @@ -0,0 +1,27 @@ |
| +package console |
| + |
| +import "net/http" |
| + |
| +const indexAccounts = "accounts" |
| + |
| +func (s *Server) handleAccountsIndex(w http.ResponseWriter, r *http.Request) { |
| + addr, raw, ok := s.session(r) |
| + if !ok { |
| + http.Redirect(w, r, "/", http.StatusFound) |
| + return |
| + } |
| + accounts, err := s.store.AccountsFor(addr) |
| + if err != nil { |
| + s.renderMessage(w, r, http.StatusInternalServerError, "Error", "Could not open your account. Please try again.") |
| + return |
| + } |
| + for i := range accounts { |
| + accounts[i].Seg = preferredSeg(accounts, &accounts[i]) |
| + } |
| + p := page{ |
| + Title: "Accounts", Address: addr, CSRF: raw, |
| + Accounts: accounts, IndexOf: indexAccounts, |
| + } |
| + p.Flash, p.FlashErr = s.takeFlash(w, r) |
| + s.render(w, http.StatusOK, "nav_index", p) |
| +} |
diff --git a/internal/console/accountindex_test.go b/internal/console/accountindex_test.go| new file mode 100644 |
| index 000000000..d89d6ffb8 |
| --- /dev/null |
| +++ b/internal/console/accountindex_test.go |
| @@ -0,0 +1,42 @@ |
| +package console |
| + |
| +import ( |
| + "net/http" |
| + "strings" |
| + "testing" |
| + "time" |
| +) |
| + |
| +func TestAccountsIndexMembership(t *testing.T) { |
| + fx := newConsoleFixture(t) |
| + anon := newBrowser(t) |
| + if status, loc, _ := get(t, anon, fx.ts.URL+"/accounts"); status != http.StatusFound || loc != "/" { |
| + t.Fatalf("signed out accounts = %d -> %q", status, loc) |
| + } |
| + otherID := testAccountID() |
| + if err := fx.st.CreateAccount(otherID, accountSqid(otherID), "other-private", "sam@keymail.dev", time.Now()); err != nil { |
| + t.Fatal(err) |
| + } |
| + c := signInPaul(t, fx) |
| + status, _, body := get(t, c, fx.ts.URL+"/accounts") |
| + if status != http.StatusOK || !strings.Contains(body, `href="`+navPath("/index")+`"`) { |
| + t.Fatalf("accounts = %d, missing own account menu", status) |
| + } |
| + if strings.Contains(body, "other-private") || strings.Contains(body, accountSqid(otherID)) { |
| + t.Fatal("account list exposes a non-member account") |
| + } |
| + if err := fx.st.AddMember(otherID, "paul@keymail.dev", RoleMember, time.Now()); err != nil { |
| + t.Fatal(err) |
| + } |
| + _, _, body = get(t, c, fx.ts.URL+"/accounts") |
| + if !strings.Contains(body, `href="/a/other-private/index"`) { |
| + t.Fatal("new membership is missing from account list") |
| + } |
| + if err := fx.st.RemoveMember(otherID, "paul@keymail.dev"); err != nil { |
| + t.Fatal(err) |
| + } |
| + _, _, body = get(t, c, fx.ts.URL+"/accounts") |
| + if strings.Contains(body, "other-private") { |
| + t.Fatal("removed membership remains in account list") |
| + } |
| +} |
diff --git a/internal/console/appnav_test.go b/internal/console/appnav_test.go| index dff7afa51..c1c91812f 100644 |
| --- a/internal/console/appnav_test.go |
| +++ b/internal/console/appnav_test.go |
| @@ -368,7 +368,4 @@ func TestHeaderWrapsOnNarrowScreens(t *testing.T) { |
| t.Errorf("%s does not wrap: %s", sel, blk) |
| } |
| } |
| - if blk := cssBlock(t, body, "header .addr"); !strings.Contains(blk, "text-overflow: ellipsis") { |
| - t.Errorf("header .addr does not truncate: %s", blk) |
| - } |
| } |
diff --git a/internal/console/assets_test.go b/internal/console/assets_test.go| index 2e95dcc29..c2a40ca85 100644 |
| --- a/internal/console/assets_test.go |
| +++ b/internal/console/assets_test.go |
| @@ -4,6 +4,7 @@ import ( |
| "bufio" |
| "crypto/sha256" |
| "encoding/hex" |
| + "encoding/json" |
| "fmt" |
| "io" |
| "net/http" |
| @@ -359,3 +360,33 @@ func TestStaticIsNotMeasured(t *testing.T) { |
| } |
| } |
| } |
| + |
| +func TestFiestaInlineThemeMatchesVersion(t *testing.T) { |
| + b, err := staticFS.ReadFile("static/fiesta/VERSION") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var pin map[string]string |
| + if err := json.Unmarshal(b, &pin); err != nil { |
| + t.Fatal(err) |
| + } |
| + theme, err := tmplFS.ReadFile("templates/fiesta.html") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + license, err := staticFS.ReadFile("static/fiesta/LICENSE") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + source := strings.TrimSuffix(strings.TrimPrefix(string(theme), "{{define \"fiesta_day\"}}\n"), "\n{{end}}\n") |
| + for key, content := range map[string][]byte{ |
| + "template_sha256": theme, |
| + "source_sha256": []byte(source), |
| + "license_sha256": license, |
| + } { |
| + sum := sha256.Sum256(content) |
| + if got := hex.EncodeToString(sum[:]); got != pin[key] { |
| + t.Errorf("%s: got %s, VERSION records %s", key, got, pin[key]) |
| + } |
| + } |
| +} |
diff --git a/internal/console/authcli.go b/internal/console/authcli.go| index dd33d676d..c1376804f 100644 |
| --- a/internal/console/authcli.go |
| +++ b/internal/console/authcli.go |
| @@ -1712,7 +1712,7 @@ func (s *Server) handleCLITokens(w http.ResponseWriter, r *http.Request) { |
| s.renderMessage(w, r, http.StatusInternalServerError, "Error", "Could not read your terminals. Please try again.") |
| return |
| } |
| - p := cliPage{page: page{Title: "Your settings", Address: addr, CSRF: raw}, |
| + p := cliPage{page: page{Title: "Your settings", Address: addr, CSRF: raw, MobileParent: &navLink{Label: "Accounts", Href: "/accounts"}}, |
| Tokens: toks, Console: s.cfg.Origin, Days: int(CLITokenTTL / (24 * time.Hour)), |
| ServiceAccounts: s.serviceAccountSqids(toks)} |
| p.Flash, p.FlashErr = s.takeFlash(w, r) |
diff --git a/internal/console/billingchange.go b/internal/console/billingchange.go| index 5b6ae6f2d..f83909a42 100644 |
| --- a/internal/console/billingchange.go |
| +++ b/internal/console/billingchange.go |
| @@ -210,6 +210,7 @@ func (s *Server) renderChangeConfirm(w http.ResponseWriter, r *http.Request, add |
| p.Title = billingCopy["confirm.title"] |
| p.AppName = acct.Name |
| p.ActiveNav = "billing" |
| + p.mobileParentSection("billing") |
| p.Confirm = &ConfirmView{ |
| Title: billingCopy["confirm.title"], |
| Lines: []string{line}, |
diff --git a/internal/console/billingseats.go b/internal/console/billingseats.go| index 78cb46aab..4deb7f2e8 100644 |
| --- a/internal/console/billingseats.go |
| +++ b/internal/console/billingseats.go |
| @@ -689,6 +689,7 @@ func (s *Server) renderInviteConfirm(w http.ResponseWriter, r *http.Request, add |
| p.Title = billingCopy["confirm.title"] |
| p.AppName = acct.Name |
| p.ActiveNav = "team" |
| + p.mobileParentSection("team") |
| p.Confirm = &ConfirmView{ |
| Title: billingCopy["confirm.title"], |
| Lines: []string{line}, |
diff --git a/internal/console/claim_invariant_fixtures_test.go b/internal/console/claim_invariant_fixtures_test.go| index 383d3f726..eecb2fdd9 100644 |
| --- a/internal/console/claim_invariant_fixtures_test.go |
| +++ b/internal/console/claim_invariant_fixtures_test.go |
| @@ -730,6 +730,7 @@ func (cx *claimCase) crashedRestore(t *testing.T) { |
| // ---- the table ---------------------------------------------------------------- |
| var claimFixtures = map[string]claimFixture{ |
| + "route GET /accounts": claimRead("renders only the signed-in personβs account memberships"), |
| // ---- methodless routes (the handler checks r.Method itself) ---- |
| "route /api/economics/backhaul": claimRead("operator backhaul report (GET only) computed from the economics view; writes nothing"), |
| "route /api/economics/bill": claimNonApp("operator bill import, stored under economics/; names no app"), |
| @@ -810,6 +811,7 @@ var claimFixtures = map[string]claimFixture{ |
| "route GET /a/{sqid}/apps/{app}/availability": claimRead("renders edge availability counts"), |
| "route GET /a/{sqid}/apps/{app}/deployments": claimRead("redirects to the releases page"), |
| "route GET /a/{sqid}/apps/{app}/errors": claimRead("renders grouped app errors"), |
| + "route GET /a/{sqid}/apps/{app}/index": claimRead("renders the app's sections as a phone index; reads only the gate"), |
| "route GET /a/{sqid}/apps/{app}/instances": claimRead("renders the app's instance records"), |
| "route GET /a/{sqid}/apps/{app}/instances/{host}": claimRead("renders one instance and polls its report over HTTP"), |
| "route GET /a/{sqid}/apps/{app}/logs": claimRead("renders the logs page"), |
| @@ -820,10 +822,12 @@ var claimFixtures = map[string]claimFixture{ |
| "route GET /a/{sqid}/apps/{app}/releases": claimRead("renders releases"), |
| "route GET /a/{sqid}/apps/{app}/settings": claimRead("renders app settings"), |
| "route GET /a/{sqid}/apps/{app}/settings/{section}": claimRead("renders one app settings section"), |
| + "route GET /a/{sqid}/apps/{app}/settings/index": claimRead("renders the app's settings sections as a phone index; reads only the gate"), |
| "route GET /a/{sqid}/billing": claimRead("renders the billing page (plans 6b) from stored billing facts, the plan row and the member count; no provider request; names no app"), |
| "route GET /a/{sqid}/fleet": claimRead("renders the account's fleet tab"), |
| "route GET /a/{sqid}/fleet/byo": claimRead("renders bring-your-own-box instructions"), |
| "route GET /a/{sqid}/fleets/{fleet}": claimRead("renders one fleet's boxes and placements"), |
| + "route GET /a/{sqid}/index": claimRead("renders the account's sections as a phone index"), |
| "route GET /a/{sqid}/settings": claimRead("renders account settings"), |
| "route GET /a/{sqid}/plan/keep": claimRead("renders the keep page (plans 4d) from the plan row, lapse items and an inventory read; writes nothing"), |
| "route GET /a/{sqid}/team": claimRead("renders members and invites"), |
diff --git a/internal/console/claim_invariant_probes_read_test.go b/internal/console/claim_invariant_probes_read_test.go| index 4aa0b1459..cce847130 100644 |
| --- a/internal/console/claim_invariant_probes_read_test.go |
| +++ b/internal/console/claim_invariant_probes_read_test.go |
| @@ -175,6 +175,7 @@ func claimInvitePageProbe() claimProbe { |
| } |
| var claimReadProbes = map[string]claimProbe{ |
| + "route GET /accounts": claimPageRead(nil, "/accounts", `id="index-title">Accounts</h1>`), |
| // ---- methodless ---- |
| "route /api/economics/backhaul": claimAPIRead(nil, "/api/economics/backhaul", `"period"`, `"accounts"`), |
| "route /fleet/architecture": claimPageRead(nil, "/fleet/architecture", "<h1>Architecture</h1>"), |
| @@ -189,6 +190,7 @@ var claimReadProbes = map[string]claimProbe{ |
| "route GET /a/{sqid}/apps/{app}/availability": claimPageRead(nil, "/a/bab/apps/titogo/availability", "titogo"), |
| "route GET /a/{sqid}/apps/{app}/deployments": claimRedirectRead("/a/bab/apps/kass/deployments", http.StatusSeeOther, "/a/bab/apps/kass/releases"), |
| "route GET /a/{sqid}/apps/{app}/errors": claimPageRead(nil, "/a/bab/apps/titogo/errors", "titogo"), |
| + "route GET /a/{sqid}/apps/{app}/index": claimPageRead(nil, "/a/bab/apps/kass/index", `id="nav-overview"`, "kass"), |
| "route GET /a/{sqid}/apps/{app}/instances": claimPageRead(nil, "/a/bab/apps/kass/instances", "kass.carlosapp.dev"), |
| "route GET /a/{sqid}/apps/{app}/instances/{host}": claimPageRead(nil, "/a/bab/apps/kass/instances/kass.carlosapp.dev", "kass.carlosapp.dev"), |
| "route GET /a/{sqid}/apps/{app}/logs": claimPageRead(nil, "/a/bab/apps/titogo/logs", "titogo"), |
| @@ -200,10 +202,13 @@ var claimReadProbes = map[string]claimProbe{ |
| "route GET /a/{sqid}/apps/{app}/settings": claimPageRead(nil, "/a/bab/apps/titogo/settings", "titogo"), |
| "route GET /a/{sqid}/apps/{app}/settings/{section}": claimPageRead(nil, "/a/bab/apps/titogo/settings/general", |
| "/apps/titogo/control-plane/set"), |
| + "route GET /a/{sqid}/apps/{app}/settings/index": claimPageRead(nil, "/a/bab/apps/titogo/settings/index", |
| + `id="nav-general"`), |
| "route GET /a/{sqid}/billing": claimPageRead(claimBillingWorld, "/a/bab/billing", "<h1>"+billingCopy["page.title"]+"</h1>"), |
| "route GET /a/{sqid}/fleet": claimPageRead(claimWorldFleet, "/a/bab/fleet", "pi"), |
| "route GET /a/{sqid}/fleet/byo": claimPageRead(nil, "/a/bab/fleet/byo", "<h1>Bring your own fleet</h1>"), |
| "route GET /a/{sqid}/fleets/{fleet}": claimPageRead(claimWorldFleet, "/a/bab/fleets/pi", "<h1>pi</h1>"), |
| + "route GET /a/{sqid}/index": claimPageRead(nil, "/a/bab/index", `id="nav-apps"`), |
| "route GET /a/{sqid}/settings": claimPageRead(nil, "/a/bab/settings", "<h1>Account settings</h1>"), |
| "route GET /a/{sqid}/plan/keep": claimPageRead(claimWorldLapse, "/a/bab/plan/keep", "<h1>Choose what stays</h1>"), |
| "route GET /a/{sqid}/team": claimPageRead(nil, "/a/bab/team", "<h1>Team</h1>", claimFxOwner), |
diff --git a/internal/console/fleets.go b/internal/console/fleets.go| index 39f01aa6d..5d0ad844c 100644 |
| --- a/internal/console/fleets.go |
| +++ b/internal/console/fleets.go |
| @@ -1464,6 +1464,7 @@ func (s *Server) handleFleetPage(w http.ResponseWriter, r *http.Request) { |
| p := s.accountPage(w, r, addr, raw, acct, role) |
| p.Title = fleet.Name |
| p.ActiveNav = "fleet" |
| + p.mobileParentSection("fleet") |
| p.FleetDetail = fleet |
| boxes, apps, warn := s.loadFleetPage(r.Context(), reg, acct, fleet) |
| p.FleetBoxes = boxes |
diff --git a/internal/console/icons.go b/internal/console/icons.go| index 64f99ba47..b0ddf2d32 100644 |
| --- a/internal/console/icons.go |
| +++ b/internal/console/icons.go |
| @@ -101,6 +101,9 @@ const ( |
| // The operator pages' narrow-screen rail toggle (Lucide: menu). |
| iconMenu template.HTML = iconOpen + `<path d="M4 12h16"/><path d="M4 6h16"/><path d="M4 18h16"/></svg>` |
| + // The profile menu's button (Lucide: user-round). |
| + iconUserRound template.HTML = iconOpen + `<circle cx="12" cy="8" r="5"/><path d="M20 21a8 8 0 0 0-16 0"/></svg>` |
| + |
| // A healthy status word's mark (Lucide: circle-check). |
| iconCircleCheck template.HTML = iconOpen + `<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>` |
| @@ -143,6 +146,7 @@ var icons = map[string]template.HTML{ |
| "layers": iconLayers, |
| "hourglass": iconHourglass, |
| "menu": iconMenu, |
| + "user-round": iconUserRound, |
| "circle-check": iconCircleCheck, |
| "circle-x": iconCircleX, |
| "info": iconInfo, |
diff --git a/internal/console/icons_test.go b/internal/console/icons_test.go| index fa9239041..89fbe3ada 100644 |
| --- a/internal/console/icons_test.go |
| +++ b/internal/console/icons_test.go |
| @@ -47,28 +47,10 @@ func TestSwitcherChromeIsInlineSVGNotTextGlyphs(t *testing.T) { |
| } |
| } |
| -// Emoji are content, never chrome (Eleven's docs/icons.md). The footer's |
| -// robot is a factor-X disclosure β a mark this platform puts on LLM-written |
| -// text everywhere, from README.md to site/platform β so it is content and it |
| -// stays. This test pins that distinction so a later sweep of "remove the |
| -// emoji" cannot quietly take the disclosure with it. |
| -func TestFactorXDisclosureKeepsItsEmoji(t *testing.T) { |
| - fx := newConsoleFixture(t) |
| - c := signInPaul(t, fx) |
| - _, _, body := get(t, c, fx.u("/")) |
| - foot, _, ok := strings.Cut(body, "</footer>") |
| - if !ok { |
| - t.Fatalf("no <footer> in:\n%s", body) |
| - } |
| - if !strings.Contains(foot, "π€") || !strings.Contains(foot, "written by an LLM") { |
| - t.Errorf("the footer lost its factor-X disclosure:\n%s", foot) |
| - } |
| -} |
| - |
| // Same-origin, the console's version. internal/status asserts this on its |
| // published page with a flat "no http(s):// anywhere" ban; the console cannot |
| -// use that ban verbatim because it legitimately LINKS out β the footer's |
| -// 11factor.org citation, an app's canary host. A link is navigation the |
| +// use that ban verbatim because it legitimately LINKS out β for example, |
| +// an app's canary host. A link is navigation the |
| // reader chooses. What must never appear is a SUBRESOURCE fetched from |
| // anywhere but this origin: anything the browser fetches on its own while |
| // rendering the page β a script, a stylesheet, a font, an image, an @import, |
diff --git a/internal/console/mobilenav.go b/internal/console/mobilenav.go| new file mode 100644 |
| index 000000000..186ba7c58 |
| --- /dev/null |
| +++ b/internal/console/mobilenav.go |
| @@ -0,0 +1,252 @@ |
| +package console |
| + |
| +import ( |
| + "net/http" |
| + "net/url" |
| +) |
| + |
| +// The console on a phone (at 800px and narrower) follows Fiesta's console |
| +// shell: every account page is either an index, a full-screen list of the |
| +// sections one level down, or a page, with one back link at the top to the |
| +// index it sits under. Both are ordinary links and server routes; nothing |
| +// here needs JavaScript. At desktop widths the header nav and the app tabs |
| +// stay as they are, and an index page still works as a page of links. |
| +// |
| +// The links are built here once, for the header nav, the app tabs and the |
| +// index pages alike, so an index can never offer a different list |
| +// from the nav it stands in for. |
| + |
| +// navLink is one link of the console's navigation. Key names the section: |
| +// it is what aria-current compares against, and an index page's anchors |
| +// carry it as their id (nav-<key>) so a back link can land on the row it |
| +// came from. |
| +type navLink struct { |
| + Key, Label, Href string |
| + Current bool |
| +} |
| + |
| +// The three index pages, by page.IndexOf. |
| +const ( |
| + indexAccount = "account" |
| + indexApp = "app" |
| + indexSettings = "settings" |
| +) |
| + |
| +// AccountLinks is the account nav: the header's links on desktop, and the |
| +// account index's list on a phone. |
| +func (p page) AccountLinks() []navLink { |
| + if p.Account == nil { |
| + return nil |
| + } |
| + links := []navLink{ |
| + {Key: "apps", Label: "Apps", Href: p.Nav + "/"}, |
| + {Key: "fleet", Label: "Fleet", Href: p.Nav + "/fleet"}, |
| + {Key: "team", Label: "Team", Href: p.Nav + "/team"}, |
| + } |
| + if p.BillingNav { |
| + links = append(links, navLink{Key: "billing", Label: billingCopy["page.title"], Href: p.Nav + "/billing"}) |
| + } |
| + links = append(links, navLink{Key: "settings", Label: "Settings", Href: p.Nav + "/settings"}) |
| + for i := range links { |
| + links[i].Current = links[i].Key == p.ActiveNav |
| + } |
| + return links |
| +} |
| + |
| +// appBase is the app's own URL, the root of every app tab's. |
| +func (p page) appBase() string { return p.Nav + "/apps/" + url.PathEscape(p.AppName) } |
| + |
| +// AppLinks is the app's sections: the tab bar on desktop, and the app |
| +// index's list on a phone. |
| +func (p page) AppLinks() []navLink { |
| + if p.AppName == "" { |
| + return nil |
| + } |
| + base := p.appBase() |
| + links := []navLink{ |
| + {Key: "overview", Label: "Overview", Href: base}, |
| + {Key: "instances", Label: "Running", Href: base + "/instances"}, |
| + {Key: "releases", Label: deploymentsCopy.Title, Href: base + "/releases"}, |
| + {Key: "logs", Label: "Logs", Href: base + "/logs"}, |
| + {Key: "errors", Label: "Errors", Href: base + "/errors"}, |
| + {Key: "availability", Label: "Availability", Href: base + "/availability"}, |
| + {Key: "analytics", Label: "Analytics", Href: base + "/analytics"}, |
| + {Key: "protection", Label: "Protection", Href: base + "/protection"}, |
| + {Key: "activity", Label: "Activity", Href: base + "/activity"}, |
| + {Key: "settings", Label: "Settings", Href: base + "/settings"}, |
| + } |
| + for i := range links { |
| + links[i].Current = links[i].Key == p.ActiveTab |
| + } |
| + return links |
| +} |
| + |
| +// IndexLinks is an index page's list. The app index sends Settings to the |
| +// settings index rather than to General, so a phone goes down one level at |
| +// a time. Nothing on an index is current: it is the level above the page. |
| +func (p page) IndexLinks() []navLink { |
| + var links []navLink |
| + switch p.IndexOf { |
| + case indexAccounts: |
| + for _, a := range p.Accounts { |
| + links = append(links, navLink{Key: a.Sqid, Label: a.Name + " Β· " + a.Sqid, Href: "/a/" + url.PathEscape(a.Seg) + "/index"}) |
| + } |
| + links = append(links, navLink{Key: "new", Label: "New account", Href: "/accounts/new"}) |
| + case indexAccount: |
| + links = p.AccountLinks() |
| + case indexApp: |
| + links = p.AppLinks() |
| + for i := range links { |
| + if links[i].Key == "settings" { |
| + links[i].Href = p.appBase() + "/settings/index" |
| + } |
| + } |
| + case indexSettings: |
| + for _, s := range p.SettingsNav { |
| + links = append(links, navLink{Key: s.Key, Label: s.Label, Href: s.Href}) |
| + } |
| + } |
| + for i := range links { |
| + links[i].Current = false |
| + } |
| + return links |
| +} |
| + |
| +// MobileView is the view a phone shows this page as: "index", "page", or |
| +// "" for a page without an account or an explicit parent. |
| +func (p page) MobileView() string { |
| + if p.MobileParent != nil { |
| + return "page" |
| + } |
| + if p.IndexOf == indexAccounts { |
| + return "index" |
| + } |
| + if p.Account == nil || p.Nav == "" || p.Op != nil { |
| + return "" |
| + } |
| + if p.IndexOf != "" { |
| + return "index" |
| + } |
| + return "page" |
| +} |
| + |
| +// MobileBack is the phone's back link: up one level, to the index row this |
| +// page was reached from. The account list is the top and has none. |
| +func (p page) MobileBack() *navLink { |
| + if p.MobileParent != nil { |
| + return p.MobileParent |
| + } |
| + if p.MobileView() == "" { |
| + return nil |
| + } |
| + switch p.IndexOf { |
| + case indexAccounts: |
| + return nil |
| + case indexAccount: |
| + return &navLink{Label: "Accounts", Href: "/accounts#nav-" + p.Account.Sqid} |
| + case indexApp: |
| + return &navLink{Label: "Apps", Href: p.Nav + "/"} |
| + case indexSettings: |
| + return &navLink{Label: p.AppName, Href: p.appBase() + "/index#nav-settings"} |
| + } |
| + if p.AppName == "" { |
| + back := &navLink{Label: p.Account.Name, Href: p.Nav + "/index"} |
| + if p.ActiveNav != "" { |
| + back.Href += "#nav-" + p.ActiveNav |
| + } |
| + return back |
| + } |
| + if p.InstanceDetail != nil && p.InstanceListURL != "" { |
| + return &navLink{Label: p.appLinkLabel("instances"), Href: p.InstanceListURL} |
| + } |
| + if p.ActiveTab == "settings" && p.SettingsSection != "" { |
| + return &navLink{Label: p.appLinkLabel("settings"), Href: p.appBase() + "/settings/index#nav-" + p.SettingsSection} |
| + } |
| + back := &navLink{Label: p.AppName, Href: p.appBase() + "/index"} |
| + if p.ActiveTab != "" { |
| + back.Href += "#nav-" + p.ActiveTab |
| + } |
| + return back |
| +} |
| + |
| +// MobileTitle is an app page's heading on a phone: the section it shows, |
| +// since the app's name is already the back link above it. "" keeps the |
| +// app's name. |
| +func (p page) MobileTitle() string { |
| + if p.MobileView() != "page" || p.AppName == "" { |
| + return "" |
| + } |
| + if p.InstanceDetail != nil { |
| + return p.appLinkLabel("instances") |
| + } |
| + if p.ActiveTab == "settings" { |
| + for _, s := range p.SettingsNav { |
| + if s.Current { |
| + return s.Label |
| + } |
| + } |
| + } |
| + return p.appLinkLabel(p.ActiveTab) |
| +} |
| + |
| +func (p page) appLinkLabel(key string) string { |
| + for _, l := range p.AppLinks() { |
| + if l.Key == key { |
| + return l.Label |
| + } |
| + } |
| + return "" |
| +} |
| + |
| +// handleAccountIndex is the account's index: its sections, and the |
| +// signed-in address and Sign out the header carries on desktop. |
| +func (s *Server) handleAccountIndex(w http.ResponseWriter, r *http.Request) { |
| + addr, raw, acct, role, ok := s.account(w, r) |
| + if !ok { |
| + return |
| + } |
| + p := s.accountPage(w, r, addr, raw, acct, role) |
| + p.Title = acct.Name |
| + p.IndexOf = indexAccount |
| + s.render(w, http.StatusOK, "nav_index", p) |
| +} |
| + |
| +// handleAppIndex is an app's index: its sections. It reads no platform |
| +// state, only the gate's membership and app checks. |
| +func (s *Server) handleAppIndex(w http.ResponseWriter, r *http.Request) { |
| + addr, raw, acct, role, app, ok := s.accountApp(w, r) |
| + if !ok { |
| + return |
| + } |
| + p := s.accountPage(w, r, addr, raw, acct, role) |
| + p.Title = app |
| + p.AppName = app |
| + p.ActiveNav = "apps" |
| + p.IndexOf = indexApp |
| + s.render(w, http.StatusOK, "nav_index", p) |
| +} |
| + |
| +// handleAppSettingsIndex is an app's settings index: its settings sections. |
| +func (s *Server) handleAppSettingsIndex(w http.ResponseWriter, r *http.Request) { |
| + addr, raw, acct, role, app, ok := s.accountApp(w, r) |
| + if !ok { |
| + return |
| + } |
| + p := s.accountPage(w, r, addr, raw, acct, role) |
| + p.Title = app |
| + p.AppName = app |
| + p.ActiveNav = "apps" |
| + p.ActiveTab = "settings" |
| + setAppSettingsSection(&p, "") |
| + p.IndexOf = indexSettings |
| + s.render(w, http.StatusOK, "nav_index", p) |
| +} |
| + |
| +func (p *page) mobileParentSection(key string) { |
| + for _, link := range p.AccountLinks() { |
| + if link.Key == key { |
| + p.MobileParent = &link |
| + return |
| + } |
| + } |
| +} |
diff --git a/internal/console/mobilenav_test.go b/internal/console/mobilenav_test.go| new file mode 100644 |
| index 000000000..4d9b3a342 |
| --- /dev/null |
| +++ b/internal/console/mobilenav_test.go |
| @@ -0,0 +1,364 @@ |
| +package console |
| + |
| +import ( |
| + "html" |
| + "net/http" |
| + "regexp" |
| + "strings" |
| + "testing" |
| + "time" |
| +) |
| + |
| +var ( |
| + indexLinkRE = regexp.MustCompile(`<a id="nav-([^"]+)" href="([^"]+)"[^>]*>([^<]+)</a>`) |
| + mobileBackRE = regexp.MustCompile(`<div class="mobile-back"><a href="([^"]+)" rel="up">([^<]+)</a></div>`) |
| + mobileHeadRE = regexp.MustCompile(`<h1 class="mobile-title">([^<]+)</h1>`) |
| +) |
| + |
| +type indexRow struct{ key, href, label string } |
| + |
| +// indexRows is the index page's list, in order. It fails the test unless |
| +// the page has exactly one index list and nothing in it is current. |
| +func indexRows(t *testing.T, body string) []indexRow { |
| + t.Helper() |
| + if n := strings.Count(body, `<nav class="index-nav"`); n != 1 { |
| + t.Fatalf("%d index lists, want 1", n) |
| + } |
| + _, rest, _ := strings.Cut(body, `<nav class="index-nav"`) |
| + list, _, ok := strings.Cut(rest, "</nav>") |
| + if !ok { |
| + t.Fatal("the index list is never closed") |
| + } |
| + if strings.Contains(list, "aria-current") { |
| + t.Errorf("an index row is marked current:\n%s", list) |
| + } |
| + var rows []indexRow |
| + for _, m := range indexLinkRE.FindAllStringSubmatch(list, -1) { |
| + rows = append(rows, indexRow{m[1], html.UnescapeString(m[2]), html.UnescapeString(m[3])}) |
| + } |
| + return rows |
| +} |
| + |
| +// mobileBack is the page's back link, "" and "" when it has none. |
| +func mobileBack(t *testing.T, body string) (href, label string) { |
| + t.Helper() |
| + all := mobileBackRE.FindAllStringSubmatch(body, -1) |
| + switch len(all) { |
| + case 0: |
| + if strings.Contains(body, `class="mobile-back"`) { |
| + t.Fatal("a back strip the pattern does not match") |
| + } |
| + return "", "" |
| + case 1: |
| + return html.UnescapeString(all[0][1]), html.UnescapeString(all[0][2]) |
| + } |
| + t.Fatalf("%d back links, want at most 1", len(all)) |
| + return "", "" |
| +} |
| + |
| +func fixtureAccountName(t *testing.T, fx *consoleFixture) string { |
| + t.Helper() |
| + acct, err := fx.st.AccountBySqid(fx.sqid) |
| + if err != nil || acct == nil { |
| + t.Fatalf("AccountBySqid = %v %v", acct, err) |
| + } |
| + return acct.Name |
| +} |
| + |
| +func TestMobileIndexRoutesGate(t *testing.T) { |
| + fx := newConsoleFixture(t) |
| + paths := []string{"/index", "/apps/kass/index", "/apps/kass/settings/index"} |
| + |
| + anon := newBrowser(t) |
| + for _, p := range paths { |
| + if status, loc, _ := get(t, anon, fx.u(p)); status != http.StatusFound || loc != "/" { |
| + t.Errorf("signed out GET %s = %d -> %q, want 302 to /", p, status, loc) |
| + } |
| + } |
| + |
| + c := signInPaul(t, fx) |
| + for _, p := range paths { |
| + if status, _, body := get(t, c, fx.u(p)); status != http.StatusOK { |
| + t.Errorf("member GET %s = %d, want 200: %s", p, status, body) |
| + } |
| + } |
| + for _, p := range []string{"/apps/nosuch/index", "/apps/nosuch/settings/index"} { |
| + status, _, body := get(t, c, fx.u(p)) |
| + if status != http.StatusNotFound || !strings.Contains(body, "No such app here.") { |
| + t.Errorf("member GET %s = %d, want the no-such-app 404: %s", p, status, body) |
| + } |
| + } |
| + for _, p := range paths { |
| + assertNonMember404(t, fx, p) |
| + } |
| +} |
| + |
| +func TestAccountIndex(t *testing.T) { |
| + fx := newConsoleFixture(t) |
| + c := signInPaul(t, fx) |
| + name := fixtureAccountName(t, fx) |
| + |
| + status, _, body := get(t, c, fx.u("/index")) |
| + if status != http.StatusOK { |
| + t.Fatalf("GET /index = %d", status) |
| + } |
| + want := []indexRow{ |
| + {"apps", navPath("/"), "Apps"}, |
| + {"fleet", navPath("/fleet"), "Fleet"}, |
| + {"team", navPath("/team"), "Team"}, |
| + {"settings", navPath("/settings"), "Settings"}, |
| + } |
| + if got := indexRows(t, body); !equalRows(got, want) { |
| + t.Errorf("account index = %v, want %v", got, want) |
| + } |
| + if !strings.Contains(body, `<body data-view="index">`) { |
| + t.Error("the account index is not marked as an index view") |
| + } |
| + if href, label := mobileBack(t, body); href != "/accounts#nav-"+fx.sqid || label != "Accounts" { |
| + t.Errorf("account menu back = %q -> %q", label, href) |
| + } |
| + _, main, _ := strings.Cut(body, "<main>") |
| + for _, need := range []string{ |
| + `<h1 id="index-title">` + html.EscapeString(name) + `</h1>`, |
| + `<nav class="index-nav" aria-labelledby="index-title">`, |
| + } { |
| + if !strings.Contains(main, need) { |
| + t.Errorf("the account index lacks %q", need) |
| + } |
| + } |
| + // The compact switcher stays in the header. |
| + if !strings.Contains(body, `<details class="switcher" id="switcher">`) { |
| + t.Error("the account index lost the account switcher") |
| + } |
| + |
| + enableBilling(t, fx.srv) |
| + _, _, body = get(t, c, fx.u("/index")) |
| + want = append(want[:3:3], indexRow{"billing", navPath("/billing"), billingCopy["page.title"]}, want[3]) |
| + if got := indexRows(t, body); !equalRows(got, want) { |
| + t.Errorf("account index with billing on = %v, want %v", got, want) |
| + } |
| +} |
| + |
| +func TestAppIndex(t *testing.T) { |
| + fx := newConsoleFixture(t) |
| + c := signInPaul(t, fx) |
| + status, _, body := get(t, c, fx.u("/apps/kass/index")) |
| + if status != http.StatusOK { |
| + t.Fatalf("GET /apps/kass/index = %d", status) |
| + } |
| + base := navPath("/apps/kass") |
| + want := []indexRow{ |
| + {"overview", base, "Overview"}, {"instances", base + "/instances", "Running"}, |
| + {"releases", base + "/releases", deploymentsCopy.Title}, {"logs", base + "/logs", "Logs"}, |
| + {"errors", base + "/errors", "Errors"}, {"availability", base + "/availability", "Availability"}, |
| + {"analytics", base + "/analytics", "Analytics"}, {"protection", base + "/protection", "Protection"}, |
| + {"activity", base + "/activity", "Activity"}, {"settings", base + "/settings/index", "Settings"}, |
| + } |
| + if got := indexRows(t, body); !equalRows(got, want) { |
| + t.Errorf("app index = %v, want %v", got, want) |
| + } |
| + if !strings.Contains(body, `<nav class="index-nav" aria-label="App sections">`) { |
| + t.Error("the app index list is not labelled App sections") |
| + } |
| + if strings.Contains(body, `class="tabs"`) { |
| + t.Error("the app index also renders the tab bar") |
| + } |
| + if href, label := mobileBack(t, body); href != navPath("/") || label != "Apps" { |
| + t.Errorf("app index back = %q -> %q, want Apps -> %q", label, href, navPath("/")) |
| + } |
| + // The tabs and the index are one list: every tab but Settings links |
| + // where its index row does. |
| + _, _, overview := get(t, c, fx.u("/apps/kass")) |
| + labels, _ := appTabLabels(t, overview) |
| + for i, row := range want { |
| + if labels[i] != row.label { |
| + t.Errorf("tab %d = %q, index row = %q", i, labels[i], row.label) |
| + } |
| + } |
| +} |
| + |
| +func TestAppSettingsIndex(t *testing.T) { |
| + fx := newConsoleFixture(t) |
| + c := signInPaul(t, fx) |
| + status, _, body := get(t, c, fx.u("/apps/kass/settings/index")) |
| + if status != http.StatusOK { |
| + t.Fatalf("GET /apps/kass/settings/index = %d", status) |
| + } |
| + rows := indexRows(t, body) |
| + var labels []string |
| + for _, r := range rows { |
| + labels = append(labels, r.label) |
| + wantHref := navPath("/apps/kass/settings/" + r.key) |
| + if r.key == "general" { |
| + wantHref = navPath("/apps/kass/settings") |
| + } |
| + if r.href != wantHref { |
| + t.Errorf("settings index row %s -> %q, want %q", r.key, r.href, wantHref) |
| + } |
| + } |
| + _, _, general := get(t, c, fx.u("/apps/kass/settings")) |
| + if want := settingsNavLabels(t, general); strings.Join(labels, "|") != strings.Join(want, "|") { |
| + t.Errorf("settings index = %q, the settings nav = %q", labels, want) |
| + } |
| + if !strings.Contains(body, `<nav class="index-nav" aria-label="Settings sections">`) { |
| + t.Error("the settings index list is not labelled Settings sections") |
| + } |
| + if strings.Contains(body, `class="settings-nav"`) { |
| + t.Error("the settings index also renders the settings nav") |
| + } |
| + if href, label := mobileBack(t, body); href != navPath("/apps/kass/index#nav-settings") || label != "kass" { |
| + t.Errorf("settings index back = %q -> %q, want kass -> the app index's Settings row", label, href) |
| + } |
| +} |
| + |
| +func TestMobileBackTargets(t *testing.T) { |
| + fx := newConsoleFixture(t) |
| + addKassWebRoutes(t, fx) |
| + c := signInPaul(t, fx) |
| + name := fixtureAccountName(t, fx) |
| + |
| + for _, tc := range []struct { |
| + path, back, label, title string |
| + }{ |
| + {"/", "/index#nav-apps", name, ""}, |
| + {"/team", "/index#nav-team", name, ""}, |
| + {"/apps/new", "/", "Apps", ""}, |
| + {"/trash", "/", "Apps", ""}, |
| + {"/fleet/byo", "/fleet", "Fleet", ""}, |
| + {"/settings", "/index#nav-settings", name, ""}, |
| + {"/apps/kass", "/apps/kass/index#nav-overview", "kass", "Overview"}, |
| + {"/apps/kass/logs", "/apps/kass/index#nav-logs", "kass", "Logs"}, |
| + {"/apps/kass/settings", "/apps/kass/settings/index#nav-general", "Settings", "General"}, |
| + {"/apps/kass/settings/domains", "/apps/kass/settings/index#nav-domains", "Settings", "Domains"}, |
| + {"/apps/kass/settings/pipeline", "/apps/kass/settings/index#nav-pipeline", "Settings", "Release pipeline"}, |
| + {"/apps/kass/instances/web-1.example.com", "/apps/kass/instances", "Running", "Running"}, |
| + } { |
| + status, _, body := get(t, c, fx.u(tc.path)) |
| + if status != http.StatusOK { |
| + t.Errorf("GET %s = %d", tc.path, status) |
| + continue |
| + } |
| + if !strings.Contains(body, `<body data-view="page">`) { |
| + t.Errorf("%s is not marked as a page view", tc.path) |
| + } |
| + if href, label := mobileBack(t, body); href != navPath(tc.back) || label != tc.label { |
| + t.Errorf("%s back = %q -> %q, want %q -> %q", tc.path, label, href, tc.label, navPath(tc.back)) |
| + } |
| + heads := mobileHeadRE.FindAllStringSubmatch(body, -1) |
| + switch { |
| + case tc.title == "" && len(heads) != 0: |
| + t.Errorf("%s has a phone heading %v, want none", tc.path, heads) |
| + case tc.title != "" && (len(heads) != 1 || heads[0][1] != tc.title): |
| + t.Errorf("%s phone heading = %v, want %q", tc.path, heads, tc.title) |
| + } |
| + // The desktop heading is the app's name, as it was. |
| + if tc.title != "" && !strings.Contains(body, "<h1>kass</h1>") { |
| + t.Errorf("%s lost its desktop heading", tc.path) |
| + } |
| + } |
| + |
| + // Personal settings return to the account list. |
| + _, _, personal := get(t, c, fx.ts.URL+"/settings") |
| + if href, label := mobileBack(t, personal); href != "/accounts" || label != "Accounts" { |
| + t.Errorf("personal settings back = %q -> %q", label, href) |
| + } |
| + _, _, creation := get(t, c, fx.ts.URL+"/accounts/new") |
| + if href, label := mobileBack(t, creation); href != "/accounts#nav-new" || label != "Accounts" { |
| + t.Errorf("new account back = %q -> %q", label, href) |
| + } |
| + |
| + if !strings.Contains(personal, `action="/auth/signout"`) { |
| + t.Error("your settings page lost Sign out") |
| + } |
| +} |
| + |
| +// TestAppHeadKeepsExpiryOnPhones: an app page's phone heading replaces |
| +// only the app's name; a temporary app's Keep form is still in the head. |
| +func TestAppHeadKeepsExpiryOnPhones(t *testing.T) { |
| + p := page{ |
| + Account: &Account{Name: "shop", Sqid: "bab"}, Nav: "/a/shop", Base: "/a/bab", |
| + AppName: "web", ActiveTab: "logs", ExpiresAt: time.Now().Add(time.Hour), CSRF: "tok", |
| + } |
| + var out strings.Builder |
| + if err := templates.ExecuteTemplate(&out, "appnav", p); err != nil { |
| + t.Fatal(err) |
| + } |
| + head, _, _ := strings.Cut(out.String(), "</div>") |
| + for _, need := range []string{`<h1>web</h1>`, `<h1 class="mobile-title">Logs</h1>`, |
| + `action="/a/bab/apps/web/keep"`, `>Keep this app</button>`} { |
| + if !strings.Contains(head, need) { |
| + t.Errorf("the app head lacks %q:\n%s", need, head) |
| + } |
| + } |
| +} |
| + |
| +func TestPhoneViewStyle(t *testing.T) { |
| + fx := newConsoleFixture(t) |
| + c := signInPaul(t, fx) |
| + _, _, body := get(t, c, fx.u("/apps/kass")) |
| + if blk := cssBlock(t, body, `body[data-view="page"] .tabs, body[data-view="page"] .settings-nav`); !strings.Contains(blk, "display: none") { |
| + t.Errorf("a phone page still shows the tabs and settings nav: %s", blk) |
| + } |
| + if blk := cssBlock(t, body, "body[data-view] header :is(.switcher, .brand, .account-links)"); !strings.Contains(blk, "display: none") { |
| + t.Errorf("a phone account page still shows the header nav: %s", blk) |
| + } |
| + for _, sel := range []string{".index-nav a", ".mobile-back a"} { |
| + if blk := cssBlock(t, body, sel); !strings.Contains(blk, "min-height: 2.75rem") { |
| + t.Errorf("%s is under the 44px touch target: %s", sel, blk) |
| + } |
| + } |
| +} |
| + |
| +// One header carries the way back on the left and the profile menu on the |
| +// right: the back link is inside it, not a strip after it, and the one |
| +// Sign out form lives in the menu behind the signed-in address. |
| +func TestHeaderHoldsBackAndProfile(t *testing.T) { |
| + fx := newConsoleFixture(t) |
| + c := signInPaul(t, fx) |
| + csrf := sessionToken(t, fx, c) |
| + _, _, body := get(t, c, fx.u("/apps/kass")) |
| + head, rest, ok := strings.Cut(body, "</header>") |
| + if !ok { |
| + t.Fatal("no <header>") |
| + } |
| + if !mobileBackRE.MatchString(head) || mobileBackRE.MatchString(rest) { |
| + t.Errorf("the back link is not inside the header only:\n%s", head) |
| + } |
| + if n := strings.Count(body, `action="/auth/signout"`); n != 1 { |
| + t.Errorf("%d sign out forms, want 1", n) |
| + } |
| + for _, need := range []string{ |
| + `<details class="profile" id="profile">`, |
| + `<summary aria-label="`, |
| + `<a class="addr" href="/settings">`, |
| + `name="csrf" value="` + csrf + `"`, |
| + `<script data-profile-menu>`, |
| + } { |
| + if !strings.Contains(head+rest, need) { |
| + t.Errorf("the page lacks %q", need) |
| + } |
| + } |
| + if !strings.Contains(head, `class="profile"`) || !strings.Contains(head, "Sign out") { |
| + t.Errorf("the profile menu is outside the header:\n%s", head) |
| + } |
| + |
| + status, _, out := get(t, newBrowser(t), fx.ts.URL+"/") |
| + if status != http.StatusOK { |
| + t.Fatalf("signed-out home = %d", status) |
| + } |
| + if strings.Contains(out, `class="profile"`) || strings.Contains(out, "/auth/signout") { |
| + t.Error("a signed-out page shows the profile menu") |
| + } |
| +} |
| + |
| +func equalRows(a, b []indexRow) bool { |
| + if len(a) != len(b) { |
| + return false |
| + } |
| + for i := range a { |
| + if a[i] != b[i] { |
| + return false |
| + } |
| + } |
| + return true |
| +} |
diff --git a/internal/console/ownership.go b/internal/console/ownership.go| index 5d1675b9b..37f8b88bc 100644 |
| --- a/internal/console/ownership.go |
| +++ b/internal/console/ownership.go |
| @@ -281,6 +281,7 @@ func (s *Server) handleTrash(w http.ResponseWriter, r *http.Request) { |
| p := s.accountPage(w, r, addr, raw, acct, role) |
| p.Title = "Trash" |
| p.ActiveNav = "apps" |
| + p.mobileParentSection("apps") |
| p.Trashed = TrashedApps(r.Context(), s.cfg.Releases, acct.Sqid, rows) |
| s.render(w, http.StatusOK, "trash", p) |
| } |
diff --git a/internal/console/perfwalk_test.go b/internal/console/perfwalk_test.go| index 03a4c8fbd..b21f5b291 100644 |
| --- a/internal/console/perfwalk_test.go |
| +++ b/internal/console/perfwalk_test.go |
| @@ -493,6 +493,7 @@ func perfTargets(fx *consoleFixture) map[string][]perfTarget { |
| "/fleet/architecture": ok("/fleet/architecture"), |
| "GET /invite/{token}": ok("/invite/" + seeds.invite), |
| "GET /a/{sqid}/{$}": ok(fx.path("/")), |
| + "GET /a/{sqid}/index": ok(fx.path("/index")), |
| "GET /a/{sqid}/apps/new": ok(fx.path("/apps/new")), |
| "GET /a/{sqid}/fleet": ok(fx.path("/fleet")), |
| "GET /a/{sqid}/fleet/byo": ok(fx.path("/fleet/byo")), |
| @@ -501,6 +502,8 @@ func perfTargets(fx *consoleFixture) map[string][]perfTarget { |
| "GET /a/{sqid}/team": ok(fx.path("/team")), |
| "GET /a/{sqid}/trash": ok(fx.path("/trash")), |
| "GET /a/{sqid}/apps/{app}": ok(app), |
| + "GET /a/{sqid}/apps/{app}/index": ok(app + "/index"), |
| + "GET /a/{sqid}/apps/{app}/settings/index": ok(app + "/settings/index"), |
| "GET /a/{sqid}/apps/{app}/instances/{host}": ok(app + "/instances/kass.carlosapp.dev"), |
| "GET /a/{sqid}/plan/keep": ok("/a/" + seeds.lapsed + "/plan/keep"), |
| } |
diff --git a/internal/console/planlapse_keep.go b/internal/console/planlapse_keep.go| index 6bcba2153..c1fb4c873 100644 |
| --- a/internal/console/planlapse_keep.go |
| +++ b/internal/console/planlapse_keep.go |
| @@ -69,6 +69,7 @@ func (s *Server) handlePlanKeep(w http.ResponseWriter, r *http.Request) { |
| p := s.accountPage(w, r, addr, raw, acct, RoleOwner) |
| p.Title = planKeepCopy["keep.title"] |
| p.ActiveNav = "settings" |
| + p.mobileParentSection("settings") |
| view := &planKeepView{Title: planKeepCopy["keep.title"], Save: planKeepCopy["keep.save"]} |
| p.PlanKeep = view |
| row, err := s.store.AccountPlan(acct.ID) |
diff --git a/internal/console/remotemetrics_test.go b/internal/console/remotemetrics_test.go| index ff2cdc166..26cf6a6f5 100644 |
| --- a/internal/console/remotemetrics_test.go |
| +++ b/internal/console/remotemetrics_test.go |
| @@ -93,7 +93,7 @@ func (tb *twoBoxes) noRemoteReadings(t *testing.T, bad ...string) { |
| t.Fatalf("the remote row carries a reading: %+v", m) |
| } |
| for _, path := range []string{"/apps/shop", "/apps/shop/instances", "/apps/shop/instances/" + remoteHost} { |
| - body := tb.page(t, path) |
| + body := stripSharedStyle(t, tb.page(t, path)) |
| for _, b := range bad { |
| if strings.Contains(body, b) { |
| t.Fatalf("%s shows %q:\n%s", path, b, body) |
diff --git a/internal/console/server.go b/internal/console/server.go| index cfee8f035..02e93c86c 100644 |
| --- a/internal/console/server.go |
| +++ b/internal/console/server.go |
| @@ -1887,6 +1887,7 @@ func NewServer(cfg Config, st *Store) (*Server, error) { |
| // Account-scoped and explicit: /a/<sqid>/apps/<app> rather than |
| // account-by-session, so a link a teammate opens lands where you meant. |
| s.registerRoute("GET /a/{sqid}/{$}", s.handleAccountHome) |
| + s.registerRoute("GET /a/{sqid}/index", s.handleAccountIndex) |
| s.registerRoute("GET /a/{sqid}/fleet", s.handleAccountFleetTab) |
| s.registerRoute("GET /a/{sqid}/fleet/byo", s.handleFleetBYO) |
| s.registerRoute("GET /a/{sqid}/team", s.handleTeam) |
| @@ -1925,6 +1926,7 @@ func NewServer(cfg Config, st *Store) (*Server, error) { |
| s.registerRoute("POST /a/{sqid}/apps/new", s.handleNewApp) |
| s.registerRoute("POST /a/{sqid}/apps/new/region", s.handleNewAppRegion) |
| s.registerRoute("GET /a/{sqid}/apps/{app}", s.handleApp) |
| + s.registerRoute("GET /a/{sqid}/apps/{app}/index", s.handleAppIndex) |
| s.registerRoute("GET /a/{sqid}/apps/{app}/releases", s.handleAppReleases) |
| // The retired Deployments tab: Live now on the Releases page took its |
| // table. accountApp's gates run before the 303. |
| @@ -1966,6 +1968,7 @@ func NewServer(cfg Config, st *Store) (*Server, error) { |
| s.registerRoute("GET /a/{sqid}/apps/{app}/activity", s.handleAppActivity) |
| s.registerRoute("GET /a/{sqid}/apps/{app}/settings", s.handleAppSettings) |
| s.registerRoute("GET /a/{sqid}/apps/{app}/settings/{section}", s.handleAppSettings) |
| + s.registerRoute("GET /a/{sqid}/apps/{app}/settings/index", s.handleAppSettingsIndex) |
| // The pipeline settings page (pipelinepage.go, release pipelines v2 Β§5) |
| // is the Settings tab's Release pipeline section; the old GET answers |
| // with a 303 to it, after accountApp's gates. POST goes through the same |
| @@ -2044,6 +2047,7 @@ func NewServer(cfg Config, st *Store) (*Server, error) { |
| // (discussion #219, item 4). |
| s.registerRoute("GET /invite/{token}", s.handleInvitePage) |
| s.registerRoute("POST /invite/{token}", s.handleAcceptInvite) |
| + s.registerRoute("GET /accounts", s.handleAccountsIndex) |
| s.registerRoute("GET /accounts/new", s.handleNewAccountForm) |
| // The upgrade entry the public pricing page links to (billingpage.go, |
| // plans 6b Call 1): signed out, the front door with next; signed in, |
| @@ -2364,6 +2368,10 @@ type page struct { |
| ActiveTab string // app pages: "overview" | "releases" | "instances" | "activity" | "settings" |
| AppName string // app pages: the {app} segment, for the tab bar and eyebrow |
| + // IndexOf marks a phone index page (mobilenav.go): "accounts", "account", "app" or |
| + // "settings"; "" on every other page. |
| + IndexOf string |
| + MobileParent *navLink |
| // The signed-out front page and "Check your email" (emailsignin.go). |
| // Prefill is the address the form starts with; Next the safe local path |
| @@ -3166,7 +3174,7 @@ func (s *Server) handleNewAccountForm(w http.ResponseWriter, r *http.Request) { |
| http.Redirect(w, r, "/", http.StatusFound) |
| return |
| } |
| - p := page{Title: "New account", Address: addr, CSRF: raw} |
| + p := page{Title: "New account", Address: addr, CSRF: raw, MobileParent: &navLink{Label: "Accounts", Href: "/accounts#nav-new"}} |
| p.Flash, p.FlashErr = s.takeFlash(w, r) |
| if accts, err := s.store.AccountsFor(addr); err != nil { |
| log.Printf("console: switcher: %v", err) |
| @@ -5461,6 +5469,7 @@ func (s *Server) handleNewAppForm(w http.ResponseWriter, r *http.Request) { |
| p := s.accountPage(w, r, addr, raw, acct, role) |
| p.Title = "Create an app" |
| p.ActiveNav = "apps" |
| + p.mobileParentSection("apps") |
| p.RegionPicker = s.newAppPicker(r.Context(), s.personIP(r)) |
| p.NewAppAnalytics = s.newAppAnalytics(r.Context(), acct.Sqid) |
| s.render(w, http.StatusOK, "app_new", p) |
diff --git a/internal/console/server_test.go b/internal/console/server_test.go| index 0bbd95682..60db93aa7 100644 |
| --- a/internal/console/server_test.go |
| +++ b/internal/console/server_test.go |
| @@ -2210,13 +2210,17 @@ func TestAppPageOwnerMetricsBoundary(t *testing.T) { |
| t.Fatalf("unmetered.example.com's own row did not read No readings / no data:\n%s", row) |
| } |
| // The boundary: nothing about the other tenant, the host, or the box. |
| + // Scoped past stripSharedStyle, not the raw page: the shared layout's |
| + // inline CSS legitimately carries "55%" of its own (a box-shadow |
| + // color-mix), which would otherwise read as this leaking. |
| + delivered := stripSharedStyle(t, body) |
| for _, forbidden := range []string{ |
| "other-tenant", "box-secret-a", // other tenant's unit, the box's name |
| "55%", "4.0 KB", // the other tenant's readings |
| "77.7", "78%", "89%", "44%", // host CPU/mem/disk totals |
| } { |
| - if strings.Contains(body, forbidden) { |
| - t.Fatalf("app page leaked %q in:\n%s", forbidden, body) |
| + if strings.Contains(delivered, forbidden) { |
| + t.Fatalf("app page leaked %q in:\n%s", forbidden, delivered) |
| } |
| } |
| } |
| @@ -2317,6 +2321,30 @@ func TestAppPageOwnerMetricsCrossAccountAppName(t *testing.T) { |
| } |
| } |
| +// stripSharedStyle returns page with its one <style>...</style> block (the |
| +// shared layout's inline CSS, which also carries the vendored Fiesta CSS |
| +// via its own "fiesta_day" sub-template) removed. Everything else is kept |
| +// intact β the rest of <head> (the dynamic Title), the whole body, its |
| +// attributes and scripts β so a leak anywhere else in the response still |
| +// fails. Metrics-leak checks scope to this because that one block |
| +// legitimately spells out plain percentages (box-shadow and color-mix |
| +// values) that would otherwise collide with a forbidden tenant reading. A |
| +// page missing either delimiter fails the test rather than silently |
| +// checking the whole thing. |
| +func stripSharedStyle(t *testing.T, page string) string { |
| + t.Helper() |
| + i := strings.Index(page, "<style>") |
| + if i < 0 { |
| + t.Fatalf("no <style> in page:\n%s", page) |
| + } |
| + j := strings.Index(page[i:], "</style>") |
| + if j < 0 { |
| + t.Fatalf("<style> never closed in page:\n%s", page) |
| + } |
| + j += i + len("</style>") |
| + return page[:i] + page[j:] |
| +} |
| + |
| // resourcesSection returns just the app page's Resources block. |
| // resourcesSection used to cut out a dedicated "Resources" section; CPU/Mem |
| // readings now live as columns on the Instances table itself, so this cuts |
| @@ -2398,10 +2426,14 @@ func TestAppPageOwnerMetricsStaleBoxIsNotCurrent(t *testing.T) { |
| if !strings.Contains(row, "Not responding") || !strings.Contains(row, "no data") { |
| t.Fatalf("stale box did not render as not responding with no data:\n%s", row) |
| } |
| + // Scoped past stripSharedStyle, not the raw page: the vendored Fiesta |
| + // CSS it carries legitimately has "23%" of its own (a rim color-mix), |
| + // which would otherwise read as this reading having stayed current. |
| + delivered := stripSharedStyle(t, body) |
| for _, forbidden := range []string{"23%", "2.0 KB"} { |
| - if strings.Contains(body, forbidden) { |
| + if strings.Contains(delivered, forbidden) { |
| t.Fatalf("app page rendered a %v-old reading as current (%q):\n%s", |
| - time.Since(at).Truncate(time.Hour), forbidden, resourcesSection(t, body)) |
| + time.Since(at).Truncate(time.Hour), forbidden, resourcesSection(t, delivered)) |
| } |
| } |
| } |
diff --git a/internal/console/static/fiesta/LICENSE b/internal/console/static/fiesta/LICENSE| new file mode 100644 |
| index 000000000..d0a1fa148 |
| --- /dev/null |
| +++ b/internal/console/static/fiesta/LICENSE |
| @@ -0,0 +1,373 @@ |
| +Mozilla Public License Version 2.0 |
| +================================== |
| + |
| +1. Definitions |
| +-------------- |
| + |
| +1.1. "Contributor" |
| + means each individual or legal entity that creates, contributes to |
| + the creation of, or owns Covered Software. |
| + |
| +1.2. "Contributor Version" |
| + means the combination of the Contributions of others (if any) used |
| + by a Contributor and that particular Contributor's Contribution. |
| + |
| +1.3. "Contribution" |
| + means Covered Software of a particular Contributor. |
| + |
| +1.4. "Covered Software" |
| + means Source Code Form to which the initial Contributor has attached |
| + the notice in Exhibit A, the Executable Form of such Source Code |
| + Form, and Modifications of such Source Code Form, in each case |
| + including portions thereof. |
| + |
| +1.5. "Incompatible With Secondary Licenses" |
| + means |
| + |
| + (a) that the initial Contributor has attached the notice described |
| + in Exhibit B to the Covered Software; or |
| + |
| + (b) that the Covered Software was made available under the terms of |
| + version 1.1 or earlier of the License, but not also under the |
| + terms of a Secondary License. |
| + |
| +1.6. "Executable Form" |
| + means any form of the work other than Source Code Form. |
| + |
| +1.7. "Larger Work" |
| + means a work that combines Covered Software with other material, in |
| + a separate file or files, that is not Covered Software. |
| + |
| +1.8. "License" |
| + means this document. |
| + |
| +1.9. "Licensable" |
| + means having the right to grant, to the maximum extent possible, |
| + whether at the time of the initial grant or subsequently, any and |
| + all of the rights conveyed by this License. |
| + |
| +1.10. "Modifications" |
| + means any of the following: |
| + |
| + (a) any file in Source Code Form that results from an addition to, |
| + deletion from, or modification of the contents of Covered |
| + Software; or |
| + |
| + (b) any new file in Source Code Form that contains any Covered |
| + Software. |
| + |
| +1.11. "Patent Claims" of a Contributor |
| + means any patent claim(s), including without limitation, method, |
| + process, and apparatus claims, in any patent Licensable by such |
| + Contributor that would be infringed, but for the grant of the |
| + License, by the making, using, selling, offering for sale, having |
| + made, import, or transfer of either its Contributions or its |
| + Contributor Version. |
| + |
| +1.12. "Secondary License" |
| + means either the GNU General Public License, Version 2.0, the GNU |
| + Lesser General Public License, Version 2.1, the GNU Affero General |
| + Public License, Version 3.0, or any later versions of those |
| + licenses. |
| + |
| +1.13. "Source Code Form" |
| + means the form of the work preferred for making modifications. |
| + |
| +1.14. "You" (or "Your") |
| + means an individual or a legal entity exercising rights under this |
| + License. For legal entities, "You" includes any entity that |
| + controls, is controlled by, or is under common control with You. For |
| + purposes of this definition, "control" means (a) the power, direct |
| + or indirect, to cause the direction or management of such entity, |
| + whether by contract or otherwise, or (b) ownership of more than |
| + fifty percent (50%) of the outstanding shares or beneficial |
| + ownership of such entity. |
| + |
| +2. License Grants and Conditions |
| +-------------------------------- |
| + |
| +2.1. Grants |
| + |
| +Each Contributor hereby grants You a world-wide, royalty-free, |
| +non-exclusive license: |
| + |
| +(a) under intellectual property rights (other than patent or trademark) |
| + Licensable by such Contributor to use, reproduce, make available, |
| + modify, display, perform, distribute, and otherwise exploit its |
| + Contributions, either on an unmodified basis, with Modifications, or |
| + as part of a Larger Work; and |
| + |
| +(b) under Patent Claims of such Contributor to make, use, sell, offer |
| + for sale, have made, import, and otherwise transfer either its |
| + Contributions or its Contributor Version. |
| + |
| +2.2. Effective Date |
| + |
| +The licenses granted in Section 2.1 with respect to any Contribution |
| +become effective for each Contribution on the date the Contributor first |
| +distributes such Contribution. |
| + |
| +2.3. Limitations on Grant Scope |
| + |
| +The licenses granted in this Section 2 are the only rights granted under |
| +this License. No additional rights or licenses will be implied from the |
| +distribution or licensing of Covered Software under this License. |
| +Notwithstanding Section 2.1(b) above, no patent license is granted by a |
| +Contributor: |
| + |
| +(a) for any code that a Contributor has removed from Covered Software; |
| + or |
| + |
| +(b) for infringements caused by: (i) Your and any other third party's |
| + modifications of Covered Software, or (ii) the combination of its |
| + Contributions with other software (except as part of its Contributor |
| + Version); or |
| + |
| +(c) under Patent Claims infringed by Covered Software in the absence of |
| + its Contributions. |
| + |
| +This License does not grant any rights in the trademarks, service marks, |
| +or logos of any Contributor (except as may be necessary to comply with |
| +the notice requirements in Section 3.4). |
| + |
| +2.4. Subsequent Licenses |
| + |
| +No Contributor makes additional grants as a result of Your choice to |
| +distribute the Covered Software under a subsequent version of this |
| +License (see Section 10.2) or under the terms of a Secondary License (if |
| +permitted under the terms of Section 3.3). |
| + |
| +2.5. Representation |
| + |
| +Each Contributor represents that the Contributor believes its |
| +Contributions are its original creation(s) or it has sufficient rights |
| +to grant the rights to its Contributions conveyed by this License. |
| + |
| +2.6. Fair Use |
| + |
| +This License is not intended to limit any rights You have under |
| +applicable copyright doctrines of fair use, fair dealing, or other |
| +equivalents. |
| + |
| +2.7. Conditions |
| + |
| +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted |
| +in Section 2.1. |
| + |
| +3. Responsibilities |
| +------------------- |
| + |
| +3.1. Distribution of Source Form |
| + |
| +All distribution of Covered Software in Source Code Form, including any |
| +Modifications that You create or to which You contribute, must be under |
| +the terms of this License. You must inform recipients that the Source |
| +Code Form of the Covered Software is governed by the terms of this |
| +License, and how they can obtain a copy of this License. You may not |
| +attempt to alter or restrict the recipients' rights in the Source Code |
| +Form. |
| + |
| +3.2. Distribution of Executable Form |
| + |
| +If You distribute Covered Software in Executable Form then: |
| + |
| +(a) such Covered Software must also be made available in Source Code |
| + Form, as described in Section 3.1, and You must inform recipients of |
| + the Executable Form how they can obtain a copy of such Source Code |
| + Form by reasonable means in a timely manner, at a charge no more |
| + than the cost of distribution to the recipient; and |
| + |
| +(b) You may distribute such Executable Form under the terms of this |
| + License, or sublicense it under different terms, provided that the |
| + license for the Executable Form does not attempt to limit or alter |
| + the recipients' rights in the Source Code Form under this License. |
| + |
| +3.3. Distribution of a Larger Work |
| + |
| +You may create and distribute a Larger Work under terms of Your choice, |
| +provided that You also comply with the requirements of this License for |
| +the Covered Software. If the Larger Work is a combination of Covered |
| +Software with a work governed by one or more Secondary Licenses, and the |
| +Covered Software is not Incompatible With Secondary Licenses, this |
| +License permits You to additionally distribute such Covered Software |
| +under the terms of such Secondary License(s), so that the recipient of |
| +the Larger Work may, at their option, further distribute the Covered |
| +Software under the terms of either this License or such Secondary |
| +License(s). |
| + |
| +3.4. Notices |
| + |
| +You may not remove or alter the substance of any license notices |
| +(including copyright notices, patent notices, disclaimers of warranty, |
| +or limitations of liability) contained within the Source Code Form of |
| +the Covered Software, except that You may alter any license notices to |
| +the extent required to remedy known factual inaccuracies. |
| + |
| +3.5. Application of Additional Terms |
| + |
| +You may choose to offer, and to charge a fee for, warranty, support, |
| +indemnity or liability obligations to one or more recipients of Covered |
| +Software. However, You may do so only on Your own behalf, and not on |
| +behalf of any Contributor. You must make it absolutely clear that any |
| +such warranty, support, indemnity, or liability obligation is offered by |
| +You alone, and You hereby agree to indemnify every Contributor for any |
| +liability incurred by such Contributor as a result of warranty, support, |
| +indemnity or liability terms You offer. You may include additional |
| +disclaimers of warranty and limitations of liability specific to any |
| +jurisdiction. |
| + |
| +4. Inability to Comply Due to Statute or Regulation |
| +--------------------------------------------------- |
| + |
| +If it is impossible for You to comply with any of the terms of this |
| +License with respect to some or all of the Covered Software due to |
| +statute, judicial order, or regulation then You must: (a) comply with |
| +the terms of this License to the maximum extent possible; and (b) |
| +describe the limitations and the code they affect. Such description must |
| +be placed in a text file included with all distributions of the Covered |
| +Software under this License. Except to the extent prohibited by statute |
| +or regulation, such description must be sufficiently detailed for a |
| +recipient of ordinary skill to be able to understand it. |
| + |
| +5. Termination |
| +-------------- |
| + |
| +5.1. The rights granted under this License will terminate automatically |
| +if You fail to comply with any of its terms. However, if You become |
| +compliant, then the rights granted under this License from a particular |
| +Contributor are reinstated (a) provisionally, unless and until such |
| +Contributor explicitly and finally terminates Your grants, and (b) on an |
| +ongoing basis, if such Contributor fails to notify You of the |
| +non-compliance by some reasonable means prior to 60 days after You have |
| +come back into compliance. Moreover, Your grants from a particular |
| +Contributor are reinstated on an ongoing basis if such Contributor |
| +notifies You of the non-compliance by some reasonable means, this is the |
| +first time You have received notice of non-compliance with this License |
| +from such Contributor, and You become compliant prior to 30 days after |
| +Your receipt of the notice. |
| + |
| +5.2. If You initiate litigation against any entity by asserting a patent |
| +infringement claim (excluding declaratory judgment actions, |
| +counter-claims, and cross-claims) alleging that a Contributor Version |
| +directly or indirectly infringes any patent, then the rights granted to |
| +You by any and all Contributors for the Covered Software under Section |
| +2.1 of this License shall terminate. |
| + |
| +5.3. In the event of termination under Sections 5.1 or 5.2 above, all |
| +end user license agreements (excluding distributors and resellers) which |
| +have been validly granted by You or Your distributors under this License |
| +prior to termination shall survive termination. |
| + |
| +************************************************************************ |
| +* * |
| +* 6. Disclaimer of Warranty * |
| +* ------------------------- * |
| +* * |
| +* Covered Software is provided under this License on an "as is" * |
| +* basis, without warranty of any kind, either expressed, implied, or * |
| +* statutory, including, without limitation, warranties that the * |
| +* Covered Software is free of defects, merchantable, fit for a * |
| +* particular purpose or non-infringing. The entire risk as to the * |
| +* quality and performance of the Covered Software is with You. * |
| +* Should any Covered Software prove defective in any respect, You * |
| +* (not any Contributor) assume the cost of any necessary servicing, * |
| +* repair, or correction. This disclaimer of warranty constitutes an * |
| +* essential part of this License. No use of any Covered Software is * |
| +* authorized under this License except under this disclaimer. * |
| +* * |
| +************************************************************************ |
| + |
| +************************************************************************ |
| +* * |
| +* 7. Limitation of Liability * |
| +* -------------------------- * |
| +* * |
| +* Under no circumstances and under no legal theory, whether tort * |
| +* (including negligence), contract, or otherwise, shall any * |
| +* Contributor, or anyone who distributes Covered Software as * |
| +* permitted above, be liable to You for any direct, indirect, * |
| +* special, incidental, or consequential damages of any character * |
| +* including, without limitation, damages for lost profits, loss of * |
| +* goodwill, work stoppage, computer failure or malfunction, or any * |
| +* and all other commercial damages or losses, even if such party * |
| +* shall have been informed of the possibility of such damages. This * |
| +* limitation of liability shall not apply to liability for death or * |
| +* personal injury resulting from such party's negligence to the * |
| +* extent applicable law prohibits such limitation. Some * |
| +* jurisdictions do not allow the exclusion or limitation of * |
| +* incidental or consequential damages, so this exclusion and * |
| +* limitation may not apply to You. * |
| +* * |
| +************************************************************************ |
| + |
| +8. Litigation |
| +------------- |
| + |
| +Any litigation relating to this License may be brought only in the |
| +courts of a jurisdiction where the defendant maintains its principal |
| +place of business and such litigation shall be governed by laws of that |
| +jurisdiction, without reference to its conflict-of-law provisions. |
| +Nothing in this Section shall prevent a party's ability to bring |
| +cross-claims or counter-claims. |
| + |
| +9. Miscellaneous |
| +---------------- |
| + |
| +This License represents the complete agreement concerning the subject |
| +matter hereof. If any provision of this License is held to be |
| +unenforceable, such provision shall be reformed only to the extent |
| +necessary to make it enforceable. Any law or regulation which provides |
| +that the language of a contract shall be construed against the drafter |
| +shall not be used to construe this License against a Contributor. |
| + |
| +10. Versions of the License |
| +--------------------------- |
| + |
| +10.1. New Versions |
| + |
| +Mozilla Foundation is the license steward. Except as provided in Section |
| +10.3, no one other than the license steward has the right to modify or |
| +publish new versions of this License. Each version will be given a |
| +distinguishing version number. |
| + |
| +10.2. Effect of New Versions |
| + |
| +You may distribute the Covered Software under the terms of the version |
| +of the License under which You originally received the Covered Software, |
| +or under the terms of any subsequent version published by the license |
| +steward. |
| + |
| +10.3. Modified Versions |
| + |
| +If you create software not governed by this License, and you want to |
| +create a new license for such software, you may create and use a |
| +modified version of this License if you rename the license and remove |
| +any references to the name of the license steward (except to note that |
| +such modified license differs from this License). |
| + |
| +10.4. Distributing Source Code Form that is Incompatible With Secondary |
| +Licenses |
| + |
| +If You choose to distribute Source Code Form that is Incompatible With |
| +Secondary Licenses under the terms of this version of the License, the |
| +notice described in Exhibit B of this License must be attached. |
| + |
| +Exhibit A - Source Code Form License Notice |
| +------------------------------------------- |
| + |
| + This Source Code Form is subject to the terms of the Mozilla Public |
| + License, v. 2.0. If a copy of the MPL was not distributed with this |
| + file, You can obtain one at https://mozilla.org/MPL/2.0/. |
| + |
| +If it is not possible or desirable to put the notice in a particular |
| +file, then You may include the notice in a location (such as a LICENSE |
| +file in a relevant directory) where a recipient would be likely to look |
| +for such a notice. |
| + |
| +You may add additional accurate notices of copyright ownership. |
| + |
| +Exhibit B - "Incompatible With Secondary Licenses" Notice |
| +--------------------------------------------------------- |
| + |
| + This Source Code Form is "Incompatible With Secondary Licenses", as |
| + defined by the Mozilla Public License, v. 2.0. |
diff --git a/internal/console/static/fiesta/VERSION b/internal/console/static/fiesta/VERSION| new file mode 100644 |
| index 000000000..6e59dbbe4 |
| --- /dev/null |
| +++ b/internal/console/static/fiesta/VERSION |
| @@ -0,0 +1,10 @@ |
| +{ |
| + "version": "1.1.0", |
| + "upstream": "amadan.net/rastrillo/fiesta", |
| + "commit": "4ee76b5e651ff4fb5a4bae12d7508f55a2531eff", |
| + "source": "css/themes/day.css", |
| + "source_sha256": "2deaa9f663d9929cfa9238d60ed0e532dc552313d5838b8e0d076f9991b4907f", |
| + "release_sha256": "2a14664966b0dd9d92313cf891a2e79abc492a96afaeea035745dd427ba74283", |
| + "template_sha256": "ac320e5392bd93bd24b5b5adcec419edca94359c8e30d49c9c15552172fa2308", |
| + "license_sha256": "3f3d9e0024b1921b067d6f7f88deb4a60cbe7a78e76c64e3f1d7fc3b779b9d04" |
| +} |
diff --git a/internal/console/templates/app_overview.html b/internal/console/templates/app_overview.html| index 965b79ebc..5436d95ff 100644 |
| --- a/internal/console/templates/app_overview.html |
| +++ b/internal/console/templates/app_overview.html |
| @@ -15,7 +15,7 @@ |
| <p>{{$.StatusCopy.NoVersion}}</p> |
| {{else}} |
| <p>{{.Deployment.ReportingText}}</p> |
| - <ul>{{range .Deployment.Versions}}<li><code>{{.Version}}</code></li>{{end}}</ul> |
| + <ul class="version-list" role="list">{{range .Deployment.Versions}}<li><code>{{.Version}}</code></li>{{end}}</ul> |
| {{if .Deployment.UnknownCount}}<p>{{$.StatusCopy.Partial}}</p>{{end}} |
| {{end}} |
| </section> |
diff --git a/internal/console/templates/appnav.html b/internal/console/templates/appnav.html| index c3c3ef6d7..4c2797138 100644 |
| --- a/internal/console/templates/appnav.html |
| +++ b/internal/console/templates/appnav.html |
| @@ -2,6 +2,7 @@ |
| <div class="pagehead"> |
| <p class="eyebrow">App Β· {{.Account.Name}}</p> |
| <h1>{{.AppName}}</h1> |
| + {{with .MobileTitle}}<h1 class="mobile-title">{{.}}</h1>{{end}} |
| {{if not .ExpiresAt.IsZero}} |
| <p class="small">Temporary. It moves to the Trash on {{fmtTime .ExpiresAt}}, and is deleted 3 days after that.</p> |
| <form method="post" action="{{.Base}}/apps/{{.AppName}}/keep"> |
| @@ -11,15 +12,7 @@ |
| {{end}} |
| </div> |
| <nav class="tabs" aria-label="App sections"> |
| - <a href="{{.Nav}}/apps/{{.AppName}}"{{if eq .ActiveTab "overview"}} aria-current="page"{{end}}>Overview</a> |
| - <a href="{{.Nav}}/apps/{{.AppName}}/instances"{{if eq .ActiveTab "instances"}} aria-current="page"{{end}}>Running</a> |
| - <a href="{{.Nav}}/apps/{{.AppName}}/releases"{{if eq .ActiveTab "releases"}} aria-current="page"{{end}}>{{.DeploymentsCopy.Title}}</a> |
| - <a href="{{.Nav}}/apps/{{.AppName}}/logs"{{if eq .ActiveTab "logs"}} aria-current="page"{{end}}>Logs</a> |
| - <a href="{{.Nav}}/apps/{{.AppName}}/errors"{{if eq .ActiveTab "errors"}} aria-current="page"{{end}}>Errors</a> |
| - <a href="{{.Nav}}/apps/{{.AppName}}/availability"{{if eq .ActiveTab "availability"}} aria-current="page"{{end}}>Availability</a> |
| - <a href="{{.Nav}}/apps/{{.AppName}}/analytics"{{if eq .ActiveTab "analytics"}} aria-current="page"{{end}}>Analytics</a> |
| - <a href="{{.Nav}}/apps/{{.AppName}}/protection"{{if eq .ActiveTab "protection"}} aria-current="page"{{end}}>Protection</a> |
| - <a href="{{.Nav}}/apps/{{.AppName}}/activity"{{if eq .ActiveTab "activity"}} aria-current="page"{{end}}>Activity</a> |
| - <a href="{{.Nav}}/apps/{{.AppName}}/settings"{{if eq .ActiveTab "settings"}} aria-current="page"{{end}}>Settings</a> |
| + {{range .AppLinks}}<a href="{{.Href}}"{{if .Current}} aria-current="page"{{end}}>{{.Label}}</a> |
| + {{end}} |
| </nav> |
| {{end}} |
diff --git a/internal/console/templates/apps.html b/internal/console/templates/apps.html| index 23e38a2dd..e70c9caaa 100644 |
| --- a/internal/console/templates/apps.html |
| +++ b/internal/console/templates/apps.html |
| @@ -7,20 +7,53 @@ |
| {{if .Apps}} |
| <h1>Apps</h1> |
| </div> |
| -<div class="tablewrap"> |
| -<table> |
| - <tr><th scope="col">App</th><th scope="col">Running at</th><th scope="col">{{$.RegionCopy.PickerLabel}}</th><th scope="col">Health</th><th scope="col">{{$.StatusCopy.ObservedLabel}}</th></tr> |
| +<div class="tablewrap app-list"> |
| +<table role="table"> |
| + <tr class="app-head" role="row"><th role="columnheader" scope="col">App</th><th role="columnheader" scope="col">Running at</th><th role="columnheader" scope="col">{{$.RegionCopy.PickerLabel}}</th><th role="columnheader" scope="col">Health</th><th role="columnheader" scope="col">{{$.StatusCopy.ObservedLabel}}</th></tr> |
| {{range .Apps}} |
| - <tr> |
| - <td><a href="{{$.Nav}}/apps/{{.App}}">{{.App}}</a></td> |
| - <td>{{if .URL}}<a href="https://{{.URL}}">{{.URL}}</a>{{else}}β{{end}}</td> |
| - <td>{{if .Region.Known}}{{.Region.Text}}{{range .Elsewhere}}<br><span class="small">{{.Line}}</span>{{end}}{{else}}β{{end}}</td> |
| - <td><span class="chip chip-health-{{.Verdict}}">{{.VerdictLabel}}</span></td> |
| - <td>{{if .Deployment.Mixed}}{{$.StatusCopy.Mixed}}{{else if .Deployment.UniformVersion}}<code>{{.Deployment.UniformVersion}}</code>{{else}}β{{end}}{{if .CanaryN}} <span class="chip chip-canary">{{.CanaryN}} test version{{if ne .CanaryN 1}}s{{end}}</span>{{end}}</td> |
| + <tr role="row" data-app-row> |
| + <td role="cell" class="app-name"><a href="{{$.Nav}}/apps/{{.App}}">{{.App}}</a></td> |
| + <td role="cell" class="app-host">{{if .URL}}<a href="https://{{.URL}}">{{.URL}}</a>{{else}}β{{end}}</td> |
| + <td role="cell" class="app-region">{{if .Region.Known}}{{.Region.Text}}{{range .Elsewhere}}<br><span class="small">{{.Line}}</span>{{end}}{{else}}β{{end}}</td> |
| + <td role="cell" class="app-health"><span class="chip chip-health-{{.Verdict}}">{{.VerdictLabel}}</span></td> |
| + <td role="cell" class="app-observed{{if not (or .Deployment.Mixed .Deployment.UniformVersion .CanaryN)}} app-empty{{end}}"><span class="app-meta-label">{{$.StatusCopy.ObservedLabel}}</span>{{if .Deployment.Mixed}}{{$.StatusCopy.Mixed}}{{else if .Deployment.UniformVersion}}<code>{{.Deployment.UniformVersion}}</code>{{else}}β{{end}}{{if .CanaryN}} <span class="chip chip-canary">{{.CanaryN}} test version{{if ne .CanaryN 1}}s{{end}}</span>{{end}}</td> |
| </tr> |
| {{end}} |
| </table> |
| </div> |
| +<style> |
| +.app-list .app-meta-label { display: none; } |
| +.app-list tr[data-app-row] { position: relative; } |
| +.app-list .app-name a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--rst-radius-sm); } |
| +.app-list .app-name a:focus-visible { outline: none; } |
| +.app-list .app-name a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; } |
| +.app-list .app-host a { position: relative; z-index: 2; } |
| +@media (hover: hover) { |
| + .app-list tr[data-app-row]:has(.app-name a:hover) { background: var(--accent-soft); } |
| +} |
| +@media (max-width: 800px) { |
| +.tablewrap.app-list { overflow: visible; } |
| +.tablewrap.app-list > table { display: block; width: 100%; margin: 0; } |
| +.tablewrap.app-list > table > tbody { display: block; } |
| +.tablewrap.app-list tr.app-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } |
| +.tablewrap.app-list tr[data-app-row] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "name name" "host host" "health region" "observed observed"; gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule); } |
| +.tablewrap.app-list > table > tbody > tr[data-app-row]:last-child { border-bottom: 0; } |
| +.tablewrap.app-list > table tr[data-app-row] > td { display: block; min-width: 0; margin: 0; padding: 0; border: 0; overflow-wrap: anywhere; white-space: normal; } |
| +.tablewrap.app-list > table tr[data-app-row] > td.app-name { grid-area: name; padding-left: 0; font-size: 17px; line-height: 24px; font-weight: 600; } |
| +.tablewrap.app-list td.app-name a, .tablewrap.app-list td.app-host a { display: inline-flex; align-items: center; max-width: 100%; min-height: 44px; overflow-wrap: anywhere; } |
| +.tablewrap.app-list td.app-name a { font-size: 17px; font-weight: 600; text-decoration: none; } |
| +.tablewrap.app-list > table tr[data-app-row] > td.app-host { grid-area: host; font-size: 13px; line-height: 1.4; color: var(--muted); } |
| +.tablewrap.app-list > table tr[data-app-row] > td.app-health { grid-area: health; align-self: center; font-size: 12px; line-height: 20px; } |
| +.tablewrap.app-list .app-health .chip { display: inline-flex; align-items: center; max-width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; font: 400 12px/20px var(--sans); } |
| +.tablewrap.app-list .app-health .chip::before { flex: none; margin: 0 6px 0 0; } |
| +.tablewrap.app-list .app-health .chip-health-attention { color: var(--warn, #a6790f); } |
| +.tablewrap.app-list .app-health .chip-health-attention::before { background: var(--warn, #a6790f); } |
| +.tablewrap.app-list > table tr[data-app-row] > td.app-region { grid-area: region; align-self: center; justify-self: end; text-align: right; font-size: 12px; line-height: 20px; color: var(--muted); } |
| +.tablewrap.app-list > table tr[data-app-row] > td.app-observed { grid-area: observed; font-size: 12px; line-height: 20px; } |
| +.tablewrap.app-list .app-meta-label { display: inline; margin-right: 6px; font-size: 12px; color: var(--muted); } |
| +.tablewrap.app-list > table tr[data-app-row] > td.app-empty { display: none; } |
| +} |
| +</style> |
| {{else}} |
| <h1>Welcome to {{.ConsoleName}}</h1> |
| </div> |
diff --git a/internal/console/templates/fiesta.html b/internal/console/templates/fiesta.html| new file mode 100644 |
| index 000000000..55f472022 |
| --- /dev/null |
| +++ b/internal/console/templates/fiesta.html |
| @@ -0,0 +1,425 @@ |
| +{{define "fiesta_day"}} |
| +/* day β rastrillo's default theme: an everyday blue on white and grey. |
| + Structure lives in tokens.css; this file is colour, type and shape. |
| + rastrillo new writes it once as static/theme.css. |
| + |
| + The look: professional, with a point of view. Near-greyscale neutrals |
| + with hairline borders, one cobalt that means "this does something", |
| + crisp 6px and 4px corners, and natural depth: light comes from above, |
| + cards rest on the page, controls press in. Status keeps the |
| + conventional green, amber and red, so a pill is never mistaken for a |
| + link. |
| + |
| + ββ One block, both schemes βββββββββββββββββββββββββββββββββββββββββββ |
| + Every token is declared once, as light-dark(<light>, <dark>), under a |
| + single :root that sets color-scheme: light dark. The browser picks the |
| + half that matches the resolved scheme, so there is no second copy of |
| + the palette to keep in sync and no way to author dark half-done. The |
| + two rules at the bottom are the whole toggle: setting color-scheme on |
| + :root[data-theme=β¦] re-resolves every light-dark() in the file at |
| + once, in both directions, which is why an explicit choice beats the OS |
| + without restating a single colour. |
| + |
| + Tokens with one value in both schemes β the font stack, the radii β |
| + are written plain, because light-dark(x, x) says nothing twice. |
| + |
| + light-dark() is a colour function: it may only stand where a <color> |
| + is expected. So a shadow token wraps its colour in it and writes the |
| + geometry once, outside the call β `0 8px 24px light-dark(a, b)`, never |
| + `light-dark(0 8px 24px a, β¦)`, which no browser would accept as a |
| + box-shadow. |
| + |
| + ββ The shape axis ββββββββββββββββββββββββββββββββββββββββββββββββββββ |
| + Radius and shadow are the theme's now, not tokens.css's: a theme that |
| + can only change colour cannot change how an app feels. day is crisp |
| + and lit from above: 6px cards, 4px controls, a short contact shadow |
| + where an object meets the page and soft ambient light around it, so |
| + things rest on the page rather than float. |
| + |
| + ββ WCAG 2.2 AA, measured βββββββββββββββββββββββββββββββββββββββββββββ |
| + Normal text needs 4.5:1; large text and UI component boundaries need |
| + 3:1. Every pair below was computed from these exact hex values, in |
| + both schemes. If you change a token, recompute its rows. |
| + |
| + LIGHT ratio requirement |
| + --rst-text on --rst-surface 17.72 4.5:1 text |
| + --rst-text on --rst-bg 17.13 4.5:1 text |
| + --rst-text on --rst-surface-2 15.99 4.5:1 text |
| + --rst-text on --rst-accent-soft 15.65 4.5:1 text |
| + --rst-text-muted on --rst-surface 7.72 4.5:1 text |
| + --rst-text-muted on --rst-bg 7.46 4.5:1 text |
| + --rst-text-muted on --rst-surface-2 6.97 4.5:1 text |
| + --rst-text-muted on --rst-accent-soft 6.82 4.5:1 text |
| + --rst-text-faint on --rst-surface 5.27 4.5:1 text |
| + --rst-text-faint on --rst-bg 5.10 4.5:1 text |
| + --rst-text-faint on --rst-surface-2 4.76 4.5:1 text |
| + --rst-text-faint on --rst-accent-soft 4.65 4.5:1 text |
| + --rst-accent on --rst-surface 6.25 4.5:1 text + focus ring |
| + --rst-accent on --rst-bg 6.04 4.5:1 text + focus ring |
| + --rst-accent on --rst-surface-2 5.64 4.5:1 text |
| + --rst-accent on --rst-accent-soft 5.52 4.5:1 text |
| + --rst-on-accent on --rst-accent 6.25 4.5:1 label where the accent itself fills |
| + --rst-on-accent on --rst-accent-strong 8.47 4.5:1 the same, hover |
| + --rst-line-strong on --rst-surface 3.60 3:1 control border |
| + --rst-line-strong on --rst-bg 3.48 3:1 control border |
| + --rst-line-strong on --rst-surface-2 3.25 3:1 control border |
| + pill neutral fg on its own tint 9.02 4.5:1 text |
| + pill positive fg on its own tint 6.49 4.5:1 text |
| + pill warning fg on its own tint 6.15 4.5:1 text |
| + pill negative fg on its own tint 5.30 4.5:1 text |
| + --rst-tone-positive-fg on --rst-surface 7.13 4.5:1 a stat's rising delta |
| + --rst-tone-negative-fg on --rst-surface 6.47 4.5:1 a stat's falling delta |
| + --rst-on-accent on negative fg (fill) 6.47 4.5:1 danger label, old tokens.css |
| + --rst-on-accent-fill on --rst-accent-fill 5.94 4.5:1 primary button label |
| + --rst-on-accent-fill on --rst-accent-fill-hover 7.11 4.5:1 primary button label, hover |
| + --rst-on-danger-fill on --rst-danger-fill 5.46 4.5:1 danger button label |
| + --rst-on-danger-fill-hover on --rst-danger-fill-hover 6.52 4.5:1 danger button label, hover |
| + --rst-text on --rst-row-tint-hover 16.54 4.5:1 list-row-action text, hovered |
| + --rst-text on --rst-row-tint-press 15.65 4.5:1 list-row-action text, pressed |
| + --rst-control-text-hover on --rst-control-face-hover 16.67 4.5:1 plain button label, hover |
| + --rst-text-muted on --rst-control-face-hover 7.26 4.5:1 muted label, hovered plain face |
| + --rst-text on --rst-tint-hover 16.54 4.5:1 row text, hovered |
| + --rst-text on --rst-tint-press 15.65 4.5:1 row text, pressed |
| + --rst-text-muted on --rst-tint-hover 7.21 4.5:1 muted cell, hovered row |
| + --rst-text-muted on --rst-tint-press 6.82 4.5:1 muted cell, pressed row |
| + --rst-text-faint on --rst-tint-hover 4.92 4.5:1 faint cell, hovered row |
| + --rst-text-faint on --rst-tint-press 4.66 4.5:1 faint cell, pressed row |
| + --rst-accent on --rst-tint-hover 5.83 4.5:1 a link on a hovered row |
| + --rst-nav-current-fg on --rst-nav-current-bg 17.72 4.5:1 the current nav item |
| + --rst-track-off on --rst-surface 3.41 3:1 switch off track |
| + --rst-track-off on --rst-bg 3.30 3:1 switch off track on the page |
| + --rst-knob-shade on --rst-track-off 3.07 3:1 knob on the off track |
| + --rst-knob-shade on --rst-accent-fill 5.34 3:1 knob on the on track |
| + |
| + DARK ratio requirement |
| + --rst-text on --rst-surface 15.63 4.5:1 text |
| + --rst-text on --rst-bg 16.64 4.5:1 text |
| + --rst-text on --rst-surface-2 15.03 4.5:1 text |
| + --rst-text on --rst-accent-soft 13.02 4.5:1 text |
| + --rst-text-muted on --rst-surface 7.12 4.5:1 text |
| + --rst-text-muted on --rst-bg 7.59 4.5:1 text |
| + --rst-text-muted on --rst-surface-2 6.85 4.5:1 text |
| + --rst-text-muted on --rst-accent-soft 5.94 4.5:1 text |
| + --rst-text-faint on --rst-surface 5.48 4.5:1 text |
| + --rst-text-faint on --rst-bg 5.84 4.5:1 text |
| + --rst-text-faint on --rst-surface-2 5.27 4.5:1 text |
| + --rst-text-faint on --rst-accent-soft 4.57 4.5:1 text |
| + --rst-accent on --rst-surface 7.34 4.5:1 text + focus ring |
| + --rst-accent on --rst-bg 7.81 4.5:1 text + focus ring |
| + --rst-accent on --rst-surface-2 7.06 4.5:1 text |
| + --rst-accent on --rst-accent-soft 6.11 4.5:1 text |
| + --rst-on-accent on --rst-accent 7.81 4.5:1 label where the accent itself fills |
| + --rst-on-accent on --rst-accent-strong 10.62 4.5:1 the same, hover |
| + --rst-line-strong on --rst-surface 3.86 3:1 control border |
| + --rst-line-strong on --rst-bg 4.12 3:1 control border |
| + --rst-line-strong on --rst-surface-2 3.72 3:1 control border |
| + pill neutral fg on its own tint 8.44 4.5:1 text |
| + pill positive fg on its own tint 10.18 4.5:1 text |
| + pill warning fg on its own tint 9.62 4.5:1 text |
| + pill negative fg on its own tint 7.85 4.5:1 text |
| + --rst-tone-positive-fg on --rst-surface 11.88 4.5:1 a stat's rising delta |
| + --rst-tone-negative-fg on --rst-surface 8.77 4.5:1 a stat's falling delta |
| + --rst-on-accent on negative fg (fill) 9.34 4.5:1 danger label, old tokens.css |
| + --rst-on-accent-fill on --rst-accent-fill 5.26 4.5:1 primary button label |
| + --rst-on-accent-fill on --rst-accent-fill-hover 6.32 4.5:1 primary button label, hover |
| + --rst-on-danger-fill on --rst-danger-fill 5.46 4.5:1 danger button label |
| + --rst-on-danger-fill-hover on --rst-danger-fill-hover 6.52 4.5:1 danger button label, hover |
| + --rst-text on --rst-row-tint-hover 14.59 4.5:1 list-row-action text, hovered |
| + --rst-text on --rst-row-tint-press 14.10 4.5:1 list-row-action text, pressed |
| + --rst-control-text-hover on --rst-control-face-hover 14.43 4.5:1 plain button label, hover |
| + --rst-text-muted on --rst-control-face-hover 6.58 4.5:1 muted label, hovered plain face |
| + --rst-text on --rst-tint-hover 14.59 4.5:1 row text, hovered |
| + --rst-text on --rst-tint-press 14.10 4.5:1 row text, pressed |
| + --rst-text-muted on --rst-tint-hover 6.65 4.5:1 muted cell, hovered row |
| + --rst-text-muted on --rst-tint-press 6.43 4.5:1 muted cell, pressed row |
| + --rst-text-faint on --rst-tint-hover 5.12 4.5:1 faint cell, hovered row |
| + --rst-text-faint on --rst-tint-press 4.95 4.5:1 faint cell, pressed row |
| + --rst-accent on --rst-tint-hover 6.85 4.5:1 a link on a hovered row |
| + --rst-nav-current-fg on --rst-nav-current-bg 15.63 4.5:1 the current nav item |
| + --rst-track-off on --rst-surface 3.86 3:1 switch off track |
| + --rst-track-off on --rst-bg 4.12 3:1 switch off track on the page |
| + --rst-knob-shade on --rst-track-off 3.50 3:1 knob on the off track |
| + --rst-knob-shade on --rst-accent-fill 3.90 3:1 knob on the on track |
| + |
| + The tightest pair is --rst-knob-shade on --rst-track-off, 3.07:1 in |
| + light against a 3:1 floor. --rst-control-border is below 3:1 by |
| + design; see its comment. Put a token on a surface not listed above |
| + and you are guessing; recompute first. |
| + |
| + --rst-control-border is the one pair kept below the floor: 1.49:1 in |
| + light and 1.56:1 in dark against --rst-surface. The label identifies |
| + the button, so the boundary is decoration under WCAG 1.4.11 and |
| + carries no 3:1 floor. Do not argue it up. |
| + |
| + --rst-line is a hairline divider between rows, not a control border or |
| + a meaningful graphic, so 1.4.11's 3:1 does not apply to it. Control |
| + borders use --rst-line-strong, which does clear 3:1. |
| + |
| + --rst-header-rule is not in the table either, and deliberately so |
| + (design doc Β§6-v2.2): the page header's rule is decoration, not |
| + structure β the heading's size, weight and spacing carry the |
| + structure β so no contrast floor applies to it and it is not in |
| + ui/contrast_test.go's pair table. Do not argue it up to 3:1. |
| + |
| + Pagination chips are the one deliberate exception: they are bordered |
| + with --rst-line rather than --rst-line-strong, because a page strip |
| + ringed in hard outlines shouts louder than the list it belongs to. |
| + 1.4.11 is satisfied without that border β each chip's meaning is |
| + carried by its text label at 4.5:1 or better, and the current page |
| + adds a filled background, a heavier weight and aria-current on top. |
| + |
| + --rst-shadow-pop, --rst-shadow-knob, --rst-shadow-knob-hover, |
| + --rst-shadow-lift and |
| + --rst-overlay are not in the table: they paint a translucent shadow or |
| + scrim over whatever sits underneath, not text over a fixed |
| + background, so a contrast ratio does not apply. The scrim deepens in |
| + dark, matching --rst-shadow-pop's own jump: black reads lighter |
| + against a dark backdrop, so the overlay needs more alpha to still |
| + read as a dimming layer. |
| + ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ */ |
| + |
| +:root { |
| + color-scheme: light dark; |
| + |
| + /* Font */ |
| + --rst-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; |
| + |
| + /* Shape */ |
| + --rst-radius: 6px; |
| + --rst-radius-sm: 4px; |
| + --rst-radius-pill: 999px; |
| + |
| + /* Surfaces and lines */ |
| + --rst-bg: light-dark(#fbfbfc, #0c0d0f); |
| + --rst-surface: light-dark(#ffffff, #141518); |
| + --rst-surface-2: light-dark(#f3f3f5, #18191d); |
| + --rst-line: light-dark(#e6e6ea, #26282e); |
| + /* Light's strong line is four steps darker than the mockup's #8a8a95: |
| + the sign-in card's border has to clear 3:1 against the stage art |
| + drawn over the page, and #8a8a95 measured 2.90:1 there. */ |
| + --rst-line-strong: light-dark(#868691, #71737c); |
| + --rst-header-rule: var(--rst-line); |
| + |
| + /* Text */ |
| + --rst-text: light-dark(#18181b, #ededf0); |
| + --rst-text-muted: light-dark(#52525c, #a1a1aa); |
| + --rst-text-faint: light-dark(#6b6b75, #8c8c96); |
| + |
| + /* Accent. One colour an app sets; the rest follow it. The link hover, |
| + the tints, the halo, the plain sheen and the rim fold the accent |
| + into black, white, a surface or transparent with color-mix(in |
| + srgb), every share a literal percentage: calc(var()) in a |
| + color-mix() percentage invalidates the whole declaration in Safari |
| + (A4). The four fills and the soft ground take the accent's hue at |
| + day's own lightness, because in dark the accent is a light text |
| + blue and no mix of it with black or a surface reaches a deep button |
| + fill. Those five are declared here as day's cobalt and derived in |
| + the @supports block after this one, which an engine without |
| + relative colour skips. The fallback inside each var() applies only |
| + when --rst-accent is unset or set to initial: a custom property |
| + accepts any tokens, so a malformed override is valid as far as |
| + var() can tell and blanks every derived colour. With the default |
| + accent each derived value lands within two units per channel of the |
| + hex it replaced, and the contrast table above is computed from the |
| + resolved values. */ |
| + --rst-accent: light-dark(#1f56d6, #7aa2ff); |
| + --rst-accent-strong: light-dark(color-mix(in srgb, var(--rst-accent, #1f56d6) 80%, #000000), color-mix(in srgb, var(--rst-accent, #7aa2ff) 68.5%, #ffffff)); |
| + --rst-accent-soft: light-dark(#ecf1ff, #16234a); |
| + --rst-on-accent: light-dark(#ffffff, #0c0d0f); |
| + |
| + /* Status tones */ |
| + --rst-tone-neutral-fg: light-dark(#374151, #c3c9d1); |
| + --rst-tone-neutral-bg: light-dark(#eef0f2, #262c34); |
| + --rst-tone-positive-fg: light-dark(#166534, #6ee7a8); |
| + --rst-tone-positive-bg: light-dark(#dcfce7, #10281c); |
| + --rst-tone-warning-fg: light-dark(#854d0e, #f0c46a); |
| + --rst-tone-warning-bg: light-dark(#fef3c7, #2c2110); |
| + --rst-tone-negative-fg: light-dark(#b91c1c, #f79aa0); |
| + --rst-tone-negative-bg: light-dark(#fee2e2, #331819); |
| + |
| + /* Depth */ |
| + --rst-shadow-pop: 0 2px 4px light-dark(rgba(16, 24, 40, 0.06), rgba(0, 0, 0, 0.35)), 0 8px 16px -4px light-dark(rgba(16, 24, 40, 0.1), rgba(0, 0, 0, 0.5)); |
| + /* The knob's dome: a soft drop and a hairline ring, and hovered a |
| + longer drop, so the knob lifts as a button does. */ |
| + --rst-shadow-knob: 0 1px 2px light-dark(rgba(16, 24, 40, 0.22), rgba(0, 0, 0, 0.5)), 0 0 0 0.5px light-dark(rgba(16, 24, 40, 0.08), rgba(0, 0, 0, 0.3)); |
| + --rst-shadow-knob-hover: 0 1.5px 3px light-dark(rgba(16, 24, 40, 0.26), rgba(0, 0, 0, 0.58)), 0 0 0 0.5px light-dark(rgba(16, 24, 40, 0.08), rgba(0, 0, 0, 0.3)); |
| + --rst-shadow-lift: 0 1px 2px light-dark(rgba(16, 24, 40, 0.08), rgba(0, 0, 0, 0.3)); |
| + --rst-overlay: light-dark(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.6)); |
| + |
| + /* Filled controls have a fill, a hover fill and an edge of their own, |
| + so a hover is never a filter and a dark label is never put on a |
| + light accent. */ |
| + --rst-accent-fill: light-dark(#2257df, #2f61e8); |
| + --rst-accent-fill-hover: light-dark(#1d4dc8, #2956d0); |
| + --rst-accent-fill-edge: light-dark(#153ca0, #1f43a6); |
| + --rst-accent-fill-edge-hover: light-dark(#12358f, #1a3b95); |
| + --rst-on-accent-fill: #ffffff; |
| + --rst-danger-fill: light-dark(#c62f2f, #c43232); |
| + --rst-danger-fill-hover: light-dark(#b12929, #af2c2c); |
| + --rst-danger-fill-edge: light-dark(#8d1f1f, #8c2121); |
| + --rst-danger-fill-edge-hover: light-dark(#7e1a1a, #7d1d1d); |
| + --rst-on-danger-fill: #ffffff; |
| + --rst-on-danger-fill-hover: #ffffff; |
| + --rst-danger-hover-filter: none; |
| + |
| + /* Plain buttons and menu summaries: the face at rest, on hover and, |
| + for a ghost button, pressed; the border, which is softer than |
| + --rst-line-strong on purpose; and the hover border and label. The |
| + label identifies the button, so the boundary is decoration under |
| + WCAG 1.4.11 and carries no 3:1 floor. Do not argue it up. */ |
| + --rst-control-face: light-dark(#ffffff, #141518); |
| + --rst-control-face-hover: light-dark(#f7f8fa, #1b1d22); |
| + --rst-control-face-press: light-dark(#e6e9ee, #202329); |
| + --rst-control-border: light-dark(#d0d4dc, #343843); |
| + --rst-control-border-hover: light-dark(#8a8a95, #71737c); |
| + --rst-control-text-hover: light-dark(#18181b, #ededf0); |
| + --rst-ghost-edge: transparent; |
| + --rst-ghost-face-hover: light-dark(#f3f3f5, #18191d); |
| + --rst-ghost-edge-hover: transparent; |
| + --rst-summary-face: light-dark(#ffffff, #141518); |
| + --rst-summary-face-hover: light-dark(#f7f8fa, #1b1d22); |
| + --rst-summary-edge: light-dark(#d0d4dc, #343843); |
| + --rst-summary-edge-hover: light-dark(#8a8a95, #71737c); |
| + /* A menu summary's corner: the small radius, as a token of its own, |
| + because the focus ring follows the corner and a flat theme keeps |
| + the square ring it had. */ |
| + --rst-summary-radius: var(--rst-radius-sm); |
| + |
| + /* The light from above. A highlight along a raised edge, a short |
| + contact shadow where an object meets the page, soft ambient light |
| + around it, the fraction a filled face shades by, and how far a |
| + pressed button drops. Set every one to transparent, 0 and 0px for |
| + a flat theme. */ |
| + --rst-depth-hl: light-dark(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.06)); |
| + --rst-depth-contact: light-dark(rgba(16, 24, 40, 0.1), rgba(0, 0, 0, 0.5)); |
| + --rst-depth-ambient: light-dark(rgba(16, 24, 40, 0.06), rgba(0, 0, 0, 0.35)); |
| + --rst-depth-face: 0.04; |
| + --rst-press-drop: 1px; |
| + |
| + /* The switch: a near-white knob in both schemes, so in dark it reads |
| + as the thing you move rather than a hole; and the off track, a grey |
| + dark enough to clear 3:1 against the surface and light enough for the |
| + knob to clear 3:1 against it. */ |
| + --rst-knob: #ffffff; |
| + --rst-knob-shade: light-dark(#f1f3f6, #d9dee8); |
| + --rst-track-off: light-dark(#8a8a95, #71737c); |
| + /* The switch's size: a 40x23 track with a 19px knob under a fine |
| + pointer, 51x31 with a 27px knob on a touch screen (the iOS size). |
| + The knob is inset 2px, so each height is its knob and 4. */ |
| + --rst-switch-w: 40px; |
| + --rst-switch-h: 23px; |
| + --rst-switch-knob: 19px; |
| + --rst-switch-touch-w: 51px; |
| + --rst-switch-touch-h: 31px; |
| + --rst-switch-touch-knob: 27px; |
| + |
| + /* Rows, menu items and sidebar items on hover and pressed: the accent |
| + folded into the surface at 4.5% and 8.5% in light, and in dark into |
| + the page at 10% and into black at 19%, the shares that land on the |
| + hexes the design was measured with. Focus adds the accent as the |
| + edge and the accent at 22% as the halo. */ |
| + --rst-tint-hover: light-dark(color-mix(in srgb, var(--rst-accent, #1f56d6) 4.5%, var(--rst-surface)), color-mix(in srgb, var(--rst-accent, #7aa2ff) 10%, var(--rst-bg))); |
| + --rst-tint-press: light-dark(color-mix(in srgb, var(--rst-accent, #1f56d6) 8.5%, var(--rst-surface)), color-mix(in srgb, var(--rst-accent, #7aa2ff) 19%, #000000)); |
| + --rst-tint-tap: var(--rst-tint-press); |
| + /* The topbar's phone card, hovered: the hover tint again, as a token |
| + of its own, because the card had no hover before and a flat theme |
| + keeps none. */ |
| + --rst-tint-card-hover: var(--rst-tint-hover); |
| + /* A media tile, hovered and pressed: the hover and press tints |
| + again, as a pair of its own, because the tile had no hover before |
| + and a flat theme keeps its surface in both states. */ |
| + --rst-tint-tile-hover: var(--rst-tint-hover); |
| + --rst-tint-tile-press: var(--rst-tint-press); |
| + /* A menu group's summary, hovered: the hover tint again, as a token |
| + of its own, because the summary had no hover before and a flat |
| + theme keeps none. */ |
| + --rst-tint-group-hover: var(--rst-tint-hover); |
| + --rst-row-tint-hover: var(--rst-tint-hover); |
| + --rst-row-tint-press: var(--rst-tint-press); |
| + --rst-focus-edge: var(--rst-accent, light-dark(#1f56d6, #7aa2ff)); |
| + --rst-focus-halo: color-mix(in srgb, var(--rst-accent, light-dark(#1f56d6, #7aa2ff)) 22%, transparent); |
| + |
| + /* The light's colours at full strength: the sheen on a filled button, |
| + the sheen on a plain one (an accent tint in light, because light |
| + cannot brighten white), the rim a card catches, and the wash a dark |
| + card lifts by. The sheen caps are measured: white on the light |
| + danger fill, under the face shade, clears 4.5:1 at 0.08 and fails |
| + at 0.10. The plain sheen is the fill at 9%. The rim is the accent |
| + folded into the line in light and into a mid grey in dark, where no |
| + neutral token sits at that value. */ |
| + --rst-sheen-fill: light-dark(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)); |
| + --rst-sheen-plain: light-dark(color-mix(in srgb, var(--rst-accent-fill) 9%, transparent), rgba(255, 255, 255, 0.04)); |
| + --rst-light-rim: light-dark(color-mix(in srgb, var(--rst-accent, #1f56d6) 23%, var(--rst-line)), color-mix(in srgb, var(--rst-accent, #7aa2ff) 31%, #505050)); |
| + --rst-light-wash: light-dark(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.015)); |
| + |
| + /* The press: a whole-face wash and a spot under the pointer, as |
| + fractions of black, filled and plain. Numbers, because light-dark() |
| + takes colours only; the dark values are restated in the two blocks |
| + at the end of the file. */ |
| + --rst-press-wash: 0.08; |
| + --rst-press-spot: 0.16; |
| + --rst-press-wash-plain: 0.04; |
| + --rst-press-spot-plain: 0.07; |
| + |
| + /* The type and rail choices this theme makes: a smaller page title, |
| + a smaller box heading, stat labels in sentence case, the rail on the |
| + page background, and the current nav item as a surface thumb. */ |
| + --rst-title-size: 1.25rem; |
| + --rst-title-weight: 600; |
| + --rst-title-track: -0.012em; |
| + --rst-heading-size: 0.8125rem; |
| + --rst-label-case: none; |
| + --rst-label-track: 0; |
| + --rst-rail-bg: var(--rst-bg); |
| + --rst-nav-current-bg: light-dark(#ffffff, #141518); |
| + --rst-nav-current-fg: light-dark(#18181b, #ededf0); |
| +} |
| + |
| +/* The five hue-derived tokens, redeclared where the engine has relative |
| + colour syntax. oklch(from) needs Chrome 119, Safari 16.4 and Firefox |
| + 128, and Firefox 128 is above the floor (Chrome 123, Safari 17.5, |
| + Firefox 121). Without this gate an older engine would resolve the |
| + fill to nothing at the use site and paint a white label on a white |
| + button; below it the :root values hold, day's cobalt, which an accent |
| + override does not reach. The lightness is day's own. The chroma is |
| + the accent's, scaled to day's and capped, so a grey accent gives a |
| + grey fill rather than a vivid one at a powerless hue. The fill and |
| + the hover fill lower their lightness around hue 170, yellow through |
| + green to cyan: a colour of that lightness clipped to sRGB gains |
| + luminance, and the label sits not on the fill but on the fill under |
| + the face shade's 4% white and, hovered, under the sheen's white too, |
| + so cyan's dark hover, 4.74:1 on the bare fill, was 4.15:1 on the |
| + painted face (Astra A1). The drop is a cosine bump that is zero |
| + beyond 85 degrees from 170, so the default cobalt, at hue 263, is |
| + outside it and lands where it did; its depth is 0.05 and 0.045 in |
| + light and 0.1 and 0.05 in dark, measured against the brightest pixel |
| + of the photographed button for twelve hues, three greys and the |
| + sRGB edges in TestAnyAccentKeepsTheFillLabelReadable. Every number |
| + is a literal, and the only arithmetic is inside a channel, where |
| + every engine with relative colour takes calc(), min(), max() and |
| + cos(). */ |
| +@supports (color: oklch(from red l c h)) { |
| + :root { |
| + --rst-accent-soft: light-dark(oklch(from var(--rst-accent, #1f56d6) 0.958 min(calc(c * 0.0878), 0.018) h), oklch(from var(--rst-accent, #7aa2ff) 0.268 min(calc(c * 0.5039), 0.072) h)); |
| + --rst-accent-fill: light-dark(oklch(from var(--rst-accent, #1f56d6) calc(0.513 - 0.05 * max(0, cos((h - 170) * 1deg) - 0.087)) min(calc(c * 1.0244), 0.21) h), oklch(from var(--rst-accent, #7aa2ff) calc(0.543 - 0.1 * max(0, cos((h - 170) * 1deg) - 0.087)) min(calc(c * 1.5045), 0.215) h)); |
| + --rst-accent-fill-hover: light-dark(oklch(from var(--rst-accent, #1f56d6) calc(0.472 - 0.045 * max(0, cos((h - 170) * 1deg) - 0.087)) min(calc(c * 0.9463), 0.194) h), oklch(from var(--rst-accent, #7aa2ff) calc(0.5 - 0.05 * max(0, cos((h - 170) * 1deg) - 0.087)) min(calc(c * 1.3786), 0.197) h)); |
| + --rst-accent-fill-edge: light-dark(oklch(from var(--rst-accent, #1f56d6) 0.401 min(calc(c * 0.8049), 0.165) h), oklch(from var(--rst-accent, #7aa2ff) 0.422 min(calc(c * 1.1617), 0.166) h)); |
| + --rst-accent-fill-edge-hover: light-dark(oklch(from var(--rst-accent, #1f56d6) 0.37 min(calc(c * 0.7366), 0.151) h), oklch(from var(--rst-accent, #7aa2ff) 0.389 min(calc(c * 1.0847), 0.155) h)); |
| + } |
| +} |
| + |
| +/* The whole toggle. Setting color-scheme re-resolves every light-dark() |
| + above, so an explicit choice beats the OS in both directions without |
| + restating a colour. */ |
| +:root[data-theme="light"] { color-scheme: light; } |
| +:root[data-theme="dark"] { color-scheme: dark; } |
| + |
| +/* The dark press strengths. Two blocks, because a reader who chose Dark |
| + has data-theme and a reader on System on a dark OS has only the media |
| + query; one block alone would hand the other reader the light numbers. |
| + Numbers only: every colour above is a light-dark() pair and stays |
| + declared once. */ |
| +:root[data-theme="dark"] { --rst-press-wash: 0.18; --rst-press-spot: 0.30; --rst-press-wash-plain: 0.18; --rst-press-spot-plain: 0.30; } |
| +@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --rst-press-wash: 0.18; --rst-press-spot: 0.30; --rst-press-wash-plain: 0.18; --rst-press-spot-plain: 0.30; } } |
| + |
| +{{end}} |
diff --git a/internal/console/templates/layout.html b/internal/console/templates/layout.html| index b7e729769..e33cfcf1e 100644 |
| --- a/internal/console/templates/layout.html |
| +++ b/internal/console/templates/layout.html |
| @@ -5,29 +5,54 @@ |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <title>{{.Title}} Β· {{.Brand}}</title> |
| <style> |
| +{{template "fiesta_day" .}} |
| /* Native controls (number spinners, checkboxes, selects, scrollbars) |
| follow the theme, so they stay visible on the dark background. */ |
| :root { color-scheme: light dark; } |
| :root { |
| - --bg: #ffffff; --ink: #201d29; --muted: #6f6480; |
| - --accent: #5b3e96; --accent-strong: #4c3380; |
| - --accent-soft: rgba(91, 62, 150, 0.09); |
| - --rule: #eae7f0; --bad: #b3403a; --warn: #a6790f; --good: #2f7a4f; |
| + --rst-radius: 0.6rem; --rst-radius-sm: 0.4rem; |
| + --rst-bg: light-dark(#ffffff, #0c0d0f); |
| + --rst-surface: light-dark(#ffffff, #141518); |
| + --rst-surface-2: light-dark(#f7f7f8, #18191d); |
| + --rst-line: light-dark(#e6e6ea, #26282e); |
| + --rst-line-strong: light-dark(#868691, #71737c); |
| + --rst-text: light-dark(#202126, #ededf0); |
| + --rst-text-muted: light-dark(#60616b, #a1a1aa); |
| + --rst-accent: light-dark(#6f2c65, #d7a0cd); |
| + --rst-accent-strong: light-dark(#55204d, #ecc0e4); |
| + --rst-accent-soft: light-dark(rgba(111, 44, 101, 0.08), rgba(215, 160, 205, 0.12)); |
| + --rst-accent-fill: light-dark(#6f2c65, #864078); |
| + --rst-accent-fill-hover: light-dark(#5a2352, #743367); |
| + --rst-accent-fill-edge: light-dark(#491b42, #52234a); |
| + --rst-accent-fill-edge-hover: light-dark(#391433, #411b3a); |
| + --rst-control-face: var(--rst-surface); |
| + --rst-control-face-hover: light-dark(#f7f8fa, #1b1d22); |
| + --rst-control-face-press: light-dark(#e6e9ee, #202329); |
| + --rst-control-border: light-dark(#d0d4dc, #343843); |
| + --rst-control-border-hover: light-dark(#8a8a95, #71737c); |
| + --rst-depth-hl: light-dark(rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.07)); |
| + --rst-depth-contact: light-dark(rgba(16, 24, 40, 0.12), rgba(0, 0, 0, 0.5)); |
| + --rst-depth-ambient: light-dark(rgba(16, 24, 40, 0.06), rgba(0, 0, 0, 0.35)); |
| + --rst-depth-face: 0.06; |
| + --rack-edge: light-dark(#d9cde0, #392b43); |
| + --panel-cool: light-dark(#faf7fb, #1c1823); |
| + --wire: light-dark(#a4a4af, #686a76); |
| + --field: light-dark(#fafafb, #101114); |
| + --shadow-module: inset 1px 1px 0 var(--rst-depth-hl), 1px 2px 0 var(--rack-edge), 2px 5px 8px -3px var(--rst-depth-ambient); |
| + --shadow-raised: inset 0 1px 0 var(--rst-depth-hl), 0 1px 0 var(--rack-edge), 0 2px 3px -1px var(--rst-depth-ambient); |
| + --shadow-inset: inset 0 1px 2px var(--rst-depth-contact); |
| + --bg: var(--rst-surface); --ink: var(--rst-text); --muted: var(--rst-text-muted); |
| + --accent: var(--rst-accent); --accent-strong: var(--rst-accent-strong); |
| + --accent-soft: var(--rst-accent-soft); |
| + --rule: var(--rst-line); --bad: var(--rst-tone-negative-fg); |
| + --warn: var(--rst-tone-warning-fg); --good: var(--rst-tone-positive-fg); |
| --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; |
| --sans: ui-sans-serif, system-ui, -apple-system, sans-serif; |
| } |
| - @media (prefers-color-scheme: dark) { |
| - :root { |
| - --bg: #16141c; --ink: #f0eef6; --muted: #a99ebd; |
| - --accent: #b394f2; --accent-strong: #c9b2f7; |
| - --accent-soft: rgba(179, 148, 242, 0.12); |
| - --rule: #2c2836; --bad: #e07b76; --warn: #d9a94a; --good: #5fae7f; |
| - } |
| - } |
| [hidden] { display: none !important; } |
| * { margin: 0; padding: 0; box-sizing: border-box; } |
| body { |
| - background: var(--bg); color: var(--ink); |
| + background: var(--rst-bg); color: var(--ink); |
| font: 400 1rem/1.6 var(--sans); |
| -webkit-font-smoothing: antialiased; padding: 0 1.25rem; |
| } |
| @@ -47,10 +72,22 @@ |
| should wrap inside the box rather than force the horizontal scrollbar |
| every other <pre> on this page gets for a shell command. */ |
| .changelog { white-space: pre-wrap; } |
| - select, input[type=text], input[type=search], input[type=email] { |
| - font: inherit; font-family: var(--sans); font-size: 0.9rem; color: var(--ink); background: var(--bg); |
| - border: 1px solid var(--rule); border-radius: 0.4rem; padding: 0.3rem 0.5rem; |
| - } |
| + select, input[type=text], input[type=search], input[type=email], input[type=number] { |
| + font: inherit; font-family: var(--sans); font-size: 0.9rem; color: var(--ink); background: var(--field); |
| + border: 1px solid var(--rst-line-strong); border-radius: var(--rst-radius-sm); padding: 0.3rem 0.5rem; |
| + box-shadow: var(--shadow-inset); |
| + } |
| + select:disabled, input:disabled { |
| + background: var(--rst-surface-2); color: var(--muted); box-shadow: none; cursor: not-allowed; |
| + } |
| + /* One focus ring for every control, drawn outside the raised edge. Where a |
| + scrolling box would clip it, it is drawn just inside instead. */ |
| + :where(a, button, .btn, select, summary, input:not([type=radio]):not([type=checkbox])):focus-visible { |
| + outline: 2px solid var(--accent); outline-offset: 2px; |
| + } |
| + :where(input:not([type=radio]):not([type=checkbox]), select):focus-visible { outline-offset: 1px; } |
| + .tablewrap :where(a, button, select, input):focus-visible, |
| + .settings-nav a:focus-visible, header .switcher-menu a:focus-visible { outline-offset: -2px; } |
| td form { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; margin: 0; } |
| /* A form living inside a sentence (the bake toggle, a rung's fast-track): |
| it must not break the line it is part of. */ |
| @@ -74,16 +111,50 @@ |
| inherit its colour. */ |
| .icon { width: 1em; height: 1em; flex: none; vertical-align: -0.125em; } |
| header { |
| - max-width: 64rem; margin: 0 auto; padding: 1.4rem 0; |
| - display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; row-gap: 0.5rem; |
| - border-bottom: 1px solid var(--rule); |
| + max-width: 64rem; margin: 0 auto; padding: 1rem 0; |
| + display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; row-gap: 0.5rem; |
| + border-top: 3px solid var(--accent); border-bottom: 1px solid var(--rule); |
| } |
| header .brand a { font-weight: 700; color: var(--ink); text-decoration: none; } |
| header nav { |
| - margin-left: auto; display: flex; align-items: baseline; gap: 0.5rem 1rem; flex-wrap: wrap; |
| + margin-left: auto; display: flex; align-items: center; gap: 0.5rem 1rem; flex-wrap: wrap; |
| font-size: 0.9rem; |
| } |
| - header .addr { color: var(--muted); max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
| + /* The profile menu: a <details> like the switcher, so it works with no |
| + JavaScript. Its summary is the signed-in address as an icon button; |
| + the menu holds the address (a link to settings) and Sign out. */ |
| + header .profile { position: relative; flex: none; } |
| + header .profile > summary { |
| + display: inline-flex; align-items: center; justify-content: center; gap: 0.25rem; |
| + list-style: none; cursor: pointer; min-width: 2.75rem; min-height: 2.75rem; padding: 0 0.6rem; |
| + border: 1px solid var(--rst-control-border); border-radius: var(--rst-radius-sm); |
| + background-color: var(--rst-control-face); color: var(--muted); box-shadow: var(--shadow-raised); |
| + font-size: 1.1rem; |
| + } |
| + header .profile > summary::-webkit-details-marker { display: none; } |
| + header .profile > summary:hover { background-color: var(--rst-control-face-hover); color: var(--ink); } |
| + header .profile[open] > summary { background-color: var(--rst-control-face-press); color: var(--ink); box-shadow: var(--shadow-inset); } |
| + header .profile > summary > .icon { pointer-events: none; } |
| + header .profile > summary > .icon + .icon { width: 0.7em; height: 0.7em; } |
| + header .profile[open] > summary > .icon + .icon { transform: rotate(180deg); } |
| + header .profile-menu { |
| + position: absolute; z-index: 20; top: calc(100% + 0.5rem); right: 0; |
| + width: max-content; min-width: 13rem; max-width: min(20rem, calc(100vw - 2.5rem)); |
| + display: flex; flex-direction: column; align-items: stretch; gap: 0.15rem; |
| + background: var(--bg); border: 1px solid var(--rst-control-border); border-radius: var(--rst-radius); |
| + padding: 0.35rem; font-size: 0.9rem; |
| + box-shadow: var(--rst-shadow-pop), 1px 2px 0 var(--rack-edge); |
| + } |
| + header .profile-menu .addr, header .profile-menu button.linkish { |
| + display: flex; align-items: center; min-height: 2.75rem; padding: 0.4rem 0.55rem; |
| + border-radius: var(--rst-radius-sm); text-align: left; overflow-wrap: anywhere; |
| + } |
| + header .profile-menu .addr { color: var(--muted); } |
| + header .profile-menu :is(.addr, button.linkish):hover { background: var(--accent-soft); } |
| + header .profile-menu :is(.addr, button.linkish):focus-visible { outline-offset: -2px; } |
| + header .profile-menu form { margin: 0; } |
| + header .profile-menu button.linkish { width: 100%; } |
| + header .mobile-root { display: none; } |
| /* The account switcher sits where the wordmark used to: a <details> |
| disclosure, so it is a real button to a screen reader, opens on |
| Enter/Space, and needs no JavaScript to work at all. The inline script |
| @@ -94,10 +165,17 @@ |
| header .switcher > summary { |
| display: inline-flex; align-items: baseline; gap: 0.4rem; |
| list-style: none; cursor: pointer; |
| - padding: 0.25rem 0.5rem; margin: -0.25rem -0.5rem; border-radius: 0.5rem; |
| + padding: 0.25rem 0.6rem; border-radius: var(--rst-radius-sm); |
| + background-color: var(--rst-control-face); color: var(--accent-strong); |
| + border: 1px solid var(--rst-control-border); box-shadow: var(--shadow-raised); |
| } |
| + header .switcher > summary .small { color: inherit; } |
| header .switcher > summary::-webkit-details-marker { display: none; } |
| - header .switcher > summary:hover { background: var(--accent-soft); } |
| + header .switcher > summary:hover { background-color: var(--rst-control-face-hover); } |
| + header .switcher[open] > summary { |
| + background-color: var(--accent-soft); |
| + box-shadow: var(--shadow-inset); |
| + } |
| /* Names are free text up to 64 characters, which unbounded would shove the |
| nav off the header β truncate in the trigger, wrap in the menu. */ |
| header .switcher .current-name { |
| @@ -105,18 +183,18 @@ |
| overflow: hidden; text-overflow: ellipsis; white-space: nowrap; |
| } |
| /* The caret is an icon, not a text character: centred against a |
| - baseline-aligned row, muted, and flipped while the menu is open. */ |
| - header .switcher > summary > .icon { color: var(--muted); align-self: center; width: 0.9em; } |
| + baseline-aligned row and flipped while the menu is open. */ |
| + header .switcher > summary > .icon { color: currentColor; align-self: center; width: 0.9em; } |
| header .switcher[open] > summary > .icon { transform: rotate(180deg); } |
| header .switcher-menu { |
| - position: absolute; z-index: 20; top: calc(100% + 0.6rem); left: -0.5rem; |
| + position: absolute; z-index: 20; top: calc(100% + 0.5rem); left: 0; |
| /* max-content, not shrink-to-fit: the menu's containing block is the |
| narrow trigger, so shrink-to-fit pinned it at min-width and wrapped |
| any name longer than that mid-word. */ |
| width: max-content; min-width: 13rem; max-width: 20rem; |
| - background: var(--bg); border: 1px solid var(--rule); border-radius: 0.6rem; |
| + background: var(--bg); border: 1px solid var(--rst-control-border); border-radius: var(--rst-radius); |
| padding: 0.35rem; font-size: 0.9rem; |
| - box-shadow: 0 0.4rem 1.5rem rgba(0, 0, 0, 0.14); |
| + box-shadow: var(--rst-shadow-pop), 1px 2px 0 var(--rack-edge); |
| } |
| /* Someone in dozens of accounts gets a list that scrolls inside the menu |
| instead of running off the bottom of the screen. */ |
| @@ -148,7 +226,7 @@ |
| header .switcher-menu hr { border: 0; border-top: 1px solid var(--rule); margin: 0.35rem 0.2rem; } |
| header .switcher-menu .new a { color: var(--accent); } |
| main { max-width: 64rem; margin: 0 auto; padding: 2.5rem 0 3rem; min-height: 55vh; } |
| - h1 { font-size: 1.9rem; line-height: 1.15; margin: 0 0 1rem; } |
| + h1 { overflow-wrap: anywhere; font-size: 1.9rem; line-height: 1.15; margin: 0 0 1rem; color: var(--accent-strong); } |
| h2 { font-size: 1.25rem; margin: 2rem 0 0.75rem; } |
| h3 { font-size: 1rem; margin: 1.5rem 0 0.5rem; } |
| /* Settings: an input-and-button row, and the deletion section's heading |
| @@ -167,7 +245,11 @@ |
| .settings-nav a[aria-current="page"] { |
| color: var(--ink); background: var(--accent-soft); font-weight: 600; |
| } |
| - .settings-content { min-width: 0; } |
| + .settings-content { |
| + min-width: 0; padding: 1.25rem 1.5rem 0.5rem; background-color: var(--bg); |
| + border: 1px solid var(--rule); border-radius: var(--rst-radius); box-shadow: var(--shadow-module); |
| + } |
| + .settings-content :is(.tile, .tablewrap, .rung) { background-color: var(--rst-surface-2); box-shadow: none; } |
| .settings-content > h2:first-child { margin-top: 0; } |
| .danger-head { color: var(--bad); } |
| p { max-width: 40rem; margin: 0 0 1rem; } |
| @@ -184,7 +266,16 @@ |
| background: var(--accent-soft); border-radius: 0.5rem; |
| padding: 0.6rem 0.9rem; margin: 0 0 1.5rem; max-width: 40rem; |
| } |
| - .tablewrap { overflow-x: auto; } |
| + :where(main) :where(ul:not([class]), ol:not([class]), ul.small, ol.small) { padding-left: 1.25rem; margin: 0 0 1rem; } |
| + .tablewrap { |
| + overflow-x: auto; margin: 0 0 1rem; background-color: var(--bg); |
| + border: 1px solid var(--rule); border-radius: var(--rst-radius); box-shadow: var(--shadow-module); |
| + } |
| + .tablewrap > table:not(.packs) { margin: 0; } |
| + .tablewrap > table:not(.packs) :is(th, td):first-child { padding-left: 0.9rem; } |
| + .tablewrap > table:not(.packs) > :last-child > tr:last-child > :is(th, td) { border-bottom: 0; } |
| + .tablewrap > table:not(.packs) tr:not(.instance-group) > th { background-color: var(--panel-cool); } |
| + .tablewrap:has(> table.packs) { background: none; border: 0; border-radius: 0; box-shadow: none; margin: 0; } |
| .instances .instance-address { white-space: nowrap; } |
| .instances td:nth-child(2) { white-space: nowrap; } |
| .instance-open { display: inline-flex; padding: .25rem; } |
| @@ -232,7 +323,10 @@ |
| .tl-error .tl-m { color: var(--bad); font-weight: 600; } |
| table { border-collapse: collapse; width: 100%; margin: 0 0 1rem; font-size: 0.95rem; } |
| .tiles { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0 0 1.5rem; } |
| - .tile { flex: 1 1 10rem; background: var(--accent-soft); border-radius: 0.6rem; padding: 1rem 1.1rem; } |
| + .tile { |
| + flex: 1 1 10rem; background-color: var(--bg); border: 1px solid var(--rule); |
| + border-radius: var(--rst-radius); padding: 1rem 1.1rem; box-shadow: var(--shadow-module); |
| + } |
| /* A tile that is also a link (the Overview dashboard): the tile itself is |
| the affordance, so no underline and no accent ink β hover carries it. */ |
| a.tile { color: var(--ink); text-decoration: none; } |
| @@ -242,7 +336,7 @@ |
| .stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); } |
| .tile h2 { |
| margin: 0 0 0.35rem; font-family: var(--mono); font-size: 0.78rem; text-transform: uppercase; |
| - letter-spacing: 0.05em; color: var(--muted); font-weight: 600; |
| + letter-spacing: 0.05em; color: var(--accent-strong); font-weight: 600; |
| } |
| .tile-value { font-size: 1.6rem; font-weight: 600; margin: 0; } |
| .tile-detail { color: var(--muted); font-size: 0.8rem; margin: 0.25rem 0 0; } |
| @@ -274,6 +368,18 @@ |
| .chip-health-attention { background: var(--warn, #a6790f); color: var(--bg); } |
| .chip-health-notdeployed { border: 1px solid var(--rule); color: var(--muted); } |
| .chip-health-unknown { border: 1px solid var(--warn, #a6790f); color: var(--warn, #a6790f); } |
| + /* A small lamp ahead of each verdict. The word carries the status; the |
| + lamp is a second cue in a different shape: ok lit and round, attention a |
| + solid diamond, unknown a hollow ring, not deployed an unlit dot. */ |
| + .chip-health-ok::before, .chip-health-attention::before, |
| + .chip-health-notdeployed::before, .chip-health-unknown::before { |
| + content: ""; display: inline-block; width: 0.55em; height: 0.55em; |
| + margin: 0 0.4em 0.1em 0; border-radius: 50%; vertical-align: middle; |
| + } |
| + .chip-health-ok::before { background: var(--good); box-shadow: 0 0 0.4em color-mix(in srgb, var(--good) 55%, transparent); } |
| + .chip-health-attention::before { background: var(--bg); border-radius: 1px; transform: rotate(45deg); } |
| + .chip-health-unknown::before { box-shadow: inset 0 0 0 2px var(--warn, #a6790f); } |
| + .chip-health-notdeployed::before { background: var(--muted); opacity: 0.45; } |
| /* /fleet/economics/accounts (Task 14): FreeTierPos chips. "inside" (all |
| usage covered by the free tier, zero revenue) is the pure-cost-sink |
| case worth a second look, so it gets the same bordered warn tone as |
| @@ -304,7 +410,7 @@ |
| .chip-tier-fleet { border: 1px solid var(--accent); color: var(--accent); } |
| .chip-tier-dedicated { border: 1px solid var(--warn, #a6790f); color: var(--warn, #a6790f); } |
| .chip .icon { vertical-align: -0.1em; margin-right: 0.2em; } |
| - .chip-up { background: var(--accent-soft); color: #2f7a4f; } |
| + .chip-up { background: var(--accent-soft); color: var(--good); } |
| .chip-down { background: var(--accent-soft); color: var(--bad); } |
| .chips { display: flex; flex-wrap: wrap; margin: 0 0 1rem; } |
| /* /fleet/economics (Task 13): a box's utilization as a filled bar, CSS |
| @@ -330,31 +436,37 @@ |
| than colour, hence solid vs dashed. */ |
| .flow { margin: 0 0 1.75rem; } |
| .flow-line { |
| - --flow-y: 0.52rem; |
| + --flow-y: 1.25rem; |
| display: flex; flex-wrap: wrap; gap: 1.1rem 2.6rem; |
| list-style: none; margin: 0; padding: 0; |
| } |
| - .flow-stage { position: relative; flex: 1 1 10rem; min-width: 9rem; } |
| + .flow-stage { |
| + position: relative; flex: 1 1 10rem; min-width: 9rem; padding: 0.7rem 0.85rem 0.8rem; |
| + background-color: var(--bg); border: 1px solid var(--rule); border-radius: var(--rst-radius); |
| + box-shadow: var(--shadow-module); |
| + } |
| .flow-stage + .flow-stage::before, .flow-stage + .flow-stage::after { |
| content: ""; position: absolute; pointer-events: none; |
| } |
| .flow-stage + .flow-stage::before { |
| - left: -2.05rem; top: var(--flow-y); width: 1.3rem; border-top: 1px dashed var(--rule); |
| + left: -2.05rem; top: var(--flow-y); width: 1.3rem; border-top: 1px dashed var(--wire); |
| } |
| .flow-stage + .flow-stage::after { |
| left: -0.82rem; top: var(--flow-y); transform: translateY(-50%); |
| - border: 0.28rem solid transparent; border-right: 0; border-left-color: var(--rule); |
| + border: 0.28rem solid transparent; border-right: 0; border-left-color: var(--wire); |
| } |
| .flow-stage.is-carried::before { border-top-style: solid; border-top-color: var(--accent); } |
| .flow-stage.is-carried::after { border-left-color: var(--accent); } |
| .flow-label { |
| margin: 0; font-family: var(--mono); font-size: 0.74rem; text-transform: uppercase; |
| - letter-spacing: 0.05em; color: var(--muted); font-weight: 600; |
| + letter-spacing: 0.05em; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; |
| } |
| - .flow-version { margin: 0.3rem 0 0; font-size: 0.95rem; } |
| - /* An empty box states its emptiness in words, so it needs no fill of its |
| - own β the missing version chip is the signal. */ |
| + .flow-version { margin: 0.3rem 0 0; font-size: 0.95rem; overflow-wrap: anywhere; } |
| + /* Empty stages keep the same raised edge, with a neutral face. */ |
| + .flow-stage:not(.is-held) { background-color: var(--rst-surface-2); } |
| .flow-stage:not(.is-held) .flow-version { color: var(--muted); } |
| + .flow-stage.is-held { background-color: var(--panel-cool); } |
| + .flow-stage.is-held .flow-label { color: var(--accent-strong); } |
| .flow-note { margin: 0.25rem 0 0; font-size: 0.78rem; color: var(--muted); } |
| .flow-addrs { |
| list-style: none; margin: 0.6rem 0 0; padding: 0 0 0 0.7rem; |
| @@ -379,15 +491,16 @@ |
| padding-bottom: 0.25rem; |
| } |
| .settings-nav a { white-space: nowrap; } |
| + .settings-content { padding: 1rem 1rem 0.25rem; } |
| .flow-line { display: block; } |
| .flow-stage + .flow-stage { margin-top: 1.6rem; } |
| .flow-stage + .flow-stage::before { |
| - left: 0.55rem; top: -1.2rem; width: 0; height: 0.85rem; |
| - border-top: 0; border-left: 1px dashed var(--rule); |
| + left: 1rem; top: -1.2rem; width: 0; height: 0.85rem; |
| + border-top: 0; border-left: 1px dashed var(--wire); |
| } |
| .flow-stage + .flow-stage::after { |
| - left: 0.55rem; top: -0.34rem; transform: translateX(-50%); |
| - border: 0.28rem solid transparent; border-bottom: 0; border-top-color: var(--rule); |
| + left: 1rem; top: -0.34rem; transform: translateX(-50%); |
| + border: 0.28rem solid transparent; border-bottom: 0; border-top-color: var(--wire); |
| border-left-color: transparent; |
| } |
| .flow-stage.is-carried::before { border-left-color: var(--accent); } |
| @@ -399,7 +512,8 @@ |
| because the rung's own name is its marker. */ |
| .ladder { list-style: none; margin: 0 0 1rem; padding: 0; max-width: 40rem; } |
| .rung { |
| - border: 1px solid var(--rule); border-radius: 0.6rem; padding: 0.8rem 1rem; |
| + border: 1px solid var(--rule); border-radius: var(--rst-radius); padding: 0.8rem 1rem; |
| + background-color: var(--bg); box-shadow: var(--shadow-module); |
| } |
| .rung + .rung { margin-top: 0.4rem; } |
| .rung-name { |
| @@ -429,17 +543,37 @@ |
| form.signin { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0 0 1rem; } |
| form.signin input[type=text], form.signin input[type=email] { padding: 0.55rem 0.8rem; min-width: 16rem; } |
| form.signin label { flex-basis: 100%; font-weight: 600; } |
| + /* A button is a small raised module: a fill, a hairline edge in its own |
| + darker tone, a short lip under it that it sinks into when pressed. The |
| + variants below only swap the --btn-* tones, so hover, press and busy |
| + stay one set of rules. */ |
| button, .btn { |
| - font-size: 0.95rem; font-weight: 600; background: var(--accent); |
| - color: var(--bg); border: 0; border-radius: 0.4rem; |
| - padding: 0.6rem 1.2rem; cursor: pointer; |
| + --btn-fill: var(--rst-accent-fill); --btn-fill-hover: var(--rst-accent-fill-hover); |
| + --btn-edge: var(--rst-accent-fill-edge); --btn-edge-hover: var(--rst-accent-fill-edge-hover); |
| + --btn-lip: var(--btn-edge); --btn-ink: var(--rst-on-accent-fill); |
| + --btn-hl: color-mix(in srgb, var(--rst-depth-hl) 30%, transparent); |
| + font-size: 0.95rem; font-weight: 600; background-color: var(--btn-fill); |
| + background-image: linear-gradient(rgb(255 255 255 / var(--rst-depth-face)), rgb(0 0 0 / var(--rst-depth-face))); |
| + color: var(--btn-ink); border: 1px solid var(--btn-edge); border-radius: var(--rst-radius-sm); |
| + padding: calc(0.6rem - 1px) calc(1.2rem - 1px); cursor: pointer; |
| text-decoration: none; display: inline-block; |
| + box-shadow: inset 0 1px 0 var(--btn-hl), 0 2px 0 var(--btn-lip), 0 3px 4px -2px var(--rst-depth-contact); |
| + transition: background-color 120ms ease-out, border-color 120ms ease-out, box-shadow 120ms ease-out, translate 80ms ease-out; |
| } |
| button.linkish { |
| - background: none; color: var(--accent); font-weight: 400; padding: 0; |
| + background: none; color: var(--accent); font-weight: 400; padding: 0; border: 0; box-shadow: none; |
| border-radius: 0; text-decoration: underline; font-size: 0.9rem; cursor: pointer; |
| } |
| - button:not(.linkish):hover, .btn:hover { background: var(--accent-strong); } |
| + button:not(.linkish, .an-col):not(:disabled):hover, .btn:not([aria-disabled="true"]):hover { |
| + background-color: var(--btn-fill-hover); border-color: var(--btn-edge-hover); |
| + } |
| + button:not(.linkish, .an-col):not(:disabled):not([aria-busy="true"]):active, .btn:not([aria-disabled="true"]):active { |
| + translate: 0 var(--rst-press-drop); |
| + box-shadow: inset 0 1px 2px var(--rst-depth-contact), 0 1px 0 var(--btn-lip); |
| + } |
| + button:disabled:not([aria-busy="true"]), .btn[aria-disabled="true"] { |
| + opacity: 0.55; cursor: not-allowed; box-shadow: none; |
| + } |
| button.linkish.danger { color: var(--bad); } |
| /* A button marked data-busy shows a spinner once pressed (the script at |
| the end of the page); the label stays for screen readers. */ |
| @@ -447,11 +581,12 @@ |
| button[aria-busy="true"]::after { |
| content: ""; position: absolute; inset: 0; margin: auto; |
| width: 1.1em; height: 1.1em; border-radius: 50%; |
| - border: 2px solid var(--bg); border-right-color: transparent; |
| + border: 2px solid var(--btn-ink, var(--bg)); border-right-color: transparent; |
| animation: busy-spin 0.7s linear infinite; |
| } |
| @keyframes busy-spin { to { transform: rotate(360deg); } } |
| @media (prefers-reduced-motion: reduce) { |
| + button, .btn { transition: none; } |
| button[aria-busy="true"]::after { animation-duration: 2.4s; } |
| } |
| /* Actions that change what serves are BUTTONS, not links β small enough to |
| @@ -459,14 +594,18 @@ |
| same. Danger is filled red: rollbacks and retirements should not dress |
| like promotions. */ |
| .btn-sm, button.btn-sm { |
| - font-size: 0.85rem; padding: 0.35rem 0.8rem; border-radius: 0.4rem; |
| + font-size: 0.85rem; padding: calc(0.35rem - 1px) calc(0.8rem - 1px); border-radius: var(--rst-radius-sm); |
| } |
| .btn-secondary, button.btn-secondary { |
| - background: transparent; color: var(--accent); border: 1px solid var(--rule); |
| + --btn-fill: var(--rst-control-face); --btn-fill-hover: var(--rst-control-face-hover); |
| + --btn-edge: var(--rst-control-border); --btn-edge-hover: var(--rst-control-border-hover); |
| + --btn-lip: var(--rack-edge); --btn-hl: var(--rst-depth-hl); --btn-ink: var(--accent); |
| + } |
| + button.btn-danger, .btn-danger { |
| + --btn-fill: var(--rst-danger-fill); --btn-fill-hover: var(--rst-danger-fill-hover); |
| + --btn-edge: var(--rst-danger-fill-edge); --btn-edge-hover: var(--rst-danger-fill-edge-hover); |
| + --btn-ink: var(--rst-on-danger-fill); |
| } |
| - .btn-secondary:hover, button.btn-secondary:hover:not(.linkish) { background: var(--accent-soft); } |
| - button.btn-danger, .btn-danger { background: var(--bad); color: var(--bg); } |
| - button.btn-danger:hover, .btn-danger:hover { background: var(--bad); filter: brightness(0.9); } |
| /* The Instances table's in-cell readings: number first, then the 48h |
| shape beside it, low-contrast so the number stays the headline. */ |
| td .cell-value { display: inline-block; min-width: 3.5rem; font-weight: 600; } |
| @@ -479,8 +618,9 @@ |
| /* The confirm interstitial: one card saying exactly what is about to |
| happen, one button that does it, one link that does not. */ |
| .confirm-card { |
| - border: 1px solid var(--rule); border-radius: 0.6rem; |
| + border: 1px solid var(--rule); border-radius: var(--rst-radius); |
| padding: 1.25rem 1.4rem; max-width: 40rem; margin: 0 0 1rem; |
| + background-color: var(--bg); box-shadow: var(--shadow-module); |
| } |
| .confirm-card .actions { display: flex; gap: 0.9rem; align-items: center; margin-top: 1rem; } |
| .confirm-card .confirm-note { margin: 0.8rem 0 0; } |
| @@ -530,8 +670,9 @@ |
| column, and a 44rem card left the column edge stepping in and out down |
| the page (discussion #9). */ |
| .archbox { |
| - border: 1px solid var(--rule); border-radius: 0.6rem; |
| + border: 1px solid var(--rule); border-radius: var(--rst-radius); |
| padding: 0.9rem 1.1rem; margin: 0 0 0.6rem; max-width: 64rem; |
| + background-color: var(--bg); box-shadow: var(--shadow-module); |
| } |
| .archbox h3 { margin: 0 0 0.3rem; } |
| .archbox p { margin: 0 0 0.2rem; } |
| @@ -554,6 +695,9 @@ |
| } |
| .pagehead h1 { margin: 0 0 0.35rem; } |
| .pagehead .lede { margin: 0; font-size: 1.05rem; } |
| + .version-list { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0.5rem 0 1rem; } |
| + .version-list code { display: inline-block; overflow-wrap: anywhere; } |
| + .version-list li { min-width: 0; max-width: 100%; } |
| /* Progressive-reveal sections: a page leads with the summary strip, and |
| the deeper tables/ladder sit behind an opt-in disclosure. */ |
| .reveal > summary { font-size: 1.1rem; font-weight: 600; cursor: pointer; } |
| @@ -561,19 +705,21 @@ |
| /* App tab bar (Heroku-style), and the account nav's active marker. |
| aria-current carries the state; the accent underline draws it. */ |
| .tabs { |
| - display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0 0 2rem; |
| + display: flex; flex-wrap: wrap; gap: 1.25rem 0.25rem; margin: 0 0 2rem; |
| border-bottom: 1px solid var(--rule); |
| font-family: var(--mono); font-size: 0.85rem; |
| } |
| .tabs a { |
| color: var(--muted); text-decoration: none; |
| - padding: 0 0 0.55rem; border-bottom: 2px solid transparent; margin-bottom: -1px; |
| + padding: 0.3rem 0.5rem 0.55rem; border-bottom: 2px solid transparent; margin-bottom: -1px; |
| } |
| .tabs a:hover { color: var(--ink); } |
| - .tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); } |
| + .tabs a[aria-current] { |
| + color: var(--ink); border-bottom-color: var(--accent); |
| + background: var(--accent-soft); border-radius: 0.35rem 0.35rem 0 0; |
| + } |
| header nav a[aria-current] { color: var(--ink); font-weight: 600; text-decoration: none; } |
| header nav a.addr { color: var(--muted); text-decoration: none; } |
| - header nav a.addr:hover { text-decoration: underline; } |
| /* The billing page (billing.html). Its price elements carry fixed class |
| lists that billing.html's own currency rules and their guard test |
| (TestBillingPagePricesFollowShownCurrency) read, so they are styled |
| @@ -602,7 +748,7 @@ |
| arrows and its required check, and the label carries the look. */ |
| .seg { |
| display: inline-flex; gap: 2px; padding: 2px; border-radius: 0.5rem; |
| - background: var(--accent-soft); |
| + background: var(--accent-soft); box-shadow: var(--shadow-inset); |
| } |
| .seg label { position: relative; display: block; } |
| .seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; } |
| @@ -615,7 +761,7 @@ |
| .seg label:hover > span { color: var(--ink); } |
| .seg label:has(input:checked) > span, .seg-fixed { |
| background: var(--bg); color: var(--ink); |
| - box-shadow: 0 1px 2px rgba(32, 29, 41, 0.12), 0 1px 4px rgba(32, 29, 41, 0.08); |
| + box-shadow: var(--shadow-raised); |
| } |
| .seg label:has(input:focus-visible) > span { outline: 2px solid var(--accent); outline-offset: 1px; } |
| /* Plan cards. The label's ::after stretches over its card, so the whole |
| @@ -625,14 +771,14 @@ |
| gap: 1rem; margin: 0 0 2.25rem; |
| } |
| .plan-card { |
| - position: relative; border: 1px solid var(--rule); border-radius: 0.6rem; |
| - padding: 1.1rem 1.25rem 1.25rem; |
| + position: relative; border: 1px solid var(--rule); border-radius: var(--rst-radius); |
| + padding: 1.1rem 1.25rem 1.25rem; background-color: var(--bg); box-shadow: var(--shadow-module); |
| transition: border-color 150ms ease-out, background-color 150ms ease-out, box-shadow 150ms ease-out; |
| } |
| .plan-card:hover { border-color: var(--muted); } |
| .plan-card:has(input:checked) { |
| - border-color: var(--accent); background: var(--accent-soft); |
| - box-shadow: inset 0 0 0 1px var(--accent); |
| + border-color: var(--accent); background-image: linear-gradient(var(--accent-soft), var(--accent-soft)); |
| + box-shadow: var(--shadow-module), inset 0 0 0 1px var(--accent); |
| } |
| .plan-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; } |
| .plan-card p { margin: 0; max-width: none; } |
| @@ -669,8 +815,8 @@ |
| .packs input[type=number] { |
| width: 4.75rem; padding: 0.4rem 0.5rem; text-align: center; |
| font: inherit; font-size: 1rem; font-variant-numeric: tabular-nums; |
| - color: var(--ink); background: var(--bg); accent-color: var(--accent); |
| - border: 1px solid var(--muted); border-radius: 0.4rem; |
| + color: var(--ink); background: var(--field); accent-color: var(--accent); |
| + border: 1px solid var(--muted); border-radius: var(--rst-radius-sm); box-shadow: var(--shadow-inset); |
| } |
| .packs input[type=number]:hover { border-color: var(--ink); } |
| .packs input[type=number]:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; } |
| @@ -741,7 +887,7 @@ |
| button.an-col, .an-col { |
| position: relative; display: flex; align-items: flex-end; justify-content: center; |
| height: 100%; padding: 0 1px; margin: 0; border: 0; border-radius: 0.25rem; |
| - background: transparent; color: inherit; font: inherit; cursor: default; |
| + background: transparent; color: inherit; font: inherit; cursor: default; box-shadow: none; |
| } |
| .an-col:not(.an-future):hover, .an-col:not(.an-future):focus-visible { background: var(--accent-soft); } |
| .an-col:not(.an-future):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; } |
| @@ -815,7 +961,7 @@ |
| .an-pagelist li { grid-template-columns: minmax(0, 1fr) 60px auto 3rem; } |
| .an-spark { width: 60px; height: 16px; align-self: center; } |
| .an-spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; } |
| - .an-overview { margin: 0 0 2rem; padding: 1.25rem 1.4rem 1.4rem; border: 1px solid var(--rule); border-radius: 0.6rem; } |
| + .an-overview { margin: 0 0 2rem; padding: 1.25rem 1.4rem 1.4rem; border: 1px solid var(--rule); border-radius: var(--rst-radius); background-color: var(--bg); box-shadow: var(--shadow-module); } |
| .an-overview-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 0 0 1rem; } |
| .an-overview-head h2 { font-size: 1rem; margin: 0; } |
| .an-overview .an-figures { gap: 0.75rem 2.5rem; margin-bottom: 1rem; } |
| @@ -861,7 +1007,6 @@ |
| .done-room { margin-top: 0.5rem; color: var(--muted); } |
| .done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin: 2rem 0 0; } |
| .done-actions .btn { padding: 0.6rem 1.25rem; } |
| - .done-actions .btn:not(.btn-secondary) { border: 1px solid transparent; } |
| .done-actions .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } |
| /* Its links land on these headings, a little clear of the window's top. */ |
| #packs-title, #upgrade { scroll-margin-top: 1.5rem; } |
| @@ -888,9 +1033,62 @@ |
| .packs td:last-child { text-align: right; } |
| .buy-foot button { width: 100%; } |
| } |
| + /* Phones (800px and narrower) see an account page as Fiesta's console |
| + does: an index of sections, or a page with one back link up to the |
| + index it sits under (mobilenav.go). Account switching has its own |
| + index on phones; the app tabs and the |
| + settings sections give way to their own indexes. Wider screens never |
| + see the back strip, and an index still reads as a list of links. */ |
| + .mobile-back, .pagehead > .mobile-title { display: none; } |
| + header .account-links { display: contents; } |
| + .index-nav { display: flex; flex-direction: column; max-width: 32rem; margin: 0 0 2rem; border: 1px solid var(--rule); border-radius: var(--rst-radius); background: var(--bg); box-shadow: var(--shadow-module); overflow: hidden; } |
| + .index-nav a:last-child { border-bottom: 0; } |
| + .index-nav a { |
| + display: flex; align-items: center; min-height: 2.75rem; box-sizing: border-box; |
| + padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--rule); |
| + color: var(--ink); text-decoration: none; overflow-wrap: anywhere; |
| + } |
| + /* The box clips to its rounded corners, so the end rows take the same |
| + curve (their background and focus ring follow it) and the ring sits |
| + 3px inside, where the clip cannot reach it. */ |
| + .index-nav a:first-child { border-top-left-radius: calc(var(--rst-radius) - 1px); border-top-right-radius: calc(var(--rst-radius) - 1px); } |
| + .index-nav a:last-child { border-bottom-left-radius: calc(var(--rst-radius) - 1px); border-bottom-right-radius: calc(var(--rst-radius) - 1px); } |
| + .index-nav a:hover, .index-nav a:target { background: var(--accent-soft); } |
| + .index-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; } |
| + @media (forced-colors: active) { .index-nav a:focus-visible { outline-color: Highlight; } } |
| + @media (max-width: 800px) { |
| + body[data-view] header :is(.switcher, .brand, .account-links) { display: none; } |
| + body[data-view] header { |
| + position: sticky; top: 0; z-index: 30; flex-wrap: nowrap; gap: 0.75rem; |
| + max-width: none; margin: 0 -1.25rem; padding: 0.375rem 0.5rem; border-top: 0; |
| + background: var(--rst-bg); |
| + } |
| + body[data-view] header nav { flex: none; margin-left: auto; flex-wrap: nowrap; gap: 0; } |
| + body[data-view] header .mobile-back, body[data-view] header .mobile-root { display: flex; align-items: center; flex: 1; min-width: 0; } |
| + body[data-view] header .mobile-root { font-weight: 500; min-height: 2.75rem; padding: 0.35rem 0.75rem; } |
| + body[data-view="page"] .tabs, body[data-view="page"] .settings-nav { display: none; } |
| + body[data-view] { border-top: 3px solid var(--accent); } |
| + body[data-view] .pagehead > .eyebrow { display: none; } |
| + body[data-view] main { padding-top: 1.25rem; } |
| + .mobile-back a { |
| + display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; min-width: 2.75rem; |
| + box-sizing: border-box; padding: 0.35rem 0.75rem; font-weight: 500; text-decoration: none; |
| + overflow-wrap: anywhere; |
| + } |
| + .mobile-back a::before { |
| + content: ""; flex: none; width: 0.55rem; height: 0.55rem; |
| + border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(-45deg); |
| + } |
| + .mobile-back a:focus-visible { outline-offset: -2px; } |
| + :root:has(body[data-view]) { scroll-padding-top: calc(3.5rem + 1px); } |
| + .pagehead > h1:has(+ .mobile-title) { display: none; } |
| + .pagehead > .mobile-title { display: block; overflow-wrap: anywhere; } |
| + .index-nav { max-width: none; } |
| + |
| + } |
| </style> |
| </head> |
| -<body> |
| +<body{{with .MobileView}} data-view="{{.}}"{{end}}> |
| <header> |
| {{if .Account}} |
| <details class="switcher" id="switcher"> |
| @@ -917,19 +1115,21 @@ |
| {{else}} |
| <div class="brand"><a href="/">{{.Brand}}</a></div> |
| {{end}} |
| - {{if .Address}}<nav> |
| - {{if .Account}} |
| - <a href="{{.Nav}}/"{{if eq .ActiveNav "apps"}} aria-current="page"{{end}}>Apps</a> |
| - <a href="{{.Nav}}/fleet"{{if eq .ActiveNav "fleet"}} aria-current="page"{{end}}>Fleet</a> |
| - <a href="{{.Nav}}/team"{{if eq .ActiveNav "team"}} aria-current="page"{{end}}>Team</a> |
| - {{if .BillingNav}}<a href="{{.Nav}}/billing"{{if eq .ActiveNav "billing"}} aria-current="page"{{end}}>{{billingText "page.title"}}</a>{{end}} |
| - <a href="{{.Nav}}/settings"{{if eq .ActiveNav "settings"}} aria-current="page"{{end}}>Settings</a> |
| - {{end}} |
| - <a class="addr" href="/settings" title="{{.Address}}">{{.Address}}</a> |
| - <form method="post" action="/auth/signout"> |
| - <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| - <button class="linkish" type="submit">Sign out</button> |
| - </form> |
| + {{with .MobileBack}}<div class="mobile-back"><a href="{{.Href}}" rel="up">{{.Label}}</a></div> |
| + {{end}}{{if eq .IndexOf "accounts"}}<span class="mobile-root" aria-hidden="true">Accounts</span> |
| + {{end}}{{if .Address}}<nav> |
| + <span class="account-links">{{range .AccountLinks}}<a href="{{.Href}}"{{if .Current}} aria-current="page"{{end}}>{{.Label}}</a> |
| + {{end}}</span> |
| + <details class="profile" id="profile"> |
| + <summary aria-label="{{.Address}}">{{icon "user-round"}}{{icon "chevron-down"}}</summary> |
| + <div class="profile-menu"> |
| + <a class="addr" href="/settings">{{.Address}}</a> |
| + <form method="post" action="/auth/signout"> |
| + <input type="hidden" name="csrf" value="{{.CSRF}}"> |
| + <button class="linkish" type="submit">Sign out</button> |
| + </form> |
| + </div> |
| + </details> |
| </nav>{{end}} |
| </header> |
| <main> |
| @@ -939,7 +1139,6 @@ |
| {{define "bottom"}} |
| </main> |
| -<footer>π€ Console text written by an LLM, per <a href="https://11factor.org/#x">factor X</a>.</footer> |
| <script> |
| // Enhancement only: a submit button marked data-busy can't be pressed twice |
| // and shows a spinner for at least 650 ms before its form goes, so a fast |
| @@ -1048,6 +1247,20 @@ |
| }); |
| })(); |
| </script> |
| +<script data-profile-menu> |
| +// Enhancement only: Escape closes the profile menu and returns focus to its |
| +// button; a click elsewhere closes it. With JS off the <details> still works. |
| +(function () { |
| + var d = document.getElementById("profile"); |
| + if (!d) return; |
| + document.addEventListener("keydown", function (e) { |
| + if (e.key === "Escape" && d.open) { d.open = false; d.firstElementChild.focus(); } |
| + }); |
| + document.addEventListener("click", function (e) { |
| + if (d.open && !d.contains(e.target)) d.open = false; |
| + }); |
| +})(); |
| +</script> |
| </body> |
| </html> |
| {{end}} |
diff --git a/internal/console/templates/navindex.html b/internal/console/templates/navindex.html| new file mode 100644 |
| index 000000000..8b0b57626 |
| --- /dev/null |
| +++ b/internal/console/templates/navindex.html |
| @@ -0,0 +1,17 @@ |
| +{{define "nav_index"}}{{template "top" .}} |
| +{{if .Flash}}<p class="banner">{{.Flash}}</p>{{end}} |
| +{{if .FlashErr}}<p class="banner error">{{.FlashErr}}</p>{{end}} |
| +{{if or (eq .IndexOf "account") (eq .IndexOf "accounts")}} |
| +<h1 id="index-title">{{if eq .IndexOf "accounts"}}Accounts{{else}}{{.Account.Name}}{{end}}</h1> |
| +<nav class="index-nav" aria-labelledby="index-title"> |
| +{{else}} |
| +<div class="pagehead"> |
| + <p class="eyebrow">App Β· {{.Account.Name}}</p> |
| + <h1>{{if eq .IndexOf "settings"}}Settings{{else}}{{.AppName}}{{end}}</h1> |
| +</div> |
| +<nav class="index-nav" aria-label="{{if eq .IndexOf "settings"}}Settings sections{{else}}App sections{{end}}"> |
| +{{end}} |
| + {{range .IndexLinks}}<a id="nav-{{.Key}}" href="{{.Href}}">{{.Label}}</a> |
| + {{end}} |
| +</nav> |
| +{{template "bottom" .}}{{end}} |
diff --git a/internal/console/testdata/claim-routes.txt b/internal/console/testdata/claim-routes.txt| index 865bdd9e1..8803e8889 100644 |
| --- a/internal/console/testdata/claim-routes.txt |
| +++ b/internal/console/testdata/claim-routes.txt |
| @@ -27,6 +27,7 @@ route GET /a/{sqid}/apps/{app}/analytics/live |
| route GET /a/{sqid}/apps/{app}/availability |
| route GET /a/{sqid}/apps/{app}/deployments |
| route GET /a/{sqid}/apps/{app}/errors |
| +route GET /a/{sqid}/apps/{app}/index |
| route GET /a/{sqid}/apps/{app}/instances |
| route GET /a/{sqid}/apps/{app}/instances/{host} |
| route GET /a/{sqid}/apps/{app}/logs |
| @@ -36,6 +37,7 @@ route GET /a/{sqid}/apps/{app}/protection |
| route GET /a/{sqid}/apps/{app}/protection/data |
| route GET /a/{sqid}/apps/{app}/releases |
| route GET /a/{sqid}/apps/{app}/settings |
| +route GET /a/{sqid}/apps/{app}/settings/index |
| route GET /a/{sqid}/apps/{app}/settings/{section} |
| route GET /a/{sqid}/billing |
| route GET /a/{sqid}/billing/continue |
| @@ -43,11 +45,13 @@ route GET /a/{sqid}/billing/done |
| route GET /a/{sqid}/fleet |
| route GET /a/{sqid}/fleet/byo |
| route GET /a/{sqid}/fleets/{fleet} |
| +route GET /a/{sqid}/index |
| route GET /a/{sqid}/plan/keep |
| route GET /a/{sqid}/settings |
| route GET /a/{sqid}/team |
| route GET /a/{sqid}/trash |
| route GET /a/{sqid}/{$} |
| +route GET /accounts |
| route GET /accounts/new |
| route GET /alerts/confirm/{token} |
| route GET /alerts/signing-key |
diff --git a/internal/provision/console_fiesta_census_test.go b/internal/provision/console_fiesta_census_test.go| new file mode 100644 |
| index 000000000..77ca96326 |
| --- /dev/null |
| +++ b/internal/provision/console_fiesta_census_test.go |
| @@ -0,0 +1,64 @@ |
| +package provision |
| + |
| +// Record-write census entries for the console's Fiesta styling and phone |
| +// navigation (branch console-fiesta-depth, UI commit d54fda7e), layered on |
| +// probeBurstLimitWriteCensusInventory (main's newest at b7802fd8). Reviewed |
| +// independently against the source; no write site, record key or storage |
| +// change is added. |
| +// |
| +// One re-pin, no class or kinds change: |
| +// - internal/console/server.go NewServer (key-site): registers four GET |
| +// index pages, /accounts (handleAccountsIndex, behind the session), |
| +// /a/{sqid}/index (handleAccountIndex, behind account), |
| +// /a/{sqid}/apps/{app}/index and /a/{sqid}/apps/{app}/settings/index |
| +// (handleAppIndex, handleAppSettingsIndex, behind accountApp). Each only |
| +// renders links; none writes. The instances route literal is unchanged. |
| +// |
| +// Three new units in internal/console/mobilenav.go, each key-site for the |
| +// "instances" literal, as the console's other route-literal sites are: |
| +// - page.AppLinks: the app's tab links; "instances" is the Running tab's |
| +// key and URL path segment. |
| +// - page.MobileBack: the phone's back link; "instances" names the Running |
| +// tab to label the instance detail page's back link. |
| +// - page.MobileTitle: an app page's phone heading; "instances" looks up |
| +// the Running tab's label for the instance detail page. |
| +// |
| +// All three are pure methods on page that build navigation links from the |
| +// page's fields. They read no store and write nothing. |
| +func consoleFiestaWriteCensusInventory() []censusEntry { |
| + entries := append([]censusEntry(nil), probeBurstLimitWriteCensusInventory()...) |
| + repins := []censusEntry{ |
| + // console fiesta: the four GET index routes; the same literal. |
| + {"internal/console/server.go", "NewServer", "key-site", "lit:instances", "d3c7f7518b10b470526d97862a58219a21db26fbeb64aae4aea06044fe8f196e"}, |
| + } |
| + for _, r := range repins { |
| + found := false |
| + for i, e := range entries { |
| + if e.File == r.File && e.Unit == r.Unit { |
| + if e.Class != r.Class || e.Kinds != r.Kinds { |
| + panic("console-fiesta re-pin changes the class or kinds of " + r.File + ":" + r.Unit) |
| + } |
| + entries[i], found = r, true |
| + } |
| + } |
| + if !found { |
| + panic("console-fiesta re-pin of an unlisted unit " + r.File + ":" + r.Unit) |
| + } |
| + } |
| + additions := []censusEntry{ |
| + // console fiesta: the app's tab links, the Running tab's key and path. |
| + {"internal/console/mobilenav.go", "page.AppLinks", "key-site", "lit:instances", "2b6d244a05d37ad29a551026a6dcd29d00772ed89273f1c3ff8a67a7d3af1fb5"}, |
| + // console fiesta: the phone back link, labelled from the Running tab. |
| + {"internal/console/mobilenav.go", "page.MobileBack", "key-site", "lit:instances", "541ff03e4343f63f55e394032bc00733e54aa37af7584655f155ca1f67e9677e"}, |
| + // console fiesta: the phone heading, labelled from the Running tab. |
| + {"internal/console/mobilenav.go", "page.MobileTitle", "key-site", "lit:instances", "87f0b265943fa52a83295b7f0bacd8e92545dbeda749e655c742877619303b00"}, |
| + } |
| + for _, a := range additions { |
| + for _, e := range entries { |
| + if e.File == a.File && e.Unit == a.Unit { |
| + panic("console-fiesta addition of an already listed unit " + a.File + ":" + a.Unit) |
| + } |
| + } |
| + } |
| + return append(entries, additions...) |
| +} |
diff --git a/internal/provision/plan9_b8_census_test.go b/internal/provision/plan9_b8_census_test.go| index e24ec464a..5fd42a764 100644 |
| --- a/internal/provision/plan9_b8_census_test.go |
| +++ b/internal/provision/plan9_b8_census_test.go |
| @@ -366,7 +366,7 @@ func TestPlan9B8RecordWriteCensus(t *testing.T) { |
| if len(got) < 100 { |
| t.Fatalf("census found only %d units under %s; the walk is broken", len(got), root) |
| } |
| - inventory := probeBurstLimitWriteCensusInventory() |
| + inventory := consoleFiestaWriteCensusInventory() |
| problems := append(censusDiff(inventory, got), censusPolicy(inventory)...) |
| if len(problems) > 0 { |
| t.Fatalf("record-write census rejected %d site(s); update the explicit inventory only after reviewing the source:\n %s", len(problems), strings.Join(problems, "\n ")) |