Skip to content
Python

Viewer header: breadcrumb back, labeled action menu, close; Access footer one row (UX-038)

Rohit C Prasadfd1eb655473b
diff --git a/surfaces/gui/e2e/access-section.spec.ts b/surfaces/gui/e2e/access-section.spec.ts
index 522218f8..544b9d9b 100644
--- a/surfaces/gui/e2e/access-section.spec.ts
+++ b/surfaces/gui/e2e/access-section.spec.ts
@@ -91,6 +91,11 @@ test("per-session mute round-trips; the summary follows", async ({ page }) => {
const body = page.getByRole("region", { name: "Session access" });
// Muting Slack for this session drops it from the live summary (the fixture flips
// enabled on POST and the section reloads).
- await body.getByTitle("Enabled for this session — tap to mute here").nth(1).click();
+ await body
+ .getByTitle(
+ "On for this session. Off mutes it for this session only — the connector stays connected.",
+ )
+ .nth(1)
+ .click();
await expect(section.getByTestId("access-summary")).toHaveText("Browser, GitHub · 1 folder");
});
diff --git a/surfaces/gui/e2e/artifacts.spec.ts b/surfaces/gui/e2e/artifacts.spec.ts
index b71a8358..6e7707c9 100644
--- a/surfaces/gui/e2e/artifacts.spec.ts
+++ b/surfaces/gui/e2e/artifacts.spec.ts
@@ -36,7 +36,11 @@ test("HTML artifact offers Open in browser as the unsandboxed escape hatch", asy
page,
}) => {
await openReport(page);
+ // UX-038: the open action lives in the labeled ⋯ menu now.
+ await page.getByTestId("artifact-more").click();
await expect(page.getByTestId("artifact-open-browser")).toBeVisible();
+ await expect(page.getByTestId("artifact-copy-contents")).toBeVisible();
+ await expect(page.getByTestId("artifact-copy-path")).toBeVisible();
});
test("a transcript chip opens the viewer on the FIRST click even with the rail hidden", async ({
@@ -87,3 +91,16 @@ test("Show sidebar sticks while the artifact viewer is open", async ({ page }) =
// The viewer stays open too — expanding the nav is navigation, not dismissal.
await expect(page.getByTestId("artifact-frame")).toBeVisible();
});
+
+test("viewer breadcrumb goes back and ✕ closes (UX-038)", async ({ page }) => {
+ await openReport(page);
+ // The breadcrumb parent is the back action — returns to the rail sections.
+ await page.getByTestId("artifact-crumb-back").click();
+ await expect(page.getByTestId("rail-toggle-artifacts")).toBeVisible();
+
+ // Reopen (the section is still expanded from openReport), then ✕ closes the same way.
+ await page.locator(".artifact-row", { hasText: "security-review.html" }).click();
+ await expect(page.getByTestId("artifact-frame")).toBeVisible();
+ await page.getByTestId("artifact-close").click();
+ await expect(page.getByTestId("rail-toggle-artifacts")).toBeVisible();
+});
diff --git a/surfaces/gui/src/components/AccessSection.tsx b/surfaces/gui/src/components/AccessSection.tsx
index 475748b4..223d6200 100644
--- a/surfaces/gui/src/components/AccessSection.tsx
+++ b/surfaces/gui/src/components/AccessSection.tsx
@@ -317,16 +317,11 @@ export function AccessSection({
<Toggle
checked={c.enabled}
onChange={(next) => toggleSession(c.connector, next)}
- title="Enabled for this session — tap to mute here"
+ title="On for this session. Off mutes it for this session only — the connector stays connected."
/>
</div>
))}
</div>
- {connected.length > 0 && (
- <p className="text-[10.5px] text-faint mt-1 leading-snug">
- Off mutes it for <b>this session only</b> — the connector stays connected.
- </p>
- )}
{/* §32 addendum (owner ask 2026-07-13; FB-012): the catalog's long tail,
in-session. A quiet row that becomes a typeahead: full list on focus,
filter as you type. */}
@@ -379,22 +374,27 @@ export function AccessSection({
</div>
</div>
) : (
- <button
- className="mt-1 text-[12px] text-accent hover:underline text-left"
- onClick={() => setAdding(true)}
- data-testid="access-add-source"
- >
- + Add a source…
- </button>
+ /* UX-038 (owner ruling: option C): ONE footer row, both verbs — the
+ in-session add flow (with its lands-enabled-here guarantee) and the
+ global-page jump. The mute explainer lives on the toggles' tooltip. */
+ <div className="mt-1.5 flex items-center gap-1.5 text-[12px]">
+ <button
+ className="text-accent hover:underline text-left"
+ onClick={() => setAdding(true)}
+ data-testid="access-add-source"
+ >
+ + Add a source
+ </button>
+ <span className="text-faint">·</span>
+ <button
+ className="text-accent font-medium hover:underline text-left"
+ data-testid="access-manage"
+ onClick={() => onOpenIntegrations?.()}
+ >
+ Manage →
+ </button>
+ </div>
)}
- {/* Lives with its list (tester ask 2026-07-26): each group's manage link sits
- directly under that group, not pooled at the section's bottom. */}
- <button
- className="mt-1.5 block text-[12px] text-accent font-medium hover:underline text-left"
- onClick={() => onOpenIntegrations?.()}
- >
- Manage all connectors (global) →
- </button>
</div>
{recommended.length > 0 && (
diff --git a/surfaces/gui/src/components/RightRail.tsx b/surfaces/gui/src/components/RightRail.tsx
index 2dd73bab..7628fafc 100644
--- a/surfaces/gui/src/components/RightRail.tsx
+++ b/surfaces/gui/src/components/RightRail.tsx
@@ -576,18 +576,60 @@ function ArtifactViewer({
onOpenEntry?: (path: string) => void;
}) {
const [reloadKey, setReloadKey] = useState(0);
+ // UX-038: the ambiguous icon cluster collapsed into ONE labeled ⋯ menu; the
+ // breadcrumb parent is the back action and ✕ closes. Copy CONTENTS is the
+ // primary copy — the path copy (a 2026-07-12 tester fix) lives under it, labeled.
+ const [menuOpen, setMenuOpen] = useState(false);
+ const menuRef = useRef<HTMLDivElement | null>(null);
+ useEffect(() => {
+ if (!menuOpen) return;
+ const close = (e: MouseEvent) => {
+ if (!menuRef.current?.contains(e.target as Node)) setMenuOpen(false);
+ };
+ window.addEventListener("mousedown", close);
+ return () => window.removeEventListener("mousedown", close);
+ }, [menuOpen]);
const isHtml = content?.kind === "html" && !content.error;
// Best viewed in a real app: spreadsheets, PDFs, and Office docs (pptx/docx can't preview inline)
const isApp = content?.kind === "sheet" || content?.kind === "pdf" || content?.kind === "office";
+ // Text-bearing kinds can copy their contents; images/PDFs/sheets have nothing textual to copy.
+ const copyableText = typeof content?.content === "string" && !content?.error;
+ const crumbRoot = artifact.origin === "files" ? "Files" : "Artifacts";
+ const item = (
+ testid: string,
+ icon: Parameters<typeof Icon>[0]["name"],
+ label: string,
+ onClick: () => void,
+ ) => (
+ <button
+ className="artifact-menu-item"
+ data-testid={testid}
+ onClick={() => {
+ setMenuOpen(false);
+ onClick();
+ }}
+ >
+ <Icon name={icon} size={14} />
+ <span>{label}</span>
+ </button>
+ );
return (
<div className="artifact-viewer">
<div className="artifact-head">
- <button className="artifact-icon-btn" onClick={onBack} aria-label="Back to artifacts" title="Back">
- <Icon name="arrowLeft" size={16} />
- </button>
<div className="artifact-heading">
- <div className="artifact-title"><span>{artifact.origin === "files" ? "Files" : "Artifacts"}</span><span className="artifact-sep">/</span><span>{artifact.name}</span></div>
+ <div className="artifact-title">
+ <button
+ className="artifact-crumb-link"
+ data-testid="artifact-crumb-back"
+ onClick={onBack}
+ title={`Back to ${crumbRoot}`}
+ >
+ {crumbRoot}
+ </button>
+ <span className="artifact-sep">/</span>
+ <span>{artifact.name}</span>
+ </div>
<div className="artifact-path">{artifact.path}</div>
</div>
<div className="rail-actions">
@@ -604,47 +646,48 @@ function ArtifactViewer({
<Icon name="refresh" size={16} />
</button>
)}
- {isApp && (
- <button
- className="artifact-icon-btn"
- onClick={() => revealArtifact(sessionId, artifact.path, "open")}
- aria-label="Open in default app"
- title="Open in default app"
- >
- <Icon name="panelOpen" size={16} />
- </button>
- )}
- {isHtml && (
- // The sandboxed preview is deliberately offline and null-origin; a real
- // browser tab (system default app, outside app privileges) is the escape
- // hatch for sharing or printing the page.
+ <div className="artifact-menu-wrap" ref={menuRef}>
<button
className="artifact-icon-btn"
- data-testid="artifact-open-browser"
- onClick={() => revealArtifact(sessionId, artifact.path, "open")}
- aria-label="Open in browser"
- title="Open in browser"
+ data-testid="artifact-more"
+ aria-label="More actions"
+ title="More"
+ onClick={() => setMenuOpen((v) => !v)}
>
- <Icon name="panelOpen" size={16} />
+ <Icon name="moreHorizontal" size={16} />
</button>
- )}
- {/* Copy the ABSOLUTE path — the workspace-relative one is useless outside the app
- (tester catch 2026-07-12: it copied just "slack-connector-debug.md"). */}
- <button
- className="artifact-icon-btn"
- onClick={() => navigator.clipboard?.writeText(artifact.abs_path || artifact.path)}
- aria-label="Copy path"
- title="Copy full path"
- >
- <Icon name="copy" size={16} />
- </button>
+ {menuOpen && (
+ <div className="artifact-menu" data-testid="artifact-menu">
+ {copyableText &&
+ item("artifact-copy-contents", "copy", "Copy contents", () =>
+ navigator.clipboard?.writeText(content?.content || ""),
+ )}
+ {item("artifact-copy-path", "file", "Copy path", () =>
+ navigator.clipboard?.writeText(artifact.abs_path || artifact.path),
+ )}
+ <div className="artifact-menu-div" />
+ {isHtml &&
+ item("artifact-open-browser", "panelOpen", "Open in browser", () =>
+ revealArtifact(sessionId, artifact.path, "open"),
+ )}
+ {isApp &&
+ item("artifact-open-app", "panelOpen", "Open in default app", () =>
+ revealArtifact(sessionId, artifact.path, "open"),
+ )}
+ {item("artifact-reveal", "folder", "Reveal in Finder", () =>
+ revealArtifact(sessionId, artifact.path, "reveal"),
+ )}
+ </div>
+ )}
+ </div>
<button
className="artifact-icon-btn"
- onClick={() => revealArtifact(sessionId, artifact.path, "reveal")}
- aria-label="Show in folder"
- title="Show in folder"
+ data-testid="artifact-close"
+ onClick={onBack}
+ aria-label="Close the viewer"
+ title="Close"
>
- <Icon name="folder" size={16} />
+ <Icon name="x" size={16} />
</button>
</div>
</div>
diff --git a/surfaces/gui/src/styles.css b/surfaces/gui/src/styles.css
index dfb8d003..909df708 100644
--- a/surfaces/gui/src/styles.css
+++ b/surfaces/gui/src/styles.css
@@ -1929,3 +1929,24 @@ html[data-platform="linux"] ::-webkit-scrollbar-thumb:hover { background-color:
@keyframes sleep-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.85; } }
.sleep-text { flex: 1; }
.sleep-strip .btn.sm { padding: 4px 10px; font-size: 12px; }
+
+/* UX-038: viewer header — breadcrumb-as-back, ✕ close, one labeled ⋯ menu. */
+.artifact-crumb-link {
+ border: 0; background: none; padding: 1px 5px; margin-left: -5px; border-radius: 6px;
+ font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
+}
+.artifact-crumb-link:hover { color: var(--accent); background: var(--paper); }
+.artifact-menu-wrap { position: relative; }
+.artifact-menu {
+ position: absolute; right: 0; top: 34px; z-index: 30; width: 190px; padding: 5px;
+ background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
+ box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
+}
+.artifact-menu-item {
+ display: flex; width: 100%; align-items: center; gap: 9px; padding: 7px 9px;
+ border: 0; background: none; border-radius: 7px; text-align: left;
+ font-size: 12.5px; color: var(--ink); cursor: pointer;
+}
+.artifact-menu-item:hover { background: var(--paper); }
+.artifact-menu-item svg { color: var(--muted); flex: none; }
+.artifact-menu-div { height: 1px; margin: 5px 4px; background: var(--line); }