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): a code reference never pushes the page sideways [N26]

Corey Olsona6ef5a5835ac
diff --git a/src/view.css b/src/view.css
index 1b3299d1..1d19f764 100644
--- a/src/view.css
+++ b/src/view.css
@@ -262,6 +262,8 @@ form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; paddin
.feed .day { margin: 0; padding: 12px 0 4px; font: 600 11px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); }
.feed .day:first-child { padding-top: 6px; }
button.ref { width: auto; min-height: 0; border: 0; border-radius: 0; background: none; padding: 0; color: var(--accent-strong); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; display: inline; vertical-align: baseline; line-height: inherit; font: inherit; }
+/* A code reference (path:lines@sha) is one long token: wider than its line, it breaks anywhere rather than push the page sideways. */
+button.ref[data-code] { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
code.inline { padding: 0 3px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 8%, var(--surface)); font: .92em var(--mono); white-space: break-spaces; }
.code { display: block; margin: 6px 0 2px; padding: 6px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font: 12px/1.55 var(--mono); white-space: pre; overflow-x: auto; overflow-wrap: normal; }
.code > span { display: block; padding-right: 12px; }
diff --git a/test/cockpit.test.js b/test/cockpit.test.js
index 2acf7a04..3bcef90a 100644
--- a/test/cockpit.test.js
+++ b/test/cockpit.test.js
@@ -634,6 +634,46 @@ test('a project with one repo shows once in the project list [N33, N26]', async
}
});
+test('the view never scrolls sideways at 320px [N26]', { timeout: 120_000 }, async (t) => {
+ const executable = chromeExecutable();
+ if (!executable) return t.skip('Install Chrome or set PULLBOARD_CHROME for the 320px check.');
+
+ const box = machine();
+ const demo = project(box, 'narrow');
+ box.run(demo.repo, 'add', 'web', 'A title long enough to need every bit of a narrow phone row, and then some more words', '--specs', 'G1', '--criterion', 'fits');
+ box.run(demo.repo, 'add', 'web', 'Built, then sent back', '--specs', 'G1', '--criterion', 'back');
+ build(box, demo, 2, 'two.txt');
+ sendBack(box, demo, 2, 'It misses the edge the criterion names, a reason long enough to wrap on a phone.');
+ const sha = box.git(demo.repo, 'rev-parse', 'HEAD').trim();
+ box.run(demo.repo, 'shout', 'web', `Run \`pullboard next --verify\` and read SPEC.md:1-2@${sha} before you take #1.`);
+ const view = await startView(box);
+ const profile = mkdtempSync(join(tmpdir(), 'pullboard-sideways-chrome-'));
+ let chrome;
+ try {
+ chrome = await openSnapshotChrome(executable, view.link.href, profile);
+ await chrome.send('Emulation.setDeviceMetricsOverride', { width: 320, height: 800, deviceScaleFactor: 1, mobile: false });
+ await chrome.waitFor('innerWidth === 320 && document.querySelectorAll("#chain .row").length === 2');
+ for (const tab of ['items', 'shouts', 'spec', 'doctrine', 'activity', 'roadmap']) {
+ await chrome.evaluate(`document.querySelector('[data-tab="${tab}"]').click()`);
+ await chrome.waitFor(`!document.querySelector('[data-pane="${tab}"]').hidden`);
+ const seen = JSON.parse(await chrome.evaluate(`JSON.stringify((() => {
+ const edge = document.documentElement.clientWidth;
+ // Name each element that runs past the edge with nothing above it to clip or scroll it.
+ const clipped = (e) => { for (let p = e.parentElement; p && p !== document.body; p = p.parentElement) if (!['visible', ''].includes(getComputedStyle(p).overflowX)) return true; return false; };
+ const name = (e) => e.tagName.toLowerCase() + (e.id ? '#' + e.id : '') + (typeof e.className === 'string' && e.className ? '.' + e.className.trim().split(/\\s+/).join('.') : '');
+ const past = [...document.querySelectorAll('body *')].filter((e) => { const r = e.getBoundingClientRect(); return r.width > 0 && r.right > edge + 0.5 && !clipped(e); })
+ .map((e) => name(e) + ' right ' + Math.round(e.getBoundingClientRect().right) + ': ' + (e.textContent || '').trim().slice(0, 40));
+ return { scrollWidth: document.documentElement.scrollWidth, clientWidth: edge, past: past.slice(0, 8), more: Math.max(0, past.length - 8) };
+ })())`));
+ assert.ok(seen.scrollWidth <= seen.clientWidth, `320, ${tab}: the page scrolls sideways, ${seen.scrollWidth} wide in ${seen.clientWidth}; past the edge: ${seen.past.join(' | ')}${seen.more ? ` (+${seen.more} more)` : ''}`);
+ }
+ } finally {
+ if (chrome) await closeSnapshotChrome(chrome);
+ rmSync(profile, { recursive: true, force: true });
+ await view.stop();
+ }
+});
+
test('the tabs fit one row on a phone [N26]', async () => {
const view = await startView(machine());
try {