dr-sandbox/app/web/static/compare.js
Michael Pilosov 9b178dad38 runs: filter chips + compare selection up to 8
- /compare accepts ?stem=…&stem=… (repeated) for 2-8 runs; legacy ?a=&b=
  still works. compare.js parses multi-stem; template drops stem_a/_b
  data attrs that were unused.
- compare-select.js: MAX bumped to 8, button enables at 2-8 selected.
  URL emitted as ?stem=… per selection.
- runs list gets a dataset/algorithm chip filter bar above #runs-slot
  (pattern ported from metrics.js). Chips reflect the union of values in
  the current list; selection state persists across htmx swaps. Non-
  matching rows get .filtered-out (display:none).
- _runs.html li now carries data-embedder/data-generator so the filter
  can key on them.
2026-04-22 16:41:06 -06:00

16 lines
532 B
JavaScript

// compare.js — thin shim that parses ?stem=…&stem=… (legacy ?a=&b=) and
// hands off to panel-grid.js.
import { mountPanels } from './panel-grid.js?v=1';
const params = new URLSearchParams(window.location.search);
let stems = params.getAll('stem').filter(Boolean);
if (stems.length === 0) {
stems = [params.get('a') || '', params.get('b') || ''].filter(Boolean);
}
const host = document.getElementById('panel-host');
const controls = document.getElementById('compare-controls');
mountPanels({ host, controls, stems });