diff --git a/pkg/appview/handlers/home.go b/pkg/appview/handlers/home.go index d409c82..61a71db 100644 --- a/pkg/appview/handlers/home.go +++ b/pkg/appview/handlers/home.go @@ -31,8 +31,8 @@ func (h *HomeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } db.SetRegistryURL(featuredCards, h.RegistryURL) - // Fetch recently updated repositories (top 24 by last push - 6 rows at 4-col xl) - recentCards, err := db.GetRepoCards(h.ReadOnlyDB, 24, currentUserDID, db.SortByLastUpdate) + // Fetch recently updated repositories (top 18 by last push - 6 rows at 3-col lg) + recentCards, err := db.GetRepoCards(h.ReadOnlyDB, 18, currentUserDID, db.SortByLastUpdate) if err != nil { log.Printf("Error fetching recent repos: %v", err) recentCards = []db.RepoCardData{} diff --git a/pkg/appview/handlers/settings.go b/pkg/appview/handlers/settings.go index 17201bd..9f5fc6f 100644 --- a/pkg/appview/handlers/settings.go +++ b/pkg/appview/handlers/settings.go @@ -425,13 +425,15 @@ func (h *UpdateAutoRemoveUntaggedHandler) ServeHTTP(w http.ResponseWriter, r *ht w.WriteHeader(http.StatusNoContent) } -// validOciClients is the set of allowed OCI client values +// validOciClients is the set of allowed OCI client values. +// "none" means "image reference only" — no ` pull ` prefix. var validOciClients = map[string]bool{ "docker": true, "podman": true, "buildah": true, "nerdctl": true, "crane": true, + "none": true, } // UpdateOciClientHandler handles updating the preferred OCI client diff --git a/pkg/appview/public/fonts/commit-mono-400-italic.woff2 b/pkg/appview/public/fonts/commit-mono-400-italic.woff2 new file mode 100644 index 0000000..7ff084f Binary files /dev/null and b/pkg/appview/public/fonts/commit-mono-400-italic.woff2 differ diff --git a/pkg/appview/public/fonts/commit-mono-400.woff2 b/pkg/appview/public/fonts/commit-mono-400.woff2 new file mode 100644 index 0000000..d455b20 Binary files /dev/null and b/pkg/appview/public/fonts/commit-mono-400.woff2 differ diff --git a/pkg/appview/public/fonts/commit-mono-700.woff2 b/pkg/appview/public/fonts/commit-mono-700.woff2 new file mode 100644 index 0000000..b9b9e2f Binary files /dev/null and b/pkg/appview/public/fonts/commit-mono-700.woff2 differ diff --git a/pkg/appview/public/fonts/figtree-latin-ext.woff2 b/pkg/appview/public/fonts/figtree-latin-ext.woff2 new file mode 100644 index 0000000..a8a1123 Binary files /dev/null and b/pkg/appview/public/fonts/figtree-latin-ext.woff2 differ diff --git a/pkg/appview/public/fonts/figtree-latin.woff2 b/pkg/appview/public/fonts/figtree-latin.woff2 new file mode 100644 index 0000000..05ce657 Binary files /dev/null and b/pkg/appview/public/fonts/figtree-latin.woff2 differ diff --git a/pkg/appview/public/fonts/onest-latin-ext.woff2 b/pkg/appview/public/fonts/onest-latin-ext.woff2 new file mode 100644 index 0000000..c8383d6 Binary files /dev/null and b/pkg/appview/public/fonts/onest-latin-ext.woff2 differ diff --git a/pkg/appview/public/fonts/onest-latin.woff2 b/pkg/appview/public/fonts/onest-latin.woff2 new file mode 100644 index 0000000..97c4259 Binary files /dev/null and b/pkg/appview/public/fonts/onest-latin.woff2 differ diff --git a/pkg/appview/public/icons.svg b/pkg/appview/public/icons.svg index 2425fb4..ea32d1a 100644 --- a/pkg/appview/public/icons.svg +++ b/pkg/appview/public/icons.svg @@ -43,7 +43,6 @@ - diff --git a/pkg/appview/server.go b/pkg/appview/server.go index cc62bd4..e58c621 100644 --- a/pkg/appview/server.go +++ b/pkg/appview/server.go @@ -505,6 +505,7 @@ func NewAppViewServer(cfg *Config, branding *BrandingOverrides) (*AppViewServer, mainRouter.Handle("/css/*", CacheMiddleware(http.StripPrefix("/css/", PublicSubdir("css", branding)), 31536000)) mainRouter.Handle("/js/*", CacheMiddleware(http.StripPrefix("/js/", PublicSubdir("js", branding)), 31536000)) + mainRouter.Handle("/fonts/*", CacheMiddleware(http.StripPrefix("/fonts/", PublicSubdir("fonts", branding)), 31536000)) mainRouter.Handle("/static/*", CacheMiddleware(http.StripPrefix("/static/", PublicSubdir("static", branding)), 31536000)) slog.Info("UI enabled", "home", "/", "settings", "/settings") diff --git a/pkg/appview/src/css/main.css b/pkg/appview/src/css/main.css index c9a23cc..8e471ba 100644 --- a/pkg/appview/src/css/main.css +++ b/pkg/appview/src/css/main.css @@ -15,6 +15,82 @@ dark --prefersdark; } +/* ======================================== + WEB FONTS — Onest (display), Figtree (body), Commit Mono (mono) + All self-hosted under /fonts/. Variable bodies for display/body, + static weights for mono. + ======================================== */ + +/* Onest — variable (400..800), display face */ +@font-face { + font-family: "Onest"; + font-style: normal; + font-weight: 400 800; + font-display: swap; + src: url("/fonts/onest-latin.woff2") format("woff2"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +@font-face { + font-family: "Onest"; + font-style: normal; + font-weight: 400 800; + font-display: swap; + src: url("/fonts/onest-latin-ext.woff2") format("woff2"); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} + +/* Figtree — variable (300..900), body face */ +@font-face { + font-family: "Figtree"; + font-style: normal; + font-weight: 300 900; + font-display: swap; + src: url("/fonts/figtree-latin.woff2") format("woff2"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} +@font-face { + font-family: "Figtree"; + font-style: normal; + font-weight: 300 900; + font-display: swap; + src: url("/fonts/figtree-latin-ext.woff2") format("woff2"); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} + +/* Commit Mono — static 400/400-italic/700, mono face */ +@font-face { + font-family: "Commit Mono"; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url("/fonts/commit-mono-400.woff2") format("woff2"); +} +@font-face { + font-family: "Commit Mono"; + font-style: italic; + font-weight: 400; + font-display: swap; + src: url("/fonts/commit-mono-400-italic.woff2") format("woff2"); +} +@font-face { + font-family: "Commit Mono"; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url("/fonts/commit-mono-700.woff2") format("woff2"); +} + +/* ======================================== + TYPE SYSTEM — semantic tokens + Override Tailwind 4's default font stacks so `font-sans` / `font-mono` + utilities (and DaisyUI components) pick up our vendored fonts. + ======================================== */ +@theme inline { + --font-sans: "Figtree", ui-sans-serif, system-ui, sans-serif; + --font-mono: "Commit Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; + --font-display: "Onest", ui-sans-serif, system-ui, sans-serif; +} + /* ============================================ DARK - "Deep Ocean" ============================================ */ @@ -120,6 +196,19 @@ border-color: var(--color-star); } +/* ======================================== + TYPE UTILITIES — display font + tabular numerals + `font-display` applies Onest; use it on brand lockups and hero + headings. `tabular-nums` aligns numeric columns in dense tables. + ======================================== */ +@utility font-display { + font-family: var(--font-display); + letter-spacing: 0.005em; +} +@utility tabular-nums { + font-variant-numeric: tabular-nums; +} + [data-theme="dark"] { --shadow-card-hover: 0 8px 25px oklch(67.1% 0.05 145 / 0.2), 0 4px 12px oklch(0% 0 0 / 0.2); @@ -161,16 +250,32 @@ } /* ======================================== - STICKY FOOTER LAYOUT + STICKY FOOTER LAYOUT + BASE TYPE ======================================== */ @layer base { body { @apply min-h-screen flex flex-col; + font-family: var(--font-sans); + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; } main { @apply flex-1; } + + /* Cap long prose at a comfortable reading width. Pages that need to + break out of this (dashboards, tables) override with max-w-* utilities. */ + .prose { + max-width: 68ch; + } + + /* Every table gets tabular-nums by default. Registry UIs are tables of + numbers (pull counts, sizes, CVE counts, timestamps) — digits should + align vertically so the eye can compare rows. */ + table { + font-variant-numeric: tabular-nums; + } } /* ======================================== @@ -245,6 +350,16 @@ } } +/* ======================================== + KEYBOARD FOCUS RING + Applied only on :focus-visible so mouse users don't see it. + Uses the primary hue so it reads as part of the Deep Ocean palette. + ======================================== */ +:where(a, button, [role="button"], [role="tab"], input, select, textarea, summary, [tabindex]):focus-visible { + outline: 2px solid var(--color-primary); + outline-offset: 2px; +} + /* ======================================== CUSTOM COMPONENTS (Not in DaisyUI) ======================================== */ diff --git a/pkg/appview/templates/components/card-grid.html b/pkg/appview/templates/components/card-grid.html index 8ca696c..36008c0 100644 --- a/pkg/appview/templates/components/card-grid.html +++ b/pkg/appview/templates/components/card-grid.html @@ -15,7 +15,7 @@ - .HasMore: bool - whether to show Load More button */}} {{ if .Repositories }} -
+
{{ range .Repositories }} {{ template "repo-card" . }} {{ end }} diff --git a/pkg/appview/templates/components/docker-command.html b/pkg/appview/templates/components/docker-command.html index c195013..ccc9452 100644 --- a/pkg/appview/templates/components/docker-command.html +++ b/pkg/appview/templates/components/docker-command.html @@ -24,10 +24,10 @@ - Display: string - short form shown in the UI (e.g. "alice.bsky.social/myapp:v1.2.3") - Copy: string - full command copied to clipboard (e.g. "docker pull atcr.io/alice.bsky.social/myapp:v1.2.3") */}} -
- {{ icon "package" "size-4 shrink-0 text-base-content/60" }} - {{ .Display }} -
diff --git a/pkg/appview/templates/components/head.html b/pkg/appview/templates/components/head.html index 6abadd0..3be8b73 100644 --- a/pkg/appview/templates/components/head.html +++ b/pkg/appview/templates/components/head.html @@ -16,6 +16,8 @@ + +