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): keep replay controls fixed with scrollbars [A10,N26,C7]

Corey Olsonb536f115ba02
diff --git a/src/view.css b/src/view.css
index 6c2cd93f..480523b7 100644
--- a/src/view.css
+++ b/src/view.css
@@ -575,11 +575,21 @@ code.inline.long { white-space: break-spaces; overflow-wrap: anywhere; }
.flow g:hover > .box, .flow g:hover > .edge { stroke-width: 2.2; }
.console { position: static; width: min(560px, calc(100% - 32px)); margin: 8px auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 38vh; overflow: auto; cursor: pointer; }
.console.ok { border-color: var(--accent); } .console.no { border-color: var(--reject); }
-.snapshot-controls:not([hidden]) { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; padding: 12px 16px; }
-.snapshot-controls > span { font-weight: 600; }
-#replay-play { min-inline-size: 12em; }
-.snapshot-controls label { display: flex; align-items: center; gap: 6px; }
-.snapshot-controls output { color: var(--ink-muted); font: 12px/1.5 var(--mono); }
+/* Keep the replay viewport width fixed when its event list grows a classic scrollbar. */
+:root:has(body.snapshot) { overflow-y: scroll; }
+/* Changing Play and event labels occupy their own tracks, so they cannot rewrap a tap target. */
+.snapshot-controls:not([hidden]) { display: grid; grid-template-columns: minmax(0, 18rem) max-content max-content; align-items: center; gap: 10px; margin-bottom: 16px; padding: 12px 16px; }
+.snapshot-controls > span { grid-column: 1 / -1; font-weight: 600; }
+#replay-play { grid-column: 1; min-inline-size: 0; }
+#replay-pause { grid-column: 2; }
+.snapshot-controls label { grid-column: 3; display: flex; align-items: center; gap: 6px; }
+.snapshot-controls output { grid-column: 1 / -1; min-width: 0; overflow-wrap: anywhere; color: var(--ink-muted); font: 12px/1.5 var(--mono); }
+@media (width < 600px) {
+ .snapshot-controls:not([hidden]) { grid-template-columns: minmax(0, 1fr) max-content; }
+ #replay-play { grid-column: 1 / -1; }
+ #replay-pause { grid-column: 1; justify-self: start; }
+ .snapshot-controls label { grid-column: 2; }
+}
.snapshot #new-item, .snapshot form, .snapshot [data-new], .snapshot [data-release], .snapshot [data-shout], .snapshot [data-go^="decide:"] { display: none !important; }
.read-only:not(.requests) #new-item, .read-only:not(.requests) form, .read-only:not(.requests) [data-new], .read-only:not(.requests) [data-release], .read-only:not(.requests) [data-shout], .read-only:not(.requests) [data-go^="decide:"] { display: none !important; }
.person-requests { margin-bottom: 12px; padding: 12px; min-width: 0; }
diff --git a/test/cockpit/snapshot.test.js b/test/cockpit/snapshot.test.js
index b8644c81..dc55f485 100644
--- a/test/cockpit/snapshot.test.js
+++ b/test/cockpit/snapshot.test.js
@@ -338,8 +338,7 @@ test('replay speed is judged by its scheduled delay [A10,C7]', { timeout: 90_000
});
/** Measure every interactive replay control through its real start, pause, and end states. */
-test('the replay controls don\'t move when the replay starts [A10,C7]', { timeout: 60_000 }, // budget: hang-only ceiling for two viewport geometry passes.
-async function replayControlsStayPut(t) {
+const replayControlsStayPut = (wideFonts = false, classicScrollbar = false) => async function replayControlsStayPutCase(t) {
const executable = chromeExecutable();
assert.ok(executable, 'Chrome is required for replay control geometry coverage');
const box = machine();
@@ -349,6 +348,10 @@ async function replayControlsStayPut(t) {
}
const folder = join(box.dir, 'stable-replay-controls-export');
box.run(alpha.repo, 'view', '--export', folder);
+ if (classicScrollbar) {
+ const stylesheet = join(folder, 'view.css');
+ writeFileSync(stylesheet, readFileSync(stylesheet, 'utf8') + '\n::-webkit-scrollbar { width: 15px; }\n');
+ }
const host = await serveFolder(folder, '/demo/');
const profile = join(box.dir, 'stable-replay-controls-chrome');
let chrome;
@@ -399,12 +402,28 @@ async function replayControlsStayPut(t) {
})())`));
t.diagnostic('replay control boxes ' + JSON.stringify({ width, state,
runner: { node: process.version, platform: process.platform, arch: process.arch }, ...capture }));
+ if (classicScrollbar && state === 'end') {
+ assert.equal(capture.viewport.scrollbarWidth, 15, `${width}: the fixture uses the measured native 15px classic scrollbar`);
+ if (width === 375) assert.ok(capture.viewport.scrollHeight > capture.viewport.clientHeight, `${width}: the final event list needs vertical scrolling`);
+ }
return capture.boxes;
};
/** Exercise real browser input and compare control geometry within one viewport. */
const verifyWidth = async (width) => {
await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });
await chrome.waitFor(`innerWidth === ${width}`);
+ if (wideFonts) {
+ await chrome.stable(`(() => {
+ const sheet = document.styleSheets[0];
+ sheet.insertRule('.snapshot-controls, .snapshot-controls * { letter-spacing: .12em !important; }', sheet.cssRules.length);
+ })()`);
+ const spacing = JSON.parse(await chrome.stable(`JSON.stringify(
+ ['#snapshot-controls > span', '#replay-play', '#replay-pause', '#replay-speed', '#replay-progress']
+ .map(selector => getComputedStyle(document.querySelector(selector)).letterSpacing)
+ )`));
+ assert.ok(spacing.every(value => Number.parseFloat(value) > 0),
+ `${width}: every replay control receives the wide-font fixture`);
+ }
await chrome.stable(`(() => {
replayPosition(0);
const speed = document.querySelector('#replay-speed');
@@ -435,7 +454,7 @@ async function replayControlsStayPut(t) {
assert.deepEqual(boxes, atStart, `${width}: every interactive replay control keeps its box unchanged ${state}`);
}
};
- for (const width of [375, 1280]) {
+ for (const width of (wideFonts ? [375] : [375, 1280])) {
await verifyWidth(width);
}
} finally {
@@ -443,7 +462,16 @@ async function replayControlsStayPut(t) {
await host.close();
rmSync(profile, { recursive: true, force: true });
}
-});
+};
+
+test('the replay controls don\'t move when the replay starts [A10,C7]', { timeout: 60_000 }, // budget: hang-only ceiling for two viewport geometry passes.
+ replayControlsStayPut());
+
+test('the replay controls hold their place at 375 with wide fonts [A10,C7]', { timeout: 60_000 }, // budget: hang-only ceiling for one viewport geometry pass.
+ replayControlsStayPut(true));
+
+test('the replay controls hold their place with a classic scrollbar [A10,C7]', { timeout: 60_000 }, // budget: hang-only ceiling for two viewport geometry passes.
+ replayControlsStayPut(false, true));
test('static export redacts structured checkout paths but preserves paths people wrote [A10]', async () => {
const box = machine();