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('')
+15
View File
@@ -188,3 +188,18 @@ label.lbl{display:grid;gap:5px;font-size:10.5px;font-weight:700;letter-spacing:.
/* JetBrains Mono joins "//" into a ligature that reads as a missing slash in URLs (Marty 2026-10-07): no ligatures anywhere */
body,input,textarea,button,code,.mono{font-variant-ligatures:none;font-feature-settings:"liga" 0,"calt" 0}
/* chat widget on Control Room screens (2026-10-18: the bubble only lived on the retired /my dashboard) */
#iapChatBtn{position:fixed;right:20px;bottom:44px;z-index:60;width:56px;height:56px;border-radius:50%;border:0;background:var(--accent,#3b9dff);color:#fff;font-size:24px;cursor:pointer;box-shadow:0 8px 28px rgba(20,60,140,.35)}
#iapChatBtn:hover{transform:scale(1.06)}
#iapChatPanel{position:fixed;right:20px;bottom:112px;z-index:60;width:min(360px,calc(100vw - 40px));background:#fff;color:var(--ink,#14213d);border:1px solid var(--line-strong,#c9d3e3);border-radius:16px;overflow:hidden;box-shadow:0 24px 60px rgba(10,20,50,.28);display:flex;flex-direction:column}
#iapChatPanel .ch-head{padding:14px 16px;border-bottom:1px solid var(--line,#e2e8f2);font-family:var(--display,inherit);position:relative;font-weight:700}
#iapChatPanel .ch-head .ch-sub{display:block;font-size:12px;font-weight:400;color:var(--muted,#64748b)}
#iapChatClose{position:absolute;right:10px;top:10px;background:transparent;border:0;color:var(--muted,#64748b);font-size:22px;cursor:pointer;line-height:1}
#iapChatPanel .ch-msgs{padding:14px;overflow-y:auto;max-height:340px;display:flex;flex-direction:column;gap:10px}
#iapChatPanel .ch-m{border-radius:12px;padding:9px 13px;font-size:13.5px;line-height:1.5;max-width:86%}
#iapChatPanel .ch-m.bot{background:rgba(59,157,255,.08);border:1px solid rgba(59,157,255,.22);align-self:flex-start}
#iapChatPanel .ch-m.me{background:#f1f4f9;border:1px solid var(--line,#e2e8f2);align-self:flex-end}
#iapChatPanel .ch-m a{word-break:break-all}
#iapChatPanel .ch-input{display:flex;gap:8px;padding:11px;border-top:1px solid var(--line,#e2e8f2)}
#iapChatPanel .ch-input input{flex:1;min-width:0;padding:9px 11px;border:1px solid var(--line-strong,#c9d3e3);border-radius:10px;font:inherit}
#iapChatPanel .ch-input button{background:var(--accent,#3b9dff);color:#fff;border:0;border-radius:10px;padding:0 16px;font-weight:700;cursor:pointer}