web: shared chat stars, pipeline mini graphs and agent questions
- Persist chat stars in the operator-session registry (chat_star) so every browser/device shows the same Starred group; migrate old local stars once. - Add a compact pipeline graph shape to list responses and draw a lightweight list miniature; replace the cryptic id/version line with the stage count. - Surface OpenCode form questions as a chat card (chat_answer), replay a pending form to late subscribers, and notify for background questions. - Make the mobile dock's Search cell equal to every destination, keep the tab row visible with 100svh, and let Source use the full pane height. - Let a fresh sign-in auto-connect to its own origin; use a Lax session cookie with Expires so Remember me survives app/link launches. - Keep shipped starters and the skill agnostic: no repository paths, project areas or personal device commands; add Diagnose/Fix and Research starters. - Refresh the installed skill and document the new browser conventions.
This commit is contained in:
@@ -20,10 +20,11 @@ import {
|
||||
runBadge,
|
||||
runBadgeMetaLine,
|
||||
sortPipelines,
|
||||
stageCountText,
|
||||
summaryFields,
|
||||
versionRow,
|
||||
} from "../pipelines.js";
|
||||
import { PIPELINE_GRAPH_EMPTY, mount as mountGraph } from "../graph.js";
|
||||
import { PIPELINE_GRAPH_EMPTY, layoutGraph, mount as mountGraph } from "../graph.js";
|
||||
import { statusIcon } from "../statusIcon.js";
|
||||
import { writeGraphExpanded } from "../graphPrefs.js";
|
||||
|
||||
@@ -236,6 +237,69 @@ function fillPipelineRows(rowsEl) {
|
||||
rowsEl.replaceChildren(...nodes);
|
||||
}
|
||||
|
||||
// A list row's graph is a shape cue, not a reading surface: tiny nodes and
|
||||
// straight routes, no labels or chips. The detail Graph tab is the real one.
|
||||
const MINI_GRAPH_METRICS = Object.freeze({
|
||||
nodeWidth: 26,
|
||||
nodeHeight: 12,
|
||||
hGap: 12,
|
||||
pad: 2,
|
||||
laneSpacing: 8,
|
||||
terminalGap: 8,
|
||||
trackStep: 6,
|
||||
portSpacing: 4,
|
||||
labelCharWidth: 0,
|
||||
labelPadding: 0,
|
||||
labelHeight: 0,
|
||||
labelGap: 0,
|
||||
});
|
||||
const SVG_NS = "http://www.w3.org/2000/svg";
|
||||
|
||||
/** The pipeline's stages and their stage-to-stage routes, without terminals. */
|
||||
function miniGraphShape(graph) {
|
||||
const stages = graph?.stages ?? [];
|
||||
const keys = new Set(stages.map((stage) => stage.key));
|
||||
return {
|
||||
stages: stages.map((stage) => ({
|
||||
...stage,
|
||||
edges: Object.fromEntries(
|
||||
Object.entries(stage.edges ?? {}).filter(([, target]) => keys.has(target)),
|
||||
),
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
function renderPipelineMiniGraph(pipeline) {
|
||||
const shape = pipeline.shape ?? pipeline.graph;
|
||||
if (!shape?.stages?.length) return null;
|
||||
const layout = layoutGraph(miniGraphShape(shape), MINI_GRAPH_METRICS);
|
||||
if (!layout.nodes.length || !layout.width || !layout.height) return null;
|
||||
const svg = document.createElementNS(SVG_NS, "svg");
|
||||
svg.setAttribute("class", "pipeline-mini-graph");
|
||||
svg.setAttribute("viewBox", `0 0 ${Math.ceil(layout.width)} ${Math.ceil(layout.height)}`);
|
||||
svg.setAttribute("preserveAspectRatio", "xMidYMid meet");
|
||||
svg.setAttribute("aria-hidden", "true");
|
||||
svg.setAttribute("focusable", "false");
|
||||
for (const edge of layout.edges) {
|
||||
if (edge.points.length < 2) continue;
|
||||
const line = document.createElementNS(SVG_NS, "polyline");
|
||||
line.setAttribute("class", "pipeline-mini-edge");
|
||||
line.setAttribute("points", edge.points.map((point) => `${point.x},${point.y}`).join(" "));
|
||||
svg.append(line);
|
||||
}
|
||||
for (const node of layout.nodes) {
|
||||
const rect = document.createElementNS(SVG_NS, "rect");
|
||||
rect.setAttribute("class", "pipeline-mini-node");
|
||||
rect.setAttribute("x", String(node.x));
|
||||
rect.setAttribute("y", String(node.y));
|
||||
rect.setAttribute("width", String(node.width));
|
||||
rect.setAttribute("height", String(node.height));
|
||||
rect.setAttribute("rx", "3");
|
||||
svg.append(rect);
|
||||
}
|
||||
return h("span", { class: "pipeline-mini", "aria-hidden": "true" }, svg);
|
||||
}
|
||||
|
||||
function renderPipelineRow(pipeline, latestRuns, runsKnown, now) {
|
||||
const children = [
|
||||
h(
|
||||
@@ -244,8 +308,15 @@ function renderPipelineRow(pipeline, latestRuns, runsKnown, now) {
|
||||
pipelineGlyph(),
|
||||
h("span", { class: "row-title", text: pipeline.name || `pipeline ${pipeline.id}` }),
|
||||
),
|
||||
h("span", { class: "row-meta", text: pipelineSubtitle(pipeline) }),
|
||||
];
|
||||
const mini = renderPipelineMiniGraph(pipeline);
|
||||
if (mini) children.push(mini);
|
||||
children.push(
|
||||
h("span", {
|
||||
class: "row-meta",
|
||||
text: stageCountText(pipeline.stages ?? pipeline.shape?.stages?.length ?? 0),
|
||||
}),
|
||||
);
|
||||
const updated = pipelineUpdatedLine(pipeline);
|
||||
if (updated) children.push(h("span", { class: "row-meta", text: updated }));
|
||||
if (runsKnown) {
|
||||
|
||||
Reference in New Issue
Block a user