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
test(view): the wide-font toolbar test widens by letter-spacing [N26]
Corey Olsona92ceb3ccfc2
diff --git a/test/cockpit/items.test.js b/test/cockpit/items.test.jsindex 6668bf51..eaa69fa0 100644--- a/test/cockpit/items.test.js+++ b/test/cockpit/items.test.js@@ -401,21 +401,26 @@ test('the items toolbar is one row: view, filter and new [N26]', async () => {}});-test('the items toolbar fits at 375 with wide fonts [N26]', async () => {+/** The items toolbar at 375 behind CI's classic scrollbar with every label widened by a letter-spacing in em, so each+ * widens by the same share of its face on every runner, whatever fonts the runner has (#445). With forcedFonts the+ * toolbar also draws in a wide face where the machine has one; without, each label keeps its own face, which shows+ * the widening never rested on the face. */+const wideFontToolbar = (forcedFonts) => async () => {const executable = chromeExecutable();assert.ok(executable, 'the wide-font toolbar check needs Chrome');const box = machine();const longLane = 'apilonglanenameforclipping';const lanes = { web: { owns: ['web/'], specs: ['G'] }, [longLane]: { owns: ['api/'], specs: ['G'] } };- const alpha = project(box, 'wide-fonts', SPEC, { lanes });+ const alpha = project(box, forcedFonts ? 'wide-fonts' : 'wide-spacing', SPEC, { lanes });box.run(alpha.repo, 'add', 'web', 'Active item', '--specs', 'G1');box.run(alpha.repo, 'add', longLane, 'Another item', '--specs', 'G1');const view = await startView(box);const profile = mkdtempSync(join(tmpdir(), 'pullboard-items-wide-fonts-chrome-'));let chrome;- /** The toolbar's visible labels by their text's own width, measured from the glyphs, not the boxes. */+ /** The toolbar's visible labels by their text's own width, measured from the glyphs, not the boxes, and the face each draws in. */const labels = async () => JSON.parse(await chrome.stable(`JSON.stringify([...document.querySelectorAll('.items-view-switch button, #filter-label, #new-item span')]- .filter((e) => e.getClientRects().length).map((e) => { const r = document.createRange(); r.selectNodeContents(e); return [e.id || e.textContent.trim(), r.getBoundingClientRect().width]; }))`));+ .filter((e) => e.getClientRects().length).map((e) => { const r = document.createRange(); r.selectNodeContents(e); return [e.id || e.textContent.trim(), r.getBoundingClientRect().width, getComputedStyle(e).fontFamily]; }))`));+ const widths = (list) => JSON.stringify(list.map(([name, width]) => [name, Math.round(width * 100) / 100]));/** Sideways scroll of the toolbar and the page, and every box in the toolbar or its menu that reaches past the toolbar's inside edge. */const fit = async () => JSON.parse(await chrome.stable(`JSON.stringify((() => {const bar = document.querySelector('.toolbar'), s = getComputedStyle(bar), r = bar.getBoundingClientRect();@@ -435,11 +440,16 @@ test('the items toolbar fits at 375 with wide fonts [N26]', async () => {await chrome.stable("(() => { const sheet = document.styleSheets[0]; sheet.insertRule('html { overflow-y: scroll; }', 0); sheet.insertRule('::-webkit-scrollbar { width: 15px; }', 0); return true; })()");await chrome.waitFor('document.documentElement.clientWidth === 360');const before = await labels();- // A wider face and letter-spacing on the toolbar and its menu, as a runner with wider fonts draws them.- await chrome.stable("(() => { const sheet = document.styleSheets[0]; sheet.insertRule('.toolbar, .toolbar *, .filter-menu, .filter-menu * { font-family: Verdana, \"DejaVu Sans\", \"Bitstream Vera Sans\", sans-serif !important; letter-spacing: .05em !important; }', sheet.cssRules.length); return true; })()");+ // A letter-spacing in em on the toolbar and its menu adds the same share of each face to every letter, so the+ // widening does not hang on which fonts this machine has. On Linux CI the forced face fell back to the runner's+ // own and "New" widened only 6% (#445). The forced face, where a machine has it, widens further.+ const face = forcedFonts ? 'font-family: Verdana, "DejaVu Sans", "Bitstream Vera Sans", sans-serif !important; ' : '';+ await chrome.stable(`(() => { const sheet = document.styleSheets[0]; sheet.insertRule('.toolbar, .toolbar *, .filter-menu, .filter-menu * { ${face}letter-spacing: .12em !important; }', sheet.cssRules.length); return true; })()`);const after = await labels();assert.deepEqual(after.map(([name]) => name), before.map(([name]) => name), 'the same labels, widened');- assert.ok(after.every(([, width], i) => width >= before[i][1] * 1.1), `every label is at least 10% wider: ${JSON.stringify([before, after])}`);+ if (forcedFonts) assert.ok(after.every(([, , family]) => family.startsWith('Verdana')), `every label asks for the forced face: ${JSON.stringify(after)}`);+ else assert.deepEqual(after.map(([, , family]) => family), before.map(([, , family]) => family), 'every label keeps its own face');+ assert.ok(after.every(([, width], i) => width >= before[i][1] * 1.1), `every label is at least 10% wider: ${widths(before)} to ${widths(after)}`);for (const scheme of ['light', 'dark']) {await chrome.send('Emulation.setEmulatedMedia', { features: [{ name: 'prefers-color-scheme', value: scheme }] });await chrome.waitFor(`document.documentElement.dataset.scheme === '${scheme}'`);@@ -463,7 +473,11 @@ test('the items toolbar fits at 375 with wide fonts [N26]', async () => {rmSync(profile, { recursive: true, force: true });await view.stop();}-});+};++test('the items toolbar fits at 375 with wide fonts [N26]', wideFontToolbar(true));++test('the wide-font widening holds without the forced fonts [N26]', wideFontToolbar(false));test('the filter menu sets show and lane [N26]', async () => {const executable = chromeExecutable();