From 92b7afcb186d7aaf475939d58a0385f408425eeb Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Mon, 5 Oct 2026 13:13:54 +0200 Subject: feat(hub): say "N groups unreachable" on Search for a few seconds, not for good MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../meshbay-hub/src/meshbay_hub/static/copy-link.js | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'packages/meshbay-hub/src/meshbay_hub/static/copy-link.js') diff --git a/packages/meshbay-hub/src/meshbay_hub/static/copy-link.js b/packages/meshbay-hub/src/meshbay_hub/static/copy-link.js index ad6c3be..4cc3f30 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/copy-link.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/copy-link.js @@ -1,6 +1,7 @@ import { t } from './i18n.js'; import * as platform from './platform.js'; import { groupLinkRoute } from './group-link.js'; +import { say } from './note.js'; /** * "Copy link": the `#/name@owner/path` address of a file or folder @@ -41,27 +42,9 @@ async function _write(text) { return ok; } -let _note = null; -let _noteTimer = null; - -// Said once and gone, in the playlists' note (style.css `.playlist-note`). -// Appended to the body rather than rendered by a view, because the views that -// copy include modals and a context menu that has already closed. -function _say(text) { - if (!_note) { - _note = document.createElement('div'); - _note.className = 'playlist-note copy-link-note'; - _note.setAttribute('role', 'status'); - } - _note.textContent = text; - document.body.appendChild(_note); - clearTimeout(_noteTimer); - _noteTimer = setTimeout(() => { if (_note) _note.remove(); }, 2500); -} - /** Copy `url`, and say whether it worked. The link itself is shown if not. */ export async function copyLink(url) { if (!url) return; const ok = await _write(url); - _say(ok ? t('link.copied') : t('link.copy_failed', { url })); + say(ok ? t('link.copied') : t('link.copy_failed', { url })); } -- cgit v1.2.3