Radio footer, rules page, schedules editor (System timers and Claude tasks through signed runner jobs), account usage bar, usage explorer with a streamed usage.jsonl, queue Controls tab and override, running tasks on the board, stale task prune with the generic dial, greyed card stamps, commit-tree diffs from the runner preview, VS Code path links, expired asks and decisions that stay as EXPIRED cards (asks keyed by a call digest; an async PostToolUse hook closes those answered in the terminal), the Match refresh hourglass, attachments by paste, drop and paperclip in every text field (page CSP gains img-src blob: for the thumbnails) and the limits board with profiles and a passkey to loosen. Fixes: one red accept on a red-gate commit and no release while a risk is open, the send bar footer segments share one height, the mic button survives a redraw, new Match cards queue before the release card. E2E specs were still running at commit time (operator order); their failures follow as separate fixes. 🎯 Fix: 88 % 💥 Break: 8 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 81 🚦 Gate: ⛔ fix 88 % < 90, break 8 % > 5 (committed on the operator's word) Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
65 lines
2.2 KiB
JavaScript
65 lines
2.2 KiB
JavaScript
const Dial = (() => {
|
|
"use strict";
|
|
const SIZE = 140;
|
|
const RADIUS = 58;
|
|
const TICKS = 60;
|
|
|
|
/**
|
|
* @param value - a value on the dial, min to max.
|
|
* @param max - the value a full turn stands for.
|
|
* @param radius - how far from the centre.
|
|
* @returns the point [x, y] for that value, 0 and max at the top, clockwise.
|
|
*/
|
|
function point(value, max, radius) {
|
|
const angle = (value / max) * 2 * Math.PI;
|
|
const centre = SIZE / 2;
|
|
return [centre + Math.sin(angle) * radius, centre - Math.cos(angle) * radius];
|
|
}
|
|
|
|
/**
|
|
* @param value - any number.
|
|
* @param range - {min, max}: the dial's ends.
|
|
* @returns value rounded to a whole number and held between min and max.
|
|
*/
|
|
function clamp(value, range) {
|
|
return Math.max(range.min, Math.min(range.max, Math.round(value)));
|
|
}
|
|
|
|
/**
|
|
* @param degrees - the pointer's angle from the top, clockwise, in degrees.
|
|
* @param max - the value a full turn stands for.
|
|
* @returns the value at that angle, unrounded.
|
|
*/
|
|
function fromAngle(degrees, max) {
|
|
return ((degrees + 360) % 360) / (360 / max);
|
|
}
|
|
|
|
/**
|
|
* @param key - a KeyboardEvent key.
|
|
* @param value - the dial's value.
|
|
* @param options - {min, max, page}: the ends and the Page Up and Down step.
|
|
* @returns the value the key sets, held to the ends, or null for a key the dial ignores: the arrows step 1, Page Up and
|
|
* Down step page, Home and End go to min and max.
|
|
*/
|
|
function stepped(key, value, options) {
|
|
const steps = {ArrowRight: 1, ArrowUp: 1, ArrowLeft: -1, ArrowDown: -1, PageUp: options.page, PageDown: -options.page};
|
|
if (key in steps) {
|
|
return clamp(value + steps[key], options);
|
|
}
|
|
return key === "Home" ? options.min : key === "End" ? options.max : null;
|
|
}
|
|
|
|
/**
|
|
* @param page - every page-th tick is long.
|
|
* @returns the TICKS ticks of the face, each {at, long}: at its place on a turn of TICKS.
|
|
*/
|
|
function ticks(page) {
|
|
return Array.from({length: TICKS}, (_, at) => ({at, long: at % page === 0}));
|
|
}
|
|
|
|
return {SIZE, RADIUS, TICKS, point, clamp, fromAngle, stepped, ticks};
|
|
})();
|
|
if (typeof module === "object" && module.exports) {
|
|
module.exports = Dial;
|
|
}
|