From 949180b7a1fc980cf6eda3feb16e42fcac87f941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Mon, 2 Nov 2026 06:32:47 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20the=20CI=20list,=20run=20?= =?UTF-8?q?and=20job=20pages=20show=20their=20jobs=20and=20log=20again,=20?= =?UTF-8?q?which=20lost=20all=20height=20when=20the=20page=20language=20dr?= =?UTF-8?q?opped=20their=20fit=20pane;=20a=20phone's=20CI=20list=20no=20lo?= =?UTF-8?q?nger=20collapses=20its=20run;=20the=20runs=20head=20keeps=20the?= =?UTF-8?q?=20rows'=20inset=20and=20the=20log=20tools=20share=20one=20line?= =?UTF-8?q?;=20the=20logo=20no=20longer=20runs=20under=20Explore,=20which?= =?UTF-8?q?=20sat=20on=20a=20fixed=20width=20the=20wordmark=20outgrew;=20?= =?UTF-8?q?=E2=9C=A8=20feat:=20every=20search=20bar=20is=20live:=20results?= =?UTF-8?q?=20follow=20typing=20with=20focus=20and=20caret=20kept,=20Enter?= =?UTF-8?q?=20runs=20at=20once,=20audit=20log,=20issues,=20pulls=20and=20c?= =?UTF-8?q?ode=20search=20join=20in,=20and=20the=20repo=20head's=20search?= =?UTF-8?q?=20moves=20to=20the=20results=20while=20typing;=20a=20branch=20?= =?UTF-8?q?field=20waits=20for=20change,=20since=20half=20a=20name=20is=20?= =?UTF-8?q?a=20404;=20sort=20on=20issues=20and=20pulls=20applies=20on=20ch?= =?UTF-8?q?ange;=20scripts/audit/measure.ts=20reports=20a=20pane=20that=20?= =?UTF-8?q?lost=20its=20height?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/forge-web/assets/nav.js | 31 +++++++++++++++++++++++ crates/forge-web/src/pages/audit_log.rs | 4 +-- crates/forge-web/src/pages/ci_job.rs | 2 +- crates/forge-web/src/pages/ci_runs.rs | 4 +-- crates/forge-web/src/pages/code_search.rs | 15 +++++------ crates/forge-web/src/pages/issues_list.rs | 4 +-- crates/forge-web/src/pages/pulls_list.rs | 4 +-- crates/forge-web/src/pages/repo.rs | 2 +- crates/forge-web/src/views/mod.rs | 20 ++++++++------- scripts/audit/measure.ts | 7 +++++ style/_min.scss | 21 +++++++++------ style/_min_ci.scss | 26 +++++++++++++++++++ 12 files changed, 105 insertions(+), 35 deletions(-) diff --git a/crates/forge-web/assets/nav.js b/crates/forge-web/assets/nav.js index cd63849..ca87cf1 100644 --- a/crates/forge-web/assets/nav.js +++ b/crates/forge-web/assets/nav.js @@ -361,6 +361,9 @@ // A fit pane keeps its scroll when the page stays put (a live change, a post, a filter), by its place in the page. var paneTops = how === 'live' || how === 'post' || how === 'query' ? paneScrolls() : null; var bars = how === 'live' ? barSegments() : null; + var jump = liveJump && liveJump.path === dest.pathname ? liveJump.input : null; + var jumped = jump ? jump.value : ''; + liveJump = null; var steps = captureSteps(); adopt(doc, keepFields, dd, how === 'live' ? captureJobs() : null); restoreSteps(steps); @@ -375,6 +378,7 @@ else if (how === 'post' || how === 'query') { history.replaceState(null, '', dest.href); } shown = dest.pathname + dest.search; if (how === 'nav' || how === 'pop') { focusMain(); } + if (jump) { landSearch(jumped); } if (how !== 'live' && placeHash(dest.hash)) { return; } if (how === 'live' && placeAnchor(at)) { return; } if (how === 'post' || how === 'query' || how === 'live') { window.scrollTo(x, y); } @@ -1552,6 +1556,15 @@ var q = new URLSearchParams(data).toString(); var dest = withoutHash(url); dest.search = q ? '?' + q : ''; + // Enter in a live field on its own results page runs the search now and leaves the reader typing. + var typing = document.activeElement; + if (typing && typing.form === form && typing.hasAttribute('data-live-search') && url.pathname === location.pathname) { + clearTimeout(searchTimer); + searchTimer = null; + if (dest.pathname + dest.search === shown) { pending.delete(form); return; } + load({ target: dest, dest: dest, init: GET_INIT, how: 'query', keep: true, post: false, form: form }); + return; + } saveScroll(); load({ target: dest, dest: dest, init: GET_INIT, how: 'nav', keep: false, post: false, form: form }); return; @@ -1586,7 +1599,18 @@ // Search as you type: a search field marked data-live-search refetches its GET form 250 ms after // the last keystroke and swaps the page in place, with no history entry and the field's focus and // caret kept. A newer request drops an older answer. The submit button stays as the no-JS path. + // A field whose results are on another page (the repo head's code search) goes there once it has + // text: that page's field takes over with what was typed, so the reader never stops typing. var searchTimer = null; + var liveJump = null; + function landSearch(value) { + var el = document.querySelector('[data-live-search]'); + if (!el) { return; } + el.value = value; + el.focus({ preventScroll: true }); + el.setSelectionRange(value.length, value.length); + if (value !== el.defaultValue) { el.dispatchEvent(new Event('input', { bubbles: true })); } + } function liveSearch(input) { var el = input.isConnected ? input : document.querySelector('[data-live-search]'); var form = el && el.form; @@ -1596,6 +1620,13 @@ var q = new URLSearchParams(new FormData(form)).toString(); dest.search = q ? '?' + q : ''; if (dest.pathname + dest.search === shown) { return; } + if (dest.pathname !== location.pathname) { + if (!el.value.trim()) { return; } + liveJump = { path: dest.pathname, input: el }; + saveScroll(); + load({ target: dest, dest: dest, init: GET_INIT, how: 'nav', keep: false, post: false, form: null }); + return; + } load({ target: dest, dest: dest, init: GET_INIT, how: 'query', keep: true, post: false, form: null }); } document.addEventListener('input', function (e) { diff --git a/crates/forge-web/src/pages/audit_log.rs b/crates/forge-web/src/pages/audit_log.rs index aee800a..e7f6814 100644 --- a/crates/forge-web/src/pages/audit_log.rs +++ b/crates/forge-web/src/pages/audit_log.rs @@ -139,8 +139,8 @@ async fn admin_audit_view(