@@ -38,8 +38,11 @@ async function main(): Promise<void> {
3838 async ( { demoTarget, screenshot, wait } ) => {
3939 const sendBuildPrompt = async (
4040 prompt : string ,
41- userBubbleText = prompt ,
4241 ) : Promise < void > => {
42+ const userBubbles = demoTarget . locator (
43+ '.imessage-bubble[title="user"]' ,
44+ ) ;
45+ const userBubbleCountBefore = await userBubbles . count ( ) ;
4346 await demoTarget . locator ( '[data-testid="build-chat-input"]' ) . fill (
4447 prompt ,
4548 ) ;
@@ -50,18 +53,40 @@ async function main(): Promise<void> {
5053 timeout : 120_000 ,
5154 } ) ;
5255 await sendButton . click ( ) ;
53- await demoTarget . locator ( '.imessage-bubble[title="user"]' , {
54- hasText : userBubbleText ,
55- } ) . waitFor ( {
56- timeout : 20_000 ,
56+ await demoTarget . locator ( '[data-testid="build-chat-input"]' ) . evaluate (
57+ ( element ) => {
58+ if ( ! ( element instanceof HTMLTextAreaElement ) ) {
59+ throw new Error ( "Expected build chat input textarea." ) ;
60+ }
61+ return element . value ;
62+ } ,
63+ ) . then ( ( value ) => {
64+ if ( typeof value !== "string" ) {
65+ throw new Error ( "Expected build chat input value." ) ;
66+ }
5767 } ) ;
68+ const acceptedStart = Date . now ( ) ;
69+ while ( Date . now ( ) - acceptedStart < 20_000 ) {
70+ const currentUserBubbleCount = await userBubbles . count ( ) ;
71+ const draftValue = await demoTarget . locator (
72+ '[data-testid="build-chat-input"]' ,
73+ ) . evaluate ( ( element ) =>
74+ element instanceof HTMLTextAreaElement ? element . value : ""
75+ ) ;
76+ if (
77+ currentUserBubbleCount > userBubbleCountBefore ||
78+ draftValue . trim ( ) . length === 0
79+ ) {
80+ return ;
81+ }
82+ await wait ( 250 ) ;
83+ }
84+ throw new Error (
85+ `Timed out waiting for build prompt to be accepted: ${ prompt } ` ,
86+ ) ;
5887 } ;
5988
60- const normalizeWorkspacePath = ( pathname : string ) : string => {
61- return pathname . startsWith ( "/isograph/" )
62- ? pathname . slice ( "/isograph" . length )
63- : pathname ;
64- } ;
89+ const normalizeWorkspacePath = ( pathname : string ) : string => pathname ;
6590 const isWorkspaceBuildPath = ( pathname : string ) : boolean =>
6691 / ^ \/ w o r k s p a c e s \/ [ ^ / ] + \/ b u i l d (?: \/ .* ) ? $ / . test (
6792 normalizeWorkspacePath ( pathname ) ,
@@ -72,12 +97,8 @@ async function main(): Promise<void> {
7297 wait ,
7398 ( pathname ) =>
7499 pathname === "/" ||
75- pathname === "/isograph" ||
76- pathname === "/isograph/" ||
77100 pathname === "/workspaces" ||
78101 pathname === "/workspaces/new" ||
79- pathname === "/isograph/workspaces" ||
80- pathname === "/isograph/workspaces/new" ||
81102 isWorkspaceBuildPath ( pathname ) ,
82103 5_000 ,
83104 { label : "simulator load" , logEveryMs : 250 } ,
@@ -101,9 +122,7 @@ async function main(): Promise<void> {
101122 wait ,
102123 ( pathname ) =>
103124 pathname === "/workspaces" ||
104- pathname === "/workspaces/new" ||
105- pathname === "/isograph/workspaces" ||
106- pathname === "/isograph/workspaces/new" ,
125+ pathname === "/workspaces/new" ,
107126 10_000 ,
108127 { label : "workspaces landing" , logEveryMs : 250 } ,
109128 ) ;
@@ -158,7 +177,6 @@ async function main(): Promise<void> {
158177 const refreshMarker = `refresh-marker-${ Date . now ( ) } ` ;
159178 await sendBuildPrompt (
160179 `${ updateModelPrompt } and include a single line "${ refreshMarker } "` ,
161- "please update the root PROMPT.md model" ,
162180 ) ;
163181 await demoTarget . locator ( ".build-file-preview" , {
164182 hasText : "openai/gpt-5.1-chat" ,
@@ -220,7 +238,7 @@ async function main(): Promise<void> {
220238 {
221239 slug : Deno . env . get ( "GAMBIT_DEMO_SLUG" ) ?. trim ( ) ||
222240 "gambit-build-tab-demo" ,
223- iframeTargetPath : "/isograph " ,
241+ iframeTargetPath : "/" ,
224242 server : {
225243 cwd : serveRoot ,
226244 command : ( targetPort : number ) => [
0 commit comments