Files
streamline/control-web/src/styles/prompts.css
T
2026-11-16 17:26:44 -08:00

106 lines
9.1 KiB
CSS

/*
* Styles only the Prompts panel (PromptsPanel.tsx + PromptGraphPanel, PromptEditor, …) renders — split out of
* styles.css so they ship with that panel's lazy chunk instead of the
* render-blocking global stylesheet.
*
* This file loads AFTER styles.css (Vite appends the chunk's <link> on first
* open, before the panel renders), so:
* - only add selectors built on classes used exclusively by this panel's
* chunk — control-web/test/panel_css_scope.test.ts enforces it;
* - a class shared with the board / drawer / another panel stays in styles.css;
* - don't depend on source order against a styles.css rule; use specificity.
*/
.lab-diff-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.lab-diff-bar .lab-select { min-width: 180px; }
/* ── 提示词图谱 (PromptGraphPanel) ───────────────────────────────────────────
All colour comes from tokens, so the dark theme follows for free. The graph
itself is plain SVG — 23 nodes on a deterministic grid did not justify a
graph library, and a hand-drawn one stays themeable with the same variables
as the rest of the app. */
.pg { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.pg-empty { color: var(--text-2); font-size: 13px; padding: 32px; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pg-empty--err { color: var(--danger); }
.pg-bar { display: flex; align-items: center; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.pg-bar-spacer { flex: 1; }
.pg-bar-stat { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.pg-bar-stat > svg { color: var(--muted); }
.pg-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; user-select: none; }
.pg-toggle input { accent-color: var(--accent); cursor: pointer; }
.pg-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.pg-body:has(.pg-drawer) { grid-template-columns: 220px minmax(0, 1fr) 360px; }
/* Left explorer */
.pg-tree { display: flex; flex-direction: column; gap: 14px; max-height: 72vh; overflow: auto; padding-right: 4px; }
.pg-tree-group { display: flex; flex-direction: column; gap: 3px; }
.pg-tree-head { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-2); padding: 0 4px 4px; }
.pg-tree-row { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 1px solid transparent; background: transparent; border-radius: var(--r-sm); padding: 6px 8px; cursor: pointer; color: var(--text-2); font-size: 12.5px; }
.pg-tree-row:hover { background: var(--surface-2); }
.pg-tree-row.on { background: var(--accent-soft); border-color: var(--accent-edge); color: var(--text); font-weight: 600; }
.pg-tree-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-tree-count { font-size: 10.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); border-radius: 999px; padding: 1px 6px; }
/* Status dot — the same two states the graph nodes use. */
.pg-dot { width: 8px; height: 8px; border-radius: 999px; flex: none; }
.pg-dot--live { background: var(--success); }
.pg-dot--code { background: var(--muted-2); }
/* Canvas */
.pg-canvas { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: auto; max-height: 72vh; }
.pg-svg { display: block; height: auto; }
.pg-band { fill: var(--surface); }
.pg-band--alt { fill: var(--surface-2); }
.pg-band--frag { fill: var(--accent-soft); }
.pg-band-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; fill: var(--muted-2); }
.pg-col-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; fill: var(--muted); }
.pg-edge { fill: none; stroke: var(--border-strong); stroke-width: 1.4; }
.pg-edge--derive { stroke: var(--accent); stroke-dasharray: 5 4; }
.pg-edge.pg-dim { opacity: 0.1; }
.pg-node { cursor: pointer; }
.pg-node > rect:first-child { fill: var(--elev); stroke: var(--border); stroke-width: 1; transition: stroke 0.12s ease; }
.pg-node:hover > rect:first-child { stroke: var(--accent-edge); }
.pg-node.on > rect:first-child { stroke: var(--accent); stroke-width: 2; }
.pg-node-stripe { stroke: none; }
.pg-node--live .pg-node-stripe { fill: var(--success); }
.pg-node--code .pg-node-stripe { fill: var(--muted-2); }
.pg-node-title { font-size: 12.5px; font-weight: 650; fill: var(--text); pointer-events: none; }
.pg-node-meta { font-size: 10.5px; fill: var(--muted); pointer-events: none; }
.pg-node.pg-dim { opacity: 0.22; }
/* Right drawer */
.pg-drawer { display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 14px; max-height: 72vh; overflow: auto; }
.pg-drawer-head { display: flex; align-items: center; gap: 8px; }
.pg-drawer-head h3 { flex: 1; margin: 0; font-size: 14.5px; font-weight: 700; color: var(--text); }
.pg-icon-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; border-radius: var(--r-sm); }
.pg-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.pg-note { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--text-2); }
.pg-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 12px; align-items: baseline; }
.pg-facts dt { color: var(--muted); white-space: nowrap; }
.pg-facts dd { margin: 0; color: var(--text-2); min-width: 0; overflow-wrap: anywhere; }
.pg-facts code { font-family: var(--font-mono); font-size: 11px; background: var(--surface-2); border-radius: 4px; padding: 1px 5px; }
.pg-sym { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-top: 3px; }
.pg-rel { display: flex; flex-direction: column; gap: 7px; }
.pg-rel h4 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: 0.03em; color: var(--muted); text-transform: uppercase; }
.pg-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pg-chip { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); border-radius: 999px; padding: 3px 10px; font-size: 11.5px; cursor: pointer; }
.pg-chip:hover { border-color: var(--accent-edge); color: var(--accent); background: var(--accent-soft); }
.pg-muted { color: var(--muted); font-size: 11.5px; }
.pg-hint { line-height: 1.7; }
.pg-hint code { font-family: var(--font-mono); font-size: 11px; background: var(--surface-2); border-radius: 4px; padding: 1px 5px; }
.pg-preview { margin: 0; max-height: 260px; overflow: auto; font-family: var(--font-mono); font-size: 10.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px; }
.pg-open { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); border-radius: var(--r-sm); padding: 7px 12px; font-size: 12.5px; font-weight: 600; text-decoration: none; }
.pg-open:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
@media (max-width: 1100px) {
.pg-body, .pg-body:has(.pg-drawer) { grid-template-columns: minmax(0, 1fr); }
.pg-tree { max-height: 220px; }
}
/* ── 提示词控制台:版本时间线 ───────────────────────────────────────────────── */
.pg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pv { display: flex; flex-direction: column; gap: 12px; }
.pv-day { display: flex; flex-direction: column; gap: 6px; }
.pv-day-head { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--muted-2); padding-left: 2px; }
.pv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pv-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-2); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); padding: 7px 11px; min-width: 0; }
.pv-item--commit { background: var(--surface-2); }
.pv-icon { display: inline-flex; color: var(--muted); flex: none; }
.pv-node { flex: none; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); border-radius: 999px; padding: 1px 9px; font-size: 11.5px; cursor: pointer; }
.pv-node:hover { border-color: var(--accent-edge); color: var(--accent); background: var(--accent-soft); }
.pv-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.pv-sha { flex: none; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); background: var(--surface-3); border-radius: 4px; padding: 1px 6px; }
.pv-meta { flex: none; font-size: 11px; color: var(--muted); }