aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/files-app.js
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-08-29 17:35:20 +0200
committerChristophe Besson <cbesson@gmail.com>2026-08-29 17:35:20 +0200
commita36661b4c2a24199922d60be1bcb6ed597b433a5 (patch)
tree4552b64f3da6e760510ff24e86bf0cdce8033385 /packages/meshbay-hub/src/meshbay_hub/static/files-app.js
parent78eef92bfa3513a81ac64d4377f8300c533aaa6c (diff)
downloadmeshbay-a36661b4c2a24199922d60be1bcb6ed597b433a5.tar.gz
feat(hub): drop the Search page title, add a Files refresh button
1. The "Search Files" <h2> is removed from the search page — it duplicated the nav and cost a line of vertical space on mobile. `search.title` is dropped from all ten locales (its only use). 2. A monochrome refresh button sits left of the Files breadcrumb home icon. It calls `onRefreshIndex` (re-fetch the group index from the node — the file list is a view over a cached copy with no other way to pull a fresh one), spins while in flight, and only renders where an `onRefreshIndex` is wired (the real group view, not the cross-group search results). New `refresh` icon; `group.refresh_index` in all ten locales. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018BMLQjqFGCize2KtNBT79v
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/files-app.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/files-app.js19
1 files changed, 18 insertions, 1 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 3d51e67..d2f0727 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,
+ showGroup, readOnly, getTransport, onRefreshIndex,
}) {
const [selecting, setSelecting] = useState(false);
const [selected, setSelected] = useState(() => new Set());
@@ -35,6 +35,16 @@ function FilesPanel({
const [sortAsc, setSortAsc] = useState(true);
const [filter, setFilter] = useState('');
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.
+ const doRefresh = useCallback(async () => {
+ if (refreshing || !onRefreshIndex) return;
+ setRefreshing(true);
+ try { await onRefreshIndex(); } finally { setRefreshing(false); }
+ }, [refreshing, onRefreshIndex]);
// A directory from the group just left rarely exists in the one just
// entered (e.g. "outputs" in one group, absent in another) — Files would
@@ -329,6 +339,13 @@ function FilesPanel({
</div>
<div class="breadcrumbs">
+ ${onRefreshIndex && html`
+ <button class="crumb crumb-refresh ${refreshing ? 'spinning' : ''}"
+ onClick=${doRefresh} disabled=${refreshing}
+ title=${t('group.refresh_index')}>
+ <${Icon} name="refresh" />
+ </button>
+ `}
<a class="crumb" onClick=${() => setCurrentPath('')}>
<${Icon} name="home" />
</a>