From b1937336bd7e1db9109e6ea58652312cb5ccb8db Mon Sep 17 00:00:00 2001 From: Youzini-afk <13153778771cx@gmail.com> Date: Wed, 22 Apr 2026 17:16:31 +0800 Subject: [PATCH] Make persistence diagnostics detail two-column --- style.css | 16 ++++++++++++++++ ui/panel.js | 25 ++++++++++++++++++------- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/style.css b/style.css index 72f6042..32244f0 100644 --- a/style.css +++ b/style.css @@ -1689,6 +1689,16 @@ .bme-persist-kv__row span { color: var(--bme-on-surface-dim); } .bme-persist-kv__row strong { color: var(--bme-on-surface); font-weight: 600; } +.bme-persist-kv-columns { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); + gap: 12px; +} + +.bme-persist-kv-column { + min-width: 0; +} + .bme-persist-guide { margin-top: 4px; padding: 14px 16px; @@ -1728,6 +1738,12 @@ color: var(--bme-on-surface-dim); } +@media (max-width: 900px) { + .bme-persist-kv-columns { + grid-template-columns: minmax(0, 1fr); + } +} + .bme-persist-actions { display: flex; gap: 8px; diff --git a/ui/panel.js b/ui/panel.js index c080d21..7aa4b29 100644 --- a/ui/panel.js +++ b/ui/panel.js @@ -2530,14 +2530,25 @@ function _refreshTaskPersistence() { `主存储 · ${primaryTierLabel}`, `确认 · ${acceptedSummaryLabel}`, ]; + const collectVisibleRows = (rows = []) => + rows.filter(([, value]) => value !== null && value !== undefined && value !== ""); + const renderRow = ([key, value]) => + `
${_escHtml(String(key))}${_escHtml(String(value))}
`; const renderRows = (rows = []) => - rows - .filter(([, value]) => value !== null && value !== undefined && value !== "") - .map( - ([key, value]) => - `
${_escHtml(String(key))}${_escHtml(String(value))}
`, - ) + collectVisibleRows(rows) + .map(renderRow) .join(""); + const renderRowsTwoColumn = (rows = []) => { + const visibleRows = collectVisibleRows(rows); + if (!visibleRows.length) return ""; + const splitIndex = Math.ceil(visibleRows.length / 2); + return ` +
+
${visibleRows.slice(0, splitIndex).map(renderRow).join("")}
+
${visibleRows.slice(splitIndex).map(renderRow).join("")}
+
+ `; + }; const primaryRows = [ ["当前状态", acceptedSummaryLabel], @@ -2616,7 +2627,7 @@ function _refreshTaskPersistence() { 查看诊断细节
- ${renderRows(diagnosticRows)} + ${renderRowsTwoColumn(diagnosticRows)}