From 1529776d5df1c1ecc5feb6e64244c5fb2db85e26 Mon Sep 17 00:00:00 2001 From: librelad Date: Sat, 18 Jul 2026 23:10:49 +0100 Subject: [PATCH] feat(updater): mirror auto-check line to fleet Updates tab; in-banner Check-now MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extends the per-app Updates treatment to the fleet App Center → Overview → Updates list, and folds the manual check into the status line so it's the one canonical (secondary) affordance rather than a top-level tab button: - updater-page.js: renderAutoCheckLine() now ends with a right-aligned "↻ Check now" button (data-updater-action="check" — both surfaces already wire it). - overview-manager.js: drop the "Check"/"Check now" button from the Updates tab header (keep "Update all", only when updates exist); lead renderUpdates() with the auto-check line. - overview.css: .updater-autocheck wraps on narrow widths; .updater-autocheck-btn sits right (margin-left:auto), smaller. - app-tabbed-manager.js: friendlier no-data copy ("You're all caught up — no updates found for this app."). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../components/apps/core/js/app-tabbed-manager.js | 2 +- .../components/apps/overview/css/overview.css | 5 +++++ .../components/apps/overview/js/overview-manager.js | 12 ++++++++---- .../frontend/components/updater/js/updater-page.js | 3 ++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/containers/libreportal/frontend/components/apps/core/js/app-tabbed-manager.js b/containers/libreportal/frontend/components/apps/core/js/app-tabbed-manager.js index 11a2171..9c19112 100755 --- a/containers/libreportal/frontend/components/apps/core/js/app-tabbed-manager.js +++ b/containers/libreportal/frontend/components/apps/core/js/app-tabbed-manager.js @@ -594,7 +594,7 @@ class AppTabbedManager { const autoLine = this.appUpdater.renderAutoCheckLine(); const body = app ? this.appUpdater.renderAppDetail(app, { includeVersion: true }) - : `
No scan data for this app yet — the first automatic check will fill this in shortly.
`; + : `
You're all caught up — no updates found for this app.
`; section.innerHTML = this.renderAppUpdaterHead(app) + `
${autoLine}${body}
`; } diff --git a/containers/libreportal/frontend/components/apps/overview/css/overview.css b/containers/libreportal/frontend/components/apps/overview/css/overview.css index 9f4805f..5e7894e 100644 --- a/containers/libreportal/frontend/components/apps/overview/css/overview.css +++ b/containers/libreportal/frontend/components/apps/overview/css/overview.css @@ -367,6 +367,7 @@ .updater-autocheck { display: flex; align-items: center; + flex-wrap: wrap; gap: 9px; margin: 0 0 14px; padding: 9px 12px; @@ -377,6 +378,10 @@ color: rgba(var(--text-rgb), .72); } .updater-autocheck strong { color: var(--text-primary, #fff); font-weight: 600; } +.updater-autocheck-text { min-width: 0; } +/* Manual check lives here (right side), not as a top-level tab button — a nudge + for the automatic scan, not the primary way updates are found. */ +.updater-autocheck-btn { margin-left: auto; flex: 0 0 auto; padding: 4px 11px; font-size: .78rem; } .updater-autocheck-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: #36d399; box-shadow: 0 0 8px rgba(54, 211, 153, .6); diff --git a/containers/libreportal/frontend/components/apps/overview/js/overview-manager.js b/containers/libreportal/frontend/components/apps/overview/js/overview-manager.js index 60fb43b..429dfa9 100644 --- a/containers/libreportal/frontend/components/apps/overview/js/overview-manager.js +++ b/containers/libreportal/frontend/components/apps/overview/js/overview-manager.js @@ -190,8 +190,10 @@ class OverviewManager { const open = Array.from(document.querySelectorAll('#overview-view .ov-row-details:not([hidden])')) .map((d) => d.id.replace(/^ov-detail-/, '')); const anyUpdate = !!(this.updater && this.updater.apps.some((a) => a.update_available)); - const actions = checkBtn('Check') - + (anyUpdate ? ` ` : ''); + // No manual "Check" in the header — the auto-check line at the top of the + // body carries the (secondary) Check-now nudge. Only the real "Update all" + // action lives up here, and only when there's actually something to apply. + const actions = anyUpdate ? `` : ''; pane.innerHTML = this.renderHeader(id, actions) + body(this.renderUpdates()); open.forEach((app) => this._openDetail(app)); this._honorAppDeepLink(); @@ -524,9 +526,11 @@ class OverviewManager { const chip = (id, label, n) => ``; const rows = shown.map((a) => this.updateRow(a)).join('') || `
Nothing matches this filter.
`; - // Check / Update all live in the tab header's action slot (renderTab), so - // the toolbar is just the filter chips. + // The auto-check line leads the body (with its right-side Check-now nudge); + // "Update all" lives in the tab header's action slot (renderTab), so the + // toolbar is just the filter chips. return ` + ${up.renderAutoCheckLine()}
${chip('all', 'All', up.apps.length)}${chip('updates', 'Updates', nUpd)}${chip('security', 'Security', nSec)}
diff --git a/containers/libreportal/frontend/components/updater/js/updater-page.js b/containers/libreportal/frontend/components/updater/js/updater-page.js index 0f03fcc..41a32ba 100644 --- a/containers/libreportal/frontend/components/updater/js/updater-page.js +++ b/containers/libreportal/frontend/components/updater/js/updater-page.js @@ -575,7 +575,8 @@ class UpdaterPage { nextBit = ` · next check ${this.fmtRelFuture(Date.parse(gen) + iv * 60000)}`; } return `
` + - `Checked automatically · last checked ${last}${nextBit}
`; + `Checked automatically · last checked ${last}${nextBit}` + + ``; } }