Resync the vendored design system (dash-free upstream) and check it too
CI / Lint (eslint) (push) Failing after 44s
CI / Test (jest) (push) Successful in 24s
CI / Security (npm audit) (push) Successful in 7s
CI / Integration (api) (push) Successful in 1m13s
CI / Scan (secrets, workflows, shell) (push) Successful in 2m21s
CI / Lint (eslint) (pull_request) Failing after 18s
CI / UI (playwright) (push) Successful in 2m9s
CI / Deploy (push) Skipped
CI / Deploy worker (push) Skipped
CI / Notify (push) Skipped
CI / Test (jest) (pull_request) Successful in 18s
CI / Security (npm audit) (pull_request) Successful in 29s
CI / Integration (api) (pull_request) Successful in 2m23s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m19s
CI / UI (playwright) (pull_request) Successful in 1m34s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped

public/web_template is now web_template 8286bb2, which removed every em
and en dash (web_template#3, approved with screenshots). Pulse's copy was
byte-identical to the previous upstream bbec859, so the only changes are
upstream's: hyphens in comments, '-' for empty values in lt.fmt, and
'ALL SYSTEMS NOMINAL: PULSE' / offline banner and toast rewording.

- The CI dash check no longer excludes public/web_template.
- UI tests: no page renders an em or en dash; the boot screen reads
  'ALL SYSTEMS NOMINAL: PULSE'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jaredandClaude Opus 5.5 committed 2026-11-22 19:23:12 -05:00
1 parent e167e2f3b8
commit 599a62f010
6 files changed
+171 -153

No files matched your search

+40 -40
View File
@@ -1,5 +1,5 @@
/**
* LOTUSGUILD TERMINAL DESIGN SYSTEM v1.2 — base.js
* LOTUSGUILD TERMINAL DESIGN SYSTEM v1.2 - base.js
* Core JavaScript utilities shared across all LotusGuild applications
*
* Apps: Tinker Tickets (PHP), PULSE (Node.js), GANDALF (Flask)
@@ -243,7 +243,7 @@
}
// Announce the close so whoever opened the modal can undo optimistic UI or
// clean up a dynamically-inserted overlay. A modal can be dismissed four
// ways — the ✕ button, a Cancel button, a backdrop click, and Escape — and
// ways - the ✕ button, a Cancel button, a backdrop click, and Escape - and
// the last two are handled globally here, so button-only listeners miss them.
el.dispatchEvent(new CustomEvent('lt:modalclose', { bubbles: true }));
}
@@ -319,7 +319,7 @@
---------------------------------------------------------------- */
let _bootFired = false; // in-memory guard: survives within a JS context, resets on true page reload
function runBoot(appName, force) {
if (!force && _bootFired) return; // Fastest guard — blocks any same-page double-call
if (!force && _bootFired) return; // Fastest guard - blocks any same-page double-call
const storageKey = 'lt_booted_' + (appName || 'app');
if (!force && sessionStorage.getItem(storageKey)) return;
_bootFired = true;
@@ -352,7 +352,7 @@
'[ OK ] Scheduled tasks registered',
'[ OK ] Terminal interface rendered',
'',
'> ALL SYSTEMS NOMINAL — ' + name,
'> ALL SYSTEMS NOMINAL: ' + name,
'',
];
@@ -491,7 +491,7 @@
---------------------------------------------------------------- */
function timeAgo(value) {
const date = value instanceof Date ? value : new Date(value);
if (isNaN(date)) return '—';
if (isNaN(date)) return '-';
const diff = Math.floor((Date.now() - date.getTime()) / 1000);
if (diff < 60) return diff + 's ago';
if (diff < 3600) return Math.floor(diff / 60) + 'm ago';
@@ -510,7 +510,7 @@
function formatDate(value) {
const date = value instanceof Date ? value : new Date(value);
if (isNaN(date)) return '—';
if (isNaN(date)) return '-';
try {
return date.toLocaleString(undefined, {
timeZone: global.APP_TIMEZONE || undefined,
@@ -527,7 +527,7 @@
lt.bytes.format(n)
---------------------------------------------------------------- */
function formatBytes(bytes) {
if (bytes == null) return '—';
if (bytes == null) return '-';
const units = ['B','KB','MB','GB','TB']; let i = 0;
while (bytes >= 1024 && i < units.length - 1) { bytes /= 1024; i++; }
return bytes.toFixed(i === 0 ? 0 : 2) + ' ' + units[i];
@@ -1142,9 +1142,9 @@
lt.num.format / compact / percent / pad / clamp / lerp
---------------------------------------------------------------- */
const num = {
format(n, d) { if (n == null || isNaN(n)) return '—'; return Number(n).toLocaleString(undefined, { minimumFractionDigits: d || 0, maximumFractionDigits: d != null ? d : 2 }); },
format(n, d) { if (n == null || isNaN(n)) return '-'; return Number(n).toLocaleString(undefined, { minimumFractionDigits: d || 0, maximumFractionDigits: d != null ? d : 2 }); },
compact(n) { if (Math.abs(n) >= 1e9) return (n/1e9).toFixed(1)+'B'; if (Math.abs(n) >= 1e6) return (n/1e6).toFixed(1)+'M'; if (Math.abs(n) >= 1e3) return (n/1e3).toFixed(1)+'K'; return String(n); },
percent(n, total) { return total ? ((n/total)*100).toFixed(1)+'%' : '—'; },
percent(n, total) { return total ? ((n/total)*100).toFixed(1)+'%' : '-'; },
pad(n, w) { return String(Math.floor(n)).padStart(w, '0'); },
clamp(n, a, b) { return Math.min(b, Math.max(a, n)); },
lerp(a, b, t) { return a + (b - a) * t; },
@@ -1354,7 +1354,7 @@
/* ================================================================
MODULE 35 — VIEWPORT
MODULE 35 - VIEWPORT
Tracks current breakpoint, fires callbacks on change.
lt.viewport.bp() → 'xs'|'sm'|'md'|'lg'|'xl'|'2xl'|'3xl'|'4k'
lt.viewport.is('md') → true if current bp >= md
@@ -1415,7 +1415,7 @@
/* ================================================================
MODULE 36 — MOBILE NAV
MODULE 36 - MOBILE NAV
Hamburger-driven off-canvas navigation drawer with swipe support.
lt.mobileNav.open() / .close() / .toggle()
Auto-inits on [id="lt-menu-btn"] + [id="lt-nav-drawer"]
@@ -1482,7 +1482,7 @@
});
}
// Swipe gesture — open from left edge, close by swiping left
// Swipe gesture - open from left edge, close by swiping left
let _touchStartX = 0;
let _touchStartY = 0;
let _isSwiping = false;
@@ -1540,7 +1540,7 @@
/* ================================================================
MODULE 37 — THEME TOGGLE
MODULE 37 - THEME TOGGLE
lt.theme.toggle()
lt.theme.set('light'|'dark')
lt.theme.get()
@@ -1581,7 +1581,7 @@
};
/* ================================================================
MODULE 38 — NOTIFICATION BADGE
MODULE 38 - NOTIFICATION BADGE
lt.notif.set(el, count)
lt.notif.inc(el)
lt.notif.clear(el)
@@ -1618,7 +1618,7 @@
};
/* ================================================================
MODULE 39 — RIGHT-SIDE DRAWER
MODULE 39 - RIGHT-SIDE DRAWER
lt.rightDrawer.open(id)
lt.rightDrawer.close(id)
lt.rightDrawer.toggle(id)
@@ -1682,7 +1682,7 @@
});
/* ================================================================
MODULE 40 — CONTEXT MENU
MODULE 40 - CONTEXT MENU
lt.contextMenu.register(selector, items)
items = [{ label, icon, kbd, danger, divider, action }]
================================================================ */
@@ -1718,7 +1718,7 @@
_ctxMenu.appendChild(el);
});
_ctxMenu.classList.add('is-open');
// Position — keep on screen
// Position - keep on screen
const vw = window.innerWidth, vh = window.innerHeight;
const mw = _ctxMenu.offsetWidth || 180, mh = _ctxMenu.offsetHeight || 200;
_ctxMenu.style.left = Math.max(8, Math.min(x, vw - mw - 8)) + 'px';
@@ -1749,7 +1749,7 @@
};
/* ================================================================
MODULE 41 — OFFLINE DETECTION
MODULE 41 - OFFLINE DETECTION
lt.offline.onOnline(fn)
lt.offline.onOffline(fn)
lt.offline.isOnline()
@@ -1764,7 +1764,7 @@
_offlineBanner.className = 'lt-offline-banner';
_offlineBanner.setAttribute('role', 'alert');
_offlineBanner.setAttribute('aria-live', 'assertive');
_offlineBanner.innerHTML = '<span class="lt-dot lt-dot--red"></span> NO NETWORK CONNECTION — RECONNECTING...';
_offlineBanner.innerHTML = '<span class="lt-dot lt-dot--red"></span> NO NETWORK CONNECTION: RECONNECTING...';
document.body.appendChild(_offlineBanner);
}
}
@@ -1775,7 +1775,7 @@
window.addEventListener('offline', () => {
document.body.classList.add('lt-is-offline');
_offlineGetBanner().classList.add('is-visible');
toast.warning('Connection lost — working offline');
toast.warning('Connection lost, working offline');
_offlineHandlers.forEach(fn => fn());
});
window.addEventListener('online', () => {
@@ -1791,7 +1791,7 @@
};
/* ================================================================
MODULE 42 — WEBSOCKET MANAGER
MODULE 42 - WEBSOCKET MANAGER
lt.ws.connect(url, opts)
opts: { protocols, onOpen, onMessage, onClose, onError,
reconnect: true, reconnectDelay: 2000, maxRetries: 10 }
@@ -1877,7 +1877,7 @@
};
/* ================================================================
MODULE 43 — MULTI-SELECT COMBOBOX
MODULE 43 - MULTI-SELECT COMBOBOX
lt.combobox.init(inputEl, options, opts)
options = [{ value, label, icon? }]
opts: { max, placeholder, onChange }
@@ -1991,7 +1991,7 @@
};
/* ================================================================
MODULE 44 — AUTOCOMPLETE / TYPEAHEAD
MODULE 44 - AUTOCOMPLETE / TYPEAHEAD
lt.typeahead.init(inputEl, source, opts)
source: array or async fn(query) => [{value, label, icon?, meta?}]
opts: { minChars, debounceMs, onSelect, maxResults }
@@ -2082,7 +2082,7 @@
};
/* ================================================================
MODULE 45 — COOKIE UTILITY
MODULE 45 - COOKIE UTILITY
lt.cookie.set(name, value, days?, opts?)
lt.cookie.get(name)
lt.cookie.del(name)
@@ -2113,7 +2113,7 @@
};
/* ================================================================
MODULE 46 — SPLIT PANE
MODULE 46 - SPLIT PANE
lt.splitPane.init(containerEl, opts)
opts: { minA, minB, initial (0-1), vertical, onResize }
================================================================ */
@@ -2187,7 +2187,7 @@
};
/* ================================================================
MODULE 48 — SIDEBAR SUBMENUS
MODULE 48 - SIDEBAR SUBMENUS
Auto-inits .lt-sidebar-group elements.
Click label → toggle .is-open + animate submenu.
================================================================ */
@@ -2218,7 +2218,7 @@
}
/* ================================================================
MODULE 49 — INFINITE SCROLL
MODULE 49 - INFINITE SCROLL
lt.infiniteScroll.init(containerEl, loadFn, opts)
loadFn: async fn() → { items: [], done: bool }
opts: { threshold (px from bottom), loadingClass, sentinelClass }
@@ -2284,7 +2284,7 @@
};
/* ================================================================
MODULE 49 — WIZARD / MULTI-STEP FORM
MODULE 49 - WIZARD / MULTI-STEP FORM
lt.wizard.init(containerEl, opts)
opts: { onStep(n, total), onComplete(data), validate(n) }
HTML: [data-wizard-step="1"] ... [data-wizard-nav]
@@ -2377,7 +2377,7 @@
};
/* ================================================================
MODULE 50 — SORTABLE (drag-to-reorder lists/kanban)
MODULE 50 - SORTABLE (drag-to-reorder lists/kanban)
lt.sortable.init(listEl, opts)
opts: { handle (selector), onSort(newOrder, movedEl), group }
Supports cross-list dragging when group matches.
@@ -2466,7 +2466,7 @@
};
/* ================================================================
MODULE 51 — COUNTDOWN / TIMER
MODULE 51 - COUNTDOWN / TIMER
lt.timer.countdown(el, targetDate, opts)
lt.timer.stopwatch(el, opts)
el = DOM element or selector; updates .textContent
@@ -2523,7 +2523,7 @@
};
/* ================================================================
MODULE 52 — IMAGE LIGHTBOX
MODULE 52 - IMAGE LIGHTBOX
lt.lightbox.init(selector, opts)
Clicking any matched image opens a full-screen overlay with
prev/next, keyboard nav, zoom.
@@ -2625,12 +2625,12 @@
};
/* ================================================================
MODULE 53 — AUTH / JWT HELPERS
MODULE 53 - AUTH / JWT HELPERS
Extends lt.api with token refresh support.
lt.auth.setToken(accessToken, refreshToken, expiresIn)
lt.auth.getToken()
lt.auth.refresh() — explicit refresh
lt.auth.onExpire(fn) — callback when token expires & refresh fails
lt.auth.refresh() - explicit refresh
lt.auth.onExpire(fn) - callback when token expires & refresh fails
lt.auth.clear()
Auto-intercepts lt.api calls to inject Bearer header
and silently refreshes when token is within 60s of expiry.
@@ -2688,7 +2688,7 @@
isExpiringSoon: (secs = 60) => _authExpiry > 0 && Date.now() >= _authExpiry - secs * 1000,
};
// Patch lt.api — auth-aware wrapper (renamed to avoid strict-mode duplicate declaration)
// Patch lt.api - auth-aware wrapper (renamed to avoid strict-mode duplicate declaration)
async function _apiFetchAuth(method, url, body) {
if (_authAccess && auth.isExpiringSoon()) await auth.refresh();
const opts = { method, headers: Object.assign({ 'Content-Type': 'application/json' }, csrfHeaders()) };
@@ -2716,7 +2716,7 @@
api.delete = (u, b) => _apiFetchAuth('DELETE', u, b);
/* ================================================================
MODULE 54 — MARKDOWN RENDERER
MODULE 54 - MARKDOWN RENDERER
lt.markdown.render(mdString) → HTML string (sanitized)
lt.markdown.init(selector) → renders all matching el's .textContent
Uses a built-in micro-renderer (no deps) for common syntax.
@@ -2746,12 +2746,12 @@
.replace(/\*(.+?)\*/g, '<em>$1</em>')
.replace(/__(.+?)__/g, '<strong>$1</strong>')
.replace(/_(.+?)_/g, '<em>$1</em>')
// Links — block javascript: and data: URIs
// Links - block javascript: and data: URIs
.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (_, text, url) => {
const safeUrl = /^(https?:\/\/|\/|#|\.\.?\/)/i.test(url) ? url : '#';
return `<a href="${safeUrl}" target="_blank" rel="noopener noreferrer">${escHtml(text)}</a>`;
})
// Images — block javascript: and data: URIs
// Images - block javascript: and data: URIs
.replace(/!\[([^\]]*)\]\(([^)]+)\)/g, (_, alt, src) => {
const safeSrc = /^(https?:\/\/|\/|\.\.?\/)/i.test(src) ? src : '';
return `<img src="${safeSrc}" alt="${escHtml(alt)}" style="max-width:100%">`;
@@ -2783,7 +2783,7 @@
};
/* ================================================================
MODULE 55 — PAGINATION
MODULE 55 - PAGINATION
lt.pagination.init(navEl, opts)
opts: { total, perPage, page, onChange(page) }
Renders page buttons inside navEl; re-renders on page change.
@@ -2875,7 +2875,7 @@
if (o.boot) {
const bootEl = document.getElementById('lt-boot');
if (bootEl) {
const name = o.bootName || bootEl.dataset.appName || document.title.split('—')[0].trim();
const name = o.bootName || bootEl.dataset.appName || document.title.split(' | ')[0].trim();
boot.run(name);
}
}