${esc(err.message)}
`; - toast('Could not load detail: ' + err.message, true); + /* What went wrong, in words, and a way to try again (31 Oct: it said only "Failed / No live MCP + session"). The server's own message stays, smaller, for whoever reads the logs. */ + const offline = err.code === 'mcp_unavailable'; + el.detail.innerHTML = ` +${offline + ? "The console can't reach LuxAlgo's server right now, so this script's write-up and Pine source can't be fetched. Check the network — the console reconnects on its own." + : 'Something went wrong fetching it. Try again in a moment.'}
+${esc(err.message)}
+ `; + el.detail.querySelector('[data-detail-retry]')?.addEventListener('click', () => openResult(row, button)); + toast(offline ? 'LuxAlgo Library not connected — try again in a moment' : 'Could not load detail: ' + err.message, true); } } @@ -1236,7 +1250,8 @@ window.scriptPane = { skipping then meant Escape no longer closed the pane (measured 5 Oct, caught by an A/B run). */ function escapeKeydown(ev) { if (ev.key !== 'Escape') return; - const closed = (typeof window.closeDrawerIfOpen === 'function' && window.closeDrawerIfOpen()) + const closed = (typeof window.closePickerIfOpen === 'function' && window.closePickerIfOpen()) + || (typeof window.closeDrawerIfOpen === 'function' && window.closeDrawerIfOpen()) || (typeof window.closeScriptLayerIfOpen === 'function' && window.closeScriptLayerIfOpen()); if (closed) { ev.preventDefault(); return; } if (el.main && el.main.dataset.detail === 'on') { diff --git a/console/frontend/drawer.js b/console/frontend/drawer.js index c8c4ac1..f3e9c54 100644 --- a/console/frontend/drawer.js +++ b/console/frontend/drawer.js @@ -15,7 +15,7 @@ const SLICE = 60; /* rows painted at once; search still sees all 800 */ const st = { - open: false, q: '', family: '', shown: SLICE, + open: false, q: '', family: '', shown: SLICE, focus: -1, detail: false, /* the drawer's second view: the picked result (3 Oct) */ busy: '', /* slug currently running */ result: {}, /* slug → {ok, text} of its last run here */ @@ -55,6 +55,8 @@ return (indState.natives || []).map((n) => ({ slug: n.type, name: n.title, family: '__builtin', cluster: n.supported === false ? 'not supported here' : (n.present ? 'on chart' : ''), __native: true, present: n.present, supported: n.supported !== false, + /* what it is for (picker.js), so a search for "overbought" or "trailing stop" finds it */ + description: ti().purpose ? ti().purpose({ native: true, slug: n.type }) : '', })); } @@ -91,6 +93,7 @@ + chip('__fav', '★ Favourites', favN) + groups.filter((g) => !q || n(g.key) > 0 || st.family === g.key) .map((g) => chip(g.key, g.name, q ? n(g.key) : g.count)).join(''); + markMore(); } /* What is on the chart, by name — the landasan's own list. The row that matches says so and its @@ -100,22 +103,29 @@ return names.map((n) => String(n).trim().toLowerCase()); } + const ti = () => window.taIndicators || {}; + const toneOf = (key) => (ti().tone ? ti().tone(key) : 'var(--lx-fg-muted)'); + const mark = (text) => (ti().highlight ? ti().highlight(text, st.q) : esc(text)); + function rowHtml(r, i, on) { const starred = !r.__native && isFavourite('library', r.slug); const res = st.result[r.slug]; const running = st.busy === r.slug; const isOn = !r.__native && on.includes(String(r.name || r.slug).trim().toLowerCase()); - const meta = r.__native ? ['built-in', r.cluster].filter(Boolean).join(' · ') - : [famLabel(r.family || 'unfiled'), r.cluster].filter(Boolean).join(' · '); + /* The family is a coloured tag (the same hue in both views); the cluster stays plain text. */ + const tag = r.__native + ? 'Built-in' + : `${esc(famLabel(r.family || 'unfiled'))}`; + const meta = [r.cluster].filter(Boolean).join(' · '); /* 160 is not a taste: it is the width the boot warmer caches (server.py WARM_WIDTH), and test_preview_cache pins the two numbers together. A mismatch is not a smaller picture — it is every open paying S3 for all sixty rows (measured 15 Oct: 2.7 s to fill the first screen). */ - return `