Files
pipelines/web/dialogs.css
T
alan 359912f822 web: render stage-turn markdown in the artifact viewer
The full-screen viewer now opens markdown/text artifacts (text/markdown,
text/plain, .md/.markdown/.txt) through the resolved artifact URL and renders
them with the page's own DOM markdown renderer, with an honest failure message
and an external fallback. ArrowLeft/ArrowRight page the shared media+document
list, and a backdrop click closes the viewer while panel clicks do not.

The run gallery and per-visit artifacts present input.md, memory.md and
output.md as ordinary Document tiles with a drawn glyph and open the viewer.

Adds isMarkdownArtifact/isViewerArtifact with unit coverage, deterministic
viewer fixtures, and ui-smoke assertions/captures for rendered markdown,
keyboard paging, the honest 404 and backdrop dismissal.
2026-10-19 21:23:10 +01:00

510 lines
16 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* ---------------------------------------------------------------------------
Attention / "Needs you" surface (R15): the header bell with its conditional
badge, and the bottom sheet of everybody a run needs. Hand-written, dark
palette; the sheet is responsive and echoes the app's ModalBottomSheet.
--------------------------------------------------------------------------- */
.attention-bell {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 5px 9px;
margin-left: 6px;
background: transparent;
border-color: transparent;
line-height: 1;
}
.attention-bell-glyph { font-size: 15px; }
.attention-badge {
position: absolute;
top: -4px;
right: -4px;
min-width: 16px;
height: 16px;
padding: 0 4px;
border-radius: 999px;
background: var(--bad);
color: #1b0b0b;
font-size: 11px;
font-weight: 700;
line-height: 16px;
text-align: center;
}
.attention-sheet {
position: fixed;
inset: 0;
z-index: 30;
display: flex;
align-items: flex-end;
justify-content: center;
background: rgba(0, 0, 0, 0.55);
}
.attention-sheet-panel {
display: flex;
flex-direction: column;
width: min(560px, 100%);
max-height: 80vh;
min-width: 0;
background: var(--surface);
border: 1px solid var(--border);
border-bottom: 0;
border-radius: 14px 14px 0 0;
box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
outline: none;
}
.attention-sheet-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
padding: 12px 14px 8px;
border-bottom: 1px solid var(--border);
}
.attention-sheet-title { margin: 0; font-size: 16px; }
.attention-sheet-close { background: transparent; }
.attention-sheet-body {
flex: 1;
overflow-y: auto;
padding: 10px 14px 16px;
display: grid;
gap: 8px;
align-content: start;
}
.attention-empty { margin: 4px 0; color: var(--muted); }
.attention-clear { justify-self: start; background: transparent; color: var(--accent); border-color: transparent; padding: 4px 0; }
.attention-row {
display: flex;
align-items: center;
gap: 10px;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--surface-2);
padding: 4px 4px 4px 0;
}
.attention-row-open {
flex: 1;
min-width: 0;
display: flex;
align-items: center;
gap: 10px;
text-align: left;
background: transparent;
border: 0;
border-radius: 10px;
padding: 8px 6px 8px 12px;
}
.attention-icon { font-size: 15px; flex: 0 0 auto; }
.attention-text { display: grid; gap: 2px; min-width: 0; }
.attention-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-desc { color: var(--muted); font-size: 12px; }
.attention-dismiss {
flex: 0 0 auto;
background: transparent;
border-color: transparent;
color: var(--muted);
padding: 6px 10px;
}
.attention-dismiss:hover { color: var(--text); border-color: var(--border); }
@media (max-width: 760px) {
.attention-sheet-panel { width: 100%; max-height: 88vh; }
}
/* --- Omni-search (S1/S2) ------------------------------------------------- */
/* The panel sits in normal flow under the top bar; the wrapper disappears
entirely while the search is closed. */
.search-host { background: var(--surface); border-bottom: 1px solid var(--border); }
.search-host:empty { display: none; }
/* Spotlight: the search is a modal over the page, not a strip in the header. */
#searchPanel {
position: fixed;
inset: 0;
z-index: 70;
display: grid;
place-items: start center;
padding: min(12vh, 110px) 16px 16px;
background: color-mix(in srgb, #000 55%, transparent);
}
.search-modal {
width: min(760px, 100%);
max-height: 70vh;
display: grid;
gap: 8px;
padding: 12px;
background: var(--surface-2);
border: 1px solid var(--border);
border-radius: 14px;
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.search-results { max-height: 46vh; overflow-y: auto; }
.search-row.active {
background: var(--surface);
outline: 2px solid var(--accent);
outline-offset: -2px;
}
.search-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-field { display: flex; gap: 6px; align-items: center; }
.search-field-label { color: var(--muted); font-size: 12px; }
.search-select {
padding: 5px 8px;
background: var(--surface-2);
color: var(--text);
border: 1px solid var(--border);
border-radius: 8px;
font: inherit;
}
/* ---------------------------------------------------------------------------
Run-level operator actions (parity R11–R14): the waiting-for-decision card
and sheet, the shared cancel/retry/restart confirm dialogs, the one
Action-failed dialog and the inline rename control. Hand-written, the app's
dark palette; every string is set with textContent.
--------------------------------------------------------------------------- */
.run-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 4px; }
.run-action { padding: 4px 12px; font-size: 12px; }
.run-action.cancel-run { border-color: var(--warn); color: var(--warn); }
.run-action.retry-run { border-color: var(--accent); color: var(--accent); }
/* The decision card: a prominent banner above the tabs. */
.decision-card {
display: flex;
gap: 12px;
align-items: center;
padding: 12px 14px;
margin-bottom: 12px;
border: 1px solid #8edff5;
border-radius: 10px;
background: #102329;
}
.decision-card-icon { font-size: 18px; line-height: 1; }
.decision-card-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.decision-card-title { font-weight: 600; }
.decision-card-meta { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.decision-open { border-color: #8edff5; color: #8edff5; font-weight: 600; }
/* The decision sheet: a centred modal panel over a dim backdrop. */
.decision-sheet {
position: fixed;
inset: 0;
z-index: 35;
display: flex;
align-items: center;
justify-content: center;
padding: 24px;
background: rgba(0, 0, 0, 0.55);
}
.decision-sheet-panel {
display: grid;
gap: 10px;
width: min(520px, 100%);
max-height: 100%;
overflow-y: auto;
padding: 16px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.decision-sheet-title { margin: 0; font-size: 16px; }
.decision-sheet-meta { font-size: 12px; }
.decision-instructions { margin: 0; line-height: 1.5; }
.decision-options { display: grid; gap: 6px; }
.decision-option {
display: flex;
gap: 10px;
align-items: center;
width: 100%;
text-align: left;
padding: 8px 10px;
background: var(--surface-2);
border: 1px solid var(--border);
border-radius: 8px;
}
.decision-option:hover { border-color: var(--accent); }
.decision-option.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.decision-radio {
width: 14px;
height: 14px;
border-radius: 50%;
border: 2px solid var(--muted);
flex: none;
}
.decision-option.selected .decision-radio {
border-color: var(--accent);
box-shadow: inset 0 0 0 3px var(--surface-2), inset 0 0 0 8px var(--accent);
}
.decision-option-body { display: grid; gap: 2px; min-width: 0; }
.decision-option-key { font-weight: 600; }
.decision-option-target { font-size: 12px; }
.decision-field { display: grid; gap: 4px; }
.decision-field-label { font-size: 12px; color: var(--muted); }
.decision-feedback {
width: 100%;
padding: 6px 8px;
background: var(--surface-2);
color: var(--text);
border: 1px solid var(--border);
border-radius: 8px;
font: inherit;
}
.search-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-summary { flex: 1 1 160px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-clear { padding: 5px 10px; font-size: 12px; }
.search-input { flex: 1 1 260px; }
.search-close { white-space: nowrap; }
/* A bounded, self-scrolling result surface: the panel never pushes the page
body around however many hits come back. */
.search-results {
max-height: min(50vh, 420px);
overflow-y: auto;
border: 1px solid var(--border);
border-radius: 10px;
background: var(--surface-2);
}
/* The refresh indicator: shown above retained results rather than replacing
them, so a re-query never blanks the list. */
.search-progress {
height: 3px;
background: var(--accent);
border-radius: 2px;
transform-origin: left;
animation: search-progress 1.1s ease-in-out infinite;
}
@keyframes search-progress {
0% { opacity: 0.3; transform: scaleX(0.2); }
50% { opacity: 1; transform: scaleX(1); }
100% { opacity: 0.3; transform: scaleX(0.2); }
}
@media (prefers-reduced-motion: reduce) {
.search-progress { animation: none; }
}
/* A flat list of rows, with no grouping headers, matching the app. */
.search-row {
display: flex;
gap: 10px;
align-items: baseline;
padding: 8px 12px;
border-bottom: 1px solid var(--border);
}
.search-row:last-child { border-bottom: 0; }
.search-row.clickable { cursor: pointer; }
.search-row.clickable:hover { background: var(--surface); }
.search-row.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.search-row.readonly { opacity: 0.85; }
.search-kind { flex: 0 0 auto; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 2px; }
.search-row-main { flex: 1 1 auto; min-width: 0; }
.search-row-title { font-weight: 600; }
.search-row-secondary, .search-row-snippet {
font-size: 12px;
margin-top: 2px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.search-match { color: var(--accent); }
.search-searching { display: flex; gap: 8px; align-items: center; padding: 12px; }
.search-error { padding: 12px; color: var(--bad); }
.search-empty { padding: 12px; }
@media (max-width: 760px) {
.search-input { flex-basis: 100%; }
.search-summary { flex-basis: 100%; }
}
.decision-feedback:focus { outline: none; border-color: var(--accent); }
.decision-error { font-size: 13px; }
.decision-sheet-actions { display: flex; gap: 8px; justify-content: flex-end; }
.decision-confirm { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.decision-confirm:disabled, .decision-cancel:disabled { opacity: 0.5; }
/* Shared confirm dialog (cancel / retry / restart) and the Action-failed one. */
.confirm-dialog,
.action-failed {
position: fixed;
inset: 0;
z-index: 40;
display: flex;
align-items: center;
justify-content: center;
padding: 24px;
background: rgba(0, 0, 0, 0.55);
}
.confirm-panel,
.action-failed-panel {
display: grid;
gap: 12px;
width: min(420px, 100%);
padding: 16px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.confirm-title,
.action-failed-title { margin: 0; font-size: 16px; }
.confirm-message,
.action-failed-message { margin: 0; line-height: 1.5; }
.action-failed-message { color: var(--bad); }
.confirm-actions { display: flex; gap: 8px; align-items: center; }
.confirm-secondary { margin-right: auto; font-size: 12px; }
.confirm-accept { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.action-failed-ok { justify-self: end; }
/* Create a pipeline from a template (P5): the detail action and its dialog. */
.detail-actions { display: flex; gap: 8px; align-items: center; padding: 8px 12px 0; }
.template-create-open { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.template-create-dialog {
position: fixed;
inset: 0;
z-index: 40;
display: flex;
align-items: center;
justify-content: center;
padding: 24px;
background: rgba(0, 0, 0, 0.55);
}
.template-create-panel {
display: grid;
gap: 12px;
width: min(460px, 100%);
padding: 16px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.template-create-title { margin: 0; font-size: 16px; }
.template-create-field { display: grid; gap: 4px; }
.template-create-label { font-size: 12px; color: var(--muted); }
.template-create-name {
width: 100%;
padding: 6px 8px;
background: var(--surface-2);
color: var(--text);
border: 1px solid var(--border);
border-radius: 8px;
font: inherit;
}
.template-create-name:focus { outline: none; border-color: var(--accent); }
.template-create-note { margin: 0; line-height: 1.5; font-size: 13px; }
.template-create-error { font-size: 13px; }
.template-create-success { font-size: 13px; color: var(--ok); }
.template-create-actions { display: flex; gap: 8px; justify-content: flex-end; }
.template-create-confirm { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.template-create-confirm:disabled, .template-create-cancel:disabled { opacity: 0.5; }
/* The inline rename control on the Summary title row. */
.run-title-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.run-title-row .run-detail-title { margin: 0; }
.rename-field { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 0; }
.rename-input {
flex: 1;
min-width: 0;
padding: 6px 8px;
background: var(--surface-2);
color: var(--text);
border: 1px solid var(--border);
border-radius: 8px;
font: inherit;
}
.rename-input:focus { outline: none; border-color: var(--accent); }
.rename-save { border-color: var(--accent); color: var(--accent); font-weight: 600; }
/* ---------------------------------------------------------------------------
Artifact viewer (R8): the dim backdrop and its one panel, the rendered
markdown document body and the markdown's document tile. The gallery/viewer
wiring lives in views/runDetail.js and views/dialogs.js; every server string
is still set with textContent.
--------------------------------------------------------------------------- */
/* The tile treats a markdown/text file as an ordinary document: a small drawn
page glyph above the existing uppercase "Document" kind label, never a media
poster. The glyph is CSS, so it needs no emoji font; the extra top padding
keeps it clear of the absolutely positioned Copy link / Share actions. */
.artifact-document-tile { padding-top: 34px; }
.artifact-doc-glyph {
position: relative;
display: block;
width: 18px;
height: 22px;
border: 1.5px solid var(--muted);
border-radius: 2px;
}
.artifact-doc-glyph::before,
.artifact-doc-glyph::after {
content: "";
position: absolute;
left: 3px;
right: 3px;
height: 1.5px;
background: var(--muted);
}
.artifact-doc-glyph::before { top: 6px; }
.artifact-doc-glyph::after { top: 11px; }
.artifact-viewer {
z-index: 60;
align-items: center;
justify-content: center;
padding: 24px;
background: rgba(0, 0, 0, 0.78);
}
.viewer-panel {
display: flex;
flex-direction: column;
gap: var(--space-s);
width: min(1100px, 100%);
max-height: 100%;
min-height: 0;
padding: 16px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 14px;
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
outline: none;
}
.viewer-panel:focus { outline: none; }
/* Markdown/text needs the full board to scroll: a readable column, not a
centred image. The shared md-* classes keep the app's chat typography. */
.viewer-board-document {
display: block;
overflow-y: auto;
padding: 18px 20px;
background: var(--surface-2);
border: 1px solid var(--border);
border-radius: 10px;
}
.viewer-markdown {
width: 100%;
max-width: 78ch;
margin: 0 auto;
}
.viewer-markdown .md-code-block { max-width: 100%; }
.viewer-markdown .md-pre { overflow-x: auto; }
.viewer-markdown .md-table { display: block; overflow-x: auto; }
.viewer-loading { padding: 24px; text-align: center; }
.viewer-error { display: grid; gap: 10px; padding: 12px 4px; }
.viewer-error-message { color: var(--bad); line-height: 1.5; }
.viewer-external { color: var(--accent); justify-self: start; }
@media (max-width: 760px) {
.artifact-viewer { padding: 10px; }
.viewer-panel { padding: 10px; border-radius: 10px; }
.viewer-board-document { padding: 12px; }
}