Skip to content

Commit 8fd138c

Browse files
sarg3ntclaude
andcommitted
fix(updates): post-install grid is empty when view filter is "All Packages"
After installing a package, the grid was getting rebuilt with only the upgradable list (the fast `/api/os-updates/packages` path), even when the user had the view-filter dropdown set to "All Packages". In that state the just-installed package never appeared — the grid showed "No packages found" until the user manually switched view+back to retrigger the full-list fetch. Reproduced by installing a package (e.g. `btop`) from the "Install Package" modal while All Packages was selected. Read the current filter before kicking the reload, and after `loadInstalledPackages()` returns, also call `loadAllInstalledPackages()` when the active filter is "all" so the newly-installed package shows up without manual intervention. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent bacfa8e commit 8fd138c

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

gearbox/static/js/os-updates/os-updates-page.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,15 +2564,28 @@ async function confirmAptInstall() {
25642564
throw new Error(errMsg);
25652565
}
25662566
showToast('Package ' + name + ' installed successfully', 'success');
2567-
// Destroy and reload the Tabulator grid
2567+
// Destroy and reload the Tabulator grid. loadInstalledPackages only
2568+
// fetches the upgradable list (fast path) — if the user was on the
2569+
// "All Packages" view, we need to also lazy-load the full installed
2570+
// list so the just-installed package actually appears. Without this,
2571+
// the post-install grid is empty whenever the filter happens to be
2572+
// "All" (or "Held"), and the user has to switch view + back to
2573+
// trigger the full-list fetch manually.
25682574
if (installedPkgTable) {
25692575
installedPkgTable.destroy();
25702576
installedPkgTable = null;
25712577
}
25722578
allPackagesLoaded = false;
2579+
const filterSelect = document.getElementById('pkg-view-filter');
2580+
const postInstallFilter = filterSelect ? filterSelect.value : 'updates';
25732581
const el = document.getElementById('installed-packages-table');
25742582
if (el) el.innerHTML = '<div id="installed-packages-loading" class="flex items-center gap-2 p-4 text-sm text-gray-500 dark:text-slate-400"><svg class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg> Loading installed packages...</div>';
2575-
setTimeout(loadInstalledPackages, 500);
2583+
setTimeout(async () => {
2584+
await loadInstalledPackages();
2585+
if (postInstallFilter === 'all') {
2586+
await loadAllInstalledPackages();
2587+
}
2588+
}, 500);
25762589
} catch (err) {
25772590
showToast('Failed to install package: ' + err.message, 'error');
25782591
}

0 commit comments

Comments
 (0)