From b69967508f2e71e15d8dad293941d3688a280438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Thu, 19 Nov 2026 13:39:28 +0100 Subject: [PATCH 1/4] Add `last` URL parameter for a relative date range in the history view `&last=N` shows the last N days, so a bookmarked link stays fresh instead of pinning `from`/`to` dates. Co-Authored-By: Claude Opus 5.5 --- index.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 30ab891238..26dfbcedb0 100644 --- a/index.html +++ b/index.html @@ -2023,7 +2023,7 @@

Detailed Comparison

const range = history_view.range; document.getElementById('history-range').style.display = range ? 'inline' : 'none'; - document.getElementById('history-range-text').textContent = range ? `${range.from} — ${range.to}` : ''; + document.getElementById('history-range-text').textContent = !range ? '' : range.last ? `Last ${range.last} days` : `${range.from} — ${range.to}`; } document.getElementById('history-range-reset').addEventListener('click', e => { @@ -2576,7 +2576,13 @@

Detailed Comparison

history.pushState(historyState(), '', window.location.pathname + (window.location.search || '') + '#' + encodeState(selectors) + (history_view ? '&history=' + encodeURIComponent(history_view.key) : '') - + (history_view?.range ? `&from=${history_view.range.from}&to=${history_view.range.to}` : '')); + + (history_view?.range?.last ? `&last=${history_view.range.last}` + : history_view?.range ? `&from=${history_view.range.from}&to=${history_view.range.to}` : '')); +} + +/// The range of the last `days` days, relative to today, kept as `&last=` in the URL so that the link stays fresh. +function lastDaysRange(days) { + return {from: new Date(Date.now() - days * 86400000).toISOString().slice(0, 10), to: '9999-12-31', last: days}; } /// The selectors and the history view from the URL. @@ -2586,7 +2592,9 @@

Detailed Comparison

const hash = decodeURIComponent(window.location.hash.substring(1)); selectors = {...selectors, ...decodeState(hash)}; const params = Object.fromEntries(hash.split('&').map(kv => kv.split('='))); - setHistoryView(params.history, params.from && params.to ? {from: params.from, to: params.to} : null); + const last = parseInt(params.last); + setHistoryView(params.history, last > 0 ? lastDaysRange(last) + : params.from && params.to ? {from: params.from, to: params.to} : null); } catch {} } From bcce60a4fedde2ebd528ebb6d05d7701341dad40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Thu, 19 Nov 2026 13:44:33 +0100 Subject: [PATCH 2/4] Add From/To date pickers to the history view, open the last 15 days by default The history link in the summary table now opens the last 15 days; "Show all dates" lifts the limit. Co-Authored-By: Claude Opus 5.5 --- index.html | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 26dfbcedb0..e2632ad2b0 100644 --- a/index.html +++ b/index.html @@ -422,8 +422,11 @@ margin-left: 0.5rem; } + #history-from, #history-to { + font: inherit; + } + #history-range-text { - font-family: monospace; margin-right: 0.25rem; } @@ -711,6 +714,8 @@

ClickBench — a Benchmark For Analytical DBMS

← All systems History of 🔗 Copy link + From + To Show all dates @@ -1538,7 +1543,7 @@

Detailed Comparison

history_link.className = 'history-link'; history_link.innerHTML = history_icon; history_link.title = 'Show the history of the results of this system on this machine'; - history_link.href = state_hash + '&history=' + encodeURIComponent(key); + history_link.href = state_hash + '&history=' + encodeURIComponent(key) + '&last=' + history_default_days; history_link.addEventListener('click', e => { /// Let the browser open the link in a new tab. if (e.ctrlKey || e.metaKey || e.shiftKey || e.button != 0) { return; } @@ -2023,7 +2028,23 @@

Detailed Comparison

const range = history_view.range; document.getElementById('history-range').style.display = range ? 'inline' : 'none'; - document.getElementById('history-range-text').textContent = !range ? '' : range.last ? `Last ${range.last} days` : `${range.from} — ${range.to}`; + document.getElementById('history-range-text').textContent = range?.last ? `Last ${range.last} days` : ''; + document.getElementById('history-from').value = range && range.from != min_date ? range.from : ''; + document.getElementById('history-to').value = range && range.to != max_date ? range.to : ''; +} + +/// An empty input leaves its side of the range open. +const min_date = '0000-01-01'; +const max_date = '9999-12-31'; + +for (const id of ['history-from', 'history-to']) { + document.getElementById(id).addEventListener('change', () => { + const from = document.getElementById('history-from').value; + const to = document.getElementById('history-to').value; + setHistoryView(history_view.key, from || to ? {from: from || min_date, to: to || max_date} : null); + updateHistory(); + render(); + }); } document.getElementById('history-range-reset').addEventListener('click', e => { @@ -2033,8 +2054,11 @@

Detailed Comparison

render(); }); +/// The history link from the summary table opens the recent results; "Show all dates" lifts the limit. +const history_default_days = 15; + function openHistory(key) { - setHistoryView(key); + setHistoryView(key, lastDaysRange(history_default_days)); updateHistory(); render(); window.scrollTo(0, 0); @@ -2582,7 +2606,7 @@

Detailed Comparison

/// The range of the last `days` days, relative to today, kept as `&last=` in the URL so that the link stays fresh. function lastDaysRange(days) { - return {from: new Date(Date.now() - days * 86400000).toISOString().slice(0, 10), to: '9999-12-31', last: days}; + return {from: new Date(Date.now() - days * 86400000).toISOString().slice(0, 10), to: max_date, last: days}; } /// The selectors and the history view from the URL. From ec4ec758fd530044ea29cbfc448a0c4baf45d48e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Thu, 19 Nov 2026 14:53:43 +0100 Subject: [PATCH 3/4] Open all dates from the history icon when the entry has no recent results Otherwise most entries opened on an empty view. Also say "No results in this date range" when only the range is empty. Co-Authored-By: Claude Opus 5.5 --- index.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index e2632ad2b0..636f98dc17 100644 --- a/index.html +++ b/index.html @@ -1539,16 +1539,19 @@

Detailed Comparison

td_name.appendChild(remove); const key = historyKey(elem); + /// Limit to the recent results only if the latest one is among them, otherwise the view is empty. + const recent = lastDaysRange(history_default_days); + const range = elem.date >= recent.from ? recent : null; let history_link = document.createElement('a'); history_link.className = 'history-link'; history_link.innerHTML = history_icon; history_link.title = 'Show the history of the results of this system on this machine'; - history_link.href = state_hash + '&history=' + encodeURIComponent(key) + '&last=' + history_default_days; + history_link.href = state_hash + '&history=' + encodeURIComponent(key) + (range ? '&last=' + range.last : ''); history_link.addEventListener('click', e => { /// Let the browser open the link in a new tab. if (e.ctrlKey || e.metaKey || e.shiftKey || e.button != 0) { return; } e.preventDefault(); - openHistory(key); + openHistory(key, range); }); td_name.appendChild(history_link); } @@ -2057,8 +2060,8 @@

Detailed Comparison

/// The history link from the summary table opens the recent results; "Show all dates" lifts the limit. const history_default_days = 15; -function openHistory(key) { - setHistoryView(key, lastDaysRange(history_default_days)); +function openHistory(key, range) { + setHistoryView(key, range); updateHistory(); render(); window.scrollTo(0, 0); @@ -2097,7 +2100,8 @@

Detailed Comparison

const range = history_view.range; filtered_data = (history_view.data || []).filter(elem => !range || (elem.date >= range.from && elem.date <= range.to)); nothing_selected_elem.textContent = history_view.error ? `Cannot load the history: ${history_view.error}` - : !history_view.data ? 'Loading…' : history_view.data.length ? 'No results for this metric' : 'No results'; + : !history_view.data ? 'Loading…' : !history_view.data.length ? 'No results' + : filtered_data.length ? 'No results for this metric' : 'No results in this date range'; } else { applyTopRowFilters(); From 3a2f44072997115539851727403c096edb284bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Fri, 20 Nov 2026 10:58:22 +0100 Subject: [PATCH 4/4] Open all dates from the history link in the summary table Co-Authored-By: Claude Opus 5.5 --- index.html | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 636f98dc17..65edd72fac 100644 --- a/index.html +++ b/index.html @@ -1539,19 +1539,16 @@

Detailed Comparison

td_name.appendChild(remove); const key = historyKey(elem); - /// Limit to the recent results only if the latest one is among them, otherwise the view is empty. - const recent = lastDaysRange(history_default_days); - const range = elem.date >= recent.from ? recent : null; let history_link = document.createElement('a'); history_link.className = 'history-link'; history_link.innerHTML = history_icon; history_link.title = 'Show the history of the results of this system on this machine'; - history_link.href = state_hash + '&history=' + encodeURIComponent(key) + (range ? '&last=' + range.last : ''); + history_link.href = state_hash + '&history=' + encodeURIComponent(key); history_link.addEventListener('click', e => { /// Let the browser open the link in a new tab. if (e.ctrlKey || e.metaKey || e.shiftKey || e.button != 0) { return; } e.preventDefault(); - openHistory(key, range); + openHistory(key); }); td_name.appendChild(history_link); } @@ -2057,9 +2054,6 @@

Detailed Comparison

render(); }); -/// The history link from the summary table opens the recent results; "Show all dates" lifts the limit. -const history_default_days = 15; - function openHistory(key, range) { setHistoryView(key, range); updateHistory();