From ed6678f51e39e375362e6c84e8364089c826b884 Mon Sep 17 00:00:00 2001 From: ZiyaZhang Date: Sat, 18 Jul 2026 14:01:11 -0700 Subject: [PATCH] fix(desktop): compact artifact rows + auto-group --- examples/desktop/src/renderer/artifacts.js | 158 +++++++++++++++------ examples/desktop/src/renderer/style.css | 116 +++++++++++++-- 2 files changed, 219 insertions(+), 55 deletions(-) diff --git a/examples/desktop/src/renderer/artifacts.js b/examples/desktop/src/renderer/artifacts.js index 9f3a7271f8..d43c35b64f 100644 --- a/examples/desktop/src/renderer/artifacts.js +++ b/examples/desktop/src/renderer/artifacts.js @@ -3,17 +3,18 @@ // demo shell only hosts the entry point per the RFC (2026-07-13 §Deliberate // exclusions, "No embedded GUI pane"). // +// Density-spec §2 L0 shape (user-flagged 2026-07-18): each artifact renders +// as a single ~28px row — small icon + filename + kind/version chips + live +// dot + tiny right-aligned `open ↗` link. Clicking the row toggles a native +//
L1 body that carries the full path and the ghost "Open in +// browser" button. Consecutive .artifact-card siblings render as a visual +// group (shared border, zero gap between rows) via CSS `:has()`. +// // Two triggers: // 1. tool/result carrying a file write inside the artifact dir (detected // by main.js and re-broadcast as `artifact:event`). // 2. debug menu "mock: artifact" button (window.dsh.mockArtifact). // -// Card layout: -// [icon] filename.html · html v3 [ Open in browser ] -// (kind badge) -// Live indicator dot: green when the shell's server has broadcast a version -// bump within the last 2s (live reload just fired). -// // De-dup: one card per artifactId per stream. If a re-declare fires the // existing card bumps its version + flashes. @@ -26,9 +27,9 @@ const cards = new Map() // Kind-to-SVG map — inline stroke icons (currentColor, 1.6px stroke) so - // artifact cards match the minimalist icon language rather than sitting - // on emoji glyphs. Fallback below in ensureCard() falls back to the - // paperclip glyph used elsewhere for context-family cards. + // artifact rows match the minimalist icon language rather than sitting + // on emoji glyphs. Fallback is the paperclip glyph used elsewhere for + // context-family cards. const ICON_SVG = { html: '