feat(match): merge and commit-tree previews, Match motion and Home tile
The host runner computes a merge preview for each operator row that merges or commits and posts it to the runner-only /api/runner/previews, and an ask of git commit ships the staged commit tree; Match cards show what the merge brings in onto HEAD, or why no preview exists. Cards fly off with their verdict stamp unless reduced motion is set, Match gets its own button in Tasks and a Home tile that keeps the live stack, and the 3D graph and the faces fix land with it. 🎯 Fix: 85 % 💥 Break: 10 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 77 🚦 Gate: ⛔ fix 85 % < 90, break 10 % > 5 Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
96d4d2933c
commit
78f2fec339
19 files changed
+692
-90
No files matched your search
@@ -88,7 +88,7 @@ const Faces = (() => {
|
||||
return {pick, parts};
|
||||
}
|
||||
|
||||
return {SIZE, COUNTS, COMBINATIONS, of};
|
||||
return {SIZE, COUNTS, COMBINATIONS, of, hash};
|
||||
})();
|
||||
if (typeof module === "object" && module.exports) {
|
||||
module.exports = Faces;
|
||||
|
||||
@@ -10,7 +10,7 @@ const Nav = (() => {
|
||||
home: "bi-house-door", stream: "bi-activity", inbox: "bi-inbox", rules: "bi-card-checklist", agents: "bi-people", artifacts: "bi-git", tasks: "bi-list-check",
|
||||
orbit: "bi-globe2", chord: "bi-bezier2", swimlane: "bi-bar-chart-steps", tree: "bi-diagram-3", "3d": "bi-badge-3d", hierarchy: "bi-diagram-2",
|
||||
list: "bi-list-task", board: "bi-kanban", rasci: "bi-grid-3x3", gantt: "bi-calendar-range", burn: "bi-graph-down-arrow",
|
||||
resources: "bi-speedometer2",
|
||||
resources: "bi-speedometer2", match: "bi-stack",
|
||||
};
|
||||
const OLD = {graph: ["agents", "orbit"], tree: ["artifacts", "tree"]};
|
||||
const viewsOf = (screen) => (screen === "tasks" ? TASK_VIEWS : [...VIEWS, ...(OWN[screen] || [])]);
|
||||
|
||||
@@ -424,10 +424,10 @@
|
||||
place(data.nodes, layout);
|
||||
g3.badges = new Map();
|
||||
g3.faces = new Set();
|
||||
g3.graph.width(box.clientWidth).height(box.clientHeight).graphData(data);
|
||||
drawPlanes(layout, data.nodes);
|
||||
const words = `${data.nodes.length} nodes · ${data.links.length} edges · ${LAYOUTS.find(([id]) => id === layout)[1]}${calm.matches ? " · without motion (prefers-reduced-motion)" : ""}`;
|
||||
host.replaceChildren(box, h("div", {class: "space-note"}, words));
|
||||
g3.graph.width(box.clientWidth).height(box.clientHeight).graphData(data);
|
||||
drawPlanes(layout, data.nodes);
|
||||
window.requestAnimationFrame(() => g3.host === host && g3.fit && fit3d(0));
|
||||
}
|
||||
|
||||
|
||||
@@ -180,6 +180,7 @@
|
||||
Panels.panel("artifacts/tree", "Artifacts: tree", () => homeTree(() => h("div", {class: "repos"}, treeCards("", true).nodes)));
|
||||
Panels.panel("agents/order", "Agents: priority", homeOrder);
|
||||
Panels.panel("tasks/operator", "Tasks: Waits on Operator", homeInbox);
|
||||
Panels.panel("tasks/match", "Tasks: Match", () => homeMatch(), "", [6, 8]);
|
||||
Panels.item("metric", (id, view) => metricTitle(view), (size, id, view) => homeMetric(id, view));
|
||||
Panels.capture("resources-hardware", () => resourcePin("hardware"));
|
||||
Panels.capture("resources-tokens", () => resourcePin("tokens"));
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
const SWIPE_SHARE = 0.25;
|
||||
const SWIPE_UP = 80;
|
||||
const FEEDBACK_LIMIT = 2000;
|
||||
const matchView = {cards: null, order: [], marks: new Map(), opened: new Map(), decisions: new Map(), overview: false, front: null, drag: null, dom: null, sig: "", fetched: 0, loading: false, press: null};
|
||||
const FLY_MS = 400;
|
||||
const CONFETTI = 28;
|
||||
const matchView = {cards: null, order: [], marks: new Map(), opened: new Map(), decisions: new Map(), overview: false, front: null, drag: null, dom: null, sig: "", fetched: 0, loading: false, press: null, flying: false, openBefore: 0};
|
||||
|
||||
async function fetchMatch() {
|
||||
if (matchView.loading) {
|
||||
@@ -68,10 +70,12 @@
|
||||
return h("tr", {class: "match-mark", "data-line": mark.line}, h("td", {colspan: columns}, icon("bi-chat-square-text"), h("span", {class: "match-mark-text"}, revealed(mark.comment))));
|
||||
}
|
||||
|
||||
const patched = (card) => card.kind === "commit" || Boolean(card.merge);
|
||||
|
||||
function matchFileRows(card, file) {
|
||||
const commit = card.kind === "commit";
|
||||
const rows = commit ? (file.patch ? Diffs.rows(file.patch).map(patchRow) : []) : file.state === "read" ? contentRows(file.content) : [];
|
||||
const columns = commit ? 4 : 2;
|
||||
const diffed = patched(card);
|
||||
const rows = diffed ? (file.patch ? Diffs.rows(file.patch).map(patchRow) : []) : file.state === "read" ? contentRows(file.content) : [];
|
||||
const columns = diffed ? 4 : 2;
|
||||
const marks = marksOf(card).filter((mark) => mark.path === file.path);
|
||||
return rows.flatMap((row) => {
|
||||
const line = row.dataset.line;
|
||||
@@ -86,7 +90,7 @@
|
||||
function fileHead(card, file) {
|
||||
const count = marksOf(card).filter((mark) => mark.path === file.path).length;
|
||||
const marks = count ? h("span", {class: "match-marks", title: `${count} marks`}, String(count)) : null;
|
||||
if (card.kind === "commit") {
|
||||
if (patched(card)) {
|
||||
const tone = DIFF_TONES[file.status] || "neutral";
|
||||
const stat = file.status === "B" ? icon("bi-file-earmark-binary") : h("span", {class: "stat"}, h("span", {class: "add"}, `+${file.additions}`), h("span", {class: "del"}, `-${file.deletions}`));
|
||||
return h("summary", {class: "diff-head"}, h("span", {class: "letter", "data-tone": tone}, file.status), h("code", {class: "path"}, revealed(file.path)), h("span", {class: "spacer"}),
|
||||
@@ -100,8 +104,8 @@
|
||||
function fileBlock(card, file, index) {
|
||||
const opened = matchView.opened.has(card.id) ? matchView.opened.get(card.id).has(file.path) : index === 0;
|
||||
const rows = matchFileRows(card, file);
|
||||
const table = rows.length ? h("div", {class: "diff-scroll"}, h("table", {class: "diff"}, h("tbody", {}, rows))) : h("p", {class: "muted"}, card.kind === "commit" ? "No patch shipped for this file." : "Not read.");
|
||||
const block = h("details", {class: "match-file", "data-path": file.path, "data-state": card.kind === "command" ? file.state : null, open: opened}, fileHead(card, file), table);
|
||||
const table = rows.length ? h("div", {class: "diff-scroll"}, h("table", {class: "diff"}, h("tbody", {}, rows))) : h("p", {class: "muted"}, patched(card) ? "No patch shipped for this file." : "Not read.");
|
||||
const block = h("details", {class: "match-file", "data-path": file.path, "data-state": patched(card) ? null : file.state, open: opened}, fileHead(card, file), table);
|
||||
block.addEventListener("toggle", () => remember(card, block));
|
||||
return h("li", {}, block);
|
||||
}
|
||||
@@ -202,19 +206,25 @@
|
||||
if (card.kind !== "command") {
|
||||
return null;
|
||||
}
|
||||
const merge = card.merge;
|
||||
const short = (oid) => oid.slice(0, 12);
|
||||
const preview = merge ? h("p", {class: "match-merge", "data-error": String(Boolean(merge.error))}, icon(merge.error ? "bi-exclamation-triangle" : "bi-sign-merge-left"),
|
||||
merge.error ? `No merge preview: ${merge.error}` : `Brings in ${short(merge.base)} → ${short(merge.target)}, onto HEAD ${short(merge.head)}`) : null;
|
||||
return h("section", {class: "match-payload"},
|
||||
h("pre", {class: "match-command"}, h("code", {}, revealed(card.command))),
|
||||
h("p", {class: "match-directory"}, revealed(card.directory)),
|
||||
card.reason && card.reason !== "-" ? h("p", {class: "match-reason"}, revealed(card.reason)) : null);
|
||||
card.reason && card.reason !== "-" ? h("p", {class: "match-reason"}, revealed(card.reason)) : null, preview);
|
||||
}
|
||||
|
||||
function matchCard(card) {
|
||||
const files = card.files || [];
|
||||
const list = files.length ? h("ol", {class: "match-files", "aria-label": `Files: ${files.length}`}, files.map((file, index) => fileBlock(card, file, index))) : h("p", {class: "muted"}, card.kind === "commit" ? "No diff shipped with this stage." : "Its command names no file.");
|
||||
const none = card.kind === "commit" ? "No diff shipped with this stage." : card.merge ? (card.merge.error ? "No diff to show." : "The merge brings no change.") : "Its command names no file.";
|
||||
const list = files.length ? h("ol", {class: "match-files", "aria-label": `Files: ${files.length}`}, files.map((file, index) => fileBlock(card, file, index))) : h("p", {class: "muted"}, none);
|
||||
const body = h("div", {class: "match-body"}, matchCommand(card), list);
|
||||
body.addEventListener("scroll", () => openOnScroll(body, ".match-file"), {passive: true});
|
||||
const article = h("article", {class: "card match-card front", "data-card": card.id, "data-kind": card.kind, "data-stale": String(Boolean(card.stale)), "aria-label": `${card.kind} card of ${card.agent || "an agent"}`},
|
||||
matchHead(card), body);
|
||||
article.style.setProperty("--agent-hue", String(Faces.hash(card.agent) % 360));
|
||||
markable(article, card);
|
||||
window.setTimeout(() => openOnScroll(body, ".match-file"), 0);
|
||||
return article;
|
||||
@@ -236,9 +246,51 @@
|
||||
return marksOf(card).map((mark) => `${mark.path}:${mark.line}: ${mark.comment}`).join("\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} verdict accept, reject or later: the way the front card flies off, its stamp shown on the way.
|
||||
* @param {Function} then runs once the card is gone; at once without a front card or under reduced motion, never
|
||||
* while another card still flies.
|
||||
*/
|
||||
function flyOff(verdict, then) {
|
||||
const front = matchView.dom && matchView.dom.stack.querySelector(".match-card.front");
|
||||
if (matchView.flying) {
|
||||
return;
|
||||
}
|
||||
if (!front || window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
||||
then();
|
||||
return;
|
||||
}
|
||||
matchView.flying = true;
|
||||
let landed = false;
|
||||
const land = () => {
|
||||
if (!landed) {
|
||||
landed = true;
|
||||
matchView.flying = false;
|
||||
then();
|
||||
}
|
||||
};
|
||||
front.dataset.leaning = verdict;
|
||||
front.dataset.fly = verdict;
|
||||
front.addEventListener("animationend", (event) => event.target === front && land());
|
||||
window.setTimeout(land, FLY_MS);
|
||||
}
|
||||
|
||||
function decide(card, verdict, feedback) {
|
||||
matchView.decisions.set(cardKey(card), {verdict, feedback});
|
||||
drawMatch(true);
|
||||
flyOff(verdict, () => {
|
||||
matchView.decisions.set(cardKey(card), {verdict, feedback});
|
||||
drawMatch(true);
|
||||
});
|
||||
}
|
||||
|
||||
function confetti() {
|
||||
return h("div", {class: "match-confetti", "aria-hidden": "true"}, Array.from({length: CONFETTI}, (_, index) => {
|
||||
const bit = h("i", {});
|
||||
bit.style.setProperty("--x", `${(index * 37) % 100}%`);
|
||||
bit.style.setProperty("--c", String((index * 47) % 360));
|
||||
bit.style.setProperty("--r", `${(index % 2 ? 1 : -1) * (180 + index * 23)}deg`);
|
||||
bit.style.setProperty("--d", `${(index % 7) * 0.06}s`);
|
||||
return bit;
|
||||
}));
|
||||
}
|
||||
|
||||
function acceptCard(card) {
|
||||
@@ -264,8 +316,10 @@
|
||||
}
|
||||
|
||||
function laterCard(card) {
|
||||
matchView.order = [...matchView.order.filter((id) => id !== card.id), card.id];
|
||||
drawMatch(true);
|
||||
flyOff("later", () => {
|
||||
matchView.order = [...matchView.order.filter((id) => id !== card.id), card.id];
|
||||
drawMatch(true);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -275,7 +329,7 @@
|
||||
*/
|
||||
function matchKey(key) {
|
||||
const card = matchView.front;
|
||||
if (!card || !matchView.dom || !matchView.dom.stack.isConnected) {
|
||||
if (!card || ui.screen !== "match" || !matchView.dom || !matchView.dom.stack.isConnected) {
|
||||
return false;
|
||||
}
|
||||
const act = {ArrowRight: acceptCard, ArrowLeft: rejectCard, ArrowUp: laterCard}[key];
|
||||
@@ -291,8 +345,10 @@
|
||||
const drag = matchView.drag;
|
||||
if (drag && drag.id === event.pointerId) {
|
||||
const [dx, dy] = [event.clientX - drag.x, event.clientY - drag.y];
|
||||
const up = -dy > Math.abs(dx);
|
||||
article.style.transform = `translate(${dx}px, ${Math.min(0, dy)}px) rotate(${dx / 40}deg)`;
|
||||
article.dataset.leaning = dx > 0 ? "accept" : dx < 0 ? "reject" : "";
|
||||
article.dataset.leaning = up ? "later" : dx > 0 ? "accept" : dx < 0 ? "reject" : "";
|
||||
article.style.setProperty("--lean", String(Math.min(1, up ? -dy / SWIPE_UP : Math.abs(dx) / (SWIPE_SHARE * article.getBoundingClientRect().width))));
|
||||
}
|
||||
};
|
||||
const release = (event) => {
|
||||
@@ -301,18 +357,18 @@
|
||||
return;
|
||||
}
|
||||
drag.end();
|
||||
article.style.removeProperty("transform");
|
||||
delete article.dataset.leaning;
|
||||
const [dx, dy] = [event.clientX - drag.x, event.clientY - drag.y];
|
||||
const far = SWIPE_SHARE * article.getBoundingClientRect().width;
|
||||
if (event.type === "pointercancel" || !article.isConnected) {
|
||||
const swiped = event.type === "pointercancel" ? "" : Math.abs(dx) >= far && Math.abs(dx) > Math.abs(dy) ? (dx > 0 ? "accept" : "reject") : -dy >= SWIPE_UP && -dy > Math.abs(dx) ? "later" : "";
|
||||
article.style.removeProperty("--lean");
|
||||
if (!((swiped === "accept" && !card.stale) || swiped === "later")) {
|
||||
article.style.removeProperty("transform");
|
||||
delete article.dataset.leaning;
|
||||
}
|
||||
if (!article.isConnected) {
|
||||
return;
|
||||
}
|
||||
if (Math.abs(dx) >= far && Math.abs(dx) > Math.abs(dy)) {
|
||||
(dx > 0 ? acceptCard : rejectCard)(card);
|
||||
} else if (-dy >= SWIPE_UP && -dy > Math.abs(dx)) {
|
||||
laterCard(card);
|
||||
}
|
||||
({accept: acceptCard, reject: rejectCard, later: laterCard}[swiped] || (() => null))(card);
|
||||
};
|
||||
head.addEventListener("pointerdown", (event) => {
|
||||
if (event.button !== 0 || matchView.drag || (event.target instanceof Element && event.target.closest("button, a, input, textarea, select"))) {
|
||||
@@ -422,9 +478,26 @@
|
||||
matchView.drag.end();
|
||||
}
|
||||
const bar = h("div", {class: "card controls task-toolbar", role: "toolbar", "aria-label": "Match"}, h("strong", {}, icon("bi-stack"), "Match"), count, h("span", {class: "spacer"}), decisions,
|
||||
iconBtn("bi-list-check", "Tasks", "btn small soft", () => go("tasks", null), "Tasks: back to the task list"));
|
||||
iconBtn("bi-list-check", "Tasks", "btn small soft", () => go("tasks", null), "Tasks: back to the task list"), h("span", {"data-star-slot": ""}));
|
||||
fetchMatch();
|
||||
return h("div", {class: "graph tasks match"}, bar, stack);
|
||||
return h("div", {class: "graph tasks match", "data-panel": "tasks/match"}, bar, stack);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Element} the Match stack for a Home tile, kept while it still holds the live stack, without the
|
||||
* data-panel and star slot of the screen.
|
||||
*/
|
||||
function homeMatch() {
|
||||
const kept = homeView.hosts.get("tasks/match");
|
||||
if (kept && matchView.dom && kept.contains(matchView.dom.stack)) {
|
||||
return kept;
|
||||
}
|
||||
const host = h("div", {class: "match-home"}, matchScreen());
|
||||
host.querySelectorAll("[data-panel]").forEach((node) => node.removeAttribute("data-panel"));
|
||||
host.querySelectorAll("[data-star-slot]").forEach((node) => node.removeAttribute("data-star-slot"));
|
||||
homeView.hosts.set("tasks/match", host);
|
||||
window.setTimeout(() => drawMatch(true), 0);
|
||||
return host;
|
||||
}
|
||||
|
||||
function drawMatch(force) {
|
||||
@@ -454,6 +527,8 @@
|
||||
return;
|
||||
}
|
||||
matchView.sig = sig;
|
||||
const cleared = matchView.openBefore > 0 && !open.length;
|
||||
matchView.openBefore = open.length;
|
||||
dom.count.textContent = open.length === 1 ? "1 card waits" : `${open.length} cards wait`;
|
||||
dom.tally.textContent = String(matchView.decisions.size);
|
||||
dom.decisions.hidden = !matchView.decisions.size || shownOverview;
|
||||
@@ -464,14 +539,20 @@
|
||||
}
|
||||
if (shownOverview) {
|
||||
matchView.front = null;
|
||||
dom.stack.replaceChildren(overview(cards, open.length));
|
||||
const shown = overview(cards, open.length);
|
||||
if (cleared) {
|
||||
shown.prepend(confetti());
|
||||
}
|
||||
dom.stack.replaceChildren(shown);
|
||||
return;
|
||||
}
|
||||
const [front, ...rest] = open;
|
||||
matchView.front = front;
|
||||
const accept = h("button", {type: "button", class: "btn match-accept", disabled: Boolean(front.stale), ...named("Accept", front.stale ? `Accept: refused while the card is stale (${front.stale_reason})` : "Accept (right arrow, swipe right)"), on: {click: () => acceptCard(front)}}, icon("bi-check-lg"));
|
||||
const reject = h("button", {type: "button", class: "btn match-reject", ...named("Reject", "Reject with feedback (left arrow, swipe left)"), on: {click: () => rejectCard(front)}}, icon("bi-x-lg"));
|
||||
const later = h("button", {type: "button", class: "btn match-later", disabled: !rest.length, ...named("Later", "Later: to the back of the stack (up arrow, swipe up)"), on: {click: () => laterCard(front)}}, icon("bi-arrow-up"));
|
||||
const act = (cls, iconName, word, hint, disabled, run) => h("button", {type: "button", class: `match-act ${cls}`, disabled, ...named(word, hint), on: {click: run}},
|
||||
h("span", {class: "match-act-face", "aria-hidden": "true"}, icon(iconName)), h("span", {class: "match-act-label"}, word));
|
||||
const accept = act("match-accept", "bi-check-lg", "Accept", front.stale ? `Accept: refused while the card is stale (${front.stale_reason})` : "Accept (right arrow, swipe right)", Boolean(front.stale), () => acceptCard(front));
|
||||
const reject = act("match-reject", "bi-x-lg", "Reject", "Reject with feedback (left arrow, swipe left)", false, () => rejectCard(front));
|
||||
const later = act("match-later", "bi-arrow-up", "Later", "Later: to the back of the stack (up arrow, swipe up)", !rest.length, () => laterCard(front));
|
||||
const peeks = rest.length ? h("div", {class: "match-peeks", role: "group", "aria-label": `${rest.length} more cards`}, rest.map(peekTab)) : null;
|
||||
const behind = rest.slice(0, MATCH_PEEKS).map((card, index) => {
|
||||
const sheet = h("div", {class: "match-behind", "aria-hidden": "true"});
|
||||
@@ -481,7 +562,8 @@
|
||||
const before = dom.stack.querySelector(".match-card.front");
|
||||
const scrolled = before && before.dataset.card === front.id ? before.querySelector(".match-body").scrollTop : 0;
|
||||
const shown = matchCard(front);
|
||||
shown.dataset.fresh = String(!before || before.dataset.card !== front.id);
|
||||
draggable(shown, front);
|
||||
dom.stack.replaceChildren(peeks, h("div", {class: "match-deck"}, behind, shown), h("div", {class: "match-actions"}, reject, later, accept));
|
||||
dom.stack.replaceChildren(peeks || h("div", {class: "match-peeks"}), h("div", {class: "match-deck"}, behind, shown), h("div", {class: "match-actions"}, reject, later, accept));
|
||||
shown.querySelector(".match-body").scrollTop = scrolled;
|
||||
}
|
||||
@@ -153,7 +153,7 @@
|
||||
function taskViewSwitch(inbox) {
|
||||
return h("div", {class: "segmented", role: "group", "aria-label": "View"}, Nav.TASK_VIEWS.map(([id, name]) => h("button", {
|
||||
type: "button", class: "icon-only", ...named(name), "aria-pressed": String(!inbox && ui.views.tasks === id), on: {click: () => go("tasks", id)},
|
||||
}, icon(Nav.ICONS[id]))));
|
||||
}, icon(Nav.ICONS[id]))), h("button", {type: "button", class: "icon-only", ...named("Match"), "aria-pressed": "false", on: {click: () => go("match", null)}}, icon(Nav.ICONS.match)));
|
||||
}
|
||||
|
||||
function tasksScreen() {
|
||||
|
||||
@@ -1,14 +1,31 @@
|
||||
.graph.tasks.match > .match-stack { flex: 1; }
|
||||
.match-home { display: grid; height: 100%; min-height: 0; }
|
||||
.match-home > .graph.match { min-height: 0; }
|
||||
.match-stack { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: var(--sp-2); min-height: 0; width: min(100%, 960px); margin: 0 auto; }
|
||||
.match-peeks { display: flex; flex-wrap: wrap; gap: var(--sp-1); min-width: 0; }
|
||||
.match-peek { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: inherit; font: inherit; font-size: var(--fs-sm); cursor: pointer; }
|
||||
.match-peek[data-stale="true"] { border-color: var(--bad); }
|
||||
.match-peek .match-peek-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
|
||||
.match-deck { position: relative; display: grid; grid-template-rows: minmax(0, 1fr); min-height: 0; padding-top: 14px; }
|
||||
.match-behind { position: absolute; inset: calc(14px - var(--depth) * 7px) calc(var(--depth) * 12px) auto; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); opacity: calc(1 - var(--depth) * 0.3); }
|
||||
.match-card.front { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; padding: 0; overflow: hidden; }
|
||||
.match-card[data-stale="true"] { box-shadow: inset 0 3px 0 var(--bad); }
|
||||
.match-head { display: grid; justify-items: center; gap: 6px; padding: var(--sp-3); border-bottom: 1px solid var(--line); text-align: center; }
|
||||
.match-deck { position: relative; display: grid; grid-template-rows: minmax(0, 1fr); min-height: 0; padding-top: 14px; overflow-x: clip; }
|
||||
.match-behind { position: absolute; inset: calc(14px - var(--depth) * 7px) calc(var(--depth) * 12px) auto; height: 40px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); opacity: calc(1 - var(--depth) * 0.3); transform: rotate(calc((var(--depth) * 2 - 3) * 1deg)); }
|
||||
.match-card.front { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; padding: 0; overflow: hidden; border-radius: 22px; box-shadow: 0 14px 34px -16px rgb(0 0 0 / 0.45); }
|
||||
.match-card.front::before { content: ""; position: absolute; inset: 0 0 auto; z-index: 1; height: 6px; background: linear-gradient(90deg, hsl(var(--agent-hue, 210) 75% 58%), hsl(calc(var(--agent-hue, 210) + 70) 75% 58%)); }
|
||||
.match-card[data-stale="true"]::before { background: var(--bad); }
|
||||
.match-card.front[data-fresh="true"] { animation: match-in 0.32s cubic-bezier(0.34, 1.56, 0.64, 1); }
|
||||
.match-card.front[data-fresh="true"] .match-who .avatar { animation: match-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
|
||||
.match-card.front[data-fly="accept"] { animation: match-fly-right 0.26s ease-in forwards; }
|
||||
.match-card.front[data-fly="reject"] { animation: match-fly-left 0.26s ease-in forwards; }
|
||||
.match-card.front[data-fly="later"] { animation: match-fly-up 0.26s ease-in forwards; }
|
||||
.match-card.front[data-leaning]::after { position: absolute; top: 18%; z-index: 2; padding: 4px 14px; border: 4px solid currentColor; border-radius: 12px; background: color-mix(in srgb, var(--panel) 75%, transparent); font-size: 1.9rem; font-weight: 800; letter-spacing: 0.08em; opacity: var(--lean, 1); pointer-events: none; }
|
||||
.match-card.front[data-leaning="accept"]::after { content: "ACCEPT"; left: 7%; color: var(--ok); transform: rotate(-14deg); }
|
||||
.match-card.front[data-leaning="reject"]::after { content: "REJECT"; right: 7%; color: var(--bad); transform: rotate(14deg); }
|
||||
.match-card.front[data-leaning="later"]::after { content: "LATER"; left: 50%; color: var(--muted); transform: translateX(-50%) rotate(-4deg); }
|
||||
@keyframes match-in { from { transform: translateY(18px) scale(0.96); opacity: 0.3; } }
|
||||
@keyframes match-pop { from { transform: scale(0.5) rotate(-12deg); opacity: 0; } }
|
||||
@keyframes match-fly-right { to { transform: translate(120%, -4%) rotate(18deg); opacity: 0; } }
|
||||
@keyframes match-fly-left { to { transform: translate(-120%, -4%) rotate(-18deg); opacity: 0; } }
|
||||
@keyframes match-fly-up { to { transform: translateY(-110%) scale(0.9); opacity: 0; } }
|
||||
.match-head { display: grid; justify-items: center; gap: 6px; padding: var(--sp-3); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, hsl(var(--agent-hue, 210) 80% 60% / 0.16), transparent 75%); text-align: center; }
|
||||
.match-who { display: grid; justify-items: center; gap: 2px; }
|
||||
.match-who .avatar.big { width: 72px; height: 72px; }
|
||||
.match-name { font-size: var(--fs-lg); }
|
||||
@@ -25,6 +42,8 @@
|
||||
.match-command { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--sunken); font-family: var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
|
||||
.match-directory, .match-reason { margin: 0; color: var(--muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
|
||||
.match-directory::before { content: "in "; }
|
||||
.match-merge { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--info); font-size: var(--fs-sm); font-family: var(--mono); overflow-wrap: anywhere; }
|
||||
.match-merge[data-error="true"] { color: var(--warn); }
|
||||
.match-files { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
|
||||
.match-file { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
|
||||
.match-file > summary.diff-head { padding: 6px 10px; cursor: pointer; list-style: none; }
|
||||
@@ -37,19 +56,34 @@
|
||||
.match-mark-text { margin-left: 6px; }
|
||||
.match-comment-box { display: grid; gap: 6px; }
|
||||
.match-comment-box .actions { display: flex; justify-content: flex-end; gap: 6px; }
|
||||
.match-actions { display: flex; justify-content: space-between; padding-bottom: var(--sp-1); }
|
||||
.match-actions .btn { width: 56px; height: 56px; border-radius: 50%; }
|
||||
.match-reject { color: var(--bad); }
|
||||
.match-accept { color: var(--ok); }
|
||||
.match-accept:disabled, .match-later:disabled { opacity: 0.4; cursor: not-allowed; }
|
||||
.match-actions { display: flex; justify-content: space-between; align-items: end; padding: 0 var(--sp-2) var(--sp-1); }
|
||||
.match-act { display: grid; justify-items: center; gap: 8px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; }
|
||||
.match-act-face { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: var(--tone); color: #fff; font-size: 2rem; box-shadow: 0 6px 0 color-mix(in srgb, var(--tone) 55%, #000), 0 14px 26px -12px var(--tone); transition: transform 0.12s ease, box-shadow 0.12s ease; }
|
||||
.match-reject { --tone: var(--bad); }
|
||||
.match-accept { --tone: var(--ok); }
|
||||
.match-later { --tone: var(--muted); }
|
||||
.match-later .match-act-face { width: 60px; height: 60px; font-size: 1.5rem; }
|
||||
.match-act:hover:not(:disabled) .match-act-face { transform: translateY(-2px) scale(1.06); }
|
||||
.match-act:active:not(:disabled) .match-act-face { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--tone) 55%, #000), 0 4px 10px -6px var(--tone); }
|
||||
.match-act:focus-visible { outline: none; }
|
||||
.match-act:focus-visible .match-act-face { outline: 3px solid var(--accent); outline-offset: 4px; }
|
||||
.match-act:disabled { opacity: 0.4; cursor: not-allowed; }
|
||||
.match-head { touch-action: pan-y; cursor: grab; }
|
||||
.match-card.front[data-leaning] { transition: none; }
|
||||
.match-card.front[data-leaning="accept"] { box-shadow: inset 0 0 0 3px var(--ok); }
|
||||
.match-card.front[data-leaning="reject"] { box-shadow: inset 0 0 0 3px var(--bad); }
|
||||
.match-done { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; }
|
||||
.match-confetti { position: absolute; inset: 0; pointer-events: none; }
|
||||
.match-confetti i { position: absolute; top: -12px; left: var(--x); width: 9px; height: 14px; border-radius: 2px; background: hsl(var(--c) 85% 60%); animation: match-confetti 1.4s ease-in var(--d) forwards; opacity: 0; }
|
||||
@keyframes match-confetti { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(70vh) rotate(var(--r)); } }
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.match-card.front, .match-card.front .match-who .avatar, .match-confetti i { animation: none !important; }
|
||||
.match-act-face { transition: none; }
|
||||
}
|
||||
.match-open-overview { display: inline-flex; align-items: center; gap: 4px; }
|
||||
.match-tally { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: var(--fs-xs); text-align: center; }
|
||||
.match-feedback { width: 100%; font-family: var(--mono); resize: vertical; }
|
||||
.match-overview { grid-row: 1 / -1; display: grid; align-content: start; gap: var(--sp-2); min-height: 0; overflow: auto; }
|
||||
.match-overview { position: relative; grid-row: 1 / -1; display: grid; align-content: start; gap: var(--sp-2); min-height: 0; overflow: auto; }
|
||||
.match-overview .actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); }
|
||||
.match-decisions { display: grid; gap: var(--sp-1); margin: 0; padding: 0; list-style: none; }
|
||||
.match-decision { display: grid; gap: 4px; min-width: 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; }
|
||||
@@ -62,4 +96,7 @@
|
||||
.match-head { padding: var(--sp-2); }
|
||||
.match-who .avatar.big { width: 56px; height: 56px; }
|
||||
.match-body { padding: var(--sp-1) var(--sp-2) var(--sp-2); }
|
||||
.match-act-face { width: 64px; height: 64px; font-size: 1.7rem; }
|
||||
.match-later .match-act-face { width: 52px; height: 52px; font-size: 1.3rem; }
|
||||
.match-card.front[data-leaning]::after { font-size: 1.4rem; }
|
||||
}
|
||||
Reference in new issue
Block a user