Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
fix(view): open-board help strips and the unpaired link step [N26,H5]
Corey Olson7621b43124eb
diff --git a/src/view.css b/src/view.cssindex cb50bd57..7427d89f 100644--- a/src/view.css+++ b/src/view.css@@ -181,9 +181,11 @@ a.ghost { color: var(--ink); }.ob-spin::after { content: ""; position: absolute; top: -5.5px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--accent); }@keyframes ob-turn { to { transform: rotate(1turn); } }@media (prefers-reduced-motion: reduce) { .ob-live i, .ob-spin { animation: none; } }-.ob-help { display: flex; align-items: center; gap: 12px; max-width: 420px; margin: 26px auto 0; padding: 10px 10px 10px 14px; border: 1px dashed var(--line-strong); border-radius: 14px; text-align: left; color: var(--ink-muted); font-size: 14.5px; }+.ob-help { display: flex; align-items: center; gap: 12px; max-width: 500px; margin: 26px auto 0; padding: 10px 10px 10px 14px; border: 1px dashed var(--line-strong); border-radius: 14px; text-align: left; color: var(--ink-muted); font-size: 14.5px; }.ob-help > span { flex: 1; min-width: 0; }.ob-help small { display: block; color: var(--ink); font-size: 15px; font-weight: 600; }+/* The help strip's Copy is the mockup's 40 px button, so on a computer its sentence keeps to one line. */+.ob-help button { height: 40px; padding: 0 14px; border-radius: 10px; font-size: 14.5px; }/* The browser's own permission prompt, drawn so people know what to click. */.ob-ask { position: relative; margin: 28px auto 0; max-width: 380px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); text-align: left; }.ob-ask .t { font-weight: 600; }diff --git a/src/view/hosted.js b/src/view/hosted.jsindex 2a52db8f..ddc48d6a 100644--- a/src/view/hosted.js+++ b/src/view/hosted.js@@ -96,12 +96,14 @@ export function hostedBrowser(agent) {* and One step on your computer, for a phone and for a person signed in with nothing shared.** @param {string|null} state - looking, asking, blocked, not-running, mismatch, problem, signed-out, no-linked, unpaired, linked-failed or local-failed.- * @param {{phone?: boolean, detail?: string}} [facts] - Whether the page runs on a phone, and a refusal's own words.+ * @param {{phone?: boolean, detail?: string, linked?: string[]}} [facts] - Whether the page runs on a phone, a refusal's own words, and the boards the account shares that this browser cannot open yet.* @returns {null|{state: string, kind: string, heading: string, text?: string, parts: string[], command?: string, ask?: string, small?: string, live?: string, lead?: string, help?: string, detail?: string}}*/export function hostedState(state, facts = {}) {const agent = 'Something not working? Ask your agent';const opening = 'Help me open my Pullboard board.';+ const updating = 'Help me update Pullboard.';+ const shared = facts.linked || [];const share = { kind: 'state', heading: 'One step on your computer', text: 'On the computer with your projects, open a terminal and run this once:', parts: ['command'], command: 'pullboard relay on --all', ask: 'Help me share my boards with my phone.',small: 'It shares every project with your account. Your boards show up here by themselves.', live: 'Waiting for your boards' };const models = {@@ -112,14 +114,19 @@ export function hostedState(state, facts = {}) {live: 'Your boards open as soon as it\'s on', lead: agent, help: 'My browser blocked Pullboard. Help me fix it.' },'not-running': { kind: 'state', heading: 'Where are your projects?', parts: ['two'], live: 'Still looking on this computer', wide: true },'mismatch': { kind: 'state', heading: 'Update Pullboard on this computer', text: 'The Pullboard on this computer does not match this page. Update it, and this page opens your boards by itself.', parts: ['command'],- command: 'npm i -g pullboard', ask: opening, live: 'Still looking on this computer' },+ command: 'npm i -g pullboard', ask: updating, live: 'Still looking on this computer', lead: agent, help: updating },'problem': { kind: 'state', heading: 'Open your board', text: facts.detail || 'This page could not take the connection Pullboard on this computer sent back.', parts: ['open'], lead: agent, help: opening },'signed-out': facts.phone? { kind: 'state', heading: 'Your boards, on your phone', text: 'Sign in with the GitHub account you use on your computer.', parts: ['github'], small: 'Nothing to install on your phone.',lead: 'Stuck? On your computer, ask your agent', help: 'Help me see my boards on my phone.' }- : { kind: 'state', heading: 'Open them from any device', text: 'Your boards on your phone and every computer, from the GitHub account you shared them with.', parts: ['github'], small: 'Not shared yet? After you sign in, it shows the one step.' },+ : { kind: 'state', heading: 'Open them from any device', text: 'Your boards on your phone and every computer, from the GitHub account you shared them with.', parts: ['github'], small: 'Not shared yet? After you sign in, it shows the one step.',+ lead: agent, help: opening },'no-linked': share,- 'unpaired': share,+ // The account shares boards this browser holds no key for. Running the command alone never opens them here: a+ // browser enrolls only from the pairing link the command prints (relay/browser-devices.js enrollPhone), so the+ // screen says to open that link or scan its QR, as the screen before it did.+ 'unpaired': { ...share, text: 'On the computer with your projects, open a terminal and run this, then open the link it prints here or scan its QR:', ask: opening,+ small: 'Your account shares ' + (shared.join(', ') || 'your boards') + '. This browser opens ' + (shared.length === 1 ? 'it' : 'them') + ' from that link.' },'linked-failed': { kind: 'note', heading: 'Shared boards did not load', text: 'They show here by themselves once they answer.', parts: [], detail: facts.detail },'local-failed': { kind: 'note', heading: 'This computer\'s boards did not load', text: 'They show here by themselves once Pullboard answers.', parts: [], detail: facts.detail },};diff --git a/test/cockpit/open-board.test.js b/test/cockpit/open-board.test.jsindex fe885fe1..2a748ad9 100644--- a/test/cockpit/open-board.test.js+++ b/test/cockpit/open-board.test.js@@ -1,6 +1,6 @@/** Opening your board from pullboard.dev: one clear screen at a time, in the approved words, moving on by itself [N26,H5]. */import assert from 'node:assert/strict';-import { request } from 'node:http';+import { createServer, request } from 'node:http';import { mkdtempSync, rmSync } from 'node:fs';import { tmpdir } from 'node:os';import { join } from 'node:path';@@ -121,6 +121,7 @@ const SHOWN = `JSON.stringify((() => {commands: all('#local-note .ob-cmd').map((box) => ({ code: box.querySelector('code').textContent.trim(), copy: copy(box), mono: /mono|Menlo|Consolas/i.test(getComputedStyle(box.querySelector('code')).fontFamily), height: height(box) })),agents: all('#local-note .ob-agent').map((box) => ({ text: box.textContent.replace(/Copy$/, '').trim(), copy: copy(box), height: height(box) })),help: all('#local-note .ob-help').map((strip) => ({ text: strip.textContent.replace(/Copy$/, '').trim(), copy: copy(strip), border: getComputedStyle(strip).borderTopStyle })),+ helpFit: all('#local-note .ob-help').map((strip) => { const said = strip.querySelector('small'); return { button: height(strip.querySelector('button')), oneLine: said.getBoundingClientRect().height < parseFloat(getComputedStyle(said).fontSize) * 1.8 }; }),github: all('#local-note .ob-gh').map((button) => ({ text: button.textContent.trim(), href: button.getAttribute('href'), height: height(button), background: getComputedStyle(button).backgroundColor })),live: all('#local-note .ob-live').map((line) => line.textContent.trim()),ask: all('#local-note .ob-ask').map((bubble) => bubble.textContent.replace(/\\s+/g, ' ').trim()),@@ -154,13 +155,13 @@ function alone(seen, heading, { allow = '' } = {}) {assert.equal(seen.theme, true, `${seen.state}: the theme toggle sits in the header`);}-test('each open-board state shows alone with its words [N26,H5]', { timeout: 120_000 }, async () => { // budget: hang ceiling for seven hosted page loads in Chrome with screenshots at two widths.+test('each open-board state shows alone with its words [N26,H5]', { timeout: 150_000 }, async () => { // budget: hang ceiling for nine hosted page loads in Chrome with screenshots at two widths.const executable = chromeExecutable();assert.ok(executable, 'the open-board check needs real Chrome');const box = machine();project(box, 'open-board-states');const profile = mkdtempSync(join(tmpdir(), 'pullboard-open-board-'));- let view, chrome, stand;+ let view, chrome, stand, other;try {view = await startView(box);chrome = await openSnapshotChrome(executable, 'about:blank', profile);@@ -185,6 +186,7 @@ test('each open-board state shows alone with its words [N26,H5]', { timeout: 120assert.match(asking.ask[0], /^app\.pullboard\.dev wants to Access other apps and services on this device Block Allow ↑ click this$/, 'with its words and the button to click');assert.deepEqual(asking.live, ['Waiting for you to click Allow'], 'a live line says the page waits');assert.deepEqual(asking.help, [{ text: 'Something not working? Ask your agent“Help me allow Pullboard in my browser.”', copy: 'Help me allow Pullboard in my browser.', border: 'dashed' }], 'a dashed help strip ends the screen with a sentence to copy');+ assert.deepEqual(asking.helpFit, [{ button: 40, oneLine: true }], 'its Copy is the 40 px button the mockup draws, and on a computer the sentence keeps to one line');await press(chrome, "document.querySelector('#local-note .ob-help button')");await chrome.waitFor("document.querySelector('#local-note .ob-help button').textContent === 'Copied'", 5_000); // budget: hang ceiling for one clipboard write.// The theme toggle in the header turns the page to the other scheme.@@ -202,6 +204,7 @@ test('each open-board state shows alone with its words [N26,H5]', { timeout: 120assert.deepEqual(blocked.steps, ['Click the icon left of the address, at the top of this window.', 'Find Local network access, or Apps on this device.', 'Set it to Allow.'], 'three steps');assert.deepEqual(blocked.live, ['Your boards open as soon as it\'s on']);assert.deepEqual(blocked.help, [{ text: 'Something not working? Ask your agent“My browser blocked Pullboard. Help me fix it.”', copy: 'My browser blocked Pullboard. Help me fix it.', border: 'dashed' }]);+ assert.deepEqual(blocked.helpFit, [{ button: 40, oneLine: true }], 'the sentence keeps to one line');// Where are your projects: nothing runs here and nobody is signed in, so two equal cards say how the paths differ.const absent = await openState(chrome, '?absent', 'not-running', 'open-board-where');@@ -219,10 +222,32 @@ test('each open-board state shows alone with its words [N26,H5]', { timeout: 120await press(chrome, "document.querySelector('#local-note .ob-cmd button')");await chrome.waitFor("document.querySelector('#local-note .ob-cmd button').textContent === 'Copied'", 5_000); // budget: hang ceiling for one clipboard write.+ // Pullboard on this computer speaks another version of the page's protocol: one command updates it, and a dashed+ // strip ends the screen, as on every screen where something can go wrong.+ other = createServer((req, res) => {+ res.writeHead(200, { 'content-type': 'application/json', 'access-control-allow-origin': HOSTED });+ res.end(JSON.stringify({ version: 2, apiVersion: 2, hostedOrigin: HOSTED }));+ });+ await new Promise((ready) => other.listen(0, '127.0.0.1', ready));+ stand.local = 'http://127.0.0.1:' + other.address().port;+ const update = await openState(chrome, '?mismatch', 'mismatch', 'open-board-update');+ alone(update, 'Update Pullboard on this computer');+ assert.deepEqual(update.commands.map((command) => [command.code, command.copy, command.height]), [['$npm i -g pullboard', 'npm i -g pullboard', 60]], 'the update command in a mono box with Copy');+ assert.deepEqual(update.agents.map((agent) => [agent.text, agent.copy, agent.height]), [['Ask your agent“Help me update Pullboard.”', 'Help me update Pullboard.', 60]], 'its "or" box asks the agent to help update');+ assert.deepEqual(update.help, [{ text: 'Something not working? Ask your agent“Help me update Pullboard.”', copy: 'Help me update Pullboard.', border: 'dashed' }], 'a dashed help strip with a sentence to copy ends the screen');+ assert.deepEqual(update.helpFit, [{ button: 40, oneLine: true }]);+ await press(chrome, "document.querySelector('#local-note .ob-help button')");+ await chrome.waitFor("document.querySelector('#local-note .ob-help button').textContent === 'Copied'", 5_000); // budget: hang ceiling for one clipboard write.+ stand.local = null;+// A pairing link on a computer, not signed in: the one way that opens boards from any device.const out = await openState(chrome, '?out#board=' + 'b'.repeat(32) + '&key=k1', 'signed-out', 'open-board-sign-in');alone(out, 'Open them from any device');assert.deepEqual(out.github.map((button) => [button.text, button.href, button.height]), [['Sign in with GitHub', '/auth/github/start', 60]]);+ assert.deepEqual(out.help, [{ text: 'Something not working? Ask your agent“Help me open my Pullboard board.”', copy: 'Help me open my Pullboard board.', border: 'dashed' }], 'a dashed help strip with a sentence to copy ends the screen');+ assert.deepEqual(out.helpFit, [{ button: 40, oneLine: true }]);+ await press(chrome, "document.querySelector('#local-note .ob-help button')");+ await chrome.waitFor("document.querySelector('#local-note .ob-help button').textContent === 'Copied'", 5_000); // budget: hang ceiling for one clipboard write.// The phone's first screen, drawn by the view from the state #757 provides: one GitHub button, nothing about this computer.const phone = await openState(chrome, '?plain-phone#board=' + 'b'.repeat(32) + '&key=k1', 'signed-out', 'open-board-phone');@@ -243,6 +268,19 @@ test('each open-board state shows alone with its words [N26,H5]', { timeout: 120assert.deepEqual(share.agents.map((agent) => [agent.text, agent.copy, agent.height]), [[words.share.agent + '“' + words.share.ask + '”', words.share.ask, 60]]);assert.deepEqual(share.small, [words.share.small]);assert.deepEqual(share.live, [words.share.waiting]);++ // Signed in, and the account shares a board this browser holds no key for. Running the command alone never opens+ // it here: a browser enrolls only from the pairing link the command prints, so the screen says to open that link+ // or scan its QR, and never that the boards show up by themselves. Nobody waits forever.+ stand.linked = [{ id: 'a'.repeat(32), repository: 'acme/web', linkedAt: 0 }];+ const unpaired = await openState(chrome, '?linked', 'unpaired', 'open-board-unpaired');+ alone(unpaired, words.share.title, { allow: words.share.command });+ assert.equal(unpaired.say, 'On the computer with your projects, open a terminal and run this, then open the link it prints here or scan its QR:', 'the step names the link and the QR');+ assert.deepEqual(unpaired.commands.map((command) => [command.code, command.copy]), [['$' + words.share.command, words.share.command]]);+ assert.deepEqual(unpaired.small, ['Your account shares acme/web. This browser opens it from that link.'], 'it names the shared board and how this browser opens it');+ assert.doesNotMatch(unpaired.text, /by themselves/, 'and never says the boards arrive by themselves');+ assert.deepEqual(unpaired.live, [words.share.waiting]);+ stand.linked = [];assert.deepEqual(chrome.exceptions, [], 'Chrome reports no uncaught exceptions');assert.deepEqual(stand.failures, [], 'the stand-in hosted page was served');} finally {@@ -250,8 +288,11 @@ test('each open-board state shows alone with its words [N26,H5]', { timeout: 120finally {try { if (chrome) await closeSnapshotChrome(chrome); }finally {- try { if (view) await view.stop(); }- finally { rmSync(profile, { recursive: true, force: true }); }+ try { if (other) await new Promise((closed) => { other.close(closed); other.closeAllConnections(); }); }+ finally {+ try { if (view) await view.stop(); }+ finally { rmSync(profile, { recursive: true, force: true }); }+ }}}}