Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(webui): tidy work header and unify identity copying
  • Loading branch information
yyjeqhc committed Oct 2, 2026
commit 82250bc0ba51393c97fa721007438159732bb319
Binary file added artifacts/work-header/work-1440-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artifacts/work-header/work-1440-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artifacts/work-header/work-390-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artifacts/work-header/work-390-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artifacts/work-header/work-800-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artifacts/work-header/work-800-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,604 changes: 1,811 additions & 1,793 deletions frontend/dist/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion frontend/dist/styles.css

Large diffs are not rendered by default.

87 changes: 45 additions & 42 deletions frontend/src/runtime-v2/components/WindowWorkbench.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export function WindowWorkbench({
: currentProjectName;
const currentMachine = currentProject?.client_id;
const currentDirectory = displayProjectPath(currentProject?.path);
const currentProjectAddress = currentProject?.id;
const currentProjectAddress = currentProjectId;
const hasSelectedWindow = Boolean(selectedSummary || detail);
const visibleActiveCount = detail?.active_count ?? selectedSummary?.active_count ?? 0;
const visibleActivityCount = (detail?.activity_returned || 0) + visibleActiveCount;
Expand Down Expand Up @@ -347,54 +347,57 @@ export function WindowWorkbench({
)}
</div>
<h2>{currentWorkspaceName || currentActivity || t("Window")}</h2>
<div className="window-header-facts">
<span className="window-header-fact" title={windows.selectedKey} data-testid="current-window-identity">
<Monitor size={14} /><small>{t("Window")}</small>
<CopyIdentity key={windows.selectedKey} value={windows.selectedKey} label={t("Window")} language={language} />
</span>
{currentMachine && (
<span className="window-header-fact" title={currentMachine}>
<Server size={14} />
<small>{t("Machine")}</small>
<strong>{currentMachine}</strong>
</span>
)}
{currentDirectory && (
<span className="window-header-fact" title={currentDirectory}>
<FolderOpen size={14} />
<small>{t("Directory")}</small>
<strong>{currentDirectory}</strong>
</span>
)}
{currentProjectAddress && (
<span className="window-header-fact" title={currentProjectAddress}>
<Box size={14} />
<small>{t("Project address")}</small>
<strong>{currentProjectAddress}</strong>
</span>
)}
{firstObservedAt && (
<span className="window-header-fact" title={absoluteTime(firstObservedAt)}>
<Clock3 size={14} />
<small>{t("First active")}</small>
<strong>{absoluteTime(firstObservedAt)}</strong>
</span>
)}
{currentActivity && (
<span className="window-header-fact window-header-activity">
<CircleDot size={12} />
<small>{t("Latest activity")}</small>
<strong>{currentActivity}{lastObservedAt ? " · " + clockTime(lastObservedAt) : ""}</strong>
</span>
)}
</div>
</div>
<span className={"quiet-pill " + (isActive ? "running" : "")}>
<CircleDot size={11} />
{isActive
? visibleActiveCount + " " + t("active")
: t("Idle") + " · " + relativeTime(lastObservedAt)}
</span>
<div className="window-header-facts">
<span className="window-header-fact" title={windows.selectedKey} data-testid="current-window-identity">
<Monitor size={14} /><small>{t("Window")}</small>
<CopyIdentity key={windows.selectedKey} value={windows.selectedKey} label={t("Window")} language={language} />
</span>
{currentMachine && (
<span className="window-header-fact" title={currentMachine}>
<Server size={14} />
<small>{t("Machine")}</small>
<CopyIdentity key={currentMachine} value={currentMachine} label={t("Machine")} language={language} />
</span>
)}
{currentDirectory && (
<span className="window-header-fact" title={currentDirectory}>
<FolderOpen size={14} />
<small>{t("Directory")}</small>
<CopyIdentity key={currentDirectory} value={currentDirectory} label={t("Directory")} language={language} />
</span>
)}
{currentProjectAddress && (
<span className="window-header-fact" title={currentProjectAddress}>
<Box size={14} />
<small>{t("Project address")}</small>
<CopyIdentity key={currentProjectAddress} value={currentProjectAddress} label={t("Project address")} language={language} />
</span>
)}
</div>
<div className="window-header-timeline">
{firstObservedAt && (
<span className="window-header-event" title={absoluteTime(firstObservedAt)}>
<Clock3 size={14} />
<small>{t("First active")}</small>
<time>{absoluteTime(firstObservedAt)}</time>
</span>
)}
{currentActivity && (
<span className="window-header-event">
<CircleDot size={12} />
<small>{t("Latest activity")}</small>
<strong>{currentActivity}</strong>
{lastObservedAt && <time title={absoluteTime(lastObservedAt)}>{clockTime(lastObservedAt)}</time>}
</span>
)}
</div>
</header>

<div className="session-view-tabs window-center-tabs" role="tablist" aria-label={t("Window views")}>
Expand Down
60 changes: 27 additions & 33 deletions frontend/src/runtime-v2/styles-workflow.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,47 +56,41 @@

.window-work-main { grid-template-rows: auto 42px minmax(0, 1fr); }
.window-center-tabs { flex: 0 0 auto; }
.window-work-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px 16px; }
.window-work-header h2 { white-space: normal; overflow-wrap: anywhere; }
.window-work-header > .quiet-pill { margin-top: 4px; }
.window-header-facts {
display: flex;
gap: 7px;
align-items: center;
flex-wrap: wrap;
margin-top: 7px;
grid-column: 1 / -1;
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px 24px;
}
.window-header-fact {
min-width: 0;
display: inline-grid;
grid-template-columns: 16px auto minmax(0, auto);
gap: 5px;
display: grid;
grid-template-columns: 16px minmax(0, 1fr);
gap: 4px 6px;
align-items: center;
max-width: min(420px, 100%);
border: 1px solid var(--line);
border-radius: 999px;
padding: 4px 8px;
background: var(--surface-soft);
color: var(--muted);
font-size: 11.5px;
align-content: start;
}
.window-header-fact > svg { color: var(--quiet); }
.window-header-fact small {
color: var(--quiet);
font-size: 11px;
font-weight: 600;
white-space: nowrap;
}
.window-header-fact strong {
min-width: 0;
overflow: hidden;
color: var(--text);
font-size: 11.5px;
font-weight: 600;
text-overflow: ellipsis;
white-space: nowrap;
.window-header-fact > small { color: var(--quiet); font-size: 11px; font-weight: 600; }
.window-header-fact > .copy-identity { grid-column: 2; width: 100%; }
.window-header-timeline {
grid-column: 1 / -1;
display: flex;
flex-wrap: wrap;
gap: 8px 20px;
padding-top: 10px;
border-top: 1px solid var(--line);
}
.window-header-activity {
border-color: transparent;
background: transparent;
padding-left: 4px;
.window-header-event { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.window-header-event > svg { flex-shrink: 0; }
.window-header-event small { font-size: inherit; color: var(--quiet); }
.window-header-event strong { overflow-wrap: anywhere; font-weight: 500; }
.window-header-event time { font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) {
.window-header-facts { grid-template-columns: minmax(0, 1fr); }
}
.window-call-card.session-linked { cursor: pointer; }
.window-call-card.session-linked:hover { background: var(--surface-soft); }
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/runtime-v2/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,10 @@ code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospac
}

/* Exact identities remain readable/selectable on narrow screens. */
.copy-identity { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; max-width: 100%; }
.copy-identity code { overflow-wrap: anywhere; white-space: normal; user-select: text; }
.copy-identity { display: inline-grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 4px 6px; min-width: 0; max-width: 100%; }
.copy-identity code { min-width: 0; align-self: center; overflow-wrap: anywhere; white-space: normal; user-select: text; }
.copy-identity button { flex-shrink: 0; display: inline-flex; padding: 5px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.copy-identity small { color: var(--muted); }
.window-header-fact:has(.copy-identity) { white-space: normal; border-radius: 12px; }
.copy-identity small { grid-column: 1 / -1; color: var(--muted); }
.copy-identity button:hover { color: var(--accent); background: var(--surface-soft); }
.copy-identity button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.runtime-sync-status { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); margin: 12px 0; }
4 changes: 3 additions & 1 deletion frontend/test-v2/window-first-work.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ it("shows active Window work without any Workflow Session and keeps observe call
expect(header?.textContent).toContain("Project address");
expect(header?.textContent).toContain(worktree.id);
expect(header?.textContent).toContain(activeKey);
expect(screen.getByRole("button", { name: "Copy Window" })).toBeTruthy();
for (const label of ["Window", "Machine", "Directory", "Project address"]) {
expect(within(header!).getByRole("button", { name: "Copy " + label })).toBeTruthy();
}

expect(screen.queryByText("Each call is shown separately, from first to last.")).toBeNull();
expect(screen.queryByRole("heading", { name: "Tool calls" })).toBeNull();
Expand Down
49 changes: 49 additions & 0 deletions scripts/ui-smoke/work-header.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { chromium } from 'playwright';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import { startFixtureServer } from './server.mjs';

// Production assets with isolated read-only fixtures; no live Runtime access.
const output = new URL('../../artifacts/work-header/', import.meta.url);
fs.mkdirSync(output, { recursive: true });
const fixture = await startFixtureServer();
const browser = await chromium.launch({ headless: true });
const errors = [];
try {
for (const width of [1440, 800, 390]) {
for (const theme of ['light', 'dark']) {
const page = await browser.newPage({ viewport: { width, height: 1000 }, reducedMotion: 'reduce' });
page.on('pageerror', error => errors.push(error.message));
await page.addInitScript(theme => {
localStorage.setItem('webcodex.runtime.appearance.v1', theme);
Object.defineProperty(navigator, 'clipboard', { configurable: true, value: {
writeText: async value => { window.__copied = value; },
} });
}, theme);
await page.goto(fixture.url + '/runtime/');
const header = page.locator('.window-work-header');
await header.getByRole('button', { name: 'Copy Directory', exact: true }).waitFor();
await page.screenshot({ path: new URL(`work-${width}-${theme}.png`, output).pathname, fullPage: true });
for (const label of ['Window', 'Machine', 'Directory', 'Project address']) {
const button = header.getByRole('button', { name: 'Copy ' + label, exact: true });
const value = await button.locator('..').locator('code').textContent();
await button.click();
assert.equal(await page.evaluate(() => window.__copied), value);
}
await page.evaluate(() => { navigator.clipboard.writeText = async () => { throw new Error('denied'); }; });
await header.getByRole('button', { name: 'Copy Directory', exact: true }).click();
await header.getByText('Copy unavailable; select the text to copy.', { exact: true }).waitFor();
const bounds = await page.evaluate(() => ({ width: innerWidth, body: document.body.scrollWidth, root: document.documentElement.scrollWidth }));
assert(bounds.body <= width + 1 && bounds.root <= width + 1, JSON.stringify(bounds));
for (const fact of await header.locator('.window-header-fact').all()) {
assert(await fact.evaluate(element => element.scrollWidth <= element.clientWidth + 1));
}
await page.close();
}
}
assert.deepEqual(errors, []);
console.log('Work header: 6 viewport/theme combinations passed; exact clipboard values, denied clipboard fallback, no overflow or browser errors.');
} finally {
await browser.close();
await new Promise(resolve => fixture.server.close(resolve));
}
Loading