diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-08-30 15:19:15 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-08-30 15:19:15 +0200 |
| commit | 117f3d2611780aacda60ca529992ca3111de6634 (patch) | |
| tree | f9877d828fd17a486b3b648e8fbdbf3e395d272e /packages | |
| parent | f5d311b7a0ac0cf72eda3c07c7b19f5d13d201a0 (diff) | |
| download | meshbay-117f3d2611780aacda60ca529992ca3111de6634.tar.gz | |
fix(hub): show the Files refresh button only on the Search page
In a real group the node streams every index change to connected clients
as it happens (onIndexSync / onIndexDelta), so a manual re-fetch button
there just duplicates the live push. The cross-group Search page has no
such connection — its file list is a one-shot cached fetch — so the
button belongs there and only there. Gated on a new explicit `showRefresh`
prop that only search-page.js passes; `onRefreshIndex` stays in
commonProps for ChatPanel's own use after an attachment upload.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BMLQjqFGCize2KtNBT79v
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/files-app.js | 11 | ||||
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/search-page.js | 1 |
2 files changed, 7 insertions, 5 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/files-app.js b/packages/meshbay-hub/src/meshbay_hub/static/files-app.js index d2f0727..ab7e254 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/files-app.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/files-app.js @@ -27,7 +27,7 @@ function FilesPanel({ groupId, transportRef, gekRef, status, entries, nodeDirs, nodeRoots, setEntries, setNodeDirs, setNodeRoots, applyIndex, isNodeAdmin, operatorPaired, mayUpload, userId, setError, onPreview, - showGroup, readOnly, getTransport, onRefreshIndex, + showGroup, readOnly, getTransport, onRefreshIndex, showRefresh, }) { const [selecting, setSelecting] = useState(false); const [selected, setSelected] = useState(() => new Set()); @@ -37,9 +37,10 @@ function FilesPanel({ const [currentPath, setCurrentPath] = useState(''); const [refreshing, setRefreshing] = useState(false); - // Force a re-fetch of the group index from the node — the client's file - // list is a view over a cached copy, and there is no other way to pull a - // fresh one on demand. + // Only the cross-group Search page shows this (`showRefresh`): it has no + // live node connection pushing index deltas, so its file list really is + // a one-shot cached fetch. In a real group the node streams every change + // as it happens, so a manual re-fetch would just duplicate that. const doRefresh = useCallback(async () => { if (refreshing || !onRefreshIndex) return; setRefreshing(true); @@ -339,7 +340,7 @@ function FilesPanel({ </div> <div class="breadcrumbs"> - ${onRefreshIndex && html` + ${showRefresh && onRefreshIndex && html` <button class="crumb crumb-refresh ${refreshing ? 'spinning' : ''}" onClick=${doRefresh} disabled=${refreshing} title=${t('group.refresh_index')}> 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 fced022..f144ef0 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/search-page.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/search-page.js @@ -555,6 +555,7 @@ function SearchPage({ token, username, userId, groups, onPlayQueue, userPrefs }) showGroup=${true} readOnly=${true} getTransport=${getTransport} + showRefresh=${true} onRefreshIndex=${() => setRefreshTick((n) => n + 1)} /> `} |