From 397727d2bf3f24c81ddda1e7a9eda197d7ed3b9e Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sun, 30 Aug 2026 10:50:51 +0200 Subject: fix(hub): wire the Files refresh button on the Search page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The refresh button (added in 1cb9054, left of the breadcrumb home icon) was gated on `onRefreshIndex`, which the Search page's embedded FilesPanel did not pass — so it never showed on the one page it was asked for. The Search page now passes an `onRefreshIndex` that re-runs its all-groups index fetch (the only cache it has); the existing progress bar is the feedback. Unchanged in the normal group Files view. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_018BMLQjqFGCize2KtNBT79v --- packages/meshbay-hub/src/meshbay_hub/static/search-page.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'packages/meshbay-hub') diff --git a/packages/meshbay-hub/src/meshbay_hub/static/search-page.js b/packages/meshbay-hub/src/meshbay_hub/static/search-page.js index e36532f..fced022 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/search-page.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/search-page.js @@ -190,6 +190,9 @@ function SearchPage({ token, username, userId, groups, onPlayQueue, userPrefs }) const [indexedGroups, setIndexedGroups] = useState(new Map()); const [progress, setProgress] = useState({ done: 0, total: 0, unreachable: [] }); const [fetching, setFetching] = useState(false); + // Bumped by the Files breadcrumb refresh button — re-runs the all-groups + // index fetch below, the only "cache" this page has. + const [refreshTick, setRefreshTick] = useState(0); const [query, setQuery] = useState(''); const [viewMode, setViewMode] = useState('files'); const [videoEntry, setVideoEntry] = useState(null); @@ -232,7 +235,7 @@ function SearchPage({ token, username, userId, groups, onPlayQueue, userPrefs }) })(); return () => { cancelled = true; }; - }, [groups, token]); + }, [groups, token, refreshTick]); // -- Connection management -- @@ -551,7 +554,8 @@ function SearchPage({ token, username, userId, groups, onPlayQueue, userPrefs }) onPreview=${onPreview} showGroup=${true} readOnly=${true} - getTransport=${getTransport} /> + getTransport=${getTransport} + onRefreshIndex=${() => setRefreshTick((n) => n + 1)} /> `} ${viewMode === 'videos' && hasResults && html` -- cgit v1.2.3