From d1ef6297ecead79337522155b69c8d57a4440366 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Mon, 23 Nov 2026 14:08:30 -0500 Subject: [PATCH] Empty states say what to do next (#33) - Workers: what a worker is, the four settings it needs, and a link to the README's worker setup. - Scheduler: what a schedule does, a + New Schedule button, and a pointer to try the command in Quick Command first. - Workflows: links to the step reference and to Quick Command, under the existing Create button. - The "No workers available" pickers in Quick Command and the schedule form link to the Workers page. - UI test with stubbed empty lists checks each hint and action. Co-Authored-By: Claude Opus 5.5 --- public/assets/pages/quick.js | 3 ++- public/assets/pages/scheduler.js | 11 +++++++++-- public/assets/pages/workers.js | 5 ++++- public/assets/pages/workflows.js | 2 ++ tests/ui/pages.ui.js | 20 ++++++++++++++++++++ 5 files changed, 37 insertions(+), 4 deletions(-) diff --git a/public/assets/pages/quick.js b/public/assets/pages/quick.js index 7fd7e2d..407caa8 100644 --- a/public/assets/pages/quick.js +++ b/public/assets/pages/quick.js @@ -78,7 +78,8 @@ const wrap = document.getElementById('qc-worker-list'); if (!wrap) return; if (workers.length === 0) { - wrap.innerHTML = '
No workers available
'; + wrap.innerHTML = '
No workers available
' + + '
Connect one first: see Workers.
'; return; } const keep = preserveIds || new Set(); diff --git a/public/assets/pages/scheduler.js b/public/assets/pages/scheduler.js index 70c0d59..e467ef9 100644 --- a/public/assets/pages/scheduler.js +++ b/public/assets/pages/scheduler.js @@ -94,7 +94,13 @@ const wrap = document.getElementById('sc-wrap'); if (!wrap) return; if (_schedules.length === 0) { - wrap.innerHTML = '
No scheduled commands yet
'; + wrap.innerHTML = + '
' + + '
No scheduled commands yet
' + + '
A schedule runs a command on the workers you pick, repeatedly. ' + + 'Try the command in Quick Command first, then schedule it here.
' + + '' + + '
'; return; } wrap.innerHTML = @@ -128,7 +134,8 @@ const wrap = document.getElementById('sc-worker-list'); if (!wrap) return; if (_workers.length === 0) { - wrap.innerHTML = '
No workers available
'; + wrap.innerHTML = '
No workers available
' + + '
Connect one first: see Workers.
'; return; } wrap.innerHTML = _workers.map(w => diff --git a/public/assets/pages/workers.js b/public/assets/pages/workers.js index 467e15f..2235b9a 100644 --- a/public/assets/pages/workers.js +++ b/public/assets/pages/workers.js @@ -178,7 +178,10 @@ '
' + '
⚙
' + '
No workers connected
' + - '
Workers appear here once they connect and send a heartbeat.
' + + '
A worker is a small agent that runs commands on its host. Install it there, ' + + 'set WORKER_NAME, PULSE_SERVER, PULSE_WS and WORKER_API_KEY ' + + '(the server\'s key), and start it: it shows up here within a few seconds.
' + + 'Worker setup guide' + '
'; return; } diff --git a/public/assets/pages/workflows.js b/public/assets/pages/workflows.js index 15a366c..2909ca9 100644 --- a/public/assets/pages/workflows.js +++ b/public/assets/pages/workflows.js @@ -49,6 +49,8 @@ '
No workflows yet
' + '
Workflows let you run multi-step jobs across one or more workers.
' + '' + + '
Step types and examples' + + ' · or try a single command in Quick Command
' + '' ); } diff --git a/tests/ui/pages.ui.js b/tests/ui/pages.ui.js index 8210a69..a7f8452 100644 --- a/tests/ui/pages.ui.js +++ b/tests/ui/pages.ui.js @@ -74,3 +74,23 @@ test.describe('first visit in a session', () => { await expect(page.locator('#lt-boot-text')).toContainText('ALL SYSTEMS NOMINAL: PULSE', { timeout: 15_000 }); }); }); + +test('empty states say what to do next (#33)', async ({ page }) => { + for (const path of ['/api/workers', '/api/scheduled-commands', '/api/workflows']) { + await page.route(u => u.pathname === path, r => r.fulfill({ json: [] })); + } + await page.goto('/workers'); + await expect(page.locator('#wk-grid')).toContainText('WORKER_API_KEY'); + await expect(page.getByRole('link', { name: 'Worker setup guide' })).toHaveAttribute('href', /#pulse-worker-setup$/); + + await page.goto('/scheduler'); + await page.locator('#sc-wrap').getByRole('button', { name: '+ New Schedule' }).click(); + await expect(page.locator('#sc-create-modal')).toBeVisible(); + await page.keyboard.press('Escape'); + + await page.goto('/quick'); + await expect(page.locator('#qc-worker-list').getByRole('link', { name: 'Workers' })).toHaveAttribute('href', '/workers'); + + await page.goto('/workflows'); + await expect(page.getByRole('link', { name: 'Step types and examples' })).toHaveAttribute('href', /#workflows$/); +}); -- 2.47.3