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): measure fixed dialog presses in the viewport [N26]

Corey Olson4e3419e2641d
diff --git a/test/cockpit/spec.test.js b/test/cockpit/spec.test.js
index f478b389..e50c19e0 100644
--- a/test/cockpit/spec.test.js
+++ b/test/cockpit/spec.test.js
@@ -536,7 +536,24 @@ test('real Chrome records Spec row decisions from the row, detail and confirmed
box.run(demo.repo, 'shout', 'person', `refresh probe ${width}`);
await chrome.waitFor(`data.project.shouts.some(shout => shout.shout_text === 'refresh probe ${width}')`);
assert.equal(await chrome.stable("document.querySelector('#spec-decline-reason').value"), 'Needs a clearer outcome', `${width}: typed reason survives a live refresh`);
+ // A background scroll must not refuse a fixed dialog button that stays under the native pointer.
+ if (width === 375) await chrome.stable(`(() => {
+ window.__pullboardScrollProbe = null;
+ window.addEventListener('mousemove', () => {
+ const target = document.querySelector('#spec-decline-submit');
+ const box = () => { const r=target.getBoundingClientRect(); return { x:r.x, y:r.y, width:r.width, height:r.height }; };
+ const before={ scrollX, scrollY, box:box() };
+ window.scrollBy({ top:-49, left:0, behavior:'instant' });
+ window.__pullboardScrollProbe={ before, after:{scrollX, scrollY, box:box()}, connected:target.isConnected };
+ }, { once:true });
+ })()`);
await diagnosticClick(chrome, '#spec-decline-submit', width, 'decline submit');
+ if (width === 375) {
+ const scrollProbe = JSON.parse(await chrome.stable('JSON.stringify(window.__pullboardScrollProbe)'));
+ assert.ok(scrollProbe?.connected, 'the real pointer moved over the connected fixed dialog target');
+ assert.equal(scrollProbe.before.scrollY - scrollProbe.after.scrollY, 49, 'the background document scrolls during pointer movement');
+ assert.deepEqual(scrollProbe.after.box, scrollProbe.before.box, 'the fixed target retains its exact viewport geometry');
+ }
await chrome.waitFor("!!document.querySelector('#spec-detail .spec-feedback.ok,#spec-detail .spec-feedback.no')");
await chrome.stable("window.__confirmCalls = 0; window.confirm = () => { window.__confirmCalls += 1; return false; }");
diff --git a/test/cockpit/stable.js b/test/cockpit/stable.js
index 4392dddd..ddeae111 100644
--- a/test/cockpit/stable.js
+++ b/test/cockpit/stable.js
@@ -118,6 +118,7 @@ export async function waitForStableBoxes(chrome, find = 'document.documentElemen
/**
* Press an uncovered, stable target through real Chrome input, optionally using a browser button or modifier.
* A pointer move can change hover layout, so wait again after it and refuse a changed point rather than retrying.
+ * Compare viewport geometry: background document scrolling cannot move a fixed dialog target under that pointer.
* @param {object} chrome
* @param {string} find
* @param {{ native?: boolean, button?: string, modifiers?: number, afterMouseDown?: () => Promise<void> }} [options] - Optionally observe work while the real pointer remains held.
@@ -132,7 +133,7 @@ export async function press(chrome, find, { native = true, button = 'left', modi
const element = (${find}), rect = element.getBoundingClientRect(), x = rect.x + rect.width / 2, y = rect.y + rect.height / 2;
const hit = document.elementFromPoint(x, y);
if (!rect.width || !rect.height || !hit || (hit !== element && !element.contains(hit))) throw Error('shared press: target is hidden or covered: ' + ${JSON.stringify(find)});
- return { x, y, width: rect.width, height: rect.height, scrollX, scrollY };
+ return { x, y, width: rect.width, height: rect.height };
})()`;
const point = await rawChromeEvaluation(chrome, pointExpression);
const raw = clients.get(chrome);