Skip to content

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.

fix(relay): 60px Copy buttons; share screen before the listing [H17,H5]

Corey Olsonc1f9237bc37d
diff --git a/relay/browser-client.js b/relay/browser-client.js
index abb717f0..1e139059 100644
--- a/relay/browser-client.js
+++ b/relay/browser-client.js
@@ -557,6 +557,11 @@ export async function createTransport({ onUpdate = () => {} } = {}) {
// A pairing link opened in another tab, as a scanned QR does, saves its key here: this page fills in by itself.
addEventListener('storage', event => { if (event.key === KEYS && !accessLost) listing().then(onUpdate, notice); });
addEventListener('pagehide', () => { for (const entry of paired.values()) entry.stream?.close(); });
+ // Signed in with no board key saved and no pairing on its way, the one-command screen shows at once, while the
+ // first listing is still on the network; the listing then fills the board in, or keeps this screen.
+ let devicePairing = /(?:^#|&)device=/u.test(location.hash);
+ try { devicePairing ||= sessionStorage.getItem('pullboard.relay.device-pair.v1') !== null; } catch { /* No storage: no saved pairing. */ }
+ if (!pair && !devicePairing && !Object.keys(keys).length) showRelayScreen(document.documentElement, 'share');
if (await enrollPhone((path, options) => documentAt(path, denied, options))) keepPairingStorage();
await listing();
await installPhoneApprovals((path, options) => documentAt(path, denied, options), keys, async () => { await listing(); onUpdate(); }, access.signal);
diff --git a/relay/browser-screens.css b/relay/browser-screens.css
index ceb48d2d..683438cc 100644
--- a/relay/browser-screens.css
+++ b/relay/browser-screens.css
@@ -18,21 +18,23 @@
.relay-say { margin: 12px auto 0; color: var(--ink-muted); font-size: 17px; text-wrap: balance; }
.relay-small { margin: 12px auto 0; color: var(--ink-muted); font-size: 14.5px; text-wrap: balance; }
-/* One action, 60 px tall: the GitHub button is dark in either theme, and each box beside it is the same height. */
+/* Every button is 60 px tall: the GitHub button is dark in either theme, and each box beside it is the same height. */
.relay-big { display: flex; align-items: center; justify-content: center; gap: 12px; box-sizing: border-box; height: 60px; margin-top: 28px;
border-radius: 14px; background: #1f2328; color: #fff; font-weight: 600; font-size: 18px; text-decoration: none; }
:root[data-scheme="dark"] .relay-big { border: 1px solid var(--line-strong); }
.relay-big svg { width: 22px; height: 22px; }
.relay-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; box-sizing: border-box; height: 60px;
- padding: 0 8px 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; }
+ padding: 0 0 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; }
.relay-command { margin-top: 28px; }
.relay-command code { overflow: hidden; font: 600 14px var(--mono); white-space: nowrap; text-overflow: ellipsis; }
.relay-command code span { color: var(--ink-faint); }
.relay-agent > span, .relay-help > span { flex: 1; display: block; font-weight: 600; line-height: 1.3; }
.relay-agent small, .relay-help small { display: block; color: var(--ink-muted); font-weight: 400; font-size: 13px; }
.relay-agent svg, .relay-help svg { flex: none; width: 22px; height: 22px; color: var(--accent); }
-.relay-box button, .relay-help button { flex: none; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px;
- background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: 15px; cursor: pointer; }
+.relay-box button, .relay-help button { flex: none; box-sizing: border-box; height: 60px; padding: 0 18px; border: 1px solid var(--line);
+ border-radius: 14px; background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: 15px; cursor: pointer; }
+/* Inside a 60 px box the button takes the box's own right edge, so box and button are both 60 px. */
+.relay-box button { margin: -1px -1px -1px 0; border-radius: 0 14px 14px 0; }
.relay-or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--ink-faint); font-size: 13.5px; }
.relay-or::before, .relay-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.relay-help { display: flex; align-items: center; gap: 12px; margin-top: 26px; padding: 10px 10px 10px 14px; border: 1px dashed var(--line-strong);
diff --git a/test/relay-browser.test.js b/test/relay-browser.test.js
index 567a2c49..17be803d 100644
--- a/test/relay-browser.test.js
+++ b/test/relay-browser.test.js
@@ -511,6 +511,7 @@ const SCREEN_FACTS = `(() => {
footer: shown(document.querySelector('footer.status')),
github: box('#relay-screen .relay-github'), githubLight: rgb && (0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]) / 255,
command: box('#relay-screen .relay-command'), agent: box('#relay-screen .relay-agent'),
+ copies: [...document.querySelectorAll('#relay-screen button')].filter(shown).map(node => node.textContent.trim() + ' ' + Math.round(node.getBoundingClientRect().height)),
commandFont: document.querySelector('#relay-screen .relay-command code') ? getComputedStyle(document.querySelector('#relay-screen .relay-command code')).fontFamily : null,
};
})()`;
@@ -562,6 +563,7 @@ test('a phone not signed in sees one GitHub button and nothing about this comput
assert.equal(facts.cards, 0, how + ': no empty cards');
assert.equal(facts.footer, false, how + ': no error footer');
assert.equal(facts.github, 60, how + ': the GitHub button is 60 px tall');
+ assert.deepEqual(facts.copies, ['Copy 60'], how + ': the Stuck line\'s Copy is 60 px tall');
assert.ok(facts.githubLight < 0.2, how + ': the GitHub button is dark');
assert.equal(facts.text.trim().endsWith('Copy'), true, how + ': the screen ends with the Stuck line and its Copy');
}
@@ -611,6 +613,7 @@ test('signed in with nothing shared shows one command and waits [H5,H17]', {
assert.doesNotMatch(facts.text.replace('pullboard relay on --all', ''), /\brelay\b|\blinked\b|local view|try again/iu, device + ': relay only inside the command');
assert.equal(facts.command, 60, device + ': the command box is 60 px tall');
assert.equal(facts.agent, 60, device + ': the agent box is the same height');
+ assert.deepEqual(facts.copies, ['Copy 60', 'Copy 60'], device + ': the command\'s Copy and the agent\'s Copy are 60 px tall');
assert.match(facts.commandFont, /mono|Menlo|Consolas/iu, device + ': the command is in a mono box');
if (device === 'a phone') {
assert.doesNotMatch(facts.text, THIS_COMPUTER, 'the phone says nothing about this computer or pullboard view');
@@ -630,6 +633,48 @@ test('signed in with nothing shared shows one command and waits [H5,H17]', {
}
});
+test('a signed-in phone shows the one-command screen while its first listing is on its way [H5,H17]', {
+ skip: !findChromeExecutable() && 'Chrome is not installed',
+}, async t => {
+ const box = await relayClientFixture(t);
+ const marker = 'SHARED_AFTER_SLOW_LISTING_757';
+ assert.equal((await box.cli('add', box.lane, marker)).code, 0);
+ const chrome = await startChrome();
+ t.after(() => chrome.close());
+ await asPhone(chrome);
+ // Hold every board listing on the network until the test lets it go, as a slow phone connection does.
+ await chrome.send('Page.addScriptToEvaluateOnNewDocument', { source: `(() => {
+ const original = window.fetch.bind(window);
+ window.held757 = [];
+ window.fetch = (input, init) => {
+ const path = new URL(typeof input === 'string' ? input : input.url, location.href).pathname;
+ if (path !== '/api/v1/boards' || window.release757) return original(input, init);
+ return new Promise(resolve => { window.held757.push(() => resolve(original(input, init))); });
+ };
+ window.releaseListings757 = () => { window.release757 = true; for (const go of window.held757.splice(0)) go(); };
+ })();` });
+ await personCookie(chrome, box);
+ await chrome.navigate(box.origin);
+ await chrome.waitFor("window.held757?.length > 0 && document.documentElement.dataset.relayScreen === 'share'");
+ const facts = await chrome.evaluate(SCREEN_FACTS);
+ assert.equal(await chrome.evaluate('window.release757 === undefined && window.held757.length > 0'), true, 'the first listing is still on its way');
+ for (const words of ['One step on your computer', 'pullboard relay on --all', 'Waiting for your boards']) {
+ assert.equal(facts.text.includes(words), true, 'while the listing waits, the screen says ' + words);
+ }
+ assert.doesNotMatch(facts.text, /Pairing this browser|Projects/u, 'no pairing notice or project list while the listing waits');
+ assert.deepEqual(facts.copies, ['Copy 60', 'Copy 60'], 'both Copy buttons are 60 px tall while the listing waits');
+ await chrome.evaluate('window.samePage757 = true; window.releaseListings757()');
+ await chrome.waitFor("document.querySelector('#relay-notice') !== null && document.documentElement.dataset.relayScreen === 'share'");
+ await box.link();
+ const link = JSON.parse(readFileSync(box.linkFile, 'utf8'));
+ const encoded = readFileSync(box.keyFile, 'utf8').trim();
+ const tab = await chrome.send('Target.createTarget', { url: box.origin + '/#board=' + link.board + '&key=' + encoded });
+ assert.equal(typeof tab.targetId, 'string');
+ await chrome.waitFor("document.querySelector('#chain')?.textContent.includes(" + JSON.stringify(marker) + ')');
+ assert.equal(await chrome.evaluate("window.samePage757 === true && (document.documentElement.dataset.relayScreen ?? null) === null"), true,
+ 'once a board is shared the waiting page fills in by itself');
+});
+
/** A pre-ordered mirror's durable local outbox keeps its final browser projection recoverable. */
test('legacy queued presentations never disclose later unacknowledged moves [H5,H15]', async t => {
const box = await relayClientFixture(t);