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(view): open-board help keeps one line on Linux fonts [N26,H5]

Corey Olson973486ecc184
diff --git a/src/view.css b/src/view.css
index 0afb6a5d..3a9a9742 100644
--- a/src/view.css
+++ b/src/view.css
@@ -187,6 +187,10 @@ a.ghost { color: var(--ink); }
.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; }
+/* On a computer the sentence keeps to one line whatever fonts are installed (#829): the strip keeps the mockup's
+ width and grows only as far as a wider font needs, centred, into the panel's own padding. Linux's DejaVu needs
+ 513px for the longest sentence where the panel's box gives 520px. */
+@media (width >= 760px) { .ob-help { position: relative; left: 50%; transform: translateX(-50%); width: max-content; min-width: min(500px, 100%); max-width: calc(100vw - 32px); margin: 26px 0 0; } .ob-help small { white-space: nowrap; } }
/* 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/test/cockpit/local-origin.test.js b/test/cockpit/local-origin.test.js
index c269d64f..04a9358a 100644
--- a/test/cockpit/local-origin.test.js
+++ b/test/cockpit/local-origin.test.js
@@ -826,9 +826,13 @@ test('every hosted page state says what it is and what to do next [N26,H5]', { t
const actions = [...document.querySelectorAll('#detail button[data-shout], #detail button[data-new]')]
.filter((element) => element.getClientRects().length).map((element) => ({ text: element.textContent,
style: signature(element), height: element.getBoundingClientRect().height }));
- probe.remove(); return { baseline, actions };
+ // What the page showed, for a run where the actions do not appear (#829: Linux CI only, not reproduced here).
+ const detail = document.querySelector('#detail');
+ const seen = { innerWidth, detailShown: Boolean(detail && detail.getClientRects().length), item: view.item ?? null,
+ tab: view.tab ?? null, all: [...document.querySelectorAll('#detail button[data-shout], #detail button[data-new]')].map((element) => element.textContent + (element.getClientRects().length ? '' : ' (hidden)')) };
+ probe.remove(); return { baseline, actions, seen };
})())`));
- assert.equal(controls.actions.length, 2, `both next actions appear at ${width}px in ${theme}`);
+ assert.equal(controls.actions.length, 2, `both next actions appear at ${width}px in ${theme}: ${JSON.stringify(controls.seen)}`);
for (const action of controls.actions) {
assert.notDeepEqual(action.style, controls.baseline, `${action.text} uses the view styles at ${width}px in ${theme}`);
if (width === 390) assert.ok(action.height >= 44, `${action.text} retains a phone touch target in ${theme}`);
diff --git a/test/cockpit/open-board.test.js b/test/cockpit/open-board.test.js
index ebbc1451..a40172cd 100644
--- a/test/cockpit/open-board.test.js
+++ b/test/cockpit/open-board.test.js
@@ -35,7 +35,7 @@ function call(base, path, { method = 'GET', headers = {} } = {}) {
* the person answers), and otherwise passed to the view the test started on its own port.
*/
async function openBoardStand(chrome, view) {
- const stand = { signedIn: false, linked: [], local: null, hold: false, held: [], failures: [], failList: 0 };
+ const stand = { signedIn: false, linked: [], local: null, hold: false, held: [], failures: [], failList: 0, dropped: 0 };
const client = 'export function rememberPairing() { return null; }\nexport async function createTransport() { return { async request(path) { if (path === "/api/v1/boards") return { version: 1, boards: [], warnings: [] }; throw new Error("no paired board"); } }; }\n';
const relay = createRelayBrowserHandler({ authenticate: async () => { if (stand.signedIn) return { kind: 'session' }; throw new Refused('AUTH_REQUIRED', 'Sign in.'); } });
const send = (requestId, status, headers, body) => chrome.send('Fetch.fulfillRequest', { requestId, responseCode: status, responseHeaders: headers, body: Buffer.from(body).toString('base64') });
@@ -46,6 +46,15 @@ async function openBoardStand(chrome, view) {
const reply = await call(stand.local, address.pathname + address.search, { method: asked.method, headers: Object.fromEntries(Object.entries(asked.headers).filter(([name]) => name.toLowerCase() !== 'host')) });
return send(requestId, reply.status, Object.entries(reply.headers).filter(([name]) => !['content-length', 'transfer-encoding', 'connection', 'keep-alive', 'date'].includes(name)).map(([name, value]) => ({ name, value: String(value) })), reply.body);
};
+ /**
+ * Record a reply that failed. A reply that comes after the page stopped waiting, because it moved on, reloaded or its
+ * own wait ran out, has nowhere to go: Chrome dropped that request. It is counted, never a failure; any other error
+ * still is (#829).
+ */
+ const settle = (error) => {
+ if (/Invalid InterceptionId/u.test(error.message)) stand.dropped += 1;
+ else stand.failures.push(error.message);
+ };
const listener = ({ data }) => {
const message = JSON.parse(String(data));
if (message.method !== 'Fetch.requestPaused') return;
@@ -78,7 +87,7 @@ async function openBoardStand(chrome, view) {
const handled = await relay({ method: 'GET', url: address.pathname, headers: {} }, { writeHead: (status, headers) => { head = headers; }, end: (content) => { body = content ?? ''; } });
if (!handled) return chrome.send('Fetch.failRequest', { requestId, errorReason: 'Failed' });
return fulfil(requestId, head['content-type'], body, [{ name: 'Content-Security-Policy', value: head['content-security-policy'].replace("connect-src 'self'", "connect-src 'self' " + view.base) }]);
- })().catch((error) => stand.failures.push(error.message));
+ })().catch(settle);
};
chrome.socket.addEventListener('message', listener);
await chrome.send('Fetch.enable', { patterns: [{ urlPattern: HOSTED + '/*', requestStage: 'Request' }, { urlPattern: LOCAL + '/*', requestStage: 'Request' }, { urlPattern: view.base + '/api/v1/boards', requestStage: 'Request' }, { urlPattern: view.base + '/api/v1/boards?*', requestStage: 'Request' }] });
@@ -117,7 +126,7 @@ async function openBoardStand(chrome, view) {
stand.release = async () => {
stand.hold = false;
const held = stand.held.splice(0);
- for (const entry of held) await toView(entry);
+ for (const entry of held) await toView(entry).catch(settle);
};
/** Stop serving the stand-in. */
stand.stop = async () => {