* Remove unused `telemetryLoader` * Remove onboarding redirect behavior * Allow subRoute to be passed to navigateToProject * Replace warning dialog routes with toasts * Wire up new utilities and toasts to UI components * Add home sidebar buttons for tutorial flow * Rename menu item * Add flex-1 so home-layout fills available space * Remove onboarding avatar tests, they are becoming irrelevant * Consolidate onboarding tests to one longer one and update it to not use pixel color checks, and use fixtures. * Shorten warning toast button text * tsc, lint, and circular deps * Update circular dep file * Fix mistakes made in circular update tweaking * One more dumb created circular dep * Update src/routes/Onboarding/utils.tsx Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * Fix narrow screen home layout breaking * fix: kevin, navigation routes fixed * fix: filename parsing is correct now for onboarding with the last file sep * Fix e2e test state checks that are diff on Linux * Create onboarding project entirely through systemIOMachine * Fix Windows path construction * Make utility to verify a string is an onboarding value * Little biome formatting suggestion fix * Units onboarding step was not using OnboardingButtons * Add type checking of next and previous status, fix useNextClick * Update `OnboardingStatus` type on WASM side * Make onboarding different on browser and web, placeholder component * Show proof of concept with custom content per route * Make text type args not insta dismiss when you click anywhere * Make some utility hooks for the onboarding * Update requestedProjectName along with requestedProjectName * Build out a rough draft of desktop onboarding * Remove unused onboarding route files * Build out rough draft of browser onboarding content * @jgomez720 browser flow feedback * @jgomez420 desktop feedback * tsc and lints * Tweaks * Import is dead, long live Add files * What's up with my inability to type "highlight"? * Codespell and String casting * Update browser sample to be axial fan * lint and tsc * codespell again * Remove unused nightmare function `useDemoCode` * Add a few unit tests * Update desktop to use bulk file creation from #6747 * Oops overwrote main.kcl on the modify with text-to-cad step * Undo the dumb use of `sep` that I introduced * Fix up project test which was fragile to the number of steps in the onboarding smh * Fix up onboarding flow test * typo --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Kevin Nadro <kevin@zoo.dev>
136 lines
3.5 KiB
TypeScript
136 lines
3.5 KiB
TypeScript
import type { SaveSettingsPayload } from '@src/lib/settings/settingsTypes'
|
|
import { Themes } from '@src/lib/theme'
|
|
import type { DeepPartial } from '@src/lib/types'
|
|
|
|
import type { Settings } from '@rust/kcl-lib/bindings/Settings'
|
|
|
|
export const TEST_SETTINGS_KEY = '/settings.toml'
|
|
export const TEST_SETTINGS: DeepPartial<Settings> = {
|
|
app: {
|
|
appearance: {
|
|
theme: Themes.Dark,
|
|
},
|
|
onboarding_status: 'dismissed',
|
|
show_debug_panel: true,
|
|
},
|
|
modeling: {
|
|
enable_ssao: false,
|
|
base_unit: 'in',
|
|
mouse_controls: 'zoo',
|
|
camera_projection: 'perspective',
|
|
},
|
|
project: {
|
|
default_project_name: 'untitled',
|
|
directory: '',
|
|
},
|
|
text_editor: {
|
|
text_wrapping: true,
|
|
},
|
|
}
|
|
|
|
export const TEST_SETTINGS_ONBOARDING_START: DeepPartial<Settings> = {
|
|
...TEST_SETTINGS,
|
|
app: { ...TEST_SETTINGS.app, onboarding_status: '' },
|
|
}
|
|
|
|
export const TEST_SETTINGS_DEFAULT_THEME: DeepPartial<Settings> = {
|
|
...TEST_SETTINGS,
|
|
app: { ...TEST_SETTINGS.app, appearance: { theme: Themes.System } },
|
|
}
|
|
|
|
export const TEST_SETTINGS_CORRUPTED = {
|
|
app: {
|
|
theme: Themes.Dark,
|
|
onboardingStatus: 'dismissed',
|
|
projectDirectory: 123 as any,
|
|
showDebugPanel: true,
|
|
},
|
|
modeling: {
|
|
defaultUnit: 'invalid' as any,
|
|
mouseControls: `() => alert('hack the planet')` as any,
|
|
cameraProjection: 'perspective',
|
|
},
|
|
projects: {
|
|
defaultProjectName: false as any,
|
|
},
|
|
textEditor: {
|
|
textWrapping: true,
|
|
},
|
|
} satisfies Partial<SaveSettingsPayload>
|
|
|
|
export const TEST_CODE_GIZMO = `@settings(defaultLengthUnit = in)
|
|
part001 = startSketchOn(XZ)
|
|
|> startProfile(at = [20, 0])
|
|
|> line(end = [7.13, 4 + 0])
|
|
|> angledLine(angle = 3 + 0, length = 3.14 + 0 )
|
|
|> line(endAbsolute = [20.14 + 0, -0.14 + 0])
|
|
|> xLine(endAbsolute = 29 + 0)
|
|
|> yLine(length = -3.14 + 0, tag = $a)
|
|
|> xLine(length = 1.63)
|
|
|> angledLine(angle = 3 + 0, lengthX = 3.14 )
|
|
|> angledLine(angle = 30, lengthY = 3 + 0 )
|
|
|> angledLine(angle = 22.14 + 0, endAbsoluteX = 12)
|
|
|> angledLine(angle = 30, endAbsoluteY = 11.14)
|
|
|> angledLineThatIntersects(angle = 3.14, intersectTag = a, offset = 0)
|
|
|> tangentialArc(endAbsolute = [13.14 + 0, 13.14])
|
|
|> close()
|
|
|> extrude(length = 5 + 7)
|
|
`
|
|
|
|
export const TEST_CODE_LONG_WITH_ERROR_OUT_OF_VIEW = `width = 50.8
|
|
height = 30
|
|
thickness = 2
|
|
keychainHoleSize = 3
|
|
|
|
keychain = startSketchOn(XY)
|
|
|> startProfile(at = [0, 0])
|
|
|> line(endAbsolute = [width, 0])
|
|
|> line(endAbsolute = [width, height])
|
|
|> line(endAbsolute = [0, height])
|
|
|> close()
|
|
|> extrude(length = thickness)
|
|
|
|
keychain1 = startSketchOn(XY)
|
|
|> startProfile(at = [0, 0])
|
|
|> line(endAbsolute = [width, 0])
|
|
|> line(endAbsolute = [width, height])
|
|
|> line(endAbsolute = [0, height])
|
|
|> close()
|
|
|> extrude(length = thickness)
|
|
|
|
keychain2 = startSketchOn(XY)
|
|
|> startProfile(at = [0, 0])
|
|
|> line(endAbsolute = [width, 0])
|
|
|> line(endAbsolute = [width, height])
|
|
|> line(endAbsolute = [0, height])
|
|
|> close()
|
|
|> extrude(length = thickness)
|
|
|
|
box = startSketchOn(XY)
|
|
|> startProfile(at = [0, 0])
|
|
|> line(end = [0, 10])
|
|
|> line(end = [10, 0])
|
|
|> line(end = [0, -10], tag = $revolveAxis)
|
|
|> close()
|
|
|> extrude(length = 10)
|
|
|
|
sketch001 = startSketchOn(box, face = revolveAxis)
|
|
|> startProfile(at = [5, 10])
|
|
|> line(end = [0, -10])
|
|
|> line(end = [2, 0])
|
|
|> line(end = [0, -10])
|
|
|> close()
|
|
|> revolve(
|
|
axis = revolveAxis,
|
|
angle = 90
|
|
)
|
|
|
|
sketch001 = startSketchOn(XZ)
|
|
|> startProfile(at = [0.0, 0.0])
|
|
|> xLine(length = 0.0)
|
|
|> close()
|
|
|
|
`
|
|
|
|
export const TEST_CODE_TRIGGER_ENGINE_EXPORT_ERROR = `thing = 1`
|