Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions app/static/builder/command-builder.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 3 additions & 18 deletions app/static/builder/command-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,25 +210,10 @@
const r = () => recipe;
const store = recipeStore({request: (...a) => nulliusFetch(...a), csrf: schema.csrf, storage: (() => { try { return localStorage; } catch { return {length: 0}; } })()});
let saved = [];
// A message is a toast at the bottom right: a new one replaces it, its bar runs down and it goes, or its × closes it.
// Shown again on each message, so it lands above a dialog opened since.
// A message is the shared toast (nulliusNotify), stacked with the page's others; a new one replaces the builder's last.
const status = text => {
text = [text, ...loadNotes.splice(0)].filter(Boolean).join(' ');
const t = $('#nb-status'), bar = t && t.querySelector('.nb-toast-bar');
if (!t) return;
const show = on => {
if (t.showPopover) { if (t.matches(':popover-open')) t.hidePopover(); if (on) t.showPopover(); }
else t.hidden = !on;
};
if (!t.dataset.wired) {
t.dataset.wired = '1';
t.querySelector('.nb-toast-close').addEventListener('click', () => show(false));
bar.addEventListener('animationend', () => show(false));
}
if (!text) { show(false); return; }
show(true);
t.querySelector('.nb-toast-text').textContent = text;
bar.style.animation = 'none'; void bar.offsetWidth; bar.style.animation = '';
if (text) window.nulliusNotify?.(text, {key: 'builder'});
};
const button = (label,attrs='',cls='nb-button') => `<button type="button" class="${cls}" ${attrs}>${label}</button>`;
// Which Harbor runs this recipe: the one it pins (Runner step), or a
Expand Down Expand Up @@ -1368,7 +1353,7 @@
}catch(e){say('✕ '+e,'nb-error');b.disabled=false;}
}
// The button says it is reading until the answer's toast replaces it: a toast alone would be gone before a slow answer.
async function refreshRegistry(){const b=$('#nb-refresh'),label=b.textContent;b.disabled=true;b.classList.add('nb-loading');b.setAttribute('aria-busy','true');b.textContent='Reading Harbor’s catalogue…';status('');try{const response=await nulliusFetch('/new-run/registry');if(!response.ok)throw Error();const data=await response.json(),names=[...new Set([...schema.datasets.map(d=>d.registry),...schema.seenRegistry,...(data.names||[]),...(data.hub||[])])].filter(Boolean);$('#nb-registry').innerHTML=names.map(n=>`<option value="${esc(n)}"></option>`).join('');status(names.length+' catalogue references available. You can also enter one directly.');}catch{status('Catalogue refresh unavailable. Existing references and custom entry still work.');}finally{if(b.isConnected){b.disabled=false;b.classList.remove('nb-loading');b.removeAttribute('aria-busy');b.textContent=label;}}}
async function refreshRegistry(){const b=$('#nb-refresh'),label=b.textContent;b.disabled=true;b.classList.add('nb-loading');b.setAttribute('aria-busy','true');b.textContent='Reading Harbor’s catalogue…';try{const response=await nulliusFetch('/new-run/registry');if(!response.ok)throw Error();const data=await response.json(),names=[...new Set([...schema.datasets.map(d=>d.registry),...schema.seenRegistry,...(data.names||[]),...(data.hub||[])])].filter(Boolean);$('#nb-registry').innerHTML=names.map(n=>`<option value="${esc(n)}"></option>`).join('');status(names.length+' catalogue references available. You can also enter one directly.');}catch{status('Catalogue refresh unavailable. Existing references and custom entry still work.');}finally{if(b.isConnected){b.disabled=false;b.classList.remove('nb-loading');b.removeAttribute('aria-busy');b.textContent=label;}}}
function completeDirectory(value){clearTimeout(pendingDirs);const seq=++dirsSequence;pendingDirs=setTimeout(async()=>{try{const response=await nulliusFetch('/new-run/dirs?path='+encodeURIComponent(value));if(!response.ok)return;const data=await response.json();if(seq===dirsSequence)$('#nb-paths').innerHTML=(data.dirs||[]).map(p=>`<option value="${esc(p)}"></option>`).join('');}catch{}},180);}
// Start over (startOver): Escape outside a dialog is Keep it; another recipe taking the page's place (a load, an import,
// the other runner's) drops the question
Expand Down
2 changes: 1 addition & 1 deletion app/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1759,7 +1759,7 @@ pre.instruction { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 32

.origin-tag.benchmark { color: var(--text-dim); background: color-mix(in srgb, var(--text-faint) 16%, transparent); }

/* A notice (flash) as a toast at the bottom right, as the builder's. */
/* A notice (flash) as a toast at the bottom right. */
.toasts { position: fixed; inset: auto 16px 16px auto; margin: 0; padding: 0; border: 0; background: transparent; width: max-content; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 32px)); }
.toast { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 10px 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 13px; box-shadow: 0 12px 32px #0005; overflow: hidden; }
.toast.bad { border-color: color-mix(in srgb, var(--bad) 55%, var(--border)); }
Expand Down
2 changes: 1 addition & 1 deletion app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
{% if not embedded %}
<script src="{{ url_for('static', filename='onboarding.js') }}" data-state="{{ url_for('onboarding_state') }}" data-tour="{{ onb_tour|tojson|forceescape }}"></script>
{% endif %}
{#- Every notice a page is sent (Flask's flash) is a toast at the bottom left, as the builder's: it goes after a
{#- Every notice a page is sent (Flask's flash) is a toast at the bottom right: it goes after a
few seconds - an error after twice as many - its bar counting them, paused while pointed at, or on its close. #}
{% set notices = get_flashed_messages(with_categories=true) %}
{% if notices %}
Expand Down
5 changes: 1 addition & 4 deletions app/templates/builder/new_run.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
<input type="file" accept=".json,application/json" id="nb-import-file" hidden aria-label="Import a recipe JSON file">
{% endset %}
{{ page_head('Set up the next experiment.', actions=actions) }}
{#- a message is a toast at the bottom left.
A popover, so it shows above the Saved recipes dialog too -#}
<div id="nb-status" class="nb-toast" role="status" aria-live="polite" popover="manual"><span class="nb-toast-text"></span><button type="button" class="nb-toast-close" aria-label="Dismiss"><svg class="ic" aria-hidden="true"><use href="#i-x"/></svg></button><span class="nb-toast-bar" aria-hidden="true"></span></div>
<nav class="nb-steps" aria-label="Recipe sections"></nav>
<dialog id="nb-saved" class="nb-dialog nb-saved" aria-labelledby="nb-saved-title">
<div class="nb-dialoghead"><h2 id="nb-saved-title">Saved recipes</h2><button type="button" class="nb-dialogclose" id="nb-saved-close" aria-label="Close"><svg class="ic" aria-hidden="true"><use href="#i-x"/></svg></button></div>
<div id="nb-saved-list"></div>
Expand Down Expand Up @@ -53,7 +51,6 @@ <h2 id="nb-save-title">Give this recipe a name.</h2>
{{ tasks_state('tasks', true) }}
<section class="bench-section tasks-browse" aria-label="Tasks">{{ tasks_list('tasks') }}</section>
</article></template>
<nav class="nb-steps" aria-label="Recipe sections"></nav>
<div class="nb-layout">
<section class="nb-editor" aria-label="Recipe configuration">
<div id="nb-form"></div>
Expand Down