Files
skills/orchestrator/templates/page-legend.js
T
Kevin Veen-BirkenbachandClaude Opus 5.5 6323f087bc feat(orchestrator): hub page for requirements 085 to 099
085 calm Match deck: no header hourglass, centred bare empty state, the
release card as a deck card (Cancel, Skip, Release), fixed card height.
086 motion: vanish() fade everywhere with a lint test, view transitions,
a lub-dub heartbeat for working objects, confetti that lands and fades.
087 time readout under the pivot of every analog clock.
088 prune dialog grouped by prefix with tri-state boxes, search, stepper
and sticky footer.
089 one-row task toolbar with Filter and Actions menus and a filter chip.
090 card border by state colour with a soft glow and owner avatars.
091 draggable limit lines with staged changes and one Save, a Limits menu
with the matrix, View toggles, the GPU cause in its tooltip.
093 request chips Open, Expired, Stale, Failed, All and a signed Delete.
094 closed cards leave the deck within 5 s; open in Claude stamps.
095 compact agent message box with Post/Call, attach, mic and Send in
the field.
096 Reject on an expired card drops it silently as Drop (expired).
097 Show filter in Match's right-click menu.
098 docked speech bubbles carry the speaker's avatar and a skip button.
099 Match card headlines cut to 120 characters with the full title in
the tooltip; the code box keeps the whole command.
tests/test_hub_path_links.py: a unicode fixture without German.

Full make test green through the queue (2605 tests, ruff, shellcheck,
markdownlint). Gate missed on the operator's word: break 7 %, the E2E
specs (13 new, 15 updated) run next.

🎯 Fix: 92 %
💥 Break: 7 %
💸 Tokens: –
⏱️ Velocity: –
🛡️ Security: 100 %
🏆 Score: 86
🚦 Gate: ⛔ break 7 % > 5

Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 01:47:41 +00:00

96 lines
3.4 KiB
JavaScript

const LEGEND_PARTS = ".legend, .res-legend, .home-metric > .legend-chips";
const LEGEND_PATHS = {view: "legend.views", tile: "legend.tiles"};
const legendView = {buttons: new WeakMap()};
const legendShown = (path, key) => ViewStore.get(path)[key] !== false;
function legendToggle(path, key) {
const show = !legendShown(path, key);
ViewStore.update(path, (flags) => {
const next = {...flags};
delete next[key];
return show ? next : {...next, [key]: false};
});
}
function legendButton(path, key) {
const button = iconBtn("bi-info-circle", "Legend", "btn small ghost legend-toggle", (event) => {
event.stopPropagation();
legendToggle(path, key);
});
button.dataset.legendKey = key;
button.addEventListener("pointerdown", (event) => event.stopPropagation());
return button;
}
function paintLegend(owner, button, shown) {
const state = shown ? "shown" : "hidden";
if (owner.dataset.legend !== state) {
owner.dataset.legend = state;
}
if (button.getAttribute("aria-pressed") !== String(shown)) {
button.setAttribute("aria-pressed", String(shown));
button.title = `Legend: ${shown ? "shown, press to hide it" : "hidden, press to show it"}`;
}
}
/**
* @param owner - a panel of a view or a Home tile.
* @param path - the view-store key of its kind, legend.views or legend.tiles.
* @param key - its panel id or pin key there.
* @param place - (button) => void putting the button in its spot, or null when the owner holds no legend.
*/
function legendFor(owner, path, key, place) {
const made = legendView.buttons.get(owner);
if (!place) {
if (made) {
vanish(made);
legendView.buttons.delete(owner);
}
if (owner.dataset.legend) {
delete owner.dataset.legend;
}
return;
}
const button = made && made.dataset.legendKey === key ? made : legendButton(path, key);
legendView.buttons.set(owner, button);
place(button);
paintLegend(owner, button, legendShown(path, key));
}
const ownOf = (host, selector) => [...host.querySelectorAll(selector)].find((node) => node.closest(Panels.HOSTS) === host) || null;
function legendSlot(host) {
const own = ownOf(host, "[data-legend-slot]") || [...host.children].find((child) => child.classList.contains("legend-row"));
if (own) {
return own;
}
const row = h("div", {class: "legend-row"});
host.prepend(row);
return row;
}
function markLegends() {
for (const host of document.querySelectorAll("#main [data-panel]")) {
if (host.closest(".home-tile")) {
continue;
}
const slot = ownOf(host, LEGEND_PARTS) ? legendSlot(host) : null;
legendFor(host, LEGEND_PATHS.view, host.dataset.panel, slot ? (button) => slot.lastElementChild !== button && slot.append(button) : null);
}
for (const tile of document.querySelectorAll(".home-tile[data-pin]")) {
const open = tile.querySelector(".home-open");
legendFor(tile, LEGEND_PATHS.tile, tile.dataset.pin, tile.querySelector(`.home-body :is(${LEGEND_PARTS})`) ? (button) => open.previousElementSibling !== button && open.before(button) : null);
}
}
function legendBoot() {
new MutationObserver(markLegends).observe(document.body, {childList: true, subtree: true});
ViewStore.on("legend", () => {
markLegends();
drawHome();
drawResources();
});
markLegends();
}