carlos / platform Public

Update prototype against current platform main

codex agent, operated by paul@keymail.dev pushed by claude agent, operated by paul@keymail.dev b96bd5866f8c89f94f6b397c113f71fa23df611c parent 0b8e0a2parent 65420a4
12 files changed, +279 −33
  • internal/console/apicli.go +4 −3
  • internal/console/apiinteractive_test.go +37 −2
  • internal/console/authcli_test.go +72 −0
  • internal/console/fleets_test.go +20 −0
  • internal/console/icons.go +56 −0
  • internal/console/icons_test.go +7 −6
  • internal/console/mobilenav_test.go +10 −5
  • internal/console/svcprincipal.go +16 −0
  • internal/console/templates/appmark.html +1 −0
  • internal/console/templates/apps.html +6 −2
  • internal/console/templates/layout.html +25 −5
  • internal/console/templates/navindex.html +25 −10
diff --git a/internal/console/apicli.go b/internal/console/apicli.go
index b37cde32e..9f46c68e5 100644
--- a/internal/console/apicli.go
+++ b/internal/console/apicli.go
@@ -391,11 +391,12 @@ func (s *Server) handleAPICreateApp(w http.ResponseWriter, r *http.Request) {
return
}
addr := auditActor(p, acct)
- // allowCreate picks the person or the service create budget from the
+ // allowAppCreate picks the person or the service create budget from the
// principal (svcprincipal.go) — a person keyed on the ADDRESS as before
// (a token-keyed counter is one the holder of several tokens resets at
- // will), a service on its NAME, own budget from the operator's.
- if !s.allowCreate(p, time.Now()) {
+ // will), a service on its NAME, own budget from the operator's. An
+ // ops-account owner has no limit (#500).
+ if !s.allowAppCreate(p, time.Now()) {
jsonError(w, http.StatusTooManyRequests,
"app creation limit reached for today — use the console's New app form")
return
diff --git a/internal/console/apiinteractive_test.go b/internal/console/apiinteractive_test.go
index 16944ad8f..ec2d0cfa3 100644
--- a/internal/console/apiinteractive_test.go
+++ b/internal/console/apiinteractive_test.go
@@ -422,11 +422,46 @@ func TestInteractiveRefusalsInOrder(t *testing.T) {
}
}
// With the live marker's session gone from the hub, the same request is
- // admitted: the walk's world was otherwise whole.
+ // admitted: the walk's world was otherwise whole. release only dropped
+ // the hub's copy, so the admission's write still finds Bob's marker in
+ // the record and owes it an end row of its own: lost, alongside Alice's
+ // new session ending cancelled.
s.interactive.release(liveID)
ws := ixStart(t, fx, fx.alice, ixOpenArgv())
+ defer ws.Close()
+ after, _ := ixRecord(t, fx, ixHost)
+ if after.Interactive == nil || after.Interactive.ID == liveID {
+ t.Fatalf("the admitted session's marker: %+v, want a fresh id replacing %s", after.Interactive, liveID)
+ }
+ newID := after.Interactive.ID
ws.Close()
- ixWaitEvents(t, fx, "interactive-end", 1)
+
+ // Exactly one end row for each of the two known ids, and nothing else:
+ // Bob's old marker lost, Alice's new session cancelled.
+ want := map[string]struct{ reason, by string }{
+ liveID: {interactive.EndLost, "bob@keymail.dev"},
+ newID: {interactive.EndCancelled, "alice@keymail.dev"},
+ }
+ seen := map[string]bool{}
+ for _, e := range ixWaitEvents(t, fx, "interactive-end", 2) {
+ d := ixEndRow(t, e)
+ if seen[d.ID] {
+ t.Fatalf("interactive-end: a second row for %s: %+v", d.ID, e)
+ }
+ seen[d.ID] = true
+ w, ok := want[d.ID]
+ if !ok {
+ t.Fatalf("interactive-end: unknown id %s: %+v", d.ID, e)
+ }
+ if d.Reason != w.reason || e.Address != w.by {
+ t.Errorf("interactive-end %s: reason %q by %q, want %q by %q", d.ID, d.Reason, e.Address, w.reason, w.by)
+ }
+ }
+ for id := range want {
+ if !seen[id] {
+ t.Errorf("interactive-end: no row for %s", id)
+ }
+ }
}
func TestInteractiveOnAHostClaimConsole(t *testing.T) {
diff --git a/internal/console/authcli_test.go b/internal/console/authcli_test.go
index 8074b5acb..14580fbd8 100644
--- a/internal/console/authcli_test.go
+++ b/internal/console/authcli_test.go
@@ -675,6 +675,78 @@ func TestPersonBudgetsAreUnchanged(t *testing.T) {
}
}
+// TestOpsOwnerSkipsTheCreateBudget is #500: an owner of the ops account
+// creates apps in any account of theirs past cliCreateBurst, because a
+// benchmark run signed in as the platform owner ran out of it. Owning some
+// other account is not enough: carol owns the same demo account and still
+// stops at the ordinary limit.
+func TestOpsOwnerSkipsTheCreateBudget(t *testing.T) {
+ fx := newConsoleFixture(t)
+ const demoID = 4242
+ if err := fx.st.CreateAccount(demoID, "cdef", "Demo", "paul@keymail.dev", time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ for _, addr := range []string{"paul@keymail.dev", "carol@keymail.dev"} {
+ if err := fx.st.AddMember(demoID, addr, RoleOwner, time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ }
+ paul := cliToken(t, fx, "paul@keymail.dev", "code-ops-owner-budget")
+ for i := 0; i < cliCreateBurst+2; i++ {
+ name := fmt.Sprintf("bench-%d", i)
+ if status, out := postJSON(t, fx.ts.URL+"/api/cli/apps/cdef/new", map[string]string{"name": name}, paul); status != http.StatusOK {
+ t.Fatalf("ops owner create %d = %d %v, want no daily limit", i, status, out)
+ }
+ }
+ carol := cliToken(t, fx, "carol@keymail.dev", "code-demo-owner-budget")
+ for i := 0; i < cliCreateBurst; i++ {
+ name := fmt.Sprintf("carol-%d", i)
+ if status, out := postJSON(t, fx.ts.URL+"/api/cli/apps/cdef/new", map[string]string{"name": name}, carol); status != http.StatusOK {
+ t.Fatalf("demo owner create %d = %d %v", i, status, out)
+ }
+ }
+ status, out := postJSON(t, fx.ts.URL+"/api/cli/apps/cdef/new", map[string]string{"name": "carol-over"}, carol)
+ if status != http.StatusTooManyRequests {
+ t.Errorf("demo owner create %d+1 = %d %v, want 429: only ops owners skip the limit", cliCreateBurst, status, out)
+ }
+}
+
+// TestOpsOwnerExemptionEndsWithOwnership: the exemption is read on every
+// create, so an ops owner who is removed from the ops account is back on
+// the ordinary budget at once. Exempt creates spent none of it.
+func TestOpsOwnerExemptionEndsWithOwnership(t *testing.T) {
+ fx := newConsoleFixture(t)
+ const demoID = 4242
+ if err := fx.st.CreateAccount(demoID, "cdef", "Demo", "dana@keymail.dev", time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ for _, id := range []int64{OpsAccountID, demoID} {
+ if err := fx.st.AddMember(id, "dana@keymail.dev", RoleOwner, time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ }
+ dana := cliToken(t, fx, "dana@keymail.dev", "code-ops-owner-removed")
+ for i := 0; i < cliCreateBurst+2; i++ {
+ name := fmt.Sprintf("exempt-%d", i)
+ if status, out := postJSON(t, fx.ts.URL+"/api/cli/apps/cdef/new", map[string]string{"name": name}, dana); status != http.StatusOK {
+ t.Fatalf("ops owner create %d = %d %v", i, status, out)
+ }
+ }
+ if err := fx.st.RemoveMember(OpsAccountID, "dana@keymail.dev"); err != nil {
+ t.Fatal(err)
+ }
+ for i := 0; i < cliCreateBurst; i++ {
+ name := fmt.Sprintf("after-%d", i)
+ if status, out := postJSON(t, fx.ts.URL+"/api/cli/apps/cdef/new", map[string]string{"name": name}, dana); status != http.StatusOK {
+ t.Fatalf("create %d after removal = %d %v, want the whole budget left", i, status, out)
+ }
+ }
+ status, out := postJSON(t, fx.ts.URL+"/api/cli/apps/cdef/new", map[string]string{"name": "after-over"}, dana)
+ if status != http.StatusTooManyRequests {
+ t.Errorf("create %d+1 after removal = %d %v, want 429", cliCreateBurst, status, out)
+ }
+}
+
// TestTwoNamedServicesHaveSeparateBudgets is Minor 5 (Task 5 review): two
// DIFFERENT named services in one account must not share a budget just
// because they share an account — closing this alongside C32's empty-name
diff --git a/internal/console/fleets_test.go b/internal/console/fleets_test.go
index 117279db8..e14742e66 100644
--- a/internal/console/fleets_test.go
+++ b/internal/console/fleets_test.go
@@ -16,6 +16,7 @@ import (
"crypto/sha256"
"encoding/hex"
"errors"
+ "fmt"
"io"
"net/http"
"net/url"
@@ -59,6 +60,25 @@ func openTestReg(t *testing.T, fx *consoleFixture) *registry.Registry {
return reg
}
+// TestFleetCreateKeepsTheBudgetForOpsOwners: #500 lifted the app create
+// budget for ops owners, not the fleet one. Fleet names are global and
+// have no delete door, so paul (an ops owner) still stops at cliCreateBurst.
+func TestFleetCreateKeepsTheBudgetForOpsOwners(t *testing.T) {
+ fx, token := fleetFixture(t, "code-fleet-budget")
+ for i := 0; i < cliCreateBurst; i++ {
+ name := fmt.Sprintf("acme-%d", i)
+ if status, body := postJSON(t, fleetsURL(fx, fx.sqid)+"/new",
+ map[string]string{"name": name, "bucket": name + "-data"}, token); status != http.StatusOK {
+ t.Fatalf("create %s = %d %v, want 200", name, status, body)
+ }
+ }
+ status, body := postJSON(t, fleetsURL(fx, fx.sqid)+"/new",
+ map[string]string{"name": "acme-over", "bucket": "acme-over-data"}, token)
+ if status != http.StatusTooManyRequests {
+ t.Errorf("create %d+1 = %d %v, want 429", cliCreateBurst, status, body)
+ }
+}
+
// TestFleetCreateListRoundTrip: create, then list, and the created fleet
// comes back with an empty (never null) boxes array.
func TestFleetCreateListRoundTrip(t *testing.T) {
diff --git a/internal/console/icons.go b/internal/console/icons.go
index b0ddf2d32..e80849051 100644
--- a/internal/console/icons.go
+++ b/internal/console/icons.go
@@ -129,11 +129,67 @@ const (
iconFastForward template.HTML = iconOpen +
`<polygon points="13 19 22 12 13 5 13 19"/>` +
`<polygon points="2 19 11 12 2 5 2 19"/></svg>`
+ // Lucide: activity.
+ iconActivity template.HTML = iconOpen + `<path d="M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2" /></svg>`
+
+ // Lucide: chart-no-axes-combined.
+ iconChartNoAxesCombined template.HTML = iconOpen + `<path d="M12 16v5" /> <path d="M16 14.639V21" /> <path d="M20 10.656V21" /> <path d="m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15" /> <path d="M4 18.463V21" /> <path d="M8 14.656V21" /></svg>`
+
+ // Lucide: chevron-right.
+ iconChevronRight template.HTML = iconOpen + `<path d="m9 18 6-6-6-6" /></svg>`
+
+ // Lucide: credit-card.
+ iconCreditCard template.HTML = iconOpen + `<rect width="20" height="14" x="2" y="5" rx="2" /> <line x1="2" x2="22" y1="10" y2="10" /> <path d="M6 14h2" /></svg>`
+
+ // Lucide: database.
+ iconDatabase template.HTML = iconOpen + `<ellipse cx="12" cy="5" rx="9" ry="3" /> <path d="M3 5V19A9 3 0 0 0 21 19V5" /> <path d="M3 12A9 3 0 0 0 21 12" /></svg>`
+
+ // Lucide: flag.
+ iconFlag template.HTML = iconOpen + `<path d="M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528" /></svg>`
+
+ // Lucide: globe.
+ iconGlobe template.HTML = iconOpen + `<circle cx="12" cy="12" r="10" /> <path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" /> <path d="M2 12h20" /></svg>`
+
+ // Lucide: layout-grid.
+ iconLayoutGrid template.HTML = iconOpen + `<rect width="7" height="7" x="3" y="3" rx="1" /> <rect width="7" height="7" x="14" y="3" rx="1" /> <rect width="7" height="7" x="14" y="14" rx="1" /> <rect width="7" height="7" x="3" y="14" rx="1" /></svg>`
+
+ // Lucide: mail.
+ iconMail template.HTML = iconOpen + `<path d="m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7" /> <rect x="2" y="4" width="20" height="16" rx="2" /></svg>`
+
+ // Lucide: server.
+ iconServer template.HTML = iconOpen + `<rect width="20" height="8" x="2" y="2" rx="2" ry="2" /> <rect width="20" height="8" x="2" y="14" rx="2" ry="2" /> <line x1="6" x2="6.01" y1="6" y2="6" /> <line x1="6" x2="6.01" y1="18" y2="18" /></svg>`
+
+ // Lucide: shield.
+ iconShield template.HTML = iconOpen + `<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" /></svg>`
+
+ // Lucide: sliders-horizontal.
+ iconSlidersHorizontal template.HTML = iconOpen + `<path d="M10 5H3" /> <path d="M12 19H3" /> <path d="M14 3v4" /> <path d="M16 17v4" /> <path d="M21 12h-9" /> <path d="M21 19h-5" /> <path d="M21 5h-7" /> <path d="M8 10v4" /> <path d="M8 12H3" /></svg>`
+
+ // Lucide: trash.
+ iconTrash template.HTML = iconOpen + `<path d="M10 11v6" /> <path d="M14 11v6" /> <path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" /> <path d="M3 6h18" /> <path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" /></svg>`
+
+ // Lucide: users.
+ iconUsers template.HTML = iconOpen + `<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" /> <path d="M16 3.128a4 4 0 0 1 0 7.744" /> <path d="M22 21v-2a4 4 0 0 0-3-3.87" /> <circle cx="9" cy="7" r="4" /></svg>`
)
// icons maps each Lucide slug to its vendored markup. Slugs are the Lucide
// names so the mapping back to lucide.dev stays obvious.
var icons = map[string]template.HTML{
+ "activity": iconActivity,
+ "chart-no-axes-combined": iconChartNoAxesCombined,
+ "chevron-right": iconChevronRight,
+ "credit-card": iconCreditCard,
+ "database": iconDatabase,
+ "flag": iconFlag,
+ "globe": iconGlobe,
+ "layout-grid": iconLayoutGrid,
+ "mail": iconMail,
+ "server": iconServer,
+ "shield": iconShield,
+ "sliders-horizontal": iconSlidersHorizontal,
+ "trash": iconTrash,
+ "users": iconUsers,
+
"external-link": iconExternalLink,
"chevron-down": iconChevronDown,
"check": iconCheck,
diff --git a/internal/console/icons_test.go b/internal/console/icons_test.go
index 89fbe3ada..e626a31d6 100644
--- a/internal/console/icons_test.go
+++ b/internal/console/icons_test.go
@@ -205,12 +205,13 @@ func TestVendoredIconsAreSelfContained(t *testing.T) {
t.Errorf("icon %q reaches outside the page (%q): %s", slug, bad, s)
}
}
- // No width/height of their own: they size from the .icon CSS rule so
- // one icon at a 0.9rem menu row and the same icon in body text are the
- // same shape at two sizes, not two hand-tuned copies. (The leading
- // space is what keeps stroke-width, a different thing entirely, out
- // of this check.)
- if strings.Contains(s, " width=") || strings.Contains(s, " height=") {
+ // CSS sizes the outer SVG. Shapes inside its viewBox, such as rect,
+ // need their own dimensions to draw the icon.
+ opening, _, ok := strings.Cut(s, ">")
+ if !ok {
+ t.Fatalf("icon %q has no opening SVG tag: %s", slug, s)
+ }
+ if strings.Contains(opening, " width=") || strings.Contains(opening, " height=") {
t.Errorf("icon %q hardcodes a size instead of sizing from the text: %s", slug, s)
}
}
diff --git a/internal/console/mobilenav_test.go b/internal/console/mobilenav_test.go
index 4d9b3a342..fa066772a 100644
--- a/internal/console/mobilenav_test.go
+++ b/internal/console/mobilenav_test.go
@@ -10,7 +10,8 @@ import (
)
var (
- indexLinkRE = regexp.MustCompile(`<a id="nav-([^"]+)" href="([^"]+)"[^>]*>([^<]+)</a>`)
+ indexLinkRE = regexp.MustCompile(`(?s)<a id="nav-([^"]+)" href="([^"]+)"[^>]*>(.*?)</a>`)
+ indexLabelRE = regexp.MustCompile(`<span class="index-label">([^<]+)</span>`)
mobileBackRE = regexp.MustCompile(`<div class="mobile-back"><a href="([^"]+)" rel="up">([^<]+)</a></div>`)
mobileHeadRE = regexp.MustCompile(`<h1 class="mobile-title">([^<]+)</h1>`)
)
@@ -34,7 +35,11 @@ func indexRows(t *testing.T, body string) []indexRow {
}
var rows []indexRow
for _, m := range indexLinkRE.FindAllStringSubmatch(list, -1) {
- rows = append(rows, indexRow{m[1], html.UnescapeString(m[2]), html.UnescapeString(m[3])})
+ label := indexLabelRE.FindStringSubmatch(m[3])
+ if len(label) != 2 {
+ t.Fatalf("index row %q has no label: %s", m[1], m[3])
+ }
+ rows = append(rows, indexRow{m[1], html.UnescapeString(m[2]), html.UnescapeString(label[1])})
}
return rows
}
@@ -302,9 +307,9 @@ func TestPhoneViewStyle(t *testing.T) {
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)
+ for sel, height := range map[string]string{".index-nav a": "3.75rem", ".mobile-back a": "2.75rem"} {
+ if blk := cssBlock(t, body, sel); !strings.Contains(blk, "min-height: "+height) {
+ t.Errorf("%s is missing its %s minimum touch target: %s", sel, height, blk)
}
}
}
diff --git a/internal/console/svcprincipal.go b/internal/console/svcprincipal.go
index 12a1c1482..7d5214c93 100644
--- a/internal/console/svcprincipal.go
+++ b/internal/console/svcprincipal.go
@@ -591,6 +591,22 @@ func (s *Server) allowCreate(p Principal, now time.Time) bool {
return s.cli.svcCreate.allow(principalKey(p), now)
}
+// allowAppCreate is allowCreate for app creation, where an owner of the
+// ops account skips the person budget (#500). The budget is a ceiling on a
+// stolen token, and the platform owner's token already carries the whole
+// platform; their benchmark runs create dozens of apps a day on demo
+// accounts. Apps only: fleet names are global with no delete door, so
+// fleet creation keeps allowCreate as it is. A store error is not an
+// exemption, and an exempt create spends nothing.
+func (s *Server) allowAppCreate(p Principal, now time.Time) bool {
+ if p.Kind == PrincipalUser {
+ if role, err := s.store.Role(OpsAccountID, p.Address); err == nil && role == RoleOwner {
+ return true
+ }
+ }
+ return s.allowCreate(p, now)
+}
+
// allowTemporaryCreate is /new-temporary's budget: one limiter for both
// principal kinds, keyed like allowCreate (principalKey), separate from it
// so neither kind of create spends the other's day.
diff --git a/internal/console/templates/appmark.html b/internal/console/templates/appmark.html
new file mode 100644
index 000000000..18806a0c6
--- /dev/null
+++ b/internal/console/templates/appmark.html
@@ -0,0 +1 @@
+{{define "app_mark"}}<span class="app-mark" aria-hidden="true">{{if .}}{{printf "%.1s" .}}{{else}}{{icon "layers"}}{{end}}</span>{{end}}
diff --git a/internal/console/templates/apps.html b/internal/console/templates/apps.html
index e70c9caaa..a27c28f15 100644
--- a/internal/console/templates/apps.html
+++ b/internal/console/templates/apps.html
@@ -12,7 +12,7 @@
<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 role="row" data-app-row>
- <td role="cell" class="app-name"><a href="{{$.Nav}}/apps/{{.App}}">{{.App}}</a></td>
+ <td role="cell" class="app-name"><a href="{{$.Nav}}/apps/{{.App}}">{{template "app_mark" .App}}<span class="app-label">{{.App}}</span></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>
@@ -24,6 +24,8 @@
<style>
.app-list .app-meta-label { display: none; }
.app-list tr[data-app-row] { position: relative; }
+.app-list .app-name a { display: inline-flex; align-items: center; gap: 0.65rem; max-width: 100%; min-height: 44px; }
+.app-label { min-width: 0; overflow-wrap: anywhere; }
.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; }
@@ -32,6 +34,7 @@
.app-list tr[data-app-row]:has(.app-name a:hover) { background: var(--accent-soft); }
}
@media (max-width: 800px) {
+.tablewrap.app-list .app-mark { width: 2.75rem; height: 2.75rem; font-size: 1.25rem; }
.tablewrap.app-list { overflow: visible; }
.tablewrap.app-list > table { display: block; width: 100%; margin: 0; }
.tablewrap.app-list > table > tbody { display: block; }
@@ -40,7 +43,8 @@
.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 { display: inline-flex; align-items: center; gap: 0.65rem; max-width: 100%; min-height: 44px; overflow-wrap: anywhere; }
+.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; }
diff --git a/internal/console/templates/layout.html b/internal/console/templates/layout.html
index e33cfcf1e..c884d723c 100644
--- a/internal/console/templates/layout.html
+++ b/internal/console/templates/layout.html
@@ -493,13 +493,13 @@
.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 { margin-top: 2.25rem; }
.flow-stage + .flow-stage::before {
- left: 1rem; top: -1.2rem; width: 0; height: 0.85rem;
+ left: 1rem; top: -1.75rem; width: 0; height: 0.85rem;
border-top: 0; border-left: 1px dashed var(--wire);
}
.flow-stage + .flow-stage::after {
- left: 1rem; top: -0.34rem; transform: translateX(-50%);
+ left: 1rem; top: -0.9rem; transform: translateX(-50%);
border: 0.28rem solid transparent; border-bottom: 0; border-top-color: var(--wire);
border-left-color: transparent;
}
@@ -1044,10 +1044,30 @@
.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);
+ display: flex; align-items: center; box-sizing: border-box;
+ gap: 0.75rem; min-height: 3.75rem; padding: 0.75rem 0.875rem; border-bottom: 1px solid var(--rule);
color: var(--ink); text-decoration: none; overflow-wrap: anywhere;
}
+ .index-context { display: flex; align-items: center; gap: 0.875rem; max-width: 32rem; margin: 0.25rem 0 1.5rem; }
+ .index-context-copy { min-width: 0; }
+ .index-context h1 { margin: 0; }
+ .index-context .eyebrow { margin: 0 0 0.25rem; font-size: 0.7rem; overflow-wrap: anywhere; }
+ .index-meta { margin: 0.375rem 0 0; color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }
+ .index-meta code { font-size: 0.75rem; }
+ .app-mark { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 2rem; height: 2rem; border-radius: 0.6rem; font: 600 1rem/1 var(--mono); text-transform: uppercase; color: var(--accent-strong); background: var(--accent-soft); border: 1px solid var(--rack-edge); box-shadow: var(--shadow-raised); }
+ .app-mark .icon { width: 1rem; height: 1rem; }
+ .index-context > .app-mark { width: 2.75rem; height: 2.75rem; font-size: 1.25rem; }
+ .index-context-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 2.75rem; height: 2.75rem; color: var(--accent-strong); background: var(--accent-soft); border: 1px solid var(--rack-edge); border-radius: 0.75rem; box-shadow: var(--shadow-raised); }
+ .index-context-icon .icon { width: 1.4rem; height: 1.4rem; }
+ .index-nav .index-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 2rem; height: 2rem; border-radius: 0.5rem; background: light-dark(#f0e4ef, #382435); color: var(--accent-strong); box-shadow: inset 0 1px 0 var(--rst-depth-hl), 0 1px 1px var(--rst-depth-ambient); }
+ .index-nav .index-icon .icon { width: 1.125rem; height: 1.125rem; }
+ .index-label { flex: 1; min-width: 0; }
+ .index-chevron { display: flex; flex: none; color: var(--muted); opacity: 0.65; }
+ .index-chevron .icon { width: 1rem; height: 1rem; }
+ .index-nav :is(.index-key-fleet, .index-key-instances, .index-key-placement, .index-key-domains, .index-key-email) .index-icon { background: light-dark(#e4edf9, #1e3049); color: light-dark(#32629c, #9cbfee); }
+ .index-nav :is(.index-key-team, .index-key-availability, .index-key-protection, .index-key-storage) .index-icon { background: light-dark(#e1f0ed, #1b3833); color: light-dark(#28685e, #99d2c5); }
+ .index-nav :is(.index-key-settings, .index-key-general, .index-key-logs, .index-key-environments) .index-icon { background: light-dark(#ececf0, #2c2d34); color: var(--muted); }
+ .index-nav .index-key-delete .index-icon { background: light-dark(#f7e9e8, #3b2425); color: var(--bad); }
/* 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. */
diff --git a/internal/console/templates/navindex.html b/internal/console/templates/navindex.html
index 8b0b57626..87a153b82 100644
--- a/internal/console/templates/navindex.html
+++ b/internal/console/templates/navindex.html
@@ -1,17 +1,32 @@
+{{define "index_icon"}}{{if eq .Key "apps"}}{{icon "layout-grid"}}{{else if eq .Key "fleet"}}{{icon "server"}}{{else if eq .Key "team"}}{{icon "users"}}{{else if eq .Key "settings"}}{{icon "sliders-horizontal"}}{{else if eq .Key "billing"}}{{icon "credit-card"}}{{else if eq .Key "overview"}}{{icon "layout-grid"}}{{else if eq .Key "instances"}}{{icon "server"}}{{else if eq .Key "releases"}}{{icon "layers"}}{{else if eq .Key "logs"}}{{icon "menu"}}{{else if eq .Key "errors"}}{{icon "triangle-alert"}}{{else if eq .Key "availability"}}{{icon "activity"}}{{else if eq .Key "analytics"}}{{icon "chart-no-axes-combined"}}{{else if eq .Key "protection"}}{{icon "shield"}}{{else if eq .Key "activity"}}{{icon "activity"}}{{else if eq .Key "general"}}{{icon "sliders-horizontal"}}{{else if eq .Key "domains"}}{{icon "globe"}}{{else if eq .Key "placement"}}{{icon "server"}}{{else if eq .Key "pipeline"}}{{icon "layers"}}{{else if eq .Key "environments"}}{{icon "layers"}}{{else if eq .Key "storage"}}{{icon "database"}}{{else if eq .Key "email"}}{{icon "mail"}}{{else if eq .Key "features"}}{{icon "flag"}}{{else if eq .Key "errors-analytics"}}{{icon "activity"}}{{else if eq .Key "delete"}}{{icon "trash"}}{{else if eq .Key "new"}}{{icon "plus"}}{{else}}{{icon "layers"}}{{end}}{{end}}
{{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 class="index-context">
+ {{if eq .IndexOf "accounts"}}<span class="index-context-icon" aria-hidden="true">{{icon "user-round"}}</span>{{else if eq .IndexOf "account"}}<span class="index-context-icon" aria-hidden="true">{{icon "layers"}}</span>{{else}}{{template "app_mark" .AppName}}{{end}}
+ <div class="index-context-copy">
+ {{if eq .IndexOf "accounts"}}
+ <h1 id="index-title">Accounts</h1>
+ <p class="index-meta">{{.Address}}</p>
+ {{else if eq .IndexOf "account"}}
+ <p class="eyebrow">Account</p>
+ <h1 id="index-title">{{.Account.Name}}</h1>
+ <p class="index-meta"><code>{{.Account.Sqid}}</code><span aria-hidden="true"> · </span>{{.Role}}</p>
+ {{else if eq .IndexOf "settings"}}
+ <p class="eyebrow">{{.Account.Name}} · {{.AppName}}</p>
+ <h1 id="index-title">Settings</h1>
+ {{else}}
+ <p class="eyebrow">App · {{.Account.Name}}</p>
+ <h1 id="index-title">{{.AppName}}</h1>
+ {{end}}
+ </div>
</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>
+<nav class="index-nav" {{if or (eq .IndexOf "accounts") (eq .IndexOf "account")}}aria-labelledby="index-title"{{else}}aria-label="{{if eq .IndexOf "settings"}}Settings sections{{else}}App sections{{end}}"{{end}}>
+ {{range .IndexLinks}}<a id="nav-{{.Key}}" href="{{.Href}}" class="index-row index-key-{{.Key}}">
+ <span class="index-icon" aria-hidden="true">{{template "index_icon" .}}</span>
+ <span class="index-label">{{.Label}}</span>
+ <span class="index-chevron" aria-hidden="true">{{icon "chevron-right"}}</span>
+ </a>
{{end}}
</nav>
{{template "bottom" .}}{{end}}