Chat bubble back on every Control Room screen: the shell loads chat.js once per page (it only lived on the retired /my dashboard); Control Room styles for the widget

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-18 06:35:55 -05:00
parent 57b8eb4208
commit 8a1a6b1f6d
14 changed files with 44 additions and 23 deletions
+6
View File
@@ -48,8 +48,14 @@ window.CR = (function () {
back.addEventListener('keydown', e => { if (e.key === 'Enter' && e.target.tagName !== 'TEXTAREA') back.querySelector('#dlgOk').click(); if (e.key === 'Escape') done(null); });
});
}
// the chat bubble on every Control Room screen (Marty, 2026-10-18: it vanished when /my was retired); once per page
function chat() {
if (document.getElementById('iapChat') || document.querySelector('script[src^="/assets/chat.js"]')) return;
const s = document.createElement('script'); s.src = '/assets/chat.js?v=20261018c'; s.defer = true; document.body.appendChild(s);
}
function mount(o) {
const page = $('page'); if (!page) return;
chat();
const app = document.createElement('div'); app.className = 'app'; let railWide = true; try { railWide = localStorage.getItem('cr.rail') !== 'narrow'; } catch (e) {} if (railWide) app.classList.add('wide'); // expanded by default (Marty 2026-10-08), the choice remembered per browser
app.innerHTML = '<nav class="rail" aria-label="LinkSpin"><a class="mark" href="/" aria-label="LinkSpin home" title="LinkSpin"></a>'
+ NAV.map(([k, label, href, svg, sec]) => '<a ' + (k === 'help' ? 'id="crHelp" ' : '') + 'href="' + (BUILT.has(k) ? href : FALLBACK[k]) + '"' + (k === o.active ? ' class="on' + (sec ? ' rsec' : '') + '" aria-current="page"' : (sec ? ' class="rsec"' : '')) + ' title="' + label + '" aria-label="' + label + '"><svg viewBox="0 0 24 24">' + svg + '</svg><span class="lbl">' + label + '</span></a>').join('')