diff options
Diffstat (limited to 'modules/ext/ui-cockpit.js')
| -rw-r--r-- | modules/ext/ui-cockpit.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/ext/ui-cockpit.js b/modules/ext/ui-cockpit.js index 92dd60b..73fbe9f 100644 --- a/modules/ext/ui-cockpit.js +++ b/modules/ext/ui-cockpit.js @@ -62,6 +62,7 @@ body[data-ui-mode="cockpit"] #ui-root { display: grid; grid-template-rows: 1fr 1 defs.forEach((d, i) => { const pane = api.el('div', { class: 'pane' }); pane.dataset.pane = String(i + 1); + pane.tabIndex = -1; // so F1-F8 can actually move focus, not just scroll const h = api.el('h5'); h.appendChild(api.el('span', { text: 'F' + (i + 1) + ' ' + d.label })); h.appendChild(api.el('span', { class: 'n' })); @@ -85,7 +86,9 @@ body[data-ui-mode="cockpit"] #ui-root { display: grid; grid-template-rows: 1fr 1 // Generation guard: eight async captures per tick at 5s — a tick can outlive teardown. let gen = 0; const refresh = async () => { - const my = ++gen; + // Same as workspace: bumping per tick cancelled a slow run before the later panes were + // written, leaving them at "…" indefinitely. + const my = gen; for (const d of defs) { try { const text = await api.capture(d.cmd); @@ -117,6 +120,7 @@ body[data-ui-mode="cockpit"] #ui-root { display: grid; grid-template-rows: 1fr 1 if (idx === 5) { refresh(); return; } // F5 = refresh, as labelled const pane = panes.querySelector('[data-pane="' + idx + '"]'); if (!pane) return; + if (pane.focus) pane.focus(); pane.scrollIntoView({ block: 'nearest' }); pane.style.outline = '1px solid var(--accent-color)'; setTimeout(() => { pane.style.outline = ''; }, 900); |