forge
Explore
Log in

Don't you dare go Hollow

Branch picker is a command palette: one searchable list with Branches and Tags sections, tip ages, a default chip and key hints

Browse files at this commit

749adabe20dce7a519ab04ab9dd713e97ca5e6ceAhmet Kaan GümüşParent: 3d6ee62
  • style
    • branch picker is a command palette: one searchable list with Branches and Tags sections, tip ages, a default chip and key hints
Show full message
💄 style: branch picker is a command palette: one searchable list with Branches and Tags sections, tip ages, a default chip and key hints
crates/forge-web/assets/nav.jsmodified+47 -42
@@ -2053,54 +2053,65 @@
20532053 }, false);
20542054
20552055 // ---- branch switcher ------------------------------------------------------------------------
2056- // The ref popover in the browse bar: a filter over the active list, Branches and Tags tabs, and
2057- // arrow keys through the visible entries as in the file finder. Entries past the first REF_SHOWN
2058- // stay hidden until the filter narrows them, so the filter still reaches every name.
2056+ // The ref popover in the browse bar: one filter over a Branches and a Tags section, the matched
2057+ // part of each name marked, and arrow keys (or the pointer) through the visible entries as in the
2058+ // file finder. Entries past the first REF_SHOWN of a section stay hidden until the filter narrows
2059+ // them, so the filter still reaches every name.
20592060
2060- var REF_SHOWN = 10;
2061+ var REF_SHOWN = 8;
20612062
20622063 function refSwitchOf(el) {
20632064 return el && el.closest ? el.closest('details[data-ref-switch]') : null;
20642065 }
20652066
2066- function refPanelOf(sw) {
2067- var tab = sw.querySelector('[data-ref-tab][aria-selected="true"]');
2068- var kind = tab ? tab.getAttribute('data-ref-tab') : 'branches';
2069- return sw.querySelector('[data-ref-panel="' + kind + '"]');
2070- }
2071-
2072- function refShown(panel) {
2073- return Array.prototype.filter.call(panel.querySelectorAll('[data-ref-item]'), function (li) {
2067+ function refShown(sw) {
2068+ return Array.prototype.filter.call(sw.querySelectorAll('[data-ref-item]'), function (li) {
20742069 return !li.hidden;
20752070 });
20762071 }
20772072
2078- // Applies the filter to the active panel: every match, or the first entries when it is empty.
2073+ // Writes `name` into `el`, the first case-insensitive match of `q` wrapped in <mark>.
2074+ function refMark(el, name, q) {
2075+ var at = q ? name.toLowerCase().indexOf(q) : -1;
2076+ el.textContent = '';
2077+ if (at < 0) { el.textContent = name; return; }
2078+ var mark = document.createElement('mark');
2079+ mark.textContent = name.slice(at, at + q.length);
2080+ el.append(name.slice(0, at), mark, name.slice(at + q.length));
2081+ }
2082+
2083+ // Applies the filter to every section: each match, or the first entries when it is empty. A
2084+ // section with nothing to show hides with its heading.
20792085 function refApply(sw) {
20802086 var q = sw.querySelector('[data-ref-filter]').value.trim().toLowerCase();
2081- var panel = refPanelOf(sw);
2082- var empty = panel.querySelector('[data-ref-empty]');
2083- var shown = 0;
2084- Array.prototype.forEach.call(panel.querySelectorAll('[data-ref-item]'), function (li, i) {
2085- var show = q ? li.textContent.trim().toLowerCase().indexOf(q) >= 0 : i < REF_SHOWN;
2086- li.hidden = !show;
2087- li.removeAttribute('aria-selected');
2088- if (show) { shown++; }
2087+ var groups = sw.querySelectorAll('[data-ref-group]');
2088+ var total = 0;
2089+ groups.forEach(function (group) {
2090+ var shown = 0;
2091+ group.querySelectorAll('[data-ref-item]').forEach(function (li, i) {
2092+ var name = li.getAttribute('data-ref-name') || '';
2093+ var show = q ? name.toLowerCase().indexOf(q) >= 0 : i < REF_SHOWN;
2094+ li.hidden = !show;
2095+ li.removeAttribute('aria-selected');
2096+ if (show) { shown++; refMark(li.querySelector('.ref-text'), name, q); }
2097+ });
2098+ group.hidden = shown === 0;
2099+ total += shown;
20892100 });
2090- if (empty) { empty.hidden = shown > 0; }
2101+ var empty = sw.querySelector('[data-ref-empty]');
2102+ if (empty && groups.length) { empty.hidden = total > 0; }
20912103 refSelect(sw, 0);
20922104 }
20932105
2094- function refSelect(sw, index) {
2095- var panel = refPanelOf(sw);
2106+ function refSelect(sw, index, keep) {
20962107 var input = sw.querySelector('[data-ref-filter]');
2097- var shown = refShown(panel);
2108+ var shown = refShown(sw);
20982109 if (!shown.length) { input.removeAttribute('aria-activedescendant'); return; }
20992110 index = Math.max(0, Math.min(shown.length - 1, index));
21002111 shown.forEach(function (li, i) { li.setAttribute('aria-selected', i === index ? 'true' : 'false'); });
21012112 input.setAttribute('aria-activedescendant', shown[index].id);
2102- shown[index].scrollIntoView({ block: 'nearest' });
2103- panel.__sel = index;
2113+ if (!keep) { shown[index].scrollIntoView({ block: 'nearest' }); }
2114+ sw.__refSel = index;
21042115 }
21052116
21062117 // Opening the switcher clears the filter and focuses it.
@@ -2113,31 +2124,25 @@
21132124 input.focus();
21142125 }, true);
21152126
2116- document.addEventListener('click', function (e) {
2117- var tab = e.target && e.target.closest ? e.target.closest('[data-ref-tab]') : null;
2118- if (!tab) { return; }
2119- var sw = refSwitchOf(tab);
2120- var kind = tab.getAttribute('data-ref-tab');
2121- sw.querySelectorAll('[data-ref-tab]').forEach(function (t) {
2122- t.setAttribute('aria-selected', t === tab ? 'true' : 'false');
2123- });
2124- sw.querySelectorAll('[data-ref-panel]').forEach(function (p) {
2125- p.hidden = p.getAttribute('data-ref-panel') !== kind;
2126- });
2127- refApply(sw);
2127+ // The pointer moves the selection, so the keys pick up where it is.
2128+ document.addEventListener('mouseover', function (e) {
2129+ var li = e.target && e.target.closest ? e.target.closest('[data-ref-item]') : null;
2130+ if (!li) { return; }
2131+ var sw = refSwitchOf(li);
2132+ var i = refShown(sw).indexOf(li);
2133+ if (i >= 0 && i !== sw.__refSel) { refSelect(sw, i, true); }
21282134 }, false);
21292135
21302136 document.addEventListener('keydown', function (e) {
21312137 var input = e.target && e.target.closest ? e.target.closest('[data-ref-filter]') : null;
21322138 if (!input) { return; }
21332139 var sw = refSwitchOf(input);
2134- var panel = refPanelOf(sw);
2135- var sel = panel.__sel || 0;
2140+ var sel = sw.__refSel || 0;
21362141 if (e.key === 'ArrowDown') { e.preventDefault(); refSelect(sw, sel + 1); }
21372142 else if (e.key === 'ArrowUp') { e.preventDefault(); refSelect(sw, sel - 1); }
21382143 else if (e.key === 'Enter') {
21392144 e.preventDefault();
2140- var item = refShown(panel)[sel];
2145+ var item = refShown(sw)[sel];
21412146 var link = item ? item.querySelector('a') : null;
21422147 if (link) { sw.open = false; link.click(); }
21432148 }
crates/forge-web/src/pages/refs.rsmodified+1 -0
@@ -53,6 +53,7 @@ pub fn ref_links(
5353 name: r.name.clone(),
5454 href: repo_href(&repo.owner_name, &repo.name, "tree", &r.name),
5555 current: r.name == current,
56+ default: r.kind == RefKind::Branch && r.name == default_branch,
5657 updated: r.committer_time,
5758 };
5859 let branches = sorted
crates/forge-web/src/views/mod.rsmodified+60 -46
@@ -23,7 +23,7 @@ use topcoat::context::{Cx, try_app_context};
2323 use topcoat::router::request::uri;
2424 use topcoat::router::response::{Response, response_headers};
2525 use topcoat::router::{Body, Next, layer};
26-use topcoat::view::{Child, View, component, view};
26+use topcoat::view::{Child, Unescaped, View, component, view};
2727
2828 use crate::i18n::admin::{self as ad, K as AK};
2929 use crate::i18n::code::{self as g, K};
@@ -1222,61 +1222,69 @@ pub async fn repo_tabs(
12221222 }
12231223
12241224 /// A branch or tag in the ref switcher. `href` points at its root tree; `updated` is the commit
1225-/// time of its tip (unix seconds).
1225+/// time of its tip (unix seconds); `default` marks the repository's default branch.
12261226 #[derive(Clone)]
12271227 pub struct RefLink {
12281228 pub name: String,
12291229 pub href: String,
12301230 pub current: bool,
1231+ pub default: bool,
12311232 pub updated: i64,
12321233 }
12331234
1234-/// Entries listed before the filter narrows the list. The rest stay in the page, hidden, so the
1235-/// filter still finds every name.
1236-pub const REF_SHOWN: usize = 10;
1235+/// Entries each section lists before the filter narrows it. The rest stay in the page, hidden, so
1236+/// the filter still finds every name.
1237+pub const REF_SHOWN: usize = 8;
12371238
1238-/// One tab of the ref switcher: its entries, then the link to the full list.
1239+const BRANCH_ICON: &str = r#"<svg viewBox="0 0 24 24"><circle cx="6" cy="5" r="2"/><circle cx="6" cy="19" r="2"/><circle cx="18" cy="6" r="2"/><path d="M6 7v10M18 8c0 4-6 4-12 9"/></svg>"#;
1240+const TAG_ICON: &str = r#"<svg viewBox="0 0 24 24"><path d="M20.6 13.4 13.4 20.6a2 2 0 0 1-2.8 0L3 13V3h10l7.6 7.6a2 2 0 0 1 0 2.8z"/><circle cx="7.5" cy="7.5" r="1.5"/></svg>"#;
1241+
1242+/// One section of the ref switcher: a heading with its count, then its entries. An empty section
1243+/// is left out.
12391244 #[component]
1240-async fn ref_panel(
1245+async fn ref_group(
12411246 lang: Lang,
12421247 kind: &'static str,
1248+ heading: &'static str,
12431249 links: Vec<RefLink>,
1244- all_href: String,
1245- all_label: &'static str,
1250+ now: i64,
12461251 ) -> Result<impl View> {
1247- let empty = links.is_empty();
1252+ let count = links.len();
1253+ let icon = if kind == "tags" { TAG_ICON } else { BRANCH_ICON };
1254+ let head_id = format!("ref-head-{kind}");
12481255 Ok(view! {
1249- <div class="ref-panel" role="tabpanel" data-ref-panel=(kind) hidden=(kind != "branches")>
1250- if empty {
1251- <p class="muted small ref-note">(g::t(lang, K::NothingHere))</p>
1252- } else {
1253- <ul class="ref-list" role="listbox">
1256+ if count > 0 {
1257+ <div class="ref-group" data-ref-group="">
1258+ <div class="ref-head" id=(head_id.as_str())>
1259+ <span>(heading)</span>
1260+ <span class="ref-count">(count)</span>
1261+ </div>
1262+ <ul class="ref-list" role="group" aria-labelledby=(head_id.as_str())>
12541263 for (n, link) in links.into_iter().enumerate() {
1255- <li role="option" id=(format!("ref-{kind}-{n}")) data-ref-item="" hidden=((n >= REF_SHOWN).then_some(""))>
1256- if link.current {
1257- <a class="current" aria-current="true" href=(link.href)>
1258- <span class="ref-check" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg></span>
1259- <span class="ref-text">(link.name)</span>
1260- </a>
1261- } else {
1262- <a href=(link.href)>
1263- <span class="ref-check" aria-hidden="true"></span>
1264- <span class="ref-text">(link.name)</span>
1265- </a>
1266- }
1264+ <li role="option" id=(format!("ref-{kind}-{n}")) data-ref-item=""
1265+ data-ref-name=(link.name.as_str()) aria-current=(link.current.then_some("true"))
1266+ hidden=((n >= REF_SHOWN).then_some(""))>
1267+ <a href=(link.href)>
1268+ <span class="ref-kind" aria-hidden="true">(Unescaped::new_unchecked(icon))</span>
1269+ <span class="ref-text">(link.name.as_str())</span>
1270+ if link.default {
1271+ <span class="ref-chip">(g::t(lang, K::DefaultBadge))</span>
1272+ }
1273+ <span class="ref-age">(relative_time(lang, link.updated, now))</span>
1274+ </a>
12671275 </li>
12681276 }
12691277 </ul>
1270- <p class="muted small ref-note" data-ref-empty="" hidden=(true)>(g::t(lang, K::NoMatches))</p>
1271- }
1272- <a class="ref-all" href=(all_href)>(all_label)</a>
1273- </div>
1278+ </div>
1279+ }
12741280 })
12751281 }
12761282
12771283 /// Branch and tag switcher for the browse bar: a button showing the current ref that opens a
1278-/// popover with a filter, Branches and Tags tabs, and a link to each full list. The filter, tabs and
1279-/// arrow keys are wired in `assets/nav.js`; without it the popover still lists the first entries.
1284+/// command-palette popover: a search field over one list with a Branches and a Tags section, each
1285+/// row with its last commit's age, and a footer with key hints and links to the full lists. The
1286+/// filter, match highlight and arrow keys are wired in `assets/nav.js`; without it the popover
1287+/// still lists the first entries of each section.
12801288 #[component]
12811289 pub async fn ref_selector(
12821290 lang: Lang,
@@ -1289,29 +1297,35 @@ pub async fn ref_selector(
12891297 ) -> Result<impl View> {
12901298 // A tag shows a tag icon only when it is the current ref and no branch of that name is.
12911299 let is_tag = !branches.iter().any(|b| b.current) && tags.iter().any(|t| t.current);
1300+ let none = branches.is_empty() && tags.is_empty();
1301+ let now = now_unix();
12921302 Ok(view! {
12931303 <details class="ref-select" data-ref-switch="">
12941304 <summary title=(label) aria-label=(format!("{label}: {current}"))>
1295- if is_tag {
1296- <span class="ref-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M20.6 13.4 13.4 20.6a2 2 0 0 1-2.8 0L3 13V3h10l7.6 7.6a2 2 0 0 1 0 2.8z"/><circle cx="7.5" cy="7.5" r="1.5"/></svg></span>
1297- } else {
1298- <span class="ref-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><circle cx="6" cy="5" r="2"/><circle cx="6" cy="19" r="2"/><circle cx="18" cy="6" r="2"/><path d="M6 7v10M18 8c0 4-6 4-12 9"/></svg></span>
1299- }
1305+ <span class="ref-icon" aria-hidden="true">(Unescaped::new_unchecked(if is_tag { TAG_ICON } else { BRANCH_ICON }))</span>
13001306 <code class="ref-name">(current.as_str())</code>
13011307 <span class="ref-caret" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="m6 9 6 6 6-6"/></svg></span>
13021308 </summary>
13031309 <div class="ref-menu">
1304- <div class="ref-top">
1310+ <label class="ref-search">
1311+ <svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg>
13051312 <input type="text" class="ref-filter" data-ref-filter="" autocomplete="off" spellcheck="false"
13061313 placeholder=(g::t(lang, K::FilterRefs)) aria-label=(g::t(lang, K::FilterRefs))
1307- role="combobox" aria-expanded="true" aria-autocomplete="list">
1308- <div class="ref-tabs" role="tablist">
1309- <button type="button" role="tab" aria-selected="true" data-ref-tab="branches">(g::t(lang, K::BranchesTitle))</button>
1310- <button type="button" role="tab" aria-selected="false" data-ref-tab="tags">(g::t(lang, K::TagsTitle))</button>
1311- </div>
1314+ role="combobox" aria-expanded="true" aria-autocomplete="list" aria-controls="ref-results">
1315+ <kbd>"esc"</kbd>
1316+ </label>
1317+ <div class="ref-results" id="ref-results" role="listbox">
1318+ ref_group(lang: lang, kind: "branches", heading: g::t(lang, K::BranchesTitle), links: branches, now: now)
1319+ ref_group(lang: lang, kind: "tags", heading: g::t(lang, K::TagsTitle), links: tags, now: now)
1320+ <p class="muted small ref-note" data-ref-empty="" hidden=(!none)>
1321+ (g::t(lang, if none { K::NothingHere } else { K::NoMatches }))
1322+ </p>
1323+ </div>
1324+ <div class="ref-foot">
1325+ <span class="ref-keys" aria-hidden="true"><kbd>"↑"</kbd><kbd>"↓"</kbd><kbd>"↵"</kbd></span>
1326+ <a href=(branches_href) title=(g::t(lang, K::ViewAllBranches))>(g::t(lang, K::BranchesTitle))" ↗"</a>
1327+ <a href=(tags_href) title=(g::t(lang, K::ViewAllTags))>(g::t(lang, K::TagsTitle))" ↗"</a>
13121328 </div>
1313- ref_panel(lang: lang, kind: "branches", links: branches, all_href: branches_href, all_label: g::t(lang, K::ViewAllBranches))
1314- ref_panel(lang: lang, kind: "tags", links: tags, all_href: tags_href, all_label: g::t(lang, K::ViewAllTags))
13151329 </div>
13161330 </details>
13171331 })
style/main.scssmodified+171 -96
@@ -1164,148 +1164,229 @@ code {
11641164 }
11651165 }
11661166
1167-// Branch switcher popover: filter and tabs on top, the entries below, scrolling inside.
1167+// Branch switcher popover, laid out as a command palette: a borderless search row, one scrolling
1168+// list with a Branches and a Tags section, and a footer with key hints and the full lists.
11681169 .ref-menu {
11691170 position: absolute;
11701171 left: 0;
11711172 top: calc(100% + 6px);
11721173 z-index: 10;
1173- width: 300px;
1174+ width: 360px;
11741175 max-width: calc(100vw - 32px);
1175- max-height: 60vh;
1176+ max-height: min(60vh, 480px);
11761177 display: flex;
11771178 flex-direction: column;
1179+ overflow: hidden;
11781180 background: var(--surface);
11791181 border: 1px solid var(--border);
11801182 border-radius: var(--radius-lg);
1181- box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
1183+ box-shadow: var(--shadow);
1184+
1185+ kbd {
1186+ min-width: 18px;
1187+ padding: 0 5px;
1188+ font-family: var(--mono);
1189+ font-size: 11px;
1190+ line-height: 18px;
1191+ text-align: center;
1192+ color: var(--muted);
1193+ background: var(--surface);
1194+ border: 1px solid var(--border-strong);
1195+ border-radius: var(--radius-sm);
1196+ }
11821197 }
11831198
1184-// The tabs row is the bottom edge of the top block: its underline sits on the divider.
1185-.ref-top {
1186- padding: 8px 8px 0;
1199+// The search row is part of the menu, not a field inside it: no box, only the divider below.
1200+.ref-search {
1201+ flex: none;
1202+ display: flex;
1203+ align-items: center;
1204+ gap: 10px;
1205+ padding: 0 12px;
1206+ color: var(--muted);
11871207 border-bottom: 1px solid var(--border);
1208+
1209+ &:focus-within {
1210+ color: var(--accent);
1211+ }
11881212 }
11891213
11901214 .ref-filter {
1191- width: 100%;
1192- height: var(--control-h);
1193- box-sizing: border-box;
1194- padding: 0 10px;
1215+ flex: 1 1 auto;
1216+ min-width: 0;
1217+ height: 46px;
1218+ padding: 0;
11951219 font: inherit;
1196- font-size: 14px;
1220+ font-size: 15px;
11971221 color: var(--text);
1198- background: var(--surface-2);
1199- border: 1px solid var(--border);
1200- border-radius: var(--radius-md);
1222+ background: transparent;
1223+ border: 0;
1224+
1225+ &::placeholder {
1226+ color: var(--muted);
1227+ }
12011228
12021229 &:focus,
12031230 &:focus-visible {
12041231 outline: none;
1205- border-color: var(--focus);
1206- box-shadow: 0 0 0 3px var(--accent-soft);
1207- }
1208-}
1209-
1210-// Underline tabs: the 2px underline overlaps the 1px divider of .ref-top.
1211-.ref-tabs {
1212- display: flex;
1213- gap: 16px;
1214- margin: 8px 0 -1px;
1215-
1216- button {
1217- flex: 0 0 auto;
1218- min-height: 32px;
1219- padding: 0 2px;
1220- font: inherit;
1221- font-size: 13px;
1222- color: var(--muted);
1223- background: transparent;
1224- border: 0;
1225- border-bottom: 2px solid transparent;
1226- border-radius: 0;
1227- cursor: pointer;
1228-
1229- &:hover {
1230- color: var(--text);
1231- }
1232-
1233- &[aria-selected="true"] {
1234- color: var(--text);
1235- font-weight: 600;
1236- border-bottom-color: var(--accent);
1237- }
1238-
1239- &:focus-visible {
1240- outline: 2px solid var(--focus);
1241- outline-offset: -2px;
1242- box-shadow: none;
1243- }
1232+ box-shadow: none;
12441233 }
12451234 }
12461235
1247-.ref-panel {
1236+.ref-results {
12481237 min-height: 0;
12491238 overflow-y: auto;
1250- padding: 4px 0;
1239+ padding: 6px;
12511240 }
12521241
1253-.ref-note {
1254- margin: 8px 14px;
1242+.ref-group + .ref-group {
1243+ margin-top: 6px;
1244+ padding-top: 6px;
1245+ border-top: 1px dashed var(--border);
12551246 }
12561247
1257-.ref-all {
1258- display: block;
1259- margin-top: 4px;
1260- padding: 8px 14px;
1261- font-size: 13px;
1262- color: var(--text-2);
1263- text-decoration: none;
1264- border-top: 1px solid var(--border);
1248+.ref-head {
1249+ display: flex;
1250+ align-items: center;
1251+ gap: 6px;
1252+ padding: 6px 8px 4px;
1253+ font-size: 11px;
1254+ font-weight: 600;
1255+ letter-spacing: 0.06em;
1256+ text-transform: uppercase;
1257+ color: var(--muted);
1258+}
12651259
1266- &:hover {
1267- color: var(--text);
1268- background: var(--surface-2);
1269- }
1260+.ref-count {
1261+ padding: 0 6px;
1262+ font-family: var(--mono);
1263+ font-size: 10px;
1264+ letter-spacing: 0;
1265+ line-height: 16px;
1266+ background: var(--surface-2);
1267+ border-radius: var(--radius-full);
1268+}
1269+
1270+.ref-note {
1271+ margin: 10px 8px;
12701272 }
12711273
1272-// Rows: a fixed 16px gutter holds the checkmark on the current ref, so names line up.
1274+// Rows: kind icon, the name in mono, an optional default chip, and the tip's age pushed right.
1275+// The selected row (keys or pointer) gets a soft fill; the current ref an accent rail and name.
12731276 .ref-list {
12741277 list-style: none;
12751278 margin: 0;
12761279 padding: 0;
12771280
1278- li[aria-selected="true"] a,
1279- a:hover {
1280- background: var(--surface-2);
1281- }
1282-
12831281 a {
1282+ position: relative;
12841283 display: flex;
12851284 align-items: center;
12861285 gap: 8px;
1287- padding: 6px 14px;
1286+ padding: 7px 8px 7px 10px;
12881287 color: var(--text);
12891288 text-decoration: none;
1289+ border-radius: var(--radius-md);
1290+ }
12901291
1291- &.current {
1292+ li[aria-selected="true"] a {
1293+ background: var(--surface-2);
1294+ }
1295+
1296+ li[aria-current="true"] a {
1297+ color: var(--accent);
1298+ background: var(--accent-soft);
1299+
1300+ &::before {
1301+ content: "";
1302+ position: absolute;
1303+ left: 0;
1304+ top: 7px;
1305+ bottom: 7px;
1306+ width: 3px;
1307+ background: var(--accent);
1308+ border-radius: var(--radius-full);
1309+ }
1310+
1311+ .ref-text {
12921312 font-weight: 600;
12931313 }
1314+
1315+ .ref-kind {
1316+ color: inherit;
1317+ }
12941318 }
12951319
1296- .ref-check {
1320+ .ref-kind {
12971321 display: inline-flex;
12981322 flex: none;
1299- width: 16px;
1300- height: 16px;
1323+ color: var(--muted);
1324+
1325+ svg {
1326+ width: 14px;
1327+ height: 14px;
1328+ }
13011329 }
13021330
13031331 .ref-text {
13041332 min-width: 0;
1333+ font-family: var(--mono);
1334+ font-size: 13px;
13051335 word-break: break-all;
1336+
1337+ mark {
1338+ color: inherit;
1339+ background: var(--row-target);
1340+ border-radius: 2px;
1341+ }
1342+ }
1343+
1344+ .ref-chip {
1345+ flex: none;
1346+ padding: 0 6px;
1347+ font-size: 11px;
1348+ line-height: 18px;
1349+ color: var(--text-2);
1350+ border: 1px solid var(--border-strong);
1351+ border-radius: var(--radius-full);
1352+ }
1353+
1354+ .ref-age {
1355+ flex: none;
1356+ margin-left: auto;
1357+ padding-left: 8px;
1358+ font-size: 12px;
1359+ color: var(--muted);
1360+ white-space: nowrap;
1361+ }
1362+}
1363+
1364+.ref-foot {
1365+ flex: none;
1366+ display: flex;
1367+ align-items: center;
1368+ gap: 14px;
1369+ padding: 8px 12px;
1370+ font-size: 12px;
1371+ background: var(--surface-2);
1372+ border-top: 1px solid var(--border);
1373+
1374+ a {
1375+ color: var(--text-2);
1376+ text-decoration: none;
1377+
1378+ &:hover {
1379+ color: var(--accent);
1380+ }
13061381 }
13071382 }
13081383
1384+.ref-keys {
1385+ display: inline-flex;
1386+ gap: 4px;
1387+ margin-right: auto;
1388+}
1389+
13091390 .crumbs {
13101391 min-width: 0;
13111392 font-size: 0.9375rem;
@@ -2040,29 +2121,23 @@ code {
20402121 box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12), 0 0 0 100vmax rgba(0, 0, 0, 0.4);
20412122 }
20422123
2043- .ref-top {
2044- padding: 8px 16px 0;
2045- }
2046-
2047- .ref-note {
2048- margin: 8px 16px;
2049- }
2050-
20512124 .ref-filter {
2052- height: 44px;
2125+ height: 52px;
20532126 font-size: 16px;
20542127 }
20552128
2056- .ref-tabs button {
2057- min-height: 44px;
2129+ .ref-list a {
2130+ padding: 12px 10px 12px 12px;
20582131 }
20592132
2060- .ref-list a {
2061- padding: 12px 16px;
2133+ // No keyboard on a phone: the footer keeps only the links.
2134+ .ref-keys {
2135+ display: none;
20622136 }
20632137
2064- .ref-all {
2065- padding: 14px 16px;
2138+ .ref-foot {
2139+ justify-content: flex-end;
2140+ padding: 12px 16px;
20662141 }
20672142 }
20682143