Skip to content

Commit 42f1265

Browse files
Revert TTC Conversational UX commits (#8149)
* Revert "Update onboarding with new conversational ttc ui (#8147)" This reverts commit e7626e9. * Revert "CSS tweaks follow to TTC UI (#8137)" This reverts commit 199d5a3. * Revert "Don't include the current file prompt if there is no current file (#8135)" This reverts commit 5c1a417. * Revert "Add a source range prompt containing the current file content range (#8129)" This reverts commit 49d40f2. * Revert "Move clearing of TTC project-specific state to SystemIO (#8130)" This reverts commit e42e5f8. * Revert "Rename "Text-to-CAD Create" command to "Create project using Text-to-CAD" (#8127)" This reverts commit f7fc3b2. * Revert "Text-to-CAD UX revamp phase 1 (#7542)" This reverts commit c699bb0. * Update snapshots * Update snapshots * Fix tsc --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent e7626e9 commit 42f1265

File tree

91 files changed

+3377
-4137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+3377
-4137
lines changed

e2e/playwright/command-bar-tests.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ theta = 45deg
762762
await homePage.textToCadBtn.click()
763763
await cmdBar.expectState({
764764
stage: 'arguments',
765-
commandName: 'Create Project using Text-to-CAD',
765+
commandName: 'Text-to-CAD Create',
766766
currentArgKey: 'prompt',
767767
currentArgValue: '',
768768
headerArguments: {

e2e/playwright/fixtures/cmdBarFixture.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,15 @@ export class CmdBarFixture {
143143
await submitButton.click()
144144
}
145145

146-
openCmdBar = async () => {
146+
openCmdBar = async (selectCmd?: 'promptToEdit') => {
147147
await this.cmdBarOpenBtn.click()
148148
await expect(this.page.getByPlaceholder('Search commands')).toBeVisible()
149+
if (selectCmd === 'promptToEdit') {
150+
const promptEditCommand = this.selectOption({ name: 'Text-to-CAD Edit' })
151+
await expect(promptEditCommand.first()).toBeVisible()
152+
await promptEditCommand.first().scrollIntoViewIfNeeded()
153+
await promptEditCommand.first().click()
154+
}
149155
}
150156

151157
closeCmdBar = async () => {
@@ -261,18 +267,15 @@ export class CmdBarFixture {
261267
if (part.startsWith('--')) continue
262268

263269
const nameMatch = part.match(/name="([^"]+)"/)
264-
if (!nameMatch) {
265-
console.log('No name match found in part:', part.substring(0, 100))
266-
continue
267-
}
270+
if (!nameMatch) continue
268271

269272
const name = nameMatch[1]
270273
const content = part.split(/\r?\n\r?\n/)[1]?.trim()
271274
if (!content) continue
272275

273-
if (name === 'body') {
276+
if (name === 'event') {
274277
eventData = JSON.parse(content)
275-
} else if (name === 'files') {
278+
} else {
276279
files[name] = content
277280
}
278281
}

e2e/playwright/fixtures/editorFixture.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ export class EditorFixture {
5555
await this.scrollToBottom()
5656
if (!shouldNormalise) {
5757
const result = not
58-
? await expect(this.codeContent).not.toContainText(code, { timeout })
59-
: await expect(this.codeContent).toContainText(code, { timeout })
58+
? await expect(this.codeContent).not.toContainText(code)
59+
: await expect(this.codeContent).toContainText(code)
6060

6161
await resetPane()
6262
return result

e2e/playwright/fixtures/fixtureSetup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export class ElectronZoo {
250250
}
251251

252252
if (!this.firstUrl) {
253-
await this.page.getByRole('tab', { name: 'Projects' }).count()
253+
await this.page.getByRole('heading', { name: 'Projects' }).count()
254254
this.firstUrl = this.page.url()
255255
}
256256

e2e/playwright/fixtures/homePageFixture.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ export class HomePageFixture {
100100

101101
expectIsCurrentPage = async () => {
102102
await expect(this.page).toHaveURL(/.*home/)
103-
await expect(this.page.getByRole('tab', { name: 'Projects' })).toBeVisible()
103+
await expect(
104+
this.page.getByRole('heading', { name: 'Projects' })
105+
).toBeVisible()
104106
}
105107

106108
projectsLoaded = async () => {

e2e/playwright/fixtures/toolbarFixture.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,4 @@ export class ToolbarFixture {
326326
await expect(goToDefinitionMenuButton).toBeVisible()
327327
await goToDefinitionMenuButton.click()
328328
}
329-
330-
async fireTtcPrompt(prompt: string) {
331-
await this.openPane('text-to-cad')
332-
await expect(
333-
this.page.getByTestId('ml-ephant-conversation-input')
334-
).toBeVisible()
335-
await this.page.getByTestId('ml-ephant-conversation-input').fill(prompt)
336-
await this.page.getByTestId('ml-ephant-conversation-input-button').click()
337-
}
338329
}

e2e/playwright/native-file-menu.spec.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,14 @@ test.describe(
246246
)
247247
await openSettingsExpectLocator(page, '#themeColor')
248248
})
249+
await test.step('Modeling.Edit.Modify with Zoo Text-To-CAD', async () => {
250+
await page.waitForTimeout(250)
251+
await clickElectronNativeMenuById(
252+
tronApp,
253+
'Edit.Modify with Zoo Text-To-CAD'
254+
)
255+
await cmdBar.expectCommandName('Text-to-CAD Edit')
256+
})
249257
await test.step('Modeling.Edit.Edit parameter', async () => {
250258
await page.waitForTimeout(250)
251259
await clickElectronNativeMenuById(tronApp, 'Edit.Edit parameter')
@@ -510,7 +518,17 @@ test.describe(
510518
'Design.Create with Zoo Text-To-CAD'
511519
)
512520
await cmdBar.toBeOpened()
513-
await cmdBar.expectCommandName('Create Project using Text-to-CAD')
521+
await cmdBar.expectCommandName('Text-to-CAD Create')
522+
})
523+
524+
await test.step('Modeling.Design.Modify with Zoo Text-To-CAD', async () => {
525+
await page.waitForTimeout(250)
526+
await clickElectronNativeMenuById(
527+
tronApp,
528+
'Design.Modify with Zoo Text-To-CAD'
529+
)
530+
await cmdBar.toBeOpened()
531+
await cmdBar.expectCommandName('Text-to-CAD Edit')
514532
})
515533

516534
await test.step('Modeling.Help.KCL code samples', async () => {

e2e/playwright/projects.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ test.describe(`Project management commands`, () => {
654654
const projectNameOption = page.getByRole('option', { name: projectName })
655655
const commandWarning = page.getByText('Are you sure you want to delete?')
656656
const toastMessage = page.getByText(`Successfully deleted`)
657-
const noProjectsMessage = page.getByText('No results found')
657+
const noProjectsMessage = page.getByText('No projects found')
658658

659659
await test.step(`Setup`, async () => {
660660
await page.setBodyDimensions({ width: 1200, height: 500 })
@@ -758,7 +758,7 @@ test.describe(`Project management commands`, () => {
758758
const projectNameOption = page.getByRole('option', { name: projectName })
759759
const commandWarning = page.getByText('Are you sure you want to delete?')
760760
const toastMessage = page.getByText(`Successfully deleted`)
761-
const noProjectsMessage = page.getByText('No results found')
761+
const noProjectsMessage = page.getByText('No projects found')
762762

763763
await test.step(`Setup`, async () => {
764764
await page.setBodyDimensions({ width: 1200, height: 500 })
@@ -1042,7 +1042,7 @@ test(
10421042
})
10431043

10441044
await test.step('Check that the home page is empty', async () => {
1045-
await expect(page.getByText('No results found')).toBeVisible()
1045+
await expect(page.getByText('No projects found')).toBeVisible()
10461046
})
10471047

10481048
await test.step('Check we can still create a project', async () => {
@@ -1120,7 +1120,7 @@ test(
11201120

11211121
await test.step('should be shorted by modified initially', async () => {
11221122
const lastModifiedButton = page.getByRole('button', {
1123-
name: 'Age',
1123+
name: 'Last Modified',
11241124
})
11251125
await expect(lastModifiedButton).toBeVisible()
11261126
await expect(lastModifiedButton.getByLabel('arrow down')).toBeVisible()
@@ -1141,7 +1141,7 @@ test(
11411141

11421142
await test.step('Reverse modified order', async () => {
11431143
const lastModifiedButton = page.getByRole('button', {
1144-
name: 'Age',
1144+
name: 'Last Modified',
11451145
})
11461146
await lastModifiedButton.click()
11471147
await expect(lastModifiedButton).toBeVisible()
@@ -1217,8 +1217,8 @@ test(
12171217
// Constants and locators
12181218
const projectLinks = page.getByTestId('project-link')
12191219

1220-
// expect to see text "No results found"
1221-
await expect(page.getByText('No results found')).toBeVisible()
1220+
// expect to see text "No projects found"
1221+
await expect(page.getByText('No projects found')).toBeVisible()
12221222

12231223
await createProject({ name: 'project-000', page, returnHome: true })
12241224
await expect(projectLinks.getByText('project-000')).toBeVisible()
@@ -1365,7 +1365,7 @@ test(
13651365

13661366
await homePage.projectsLoaded()
13671367

1368-
await expect(page.getByText('No results found')).toBeVisible()
1368+
await expect(page.getByText('No projects found')).toBeVisible()
13691369
await createProject({ name: 'project-000', page, returnHome: true })
13701370
await expect(
13711371
page.getByTestId('project-link').filter({ hasText: 'project-000' })
@@ -1432,7 +1432,7 @@ test(
14321432
page.on('console', console.log)
14331433

14341434
// Our locator constants
1435-
const searchInput = page.getByPlaceholder('Search')
1435+
const searchInput = page.getByPlaceholder('Search projects')
14361436
const projectLinks = page.getByTestId('project-link')
14371437

14381438
await test.step('Search for "basi"', async () => {

e2e/playwright/prompt-to-edit-snapshot-tests.spec.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { test } from '@e2e/playwright/zoo-test'
1+
import { expect, test } from '@e2e/playwright/zoo-test'
22
import path from 'path'
33
import fsp from 'fs/promises'
44

@@ -64,7 +64,7 @@ test.describe('edit with AI example snapshots', () => {
6464
`change colour`,
6565
// TODO this is more of a snapshot, but atm it needs to be manually run locally to update the files
6666
{ tag: ['@desktop'] },
67-
async ({ context, homePage, cmdBar, editor, page, scene, toolbar }) => {
67+
async ({ context, homePage, cmdBar, editor, page, scene }) => {
6868
const project = 'test-dir'
6969
await context.folderSetupFn(async (dir) => {
7070
const projectDir = path.join(dir, project)
@@ -85,6 +85,7 @@ test.describe('edit with AI example snapshots', () => {
8585
body1CapCoords.x,
8686
body1CapCoords.y
8787
)
88+
const submittingToast = page.getByText('Submitting to Text-to-CAD API...')
8889

8990
await test.step('wait for scene to load select body and check selection came through', async () => {
9091
await clickBody1Cap()
@@ -97,9 +98,16 @@ test.describe('edit with AI example snapshots', () => {
9798

9899
await test.step('fire off edit prompt', async () => {
99100
await cmdBar.captureTextToCadRequestSnapshot(test.info())
100-
await toolbar.fireTtcPrompt('make this neon green please, use #39FF14')
101+
await cmdBar.openCmdBar('promptToEdit')
101102
await page.waitForTimeout(100)
103+
await cmdBar.progressCmdBar()
104+
// being specific about the color with a hex means asserting pixel color is more stable
105+
await page
106+
.getByTestId('cmd-bar-arg-value')
107+
.fill('make this neon green please, use #39FF14')
102108
await page.waitForTimeout(100)
109+
await cmdBar.progressCmdBar()
110+
await expect(submittingToast).toBeVisible()
103111
})
104112
}
105113
)

0 commit comments

Comments
 (0)