From 8b09da123e98395b5e03267b8352dcff9994b257 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Fri, 23 Oct 2026 01:10:24 +0100 Subject: [PATCH 1/3] wip(app): chat probe follows the new create dialog (run 170, blocked at the New marker) --- app/tool/chat_sessions_probe.mjs | 43 +++++++++++++++++-------- app/tool/chat_sessions_probe_entry.dart | 12 ++++--- 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/app/tool/chat_sessions_probe.mjs b/app/tool/chat_sessions_probe.mjs index 362473c5..6d299f0e 100644 --- a/app/tool/chat_sessions_probe.mjs +++ b/app/tool/chat_sessions_probe.mjs @@ -98,6 +98,22 @@ try { const click = async (label, what = label) => { if (!await clickLabel(label)) throw new Error(`Could not click ${what}`); }; + const clickCreateConfirm = async () => { + const point = await evaluate(`(() => { + const dialog = [...document.querySelectorAll('[role="dialog"], [role="alertdialog"]')] + .find(node => node.innerText.includes('Start a chat')); + if (!dialog) return null; + const confirm = [...dialog.querySelectorAll('flt-semantics')] + .find(node => (node.getAttribute('aria-label') || node.innerText || '') === 'New chat'); + if (!confirm) return null; + const rect = confirm.getBoundingClientRect(); + return {x: rect.x + rect.width / 2, y: rect.y + rect.height / 2}; + })()`); + if (!point) throw new Error('Could not find New chat confirm inside the Start a chat dialog'); + await send('Input.dispatchMouseEvent', { type: 'mousePressed', x: point.x, y: point.y, button: 'left', clickCount: 1 }, session); + await send('Input.dispatchMouseEvent', { type: 'mouseReleased', x: point.x, y: point.y, button: 'left', clickCount: 1 }, session); + await delay(500); + }; const clickFirst = async label => { const point = await evaluate(`(() => { const needle = ${JSON.stringify(label)}; const e=[...document.querySelectorAll('flt-semantics')].find(x => (x.getAttribute('aria-label') || x.innerText || '') === needle); if (!e) return null; e.scrollIntoView({block:'center'}); const r=e.getBoundingClientRect(); return {x:r.x+r.width/2,y:r.y+r.height/2}; })()`); if (!point) throw new Error(`Could not find ${label}`); @@ -176,7 +192,8 @@ try { // Dialog chrome at the smallest size the list supports (320 CSS px, 2x DPR). await click('New chat', 'the New chat action'); - await waitText('Server directory', 'the create dialog at 320'); + await waitText('Start a chat', 'the create dialog at 320'); + await waitText('Where should this chat live?', 'the directory picker at 320'); await shot('create-320-2x', 320, 640, 2); await click('Cancel', 'Cancel the create dialog'); await resize(390, 844); @@ -203,10 +220,9 @@ try { // A create reply without `chat_session` uses the web's exact sentence. await click('New chat', 'the New chat action'); - await waitText('Server directory', 'the create dialog'); - await focusInput(); - await type('No session title'); - await click('Create', 'the create dialog confirm'); + await waitText('Start a chat', 'the create dialog'); + await waitText('Where should this chat live?', 'the directory picker'); + await clickCreateConfirm(); await waitText( 'The server did not return the new chat session.', 'the missing-session wording', @@ -219,25 +235,24 @@ try { // Create: the dialog sends once and the accepted row arrives from a list read. await click('New chat', 'the New chat action'); - await waitText('Create', 'the create dialog'); - await focusInput(); - await type('Probe created'); - await click('Create', 'the create dialog confirm'); + await waitText('Start a chat', 'the create dialog'); + await waitText('Where should this chat live?', 'the directory picker'); + await clickCreateConfirm(); if (process.env.PROBE_DEBUG) console.log(JSON.stringify({ afterCreate: await bodyText(), labels: await semantics() }, null, 2)); - await waitText('Probe created', 'the created row'); + await waitText('New chat', 'the created row'); if ((await visibleText()).includes('no chat harness')) throw new Error('Create did not reach the fixture'); await shot('created-list', 390, 844); - // Rename: seeded with the current title, then the row reads the accepted name. - await click('Chat actions for Probe created', 'the created row actions'); + // Rename: the server-assigned fixed title is changed and read back. + await click('Chat actions for New chat', 'the created row actions'); await click('Rename…', 'Rename…'); await waitText('Rename chat', 'the rename dialog'); const seeded = await focusInput(); - if (seeded !== 'Probe created') throw new Error(`Rename was seeded with ${JSON.stringify(seeded)}`); + if (seeded !== 'New chat') throw new Error(`Rename was seeded with ${JSON.stringify(seeded)}`); await type('Probe renamed'); await click('Save', 'the rename Save'); await waitText('Probe renamed', 'the renamed row'); - if ((await visibleText()).includes('Probe created')) throw new Error('The old title survived the accepted rename'); + if ((await visibleText()).includes('Probe created') || (await visibleText()).includes('New chat')) throw new Error('The old title survived the accepted rename'); await shot('renamed-list', 390, 844); // Star the renamed row (the first unstarred row in server order). diff --git a/app/tool/chat_sessions_probe_entry.dart b/app/tool/chat_sessions_probe_entry.dart index 042d6c96..6b9bcd85 100644 --- a/app/tool/chat_sessions_probe_entry.dart +++ b/app/tool/chat_sessions_probe_entry.dart @@ -8,9 +8,9 @@ import 'package:pipelines_app/features/chat/session_screen.dart'; /// Stateful chat-session fixture for the real-browser probe: every accepted /// mutation changes the list the next `chat_sessions` read returns, so the /// screen must refresh from the server rather than guess. A title of -/// `Refused title` is refused with the server's words; `No session title` -/// returns a create reply without `chat_session`; `?unseen=1` reports newer -/// recency after the first read so the `New` marker can be observed. +/// `Refused title` is refused with the server's words; the first create returns +/// a reply without `chat_session`; `?unseen=1` reports newer recency after the +/// first read so the `New` marker can be observed. class _FixtureGateway implements ApiGateway { _FixtureGateway({this.bumpAfterFirstRead = false}); @@ -18,6 +18,7 @@ class _FixtureGateway implements ApiGateway { /// reads report newer activity, so the browser can prove the `New` marker. final bool bumpAfterFirstRead; int _reads = 0; + int _creates = 0; final _sessions = [ { @@ -66,8 +67,9 @@ class _FixtureGateway implements ApiGateway { }; case 'chat_create': final body = fields['chat_create']! as JsonMap; - // The web's exact refusal for a reply without a created session. - if ('${body['title']}' == 'No session title') return const {}; + // Exercise the missing-session refusal independently of the fixed + // title the create dialog now submits. + if (_creates++ == 0) return const {}; final session = { 'id': 'probe-new-${_nextId++}', 'title': body['title'], From 9a8e685c2c1f63b71de9d29feae2b2b0b7da73fd Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Fri, 23 Oct 2026 01:19:29 +0100 Subject: [PATCH 2/3] wip(app): chat probe reads the split New label (run 174) --- app/tool/chat_sessions_probe.mjs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/app/tool/chat_sessions_probe.mjs b/app/tool/chat_sessions_probe.mjs index 6d299f0e..f8db25bd 100644 --- a/app/tool/chat_sessions_probe.mjs +++ b/app/tool/chat_sessions_probe.mjs @@ -209,9 +209,24 @@ try { await load('?unseen=1'); await resize(390, 844); await click('Refresh', 'Refresh'); - await waitText('/workspace/demo · New', 'the open row New marker'); - const unseenBody = await visibleText(); - if (unseenBody.includes('/workspace/archive · New')) { + await waitText('Open fixture', 'the open row'); + await waitText('/workspace/demo', 'the open row directory'); + const unseenRows = await evaluate(`[...document.querySelectorAll('flt-semantics')].map(node => ({ + text: node.getAttribute('aria-label') || node.innerText || '', + rect: (() => { const r = node.getBoundingClientRect(); return {x:r.x, y:r.y, width:r.width, height:r.height}; })(), + })).filter(node => node.text && node.rect.width && node.rect.height)`); + const openRow = unseenRows.find(node => { + const lines = node.text.split('\n'); + return lines.includes('Open fixture') && lines.includes('/workspace/demo'); + }); + const closedRow = unseenRows.find(node => { + const lines = node.text.split('\n'); + return lines.includes('Closed fixture') && lines.includes('/workspace/archive'); + }); + if (!openRow || !openRow.text.split('\n').includes('New')) { + throw new Error('The open row did not report New'); + } + if (!closedRow || !closedRow.text.split('\n').includes('Closed') || closedRow.text.split('\n').includes('New')) { throw new Error('The closed row reported New'); } await shot('new-marker', 390, 844); From d22fc1d627a77bd90eae00a7502cbf1af3750c0d Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Fri, 23 Oct 2026 01:22:24 +0100 Subject: [PATCH 3/3] fix(app): chat probe checks the renamed row by its actions label --- app/tool/chat_sessions_probe.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/tool/chat_sessions_probe.mjs b/app/tool/chat_sessions_probe.mjs index f8db25bd..6d23dd69 100644 --- a/app/tool/chat_sessions_probe.mjs +++ b/app/tool/chat_sessions_probe.mjs @@ -267,7 +267,10 @@ try { await type('Probe renamed'); await click('Save', 'the rename Save'); await waitText('Probe renamed', 'the renamed row'); - if ((await visibleText()).includes('Probe created') || (await visibleText()).includes('New chat')) throw new Error('The old title survived the accepted rename'); + // The list's own `New chat` action stays on screen, so the old title is + // checked on the row's actions label, which names the row's title. + if ((await semantics()).includes('Chat actions for New chat')) throw new Error('The old title survived the accepted rename'); + if (!(await semantics()).includes('Chat actions for Probe renamed')) throw new Error('The renamed row has no actions under its new title'); await shot('renamed-list', 390, 844); // Star the renamed row (the first unstarred row in server order).