The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test: verify desktop task tails remain reachable in Chromium
Teknium80e585fad3a8
diff --git a/apps/desktop/package.json b/apps/desktop/package.jsonindex 92e94f40f1b..0b7a3f6fab9 100644--- a/apps/desktop/package.json+++ b/apps/desktop/package.json@@ -62,6 +62,7 @@"fmt": "prettier --write 'src/**/*.{ts,tsx}' 'electron/**/*.ts' 'vite.config.ts'","fix": "npm run lint:fix && npm run fmt","test:ui": "vitest run --project ui",+ "test:task-scroll": "node --test scripts/tasks-scroll.test.mjs","test:desktop:platforms": "vitest run --project electron","test:find-in-page-native": "electron electron/find-in-page-native-fixture","test": "vitest run",diff --git a/apps/desktop/scripts/fixtures/tasks-scroll.html b/apps/desktop/scripts/fixtures/tasks-scroll.htmlnew file mode 100644index 00000000000..02c976e3a27--- /dev/null+++ b/apps/desktop/scripts/fixtures/tasks-scroll.html@@ -0,0 +1,3 @@+<!doctype html>+<html lang="en"><head><meta charset="UTF-8"><title>Task scroll regression fixture</title></head>+<body><div id="root"></div><script type="module" src="./tasks-scroll.tsx"></script></body></html>diff --git a/apps/desktop/scripts/fixtures/tasks-scroll.md b/apps/desktop/scripts/fixtures/tasks-scroll.mdnew file mode 100644index 00000000000..1c41124c905--- /dev/null+++ b/apps/desktop/scripts/fixtures/tasks-scroll.md@@ -0,0 +1,21 @@+# Task-list clipping regression++From `apps/desktop`, after the locked workspace dependencies and Playwright Chromium are installed:++```sh+npm run test:task-scroll+```++The two tests mount the production `ComposerStatusStack` (including status grouping,+section collapse, task rows and the production stylesheet) with 14 and 20 synthetic+task records. Real Chromium wheel input must expose and hit-test the final row+inside the capped viewport, above a composer boundary. Collapse and re-expand must+preserve scrolling. No inline CSS treatment or `scrollIntoView` repairs the page.+The fixture uses no backend, model, native Electron bridge or user session data;+it is a renderer-component regression, not a native-app end-to-end test.++The runner serves only loopback port 18120 and cleans up its browser and Vite+server. Its Vite cache is private. Set `TASK_SCROLL_OUTPUT` to retain the JSON+geometry and screenshots in a chosen directory. Otherwise these are retained in+the printed test run's temporary directory. In shared campaigns wrap the command+with the campaign's `flock tests.lock`, and isolate `HOME` and `HERMES_HOME`.diff --git a/apps/desktop/scripts/fixtures/tasks-scroll.tsx b/apps/desktop/scripts/fixtures/tasks-scroll.tsxnew file mode 100644index 00000000000..cfc6c672fc5--- /dev/null+++ b/apps/desktop/scripts/fixtures/tasks-scroll.tsx@@ -0,0 +1,34 @@+import '@/styles.css'++import { createRoot } from 'react-dom/client'+import { MemoryRouter } from 'react-router'++import { ComposerStatusStack } from '@/app/chat/composer/status-stack'+import { RootTooltipProvider } from '@/components/ui/tooltip'+import { I18nProvider } from '@/i18n'+import { $todosBySession } from '@/store/todos'++// Input records only: the status grouping, rows, collapse and CSS are production code.+const count = Number(new URLSearchParams(location.search).get('tasks') ?? 20)+$todosBySession.set({+ 'task-scroll-fixture': Array.from({ length: count }, (_, i) => ({+ id: `task-${i + 1}`,+ content: `Phase ${i + 1}: renderer geometry task ${'long description '.repeat(i % 3)}`,+ status: 'completed' as const+ }))+})++createRoot(document.getElementById('root')!).render(+ <I18nProvider>+ <RootTooltipProvider>+ <MemoryRouter>+ <div style={{ position: 'absolute', bottom: 30, left: 200, width: 700 }}>+ <ComposerStatusStack queue={null} sessionId="task-scroll-fixture" />+ <div data-slot="fixture-composer" style={{ position: 'relative', height: 90, background: '#ddd' }}>+ Composer boundary — component fixture, no backend+ </div>+ </div>+ </MemoryRouter>+ </RootTooltipProvider>+ </I18nProvider>+)diff --git a/apps/desktop/scripts/tasks-scroll.test.mjs b/apps/desktop/scripts/tasks-scroll.test.mjsnew file mode 100644index 00000000000..82275ea8758--- /dev/null+++ b/apps/desktop/scripts/tasks-scroll.test.mjs@@ -0,0 +1,92 @@+import assert from 'node:assert/strict'+import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises'+import { tmpdir } from 'node:os'+import path from 'node:path'+import { after, before, test } from 'node:test'+import { fileURLToPath } from 'node:url'+import { chromium } from 'playwright'+import { createServer } from 'vite'++const app = fileURLToPath(new URL('../', import.meta.url))+const scratch = await mkdtemp(path.join(tmpdir(), 'hermes-task-scroll-'))+const output = process.env.TASK_SCROLL_OUTPUT ?? scratch+let server+let browser+let url++before(async () => {+ await mkdir(output, { recursive: true })+ console.log(`Task-scroll evidence: ${output}`)+ // The runner loader avoids writing config bundles to shared node_modules.+ globalThis.__dirname = app+ server = await createServer({+ root: app,+ configFile: path.join(app, 'vite.config.ts'),+ configLoader: 'runner',+ cacheDir: path.join(scratch, 'node_modules/.vite'),+ server: { host: '127.0.0.1', port: 18120, strictPort: true },+ optimizeDeps: { entries: ['scripts/fixtures/tasks-scroll.html'] }+ })+ await server.listen()+ url = 'http://127.0.0.1:18120/scripts/fixtures/tasks-scroll.html'+ browser = await chromium.launch({ headless: true, args: ['--no-sandbox'] })+})+after(async () => {+ await browser?.close()+ await server?.close()+ if (output !== scratch) await rm(scratch, { recursive: true, force: true })+})++for (const count of [14, 20]) {+ test(`${count} tasks: wheel reveals the final row above the composer`, async () => {+ const page = await browser.newPage({ viewport: { width: 1200, height: 800 }, reducedMotion: 'reduce' })+ const errors = []+ page.on('pageerror', error => errors.push(error.message))+ try {+ await page.goto(`${url}?tasks=${count}`, { timeout: 120_000 })+ const stack = page.locator('[data-slot="composer-status-stack"]')+ const last = page.getByText(`Phase ${count}:`, { exact: false })+ await last.waitFor()+ await page.evaluate(() => document.fonts.ready)+ const measure = () => stack.evaluate(el => {+ const rect = el.getBoundingClientRect()+ return { height: el.clientHeight, scrollHeight: el.scrollHeight, top: el.scrollTop,+ bounds: { top: rect.top, bottom: rect.bottom }, cardHeight: el.firstElementChild.getBoundingClientRect().height }+ })+ const before = await measure()+ await stack.hover()+ await page.mouse.wheel(0, 10000)+ // Wheel is asynchronous; wait for animation frames to deliver it, without+ // scrollIntoView/locator.click silently repairing the broken layout.+ await page.waitForTimeout(400)+ const after = await measure()+ const tail = await last.evaluate(el => {+ const r = el.getBoundingClientRect()+ return { top: r.top, bottom: r.bottom,+ hit: el.contains(document.elementFromPoint(r.x + r.width / 2, r.y + r.height / 2)) }+ })+ const composer = await page.locator('[data-slot="fixture-composer"]').boundingBox()+ const receipt = { count, before, after, tail, composer, errors }+ console.log(JSON.stringify(receipt))+ await writeFile(path.join(output, `tasks-${count}.json`), JSON.stringify(receipt, null, 2))+ await page.screenshot({ path: path.join(output, `tasks-${count}.png`) })+ assert.deepEqual(errors, [])+ assert.ok(after.scrollHeight > after.height && after.top > before.top, 'Long task list must scroll')+ assert.ok(tail.top >= after.bounds.top && tail.bottom <= after.bounds.bottom, 'Final row must be fully inside viewport')+ assert.ok(tail.bottom <= composer.y && tail.hit, 'Final row must not be occluded by composer or card')+ // Collapse/expand must recover the same bounded, scrollable list.+ await page.mouse.wheel(0, -10000)+ await page.waitForTimeout(400)+ const header = stack.getByRole('button').first()+ await header.click()+ assert.ok((await measure()).height < before.height, 'Collapsed list must release its height')+ await header.click()+ await stack.hover()+ await page.mouse.wheel(0, 10000)+ await page.waitForTimeout(400)+ assert.ok((await measure()).top > 0, 'Re-expanded list must remain scrollable')+ } finally {+ await page.close()+ }+ })+}diff --git a/website/docs/user-guide/desktop.md b/website/docs/user-guide/desktop.mdindex 763ba247a65..b0fdc06b09c 100644--- a/website/docs/user-guide/desktop.md+++ b/website/docs/user-guide/desktop.md@@ -46,6 +46,7 @@ The center of the app. You get:- **A right-hand preview rail** — render web pages, files, and tool outputs side by side while you keep chatting.- **Comment mode in the in-app browser** — click **Annotate** in the preview browser bar, then click any element (or drag a box) on the live page and type a note; each saved comment stays as a numbered pin on the page. Saving a pin never sends a turn — when you're done, **Add N comments** attaches a cropped screenshot per pin and a short prompt naming each comment to the composer, and you still hit send yourself. Each element comment carries its CSS selector, its markup, and the computed styles that matter for layout, so the agent can find the element in your source instead of guessing from the picture. Password and hidden field values, and any attribute that looks like a key or token, are redacted on the page before the markup leaves it. Larger batches arrive grouped by which part of the page each comment sits in, so twenty-odd comments become a handful of pieces of work rather than one task each — and because the groups are separate DOM subtrees they usually touch separate files, which is what makes handing them to parallel workers safe. Pin numbers hold steady if you delete one, and switching chats clears the stack.- **Composer history and queue editing** — press the up/down arrow keys in an empty composer to recall and reuse previous prompts, and edit messages you've queued up before they're sent. Pressing Stop (or Esc) while turns are queued pauses the queue and expands it above the composer; resume it from there, or send, edit, and delete individual entries.+- **Task progress above the composer** — expand the Tasks header to inspect each phase. Long lists stay bounded above the input; scroll inside the expanded list to reach the final tasks without moving the conversation.- **A conversation timeline rail** — long chats get a slim rail of markers along the edge of the transcript, one per prompt. Hover it to pop open the list of prompts, click one to jump straight to that point in the conversation. (It appears once the chat has a handful of turns.)- **Find in page** — press **Cmd/Ctrl+F** to open a find bar that searches the rendered chat transcript. Enter / Shift+Enter (or Cmd/Ctrl+G / Cmd/Ctrl+Shift+G while the bar is open) step through matches; Esc closes it.