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/note.js | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/meshbay-hub/src/meshbay_hub/static/note.js (limited to 'packages/meshbay-hub/src/meshbay_hub/static/note.js') diff --git a/packages/meshbay-hub/src/meshbay_hub/static/note.js b/packages/meshbay-hub/src/meshbay_hub/static/note.js new file mode 100644 index 0000000..f55c307 --- /dev/null +++ b/packages/meshbay-hub/src/meshbay_hub/static/note.js @@ -0,0 +1,24 @@ +/** + * A line said once and gone, in the playlists' note (style.css + * `.playlist-note`): "Link copied", "2 groups unreachable". Not a dialog — + * nothing here is anyone's to dismiss. + * + * Appended to the body rather than rendered by a view, because the views that + * speak include modals and a context menu that has already closed. One note + * at a time: a second replaces the first and restarts the clock. + */ + +let _note = null; +let _timer = null; + +export function say(text, ms = 2500) { + if (!_note) { + _note = document.createElement('div'); + _note.className = 'playlist-note page-note'; + _note.setAttribute('role', 'status'); + } + _note.textContent = text; + document.body.appendChild(_note); + clearTimeout(_timer); + _timer = setTimeout(() => { if (_note) _note.remove(); }, ms); +} -- cgit v1.2.3