Commit 87cd05d2ba

87cd05d2ba7261665d458d070e104e25bf979add

parent: 1ff115ac97

Verified · cmc ci/build: success ci/quality: success ci/test: success

cmc <hello@cleberg.net> · 2026-11-25 06:27 UTC

web: profile card spacing, two-row repo list, inline nav search + wider Cmd+K, full-width /admin

Layout: unified · split

Changed files (5)
internal/web/static/app.js +1 −1
@@ -306,7 +306,7 @@
306 if (isTyping(e.target) || e.metaKey || e.ctrlKey || e.altKey) return; 306 if (isTyping(e.target) || e.metaKey || e.ctrlKey || e.altKey) return;
307 307
308 if (e.key === '/') { 308 if (e.key === '/') {
309 const search = document.querySelector('main input[type="search"]'); 309 const search = document.querySelector('main input[type="search"], .railsearch input[type="search"]');
310 if (search) { e.preventDefault(); search.focus(); return; } 310 if (search) { e.preventDefault(); search.focus(); return; }
311 e.preventDefault(); 311 e.preventDefault();
312 openPalette(); 312 openPalette();
internal/web/static/style.css +90 −34
@@ -982,7 +982,7 @@ tr.tipbar td {
982.tipbar .spacer { flex: 1; } 982.tipbar .spacer { flex: 1; }
983.tipbar .age { color: var(--muted); white-space: nowrap; } 983.tipbar .age { color: var(--muted); white-space: nowrap; }
984 984
985.readme { margin-top: var(--sp-5); } 985.readme { margin: var(--sp-5) 0; }
986.readme .cardbody { max-width: 78ch; } 986.readme .cardbody { max-width: 78ch; }
987/* the overview README caps as a card, so prose and code share an edge */ 987/* the overview README caps as a card, so prose and code share an edge */
988.overview .readme { max-width: 88ch; } 988.overview .readme { max-width: 88ch; }
@@ -1035,21 +1035,59 @@ ul.repolist .reponame .sep { color: var(--muted); margin: 0 2px; }
1035ul.repolist .desc { margin-top: 2px; } 1035ul.repolist .desc { margin-top: 2px; }
1036ul.repolist .topics, ul.repolist .meta { margin-top: var(--sp-1); } 1036ul.repolist .topics, ul.repolist .meta { margin-top: var(--sp-1); }
1037 1037
1038/* one column per field across every row: name, labels, description, 1038/* two-row repo list layout: name + chips left and branch/license/updated
1039 topics, branch, license, updated. Rows are subgrids of the list; 1039 right on row 1; full readable description and wrapping topic pills on
1040 the name and meta paragraphs are display: contents so their parts 1040 row 2 so descriptions are never crushed by long tag lists. */
1041 are cells. Cells pad instead of a gap, so an empty column is 0 wide. */ 1041ul.repolist.rows li {
1042ul.repolist.rows { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto auto auto; } 1042 display: grid;
1043ul.repolist.rows li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: baseline; padding: var(--sp-2) var(--sp-4); } 1043 grid-template-columns: minmax(0, 1fr) auto;
1044ul.repolist.rows li > *, ul.repolist.rows .reponame > *, ul.repolist.rows .meta > * { grid-row: 1; padding-left: var(--sp-3); white-space: nowrap; } 1044 gap: var(--sp-1) var(--sp-4);
1045ul.repolist.rows .reponame, ul.repolist.rows .meta { display: contents; } 1045 align-items: baseline;
1046ul.repolist.rows .reponame .name { grid-column: 1; padding-left: 0; font-size: var(--fs-2); } 1046 padding: var(--sp-3) var(--sp-4);
1047ul.repolist.rows .labels { grid-column: 2; } 1047}
1048ul.repolist.rows .desc { grid-column: 3; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: var(--fs-2); margin: 0; } 1048ul.repolist.rows .reponame {
1049ul.repolist.rows .topics { grid-column: 4; margin: 0; } 1049 grid-column: 1;
1050ul.repolist.rows .branch { grid-column: 5; } 1050 grid-row: 1;
1051ul.repolist.rows .license { grid-column: 6; } 1051 display: flex;
1052ul.repolist.rows .updated { grid-column: 7; } 1052 align-items: center;
1053 gap: var(--sp-2);
1054 flex-wrap: wrap;
1055 font-size: var(--fs-3);
1056}
1057ul.repolist.rows .reponame .name { font-size: var(--fs-3); }
1058ul.repolist.rows .labels { display: inline-flex; gap: var(--sp-1); }
1059ul.repolist.rows .meta {
1060 grid-column: 2;
1061 grid-row: 1;
1062 display: inline-flex;
1063 align-items: center;
1064 gap: var(--sp-3);
1065 white-space: nowrap;
1066 font-size: var(--fs-1);
1067 color: var(--muted);
1068 margin: 0;
1069}
1070ul.repolist.rows .desc {
1071 grid-column: 1 / -1;
1072 color: var(--muted);
1073 font-size: var(--fs-2);
1074 margin: 2px 0 0;
1075 line-height: 1.45;
1076}
1077ul.repolist.rows .topics {
1078 grid-column: 1 / -1;
1079 display: flex;
1080 flex-wrap: wrap;
1081 gap: var(--sp-1);
1082 margin: var(--sp-1) 0 0;
1083}
1084ul.repolist.rows .branch { display: inline-flex; align-items: center; gap: 4px; }
1085ul.repolist.rows .license { font-family: var(--mono); font-size: var(--fs-0); }
1086ul.repolist.rows .updated { font-variant-numeric: tabular-nums; }
1087@media (max-width: 44rem) {
1088 ul.repolist.rows li { grid-template-columns: 1fr; }
1089 ul.repolist.rows .meta { grid-column: 1; grid-row: auto; flex-wrap: wrap; margin-top: var(--sp-1); }
1090}
1053ul.repolist.rows li.empty { display: block; } 1091ul.repolist.rows li.empty { display: block; }
1054 1092
1055/* pinned repos: a compact wrap of names, no description or meta */ 1093/* pinned repos: a compact wrap of names, no description or meta */
@@ -2111,31 +2149,48 @@ button.react.mine { border-color: var(--accent); background: var(--surface); col
2111} 2149}
2112.popform input[type="text"], .popform select { flex: 1; min-width: 0; } 2150.popform input[type="text"], .popform select { flex: 1; min-width: 0; }
2113 2151
2114/* ---- Cmd+K trigger & command palette ---- */ 2152/* ---- nav search bar & Cmd+K command palette ---- */
2115.cmdk-trigger { 2153.railsearch-mob { display: none; }
2116 display: inline-flex; 2154.railsearch {
2155 display: flex;
2117 align-items: center; 2156 align-items: center;
2118 gap: var(--sp-3); 2157 flex: 1 1 18rem;
2119 height: 30px; 2158 max-width: 28rem;
2120 margin-left: var(--sp-2); 2159 margin: 0 var(--sp-3);
2121 padding: 0 var(--sp-3); 2160 height: 32px;
2161 padding: 0 var(--sp-1) 0 var(--sp-3);
2122 border: 1px solid var(--shell-line); 2162 border: 1px solid var(--shell-line);
2123 border-radius: var(--r-ctl); 2163 border-radius: var(--r-ctl);
2124 background: var(--shell-hover); 2164 background: var(--shell-hover);
2125 color: var(--shell-muted); 2165}
2166.railsearch:focus-within { border-color: var(--shell-mark); }
2167.railsearch input[type="search"] {
2168 flex: 1;
2169 min-width: 0;
2170 height: 100%;
2171 padding: 0;
2172 border: 0;
2173 background: transparent;
2174 color: var(--shell-fg);
2126 font-size: var(--fs-1); 2175 font-size: var(--fs-1);
2127 font-weight: 400;
2128 cursor: pointer;
2129} 2176}
2130.cmdk-trigger:hover { color: var(--shell-fg); border-color: var(--shell-muted); filter: none; } 2177.railsearch input[type="search"]::placeholder { color: var(--shell-muted); }
2131.cmdk-trigger kbd { 2178.railsearch input[type="search"]:focus { outline: none; }
2132 font-family: var(--mono); 2179.cmdk-trigger {
2133 font-size: var(--fs-0); 2180 display: inline-flex;
2134 padding: 1px 5px; 2181 align-items: center;
2182 height: 24px;
2183 padding: 0 var(--sp-2);
2135 border: 1px solid var(--shell-line); 2184 border: 1px solid var(--shell-line);
2136 border-radius: var(--r-ctl); 2185 border-radius: var(--r-ctl);
2186 background: var(--shell-bg);
2137 color: var(--shell-muted); 2187 color: var(--shell-muted);
2188 font-size: var(--fs-0);
2189 font-weight: 400;
2190 cursor: pointer;
2138} 2191}
2192.cmdk-trigger:hover { color: var(--shell-fg); border-color: var(--shell-muted); filter: none; }
2193.cmdk-trigger kbd { font-family: var(--mono); font-size: var(--fs-0); color: inherit; }
2139dialog.cmdk { 2194dialog.cmdk {
2140 padding: 0; 2195 padding: 0;
2141 border: 1px solid var(--faint); 2196 border: 1px solid var(--faint);
@@ -2143,7 +2198,7 @@ dialog.cmdk {
2143 background: var(--canvas); 2198 background: var(--canvas);
2144 color: var(--fg); 2199 color: var(--fg);
2145 box-shadow: var(--shadow); 2200 box-shadow: var(--shadow);
2146 width: min(34rem, 92vw); 2201 width: min(42rem, 92vw);
2147 margin: 12vh auto auto; 2202 margin: 12vh auto auto;
2148} 2203}
2149dialog.cmdk::backdrop { background: rgb(0 0 0 / 0.45); } 2204dialog.cmdk::backdrop { background: rgb(0 0 0 / 0.45); }
@@ -2202,8 +2257,9 @@ dialog.cmdk::backdrop { background: rgb(0 0 0 / 0.45); }
2202} 2257}
2203.copybtn:hover { background: var(--hover); filter: none; } 2258.copybtn:hover { background: var(--hover); filter: none; }
2204 2259
2205@media (max-width: 34rem) { 2260@media (max-width: 44rem) {
2206 .cmdk-trigger { display: none; } 2261 .railsearch { display: none; }
2262 .railsearch-mob { display: list-item; }
2207} 2263}
2208 2264
2209/* ---- account & admin redesign ---- */ 2265/* ---- account & admin redesign ---- */
internal/web/templates/admin.html +1 −1
@@ -25,7 +25,7 @@
25 {{with .Queues.Deps}}<a class="tile{{if .Errors}} wants{{end}}" href="#deps"><b>{{.Errors}}</b><span>dependency check errors</span></a>{{end}} 25 {{with .Queues.Deps}}<a class="tile{{if .Errors}} wants{{end}}" href="#deps"><b>{{.Errors}}</b><span>dependency check errors</span></a>{{end}}
26</div> 26</div>
27 27
28<div class="withcol narrow"> 28<div class="withcol">
29<nav class="sidecol sticky" aria-label="Sections" data-scrollspy="1"> 29<nav class="sidecol sticky" aria-label="Sections" data-scrollspy="1">
30<details class="sidedrop"> 30<details class="sidedrop">
31<summary><span class="sideword">Sections</span></summary> 31<summary><span class="sideword">Sections</span></summary>
internal/web/templates/layout.html +5 −2
@@ -24,12 +24,15 @@
24 <ul class="raillist"> 24 <ul class="raillist">
25 {{if .Viewer}}<li>{{template "raillink" dict "Href" "/" "Icon" "home" "Name" "Dashboard" "Current" (eq (str . "Tab") "dashboard")}}</li>{{end}} 25 {{if .Viewer}}<li>{{template "raillink" dict "Href" "/" "Icon" "home" "Name" "Dashboard" "Current" (eq (str . "Tab") "dashboard")}}</li>{{end}}
26 <li>{{template "raillink" dict "Href" "/explore" "Icon" "compass" "Name" "Explore" "Current" (eq (str . "Tab") "explore")}}</li> 26 <li>{{template "raillink" dict "Href" "/explore" "Icon" "compass" "Name" "Explore" "Current" (eq (str . "Tab") "explore")}}</li>
27 <li>{{template "raillink" dict "Href" "/search" "Icon" "search" "Name" "Search" "Current" (eq (str . "Tab") "sitesearch")}}</li> 27 <li class="railsearch-mob">{{template "raillink" dict "Href" "/search" "Icon" "search" "Name" "Search" "Current" (eq (str . "Tab") "sitesearch")}}</li>
28 {{if .Viewer}}<li>{{template "raillink" dict "Href" "/notifications" "Icon" "bell" "Name" "Notifications" "Current" (eq (str . "Tab") "notifications") "Count" .Rail.Unread}}</li> 28 {{if .Viewer}}<li>{{template "raillink" dict "Href" "/notifications" "Icon" "bell" "Name" "Notifications" "Current" (eq (str . "Tab") "notifications") "Count" .Rail.Unread}}</li>
29 <li class="railopt"><details class="railpins"><summary class="railicon" aria-label="Pinned repositories" title="Pinned repositories">{{template "icon" "bookmark"}}<span class="vh">Pinned repositories</span></summary><div class="raildrop">{{range .Rail.Pins}}<a href="/{{.Owner}}/{{.Name}}">{{.Owner}}/{{.Name}}</a>{{else}}<span class="none">No pinned repos</span>{{end}}<a href="/{{.Viewer}}/-/repositories">All repositories →</a></div></details></li> 29 <li class="railopt"><details class="railpins"><summary class="railicon" aria-label="Pinned repositories" title="Pinned repositories">{{template "icon" "bookmark"}}<span class="vh">Pinned repositories</span></summary><div class="raildrop">{{range .Rail.Pins}}<a href="/{{.Owner}}/{{.Name}}">{{.Owner}}/{{.Name}}</a>{{else}}<span class="none">No pinned repos</span>{{end}}<a href="/{{.Viewer}}/-/repositories">All repositories →</a></div></details></li>
30 <li class="railopt">{{template "raillink" (index $items 0)}}</li>{{end}} 30 <li class="railopt">{{template "raillink" (index $items 0)}}</li>{{end}}
31 </ul> 31 </ul>
32 <button type="button" class="cmdk-trigger" aria-label="Jump to"><span>Jump to…</span><kbd>⌘K</kbd></button> 32 <form method="get" action="/search" class="railsearch" role="search">
33 <input type="search" name="q" aria-label="Search repositories, issues, and merge requests" placeholder="Search repositories, issues, MRs…">
34 <button type="button" class="cmdk-trigger" aria-label="Open command palette" title="Jump to… (⌘K)"><kbd>⌘K</kbd></button>
35 </form>
33 <span class="railgap"></span> 36 <span class="railgap"></span>
34 <ul class="raillist"> 37 <ul class="raillist">
35 {{if .Viewer}}<li class="railopt">{{template "raillink" (index $items 1)}}</li> 38 {{if .Viewer}}<li class="railopt">{{template "raillink" (index $items 1)}}</li>
internal/web/widths_test.go +7 −3
@@ -37,12 +37,16 @@ func TestListPagesAreWide(t *testing.T) {
37 } 37 }
38 } 38 }
39 // Settings pages carry a section column: every section id has a link 39 // Settings pages carry a section column: every section id has a link
40 // in the column, and the page is wide with the narrow grid. 40 // in the column. admin.html spans full width so queue tables fill the container.
41 for _, name := range []string{"settings.html", "account.html", "admin.html"} { 41 for _, name := range []string{"settings.html", "account.html", "admin.html"} {
42 src, _ := templateFS.ReadFile("templates/" + name) 42 src, _ := templateFS.ReadFile("templates/" + name)
43 s := string(src) 43 s := string(src)
44 if !strings.HasPrefix(s, `{{define "width"}}wide{{end}}`) || !strings.Contains(s, `<div class="withcol narrow">`) { 44 wantCol := `<div class="withcol narrow">`
45 t.Errorf("%s lacks the narrow column layout", name) 45 if name == "admin.html" {
46 wantCol = `<div class="withcol">`
47 }
48 if !strings.HasPrefix(s, `{{define "width"}}wide{{end}}`) || !strings.Contains(s, wantCol) {
49 t.Errorf("%s lacks the expected column layout (%s)", name, wantCol)
46 } 50 }
47 for _, m := range regexp.MustCompile(`<section id="([a-z]+)"`).FindAllStringSubmatch(s, -1) { 51 for _, m := range regexp.MustCompile(`<section id="([a-z]+)"`).FindAllStringSubmatch(s, -1) {
48 if !strings.Contains(s, `href="#`+m[1]+`"`) { 52 if !strings.Contains(s, `href="#`+m[1]+`"`) {