web: artifacts gallery, full-screen viewer and session export link (R8/R9)
Port the Android artifact derivation into a pure, DOM-free src/artifacts.js (presentedArtifacts with the retired session.md hidden everywhere, grouping by stage/visit, the header/summary/capture-note wording, kind and size formatting, viewer paging and sessionExportArtifact) and unit-test it. Wire it into src/app.js: a run-level artifacts gallery with per-(stage,visit) groups, per-visit summaries and tiles, a full-screen viewer overlay (paging, Escape/backdrop close) and the read-only session.html link. Every server string is set with textContent; captures/ stays untracked. Captured live against run 430 through test/ui-smoke.mjs: captures/04-run-430-artifacts.png, 05-artifact-viewer.png, 06-session-export-link.png. PARITY.md marks R8 and R9 done.
This commit is contained in:
+90
-1
@@ -70,7 +70,10 @@ button.ghost { background: transparent; }
|
||||
.tab.active { background: var(--surface-2); border-color: var(--border); color: var(--accent); }
|
||||
|
||||
.split { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 16px; padding: 16px; align-items: start; }
|
||||
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
|
||||
@media (max-width: 760px) {
|
||||
.split { grid-template-columns: 1fr; }
|
||||
.artifact-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
|
||||
}
|
||||
|
||||
.list, .detail {
|
||||
background: var(--surface);
|
||||
@@ -118,6 +121,92 @@ button.ghost { background: transparent; }
|
||||
|
||||
.artifacts { margin-top: 8px; font-size: 12px; }
|
||||
.artifacts a { color: var(--accent); margin-right: 10px; }
|
||||
.artifacts-summary { color: var(--accent); }
|
||||
.artifacts-note { margin-top: 2px; }
|
||||
.artifact-hint { margin: 4px 0; }
|
||||
|
||||
/* Run-level artifacts gallery: group headers + a fitting tile grid. */
|
||||
.artifacts-header { margin-top: 18px; }
|
||||
.artifact-gallery { display: grid; gap: 12px; }
|
||||
.artifact-group-head { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 4px; }
|
||||
.artifact-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.artifact-tile {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
min-height: 120px;
|
||||
padding: 10px;
|
||||
background: var(--surface-2);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
}
|
||||
.artifact-tile.clickable { cursor: pointer; }
|
||||
.artifact-tile.clickable:hover { border-color: var(--accent); }
|
||||
.artifact-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
|
||||
.artifact-poster {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
border-radius: 50%;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
.artifact-play { font-size: 18px; color: var(--text); }
|
||||
.artifact-kind { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
|
||||
.artifact-name { font-size: 12px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.artifact-size { color: var(--muted); font-size: 11px; }
|
||||
.artifact-actions { position: absolute; top: 8px; right: 6px; display: flex; gap: 4px; }
|
||||
.artifact-action {
|
||||
padding: 2px 6px;
|
||||
font-size: 10px;
|
||||
border-radius: 6px;
|
||||
background: rgba(14, 21, 19, 0.72);
|
||||
}
|
||||
.artifact-action:disabled { opacity: 0.4; cursor: not-allowed; }
|
||||
|
||||
/* The per-visit session export link / notice (parity R9). */
|
||||
.session-export { margin-top: 6px; font-size: 12px; }
|
||||
.session-link { color: var(--accent); }
|
||||
|
||||
/* Full-screen artifact viewer overlay. */
|
||||
.artifact-viewer {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 20;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 20px;
|
||||
background: rgba(0, 0, 0, 0.86);
|
||||
}
|
||||
.viewer-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
|
||||
.viewer-title { font-size: 15px; font-weight: 600; }
|
||||
.viewer-position { font-size: 12px; }
|
||||
.viewer-board { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
|
||||
.viewer-image { max-width: 100%; max-height: 100%; object-fit: contain; }
|
||||
.viewer-placeholder {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 32px;
|
||||
color: var(--muted);
|
||||
}
|
||||
.viewer-placeholder .artifact-play { font-size: 40px; }
|
||||
.viewer-nav { display: flex; gap: 8px; justify-content: center; }
|
||||
.viewer-page:disabled { opacity: 0.4; cursor: not-allowed; }
|
||||
.viewer-actions { display: flex; gap: 8px; justify-content: flex-end; }
|
||||
|
||||
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; border: 1px solid var(--border); color: var(--muted); }
|
||||
.chip-running, .chip-queued { color: var(--warn); border-color: var(--warn); }
|
||||
|
||||
Reference in New Issue
Block a user