Always give new files and dirs a new index if their names are taken (#3460)

* Add actual support for makeUnique parameter

* Add uniqueness logic to dirs, make text-to-cad receive unique filename

* No longer need makeUnique flag, it's always on

* fmt

* Don't show toast when name hasn't changed during a rename

* fmt

* Get "interact with many" text-to-cad test passing again

* Get "engine fails export" back to reliably green

* Maybe more stable click target for text-to-cad test

* Make "export is already going" test moderately more reliable

* Mark "export is already going" as fixme

* Undo that fixme thing I take it back
This commit is contained in:
Frank Noirot
2024-08-15 14:24:27 -04:00
committed by GitHub
parent 55a3e2a4ed
commit 545e610bbc
10 changed files with 240 additions and 99 deletions

View File

@ -85,6 +85,7 @@ import {
} from 'lang/std/engineConnection'
import { submitAndAwaitTextToKcl } from 'lib/textToCad'
import { useFileContext } from 'hooks/useFileContext'
import { PLAYWRIGHT_MOCK_EXPORT_DURATION } from 'lib/constants'
type MachineContext<T extends AnyStateMachine> = {
state: StateFrom<T>
@ -393,10 +394,24 @@ export const ModelingMachineProvider = ({
selection: { type: 'default_scene' },
}
const mockExportDuration = window.localStorage.getItem(
PLAYWRIGHT_MOCK_EXPORT_DURATION
)
console.log('mockExportDuration', mockExportDuration)
// Artificially delay the export in playwright tests
toast.promise(
exportFromEngine({
format: format,
}),
Promise.all([
exportFromEngine({
format: format,
}),
mockExportDuration
? new Promise((resolve) =>
setTimeout(resolve, Number(mockExportDuration))
)
: Promise.resolve(),
]),
{
loading: 'Starting print...',
success: 'Started print successfully',