More panes inside the Control Room: /tools mounts the shell (rail, topbar, strip), legacy site.css layered under cr.css + tools.css light restyle, CR tabs for Start/Promo tools/Training/Pipeline/My line/Profile, shell-owned sign-in; Promo tools gets its own rail entry

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-08 16:14:12 -05:00
parent ef06cd4baa
commit f64b7e1dec
13 changed files with 114 additions and 57 deletions
+17
View File
@@ -0,0 +1,17 @@
// /tools glue: mounts the Control Room shell around the legacy panes and keeps the topbar + rail in step with the
// active pane (my.js owns the panes themselves; the hash is the source of truth).
(function () {
const TITLES = { overview: 'Start', promo: 'Promo tools', training: 'Training', pipeline: 'Pipeline', line: 'My line', profile: 'Profile' };
const pane = () => { const h = (location.hash || '').slice(1); return TITLES[h] ? h : 'overview'; };
const railKey = p => p === 'promo' ? 'promo' : 'tools';
CR.mount({ active: railKey(pane()), title: TITLES[pane()], crumb: 'Control room', sub: '' });
function sync() {
const p = pane(); const h1 = document.querySelector('.topbar h1'); if (h1) h1.textContent = TITLES[p];
document.title = TITLES[p] + ' · LinkSpin';
const want = railKey(p) === 'promo' ? '/tools#promo' : '/tools';
document.querySelectorAll('.rail a').forEach(a => { const href = a.getAttribute('href') || ''; if (href.startsWith('/tools')) a.classList.toggle('on', href === want); });
}
window.addEventListener('hashchange', sync); sync();
// the shell owns the session: sign-in dialog, who-button, status strip, login ad, first username. my.js waits for this.
CR.requireSession(() => { window.LS_SESSION_READY = true; window.dispatchEvent(new CustomEvent('ls:session')); });
})();