Skip to content

Commit 7072b40

Browse files
committed
fix(desktop): contain long activity titles in dashboard columns
1 parent 872caa9 commit 7072b40

3 files changed

Lines changed: 55 additions & 3 deletions

File tree

‎apps/desktop/src/styles/product.css‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,11 @@
159159
.project-table-time { color: var(--ui-text-tertiary); font-size: 11px; white-space: nowrap; }
160160
.project-column-branch { width: 19%; }.project-column-activity { width: 16%; }.project-column-updated { width: 15%; }.project-column-action { width: 72px; text-align: right; }
161161
.project-open-button { min-width: 0; padding-inline: 6px; font-weight: 620; }
162-
.dashboard-activity-list { display: grid; }
162+
/* Recent-session titles have a large min-content size. An implicit auto grid
163+
track lets them escape the narrow activity column (including in WKWebView). */
164+
.dashboard-activity-list { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
165+
.dashboard-activity-link { min-width: 0; }
166+
.dashboard-activity-link .mantine-NavLink-label { display: block; }
163167
.dashboard-activity-link { border-bottom: 1px solid var(--ui-border-subtle); border-radius: 0; }
164168
.dashboard-activity-link:hover { background: var(--ui-surface-secondary); }
165169
.dashboard-activity-link .mantine-NavLink-label { overflow: hidden; font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import assert from 'node:assert/strict';
2+
import fs from 'node:fs';
3+
import path from 'node:path';
4+
import { chromium } from 'playwright';
5+
import { startFixtureServer } from './server.mjs';
6+
7+
// Isolated renderer regression for the native Desktop's unbounded recent-session
8+
// titles. Only the test fixture responds; no production Tauri/API is invoked.
9+
const root=path.resolve(import.meta.dirname,'../..');
10+
const fixture=await startFixtureServer();
11+
const chrome='/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
12+
const executablePath=process.env.UI_SMOKE_BROWSER||(fs.existsSync(chrome)?chrome:undefined);
13+
let browser;
14+
const results=[];
15+
try {
16+
browser=await chromium.launch({headless:true,...(executablePath?{executablePath}:{})});
17+
const page=await browser.newPage();
18+
await page.route('**/desktop-shim.js',async route=>{
19+
const response=await route.fetch();let source=await response.text();
20+
const marker='recent_sessions:{sessions:[],truncated:false,scan_truncated:false}';
21+
assert.equal(source.split(marker).length,2);
22+
const sessions=[0,1,2].map(index=>({session_id:'wc_sess_long_activity_'+index,project_id:'agent:fixture-runner:alpha',title:'Owner review with a deliberately long session description '.repeat(35),updated_at:Math.floor(Date.now()/1000),lifecycle:'active',mode:'normal'}));
23+
source=source.replace(marker,'recent_sessions:'+JSON.stringify({sessions,truncated:false,scan_truncated:false}));
24+
await route.fulfill({response,body:source});
25+
});
26+
for(const width of [768,1180,1440,1920]) {
27+
await page.setViewportSize({width,height:900});
28+
await page.goto(fixture.url+'/desktop/');
29+
await page.locator('.dashboard-activity-link').first().waitFor();
30+
const metrics=await page.evaluate(()=>{
31+
const section=document.querySelector('[aria-labelledby="recent-activity-title"]');
32+
const rect=section.getBoundingClientRect();
33+
return {viewport:innerWidth,documentWidth:document.documentElement.scrollWidth,sectionRight:rect.right,
34+
links:[...document.querySelectorAll('.dashboard-activity-link')].map(link=>({right:link.getBoundingClientRect().right,width:link.getBoundingClientRect().width}))};
35+
});
36+
results.push({width,...metrics});
37+
assert(metrics.documentWidth<=width+1,JSON.stringify(metrics));
38+
assert(metrics.links.every(link=>link.right<=metrics.sectionRight+1),JSON.stringify(metrics));
39+
}
40+
console.log(JSON.stringify({fixture:true,nativeBackend:false,passed:true,results},null,2));
41+
} finally {
42+
if(browser)await browser.close();await new Promise(resolve=>fixture.server.close(resolve));
43+
}

‎scripts/ui-smoke/package.json‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
"name": "webcodex-isolated-ui-smoke",
33
"private": true,
44
"type": "module",
5-
"scripts": { "test": "node smoke.mjs", "serve": "node server.mjs" },
6-
"devDependencies": { "playwright": "1.63.0" }
5+
"scripts": {
6+
"test": "node smoke.mjs && node desktop-long-activity.mjs",
7+
"serve": "node server.mjs"
8+
},
9+
"devDependencies": {
10+
"playwright": "1.63.0"
11+
}
712
}

0 commit comments

Comments
 (0)