summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/search-page.js
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-05 13:13:54 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-05 13:13:54 +0200
commit92b7afcb186d7aaf475939d58a0385f408425eeb (patch)
treea0283cdda0e91cf1af2a1ff7b1a0a896d3a4d1f4 /packages/meshbay-hub/src/meshbay_hub/static/search-page.js
parent97fa4cf78a826050b9d1df0b484a7794861cda80 (diff)
downloadmeshbay-0.18.tar.gz
feat(hub): say "N groups unreachable" on Search for a few seconds, not for goodHEAD0.18main
The line sat above the results for as long as the page was open. It is now said once a cross-group pass is over, for five seconds, in the same passing note as "Link copied" — moved out of copy-link.js into note.js (`say(text, ms)`), one note at a time for the whole page. The `.search-unreachable` rule goes with the line it styled. The copy-link probe now also checks in Chrome that the note goes by itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/search-page.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/search-page.js19
1 files changed, 12 insertions, 7 deletions
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 1ede1f6..ae8eac7 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/search-page.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/search-page.js
@@ -14,6 +14,7 @@ import { PhotosApp, groupPhotoAlbums } from './photos-app.js';
import { VideoPlayer } from './video-player.js';
import { transfers } from './transfers.js';
import { copyLink, entryPath, groupItemLink } from './copy-link.js';
+import { say } from './note.js';
import { mergeUnitEntries } from './source-merge.js';
import { useStickyBand } from './sticky.js';
import { ConnectionPool, MAX_IN_FLIGHT, MAX_POOL_SIZE } from './connection-pool.js';
@@ -22,6 +23,8 @@ const DEBOUNCE_MS = 200;
const SEARCH_VIDEO_ROOT = '__search__';
const SEARCH_AUDIO_ROOT = '__search__';
const SEARCH_PHOTO_ROOTS = ['__search_photos__'];
+// How long "N groups unreachable" stays up once a search pass is over.
+const UNREACHABLE_NOTE_MS = 5000;
// -- Index fetching -----------------------------------------------------------
@@ -313,13 +316,20 @@ function SearchPage({ token, username, userId, groups, onPlayQueue, userPrefs })
setProgress({ done: 0, total: groups.length, unreachable: [] });
if (!poolRef.current) return;
- await fetchAllIndexes(
+ const { unreachable } = await fetchAllIndexes(
poolRef.current, groups, token, username, userId,
(p) => { if (!cancelled) setProgress(p); },
(results) => { if (!cancelled) setIndexedGroups(new Map(results)); },
);
- if (!cancelled) setFetching(false);
+ if (cancelled) return;
+ setFetching(false);
+ // Said once the pass is over, for a few seconds, rather than left above
+ // the results: by then nothing more can be done about it here, and a
+ // line that stays is one more thing between the reader and the results.
+ if (unreachable.length) {
+ say(t('search.unreachable', { n: unreachable.length }), UNREACHABLE_NOTE_MS);
+ }
})();
return () => { cancelled = true; };
@@ -715,11 +725,6 @@ function SearchPage({ token, username, userId, groups, onPlayQueue, userPrefs })
</div>
`}
- ${progress.unreachable.length > 0 && html`
- <p class="search-unreachable">
- ${t('search.unreachable', { n: progress.unreachable.length })}
- </p>
- `}
${viewMode === 'files' && hasResults && html`
<${FilesPanel}