web: unify mobile back and audit controls and link pipeline run history
This commit is contained in:
@@ -92,8 +92,23 @@ try {
|
||||
await page.click(".chat-back");
|
||||
await page.waitForSelector("#chatRows");
|
||||
assert.equal(await page.evaluate("document.querySelector('#chatRows').scrollTop"), scroll);
|
||||
// Activity changes color in place; it must not move the harness mark or add a
|
||||
// Streaming label to the row.
|
||||
const iconRect = await page.evaluate(`(() => { const icon=document.querySelector('#chatRows .chat-row[data-session="${sessionId}"] .chat-backend-logo'); window.__icon=icon; const r=icon.getBoundingClientRect(); return [r.x,r.y,r.width,r.height]; })()`);
|
||||
await emit({ message_id:"msg_answer",kind:"step",step:{status:"started"} });
|
||||
assert.equal(await page.evaluate("window.__icon.dataset.activity"), "streaming");
|
||||
assert.equal(await page.evaluate("document.querySelectorAll('#chatRows .chat-activity-streaming').length"), 0);
|
||||
assert.deepEqual(await page.evaluate("(() => { const r=window.__icon.getBoundingClientRect(); return [r.x,r.y,r.width,r.height]; })()"), iconRect);
|
||||
await emit({ message_id:"msg_answer",kind:"step",step:{status:"ended"} });
|
||||
await page.evaluate(`document.querySelector('#chatRows .chat-row[data-session="${sessionId}"] .chat-session-button').click()`);
|
||||
await page.waitForSelector("#chatInput");
|
||||
await page.waitForSelector("#chatTranscript");
|
||||
await page.evaluate("(() => { const t=document.querySelector('#chatTranscript'); t.dispatchEvent(new WheelEvent('wheel',{deltaY:-240,bubbles:true})); t.scrollTop=0; t.dispatchEvent(new Event('scroll')); })()");
|
||||
await page.fill("#chatInput", "New message must scroll into view");
|
||||
await page.click("#chatSend");
|
||||
await eventually(() => page.evaluate("(() => { const t=document.querySelector('#chatTranscript'); return t.textContent.includes('New message must scroll into view') && t.scrollHeight-t.scrollTop-t.clientHeight<3; })()"));
|
||||
assert.deepEqual(await page.evaluate("window.__errors"), []);
|
||||
console.log("Model dialog focus, intermediate/terminal steps, keyboard composer identity/caret and Back scroll restoration passed.");
|
||||
console.log("Model dialog, stable activity mark, keyboard/caret, Back restoration and send-to-bottom passed.");
|
||||
} finally {
|
||||
await browser?.close();
|
||||
serve.kill("SIGTERM");
|
||||
|
||||
@@ -11,6 +11,13 @@ import {
|
||||
|
||||
const defaultRoute = () => ({ ...DEFAULT_ROUTE });
|
||||
|
||||
test("pipeline-specific Runs links survive reload and ignore invalid filter ids", () => {
|
||||
assert.deepEqual(parseRoute("/runs?pipeline=27"), { kind: "runs", pipelineId: 27 });
|
||||
assert.equal(serializeRoute({ kind: "runs", pipelineId: 27 }), "/runs?pipeline=27");
|
||||
assert.deepEqual(parseRoute("/runs?pipeline=bad"), { kind: "runs" });
|
||||
assert.equal(serializeRoute({ kind: "runs", pipelineId: -1 }), "/runs");
|
||||
});
|
||||
|
||||
test("default destination: empty, root, unknown and malformed paths", () => {
|
||||
for (const path of [
|
||||
undefined,
|
||||
|
||||
@@ -91,6 +91,43 @@ try {
|
||||
if (process.env.PIPELINES_CAPTURE_DIR) {
|
||||
await page.screenshot(join(process.env.PIPELINES_CAPTURE_DIR, "single-admitted-run.png"));
|
||||
}
|
||||
const runId = await page.evaluate("Number(location.pathname.split('/')[2])");
|
||||
assert.equal((await fetch(`http://${target}/complete-fixture`, { method: "POST" })).status, 204);
|
||||
await page.goto(`http://127.0.0.1:${port}/runs/${runId}/stage/work`);
|
||||
await page.waitForSelector(".stage-pane-back");
|
||||
const back = await page.evaluate("(() => { const b=document.querySelector('.stage-pane-back'); const r=b.getBoundingClientRect(); return {width:r.width,height:r.height,svg:!!b.querySelector('svg'),text:b.textContent}; })()");
|
||||
assert.equal(Math.round(back.width), 48);
|
||||
assert.equal(Math.round(back.height), 48);
|
||||
assert.equal(back.svg, true);
|
||||
assert.equal(back.text, "");
|
||||
await page.click(".audit-open");
|
||||
await page.waitForSelector(".audit-viewer");
|
||||
for (const width of [390, 420]) {
|
||||
await page.resize(width, 844);
|
||||
await eventually(() => page.evaluate("document.querySelector('.audit-viewer').getAnimations({subtree:true}).every(a => a.playState !== 'running')"));
|
||||
const measured = await page.evaluate("(() => { const v=document.querySelector('.audit-panel'); const tab=v.querySelector('.audit-tab.active'); const b=v.querySelector('.audit-back'); return {radius:getComputedStyle(tab).borderRadius,tabHeight:tab.getBoundingClientRect().height,backWidth:b.getBoundingClientRect().width,backHeight:b.getBoundingClientRect().height,panelWidth:v.getBoundingClientRect().width,pageWidth:document.documentElement.scrollWidth}; })()");
|
||||
assert.equal(measured.radius, "0px");
|
||||
assert.ok(Math.round(measured.tabHeight) >= 48);
|
||||
assert.equal(Math.round(measured.backWidth), 48);
|
||||
assert.equal(Math.round(measured.backHeight), 48);
|
||||
assert.ok(measured.pageWidth <= width && measured.panelWidth <= width);
|
||||
if (process.env.PIPELINES_CAPTURE_DIR) {
|
||||
await eventually(() => page.evaluate("document.querySelector('.audit-viewer').getAnimations({subtree:true}).every(a => a.playState !== 'running')"));
|
||||
await page.screenshot(join(process.env.PIPELINES_CAPTURE_DIR, `mobile-audit-${width}.png`));
|
||||
}
|
||||
}
|
||||
await page.click(".audit-back");
|
||||
await page.click(".stage-pane-back");
|
||||
await page.goto(pipeline);
|
||||
await page.waitForSelector(".pipeline-runs");
|
||||
await page.click(".pipeline-runs");
|
||||
await eventually(() => page.evaluate(`location.pathname === '/runs' && location.search === '?pipeline=${pipelineId}'`));
|
||||
await page.waitForSelector(".pipeline-filter-chip");
|
||||
assert.equal(await page.evaluate("document.querySelectorAll('.list.runs .run-row').length"), 1);
|
||||
await page.goto(`http://127.0.0.1:${port}/runs?pipeline=${pipelineId}`);
|
||||
await page.waitForSelector(".pipeline-filter-chip");
|
||||
assert.equal(await page.evaluate("document.querySelectorAll('.list.runs .run-row').length"), 1);
|
||||
if (process.env.PIPELINES_CAPTURE_DIR) await page.screenshot(join(process.env.PIPELINES_CAPTURE_DIR, "pipeline-filtered-runs.png"));
|
||||
console.log("Lost launch acknowledgement + reload reconciled to the single admitted run.");
|
||||
} finally {
|
||||
await browser?.close();
|
||||
|
||||
Reference in New Issue
Block a user