openvibers/openvibe.network Commits

Island docks beside the navbar brand; guests get an empty 200 from the active-theme check

OP OpenVibers committed 18 Sept 2026 · 369bc365d9 · 2 files, +10 −3


Changes

ddiff --git a/packages/openvibe-shared/island.js b/packages/openvibe-shared/island.js
iindex de206eea..2c3a4181 100644
---- a/packages/openvibe-shared/island.js
++++ b/packages/openvibe-shared/island.js
@@@ -72,7 +72,8 @@
pill = el('button', 'ovi-pill'); pill.type = 'button'; pill.setAttribute('aria-haspopup', 'true'); pill.setAttribute('aria-expanded', 'false');
card = el('div', 'ovi-card'); card.setAttribute('role', 'region'); card.setAttribute('aria-label', 'Activity');
host.append(pill, card);
-- const brand = document.querySelector('.openvibe-navbar .ovnav-brand, .openvibe-navbar .openvibe-brand, .navbar .nav-brand, .navbar .logo');
++ // Dock after the brand (and its launcher button); sites with their own navbar mark the spot with [data-ov-island].
++ const brand = document.querySelector('[data-ov-island], .openvibe-navbar #openvibe-launcher-btn, .openvibe-navbar .openvibe-navbar-brand, .navbar .nav-brand');
if (brand && brand.parentNode) brand.parentNode.insertBefore(host, brand.nextSibling);
else { host.classList.add('is-floating'); document.body.appendChild(host); }
const open = (v) => { host.classList.toggle('is-open', v); pill.setAttribute('aria-expanded', String(v)); };
@@@ -86,7 +87,7 @@
function brandMark(a) {
// The navbar's own mark mirrors the top activity: progress ring + state colour.
-- document.querySelectorAll('.openvibe-navbar .ov-mark, .navbar .ov-mark').forEach((m) => {
++ document.querySelectorAll('.openvibe-navbar-brand .ov-mark, .navbar .nav-brand .ov-mark').forEach((m) => {
if (m.closest('.openvibe-network-badge')) return;
if (!a) { m.removeAttribute('data-state'); m.removeAttribute('data-progress'); m.style.removeProperty('--ovm-p'); return; }
m.setAttribute('data-state', a.state === 'info' ? 'idle' : a.state);
ddiff --git a/server/themes/routes.js b/server/themes/routes.js
iindex 762d8a94..25e37263 100644
---- a/server/themes/routes.js
++++ b/server/themes/routes.js
@@@ -69,7 +69,13 @@ router.get('/', (req, res) => {
});
// ── Get User's Active Theme ──────────────────────────────────
--router.get('/me/active', requireAuth, (req, res) => {
++// A request with no credentials at all is a guest asking "do I have a theme?": answer "no" with
++// a 200 so every page view by a guest does not log a failed request in the console.
++router.get('/me/active', (req, res, next) => {
++ const hasAuth = /^Bearer\s+\S/.test(req.headers.authorization || '') || /(?:^|;\s*)ov_token=/.test(req.headers.cookie || '');
++ if (!hasAuth) return res.set('Cache-Control', 'no-store').json({ theme_id: null, guest: true });
++ next();
++}, requireAuth, (req, res) => {
const db = getDb(req);
const userId = req.user.sub || req.user.id;
const prefs = db.prepare('SELECT theme_id, custom_theme_variables FROM user_preferences WHERE user_id = ?').get(userId);