diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Inch-scale-2-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Inch-scale-2-Google-Chrome-linux.png index 8b4a8b843..2c4705b2c 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Inch-scale-2-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Inch-scale-2-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-2-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-2-Google-Chrome-linux.png index f7cca18b9..38d64b7ca 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-2-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Client-side-scene-scale-should-match-engine-scale-Millimeter-scale-2-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-linux.png index d9974fa77..64b95f484 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-off-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-linux.png index 5b3243fca..b9872ae62 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Grid-visibility-Grid-turned-on-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-2d-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-2d-1-Google-Chrome-linux.png index d4b73a585..7b2b49f8b 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-2d-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-2d-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-3d-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-3d-1-Google-Chrome-linux.png index af1d8b0e0..4015397d0 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-3d-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/Zoom-to-fit-on-load---solid-3d-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XY-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XY-1-Google-Chrome-linux.png index 04ccc0ac3..73db1f8ae 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XY-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XY-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-linux.png index d7362934b..83782ef59 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--XZ-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--YZ-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--YZ-1-Google-Chrome-linux.png index 60c31b2c3..ebd632681 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--YZ-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable--YZ-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-linux.png index 8b4db660e..9ea6c1168 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XY-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XZ-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XZ-1-Google-Chrome-linux.png index dbcda0f45..d7c873f2a 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XZ-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-XZ-1-Google-Chrome-linux.png differ diff --git a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-YZ-1-Google-Chrome-linux.png b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-YZ-1-Google-Chrome-linux.png index c69bea0d0..f49b73fdb 100644 Binary files a/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-YZ-1-Google-Chrome-linux.png and b/e2e/playwright/snapshot-tests.spec.ts-snapshots/extrude-on-default-planes-should-be-stable-YZ-1-Google-Chrome-linux.png differ diff --git a/src/components/ModelingSidebar/ModelingSidebar.tsx b/src/components/ModelingSidebar/ModelingSidebar.tsx index c24c5bdac..c432f8dde 100644 --- a/src/components/ModelingSidebar/ModelingSidebar.tsx +++ b/src/components/ModelingSidebar/ModelingSidebar.tsx @@ -136,7 +136,6 @@ export function ModelingSidebar({ paneOpacity }: ModelingSidebarProps) { iconClassName: action.iconClassName, iconSize: 'md', }} - paneIsOpen={false} onClick={action.action} /> ))} @@ -186,7 +185,7 @@ interface ModelingPaneButtonProps iconSize?: 'sm' | 'md' | 'lg' } onClick: () => void - paneIsOpen: boolean + paneIsOpen?: boolean } function ModelingPaneButton({ @@ -220,12 +219,20 @@ function ModelingPaneButton({ 'rounded-sm ' + (paneIsOpen ? '!bg-primary' : '!bg-transparent') } /> - {paneConfig.title} pane - - {paneConfig.title} pane: - - {paneConfig.keybinding} + + {paneConfig.title} + {paneIsOpen !== undefined ? ` pane` : ''} + + + + {paneConfig.title} + {paneIsOpen !== undefined ? ` pane` : ''} + {paneConfig.keybinding} ) diff --git a/src/routes/Onboarding/CodeEditor.tsx b/src/routes/Onboarding/CodeEditor.tsx index 0e94561f7..a4d140903 100644 --- a/src/routes/Onboarding/CodeEditor.tsx +++ b/src/routes/Onboarding/CodeEditor.tsx @@ -1,5 +1,11 @@ import { useModelingContext } from 'hooks/useModelingContext' -import { OnboardingButtons, useDemoCode, useDismiss, useNextClick } from '.' +import { + kbdClasses, + OnboardingButtons, + useDemoCode, + useDismiss, + useNextClick, +} from '.' import { onboardingPaths } from 'routes/Onboarding/paths' export default function OnboardingCodeEditor() { @@ -66,8 +72,8 @@ export default function OnboardingCodeEditor() {

You can resize the pane by dragging the handle on the right, and you - can collapse it by clicking the title bar or pressing{' '} - Shift + C. + can collapse it by clicking the X button in the pane's title bar or + pressing Shift + C.

Export

- Try opening the project menu and clicking the "Export Part" at the - bottom of the pane. + In addition to the "Export current part" button in the project menu, + you can also click the Export button icon at the bottom of the left + sidebar. Try clicking it now.

{APP_NAME} uses{' '} diff --git a/src/routes/Onboarding/FutureWork.tsx b/src/routes/Onboarding/FutureWork.tsx index d16863c72..f59ff5223 100644 --- a/src/routes/Onboarding/FutureWork.tsx +++ b/src/routes/Onboarding/FutureWork.tsx @@ -21,9 +21,10 @@ export default function FutureWork() {

Future Work

- We have curves, cuts, and many more CAD features coming soon. We want - your feedback on this user interface, and we want to know what - features you want to see next. Please message us in{' '} + We have curves, cuts, multi-profile sketch mode, and many more CAD + features coming soon. We want your feedback on this user interface, + and we want to know what features you want to see next. Please message + us in{' '} + ) : ( + + ) +} + +interface OnboardingResetWarningProps { + setShouldShowWarning: (arg: boolean) => void +} + +function OnboardingResetWarning(props: OnboardingResetWarningProps) { + return ( +

+
+ {!isTauri() ? ( + + ) : ( + + )} +
+
+ ) +} + +function OnboardingWarningDesktop() { const navigate = useNavigate() const dismiss = useDismiss() - const next = useNextClick(onboardingPaths.INDEX) async function createAndOpenNewProject() { const projects = await listProjects() @@ -38,60 +72,69 @@ function OnboardingWithNewFile() { )}${paths.ONBOARDING.INDEX}` ) } + return ( -
-
- {!isTauri() ? ( - <> -

- Replaying onboarding resets your code -

-

- We see you have some of your own code written in this project. - Please save it somewhere else before continuing the onboarding. -

- { - // We do want to update both the state and editor here. - codeManager.updateCodeEditor(bracket) - kclManager.executeCode(true) - next() - }} - nextText="Overwrite code and continue" - /> - - ) : ( - <> -

- Would you like to create a new project? -

-
-

- You have some content in this project that we don't want to - overwrite. If you would like to create a new project, please - click the button below. -

-
- { - void createAndOpenNewProject() - codeManager.updateCodeEditor(bracket) - dismiss() - }} - nextText="Make a new project" - /> - - )} -
-
+ <> +

+ Would you like to create a new project? +

+
+

+ You have some content in this project that we don't want to overwrite. + If you would like to create a new project, please click the button + below. +

+
+ { + void createAndOpenNewProject() + codeManager.updateCodeEditor(bracket) + dismiss() + }} + nextText="Make a new project" + /> + ) } -export default function OnboardingIntroduction() { +function OnboardingWarningWeb(props: OnboardingResetWarningProps) { + const dismiss = useDismiss() + + return ( + <> +

+ Replaying onboarding resets your code +

+

+ We see you have some of your own code written in this project. Please + save it somewhere else before continuing the onboarding. +

+ { + // We do want to update both the state and editor here. + codeManager.updateCodeStateEditor(bracket) + await codeManager.writeToFile() + + kclManager.isFirstRender = true + await kclManager.executeCode(true).then(() => { + kclManager.isFirstRender = false + }) + props.setShouldShowWarning(false) + }} + nextText="Overwrite code and continue" + /> + + ) +} + +function OnboardingIntroductionInner() { + // Reset the code to the bracket code + useDemoCode() + const { settings: { state: { @@ -108,12 +151,8 @@ export default function OnboardingIntroduction() { : '' const dismiss = useDismiss() const next = useNextClick(onboardingPaths.CAMERA) - const currentCode = codeManager.code - const isStarterCode = currentCode === '' || currentCode === bracket - useDemoCode() - - return isStarterCode ? ( + return (

@@ -172,7 +211,5 @@ export default function OnboardingIntroduction() { />

- ) : ( - ) } diff --git a/src/routes/Onboarding/ProjectMenu.tsx b/src/routes/Onboarding/ProjectMenu.tsx index b8b2604d4..141263c9d 100644 --- a/src/routes/Onboarding/ProjectMenu.tsx +++ b/src/routes/Onboarding/ProjectMenu.tsx @@ -20,8 +20,9 @@ export default function ProjectMenu() {

Project Menu

- Click on your part's name in the upper left to open the project - menu. + Click on {tauri ? `your part's name` : `the app name`} in the upper + left to open the project menu, where you can open the project + settings and export your current part. {tauri && ( <> You can click the Zoo logo to quickly navigate home. )} @@ -43,8 +44,8 @@ export default function ProjectMenu() { ) : ( <>

- From here you can export your part. You can't manage separate - files and separate projects from the browser; you have to{' '} + You can't manage separate files and separate projects from the + browser; you have to{' '} { - // We do want to update both the state and editor here. - codeManager.updateCodeEditor('') - if (kclManager.engineCommandManager.engineConnection?.isReady()) { - // If the engine is ready, promptly execute the loaded code - kclManager.executeCode(true) + async function clearEditor() { + // We do want to update both the state and editor here. + codeManager.updateCodeStateEditor('') + kclManager.isFirstRender = true + await kclManager.executeCode(true).then(() => { + kclManager.isFirstRender = false + }) } + + clearEditor() }, []) return ( diff --git a/src/routes/Onboarding/UserMenu.tsx b/src/routes/Onboarding/UserMenu.tsx index b026ca6dd..2664390fb 100644 --- a/src/routes/Onboarding/UserMenu.tsx +++ b/src/routes/Onboarding/UserMenu.tsx @@ -43,19 +43,13 @@ export default function UserMenu() {

User Menu

Click {buttonDescription} in the upper right to open the user menu. - You can change your settings, sign out, or request a feature. + You can change your user-level settings, sign out, or request a + feature.

- We only support global settings at the moment, but we are working to - implement{' '} - - per-project settings - {' '} - now. + Many settings can be set either a user or per-project level. User + settings will apply to all projects, while project settings will + only apply to the current project.

{ if (!editorManager.editorView) return - setTimeout(() => { + setTimeout(async () => { codeManager.updateCodeStateEditor(bracket) + kclManager.isFirstRender = true + await kclManager.executeCode(true).then(() => { + kclManager.isFirstRender = false + }) + codeManager.writeToFile() }) }, [editorManager.editorView]) } @@ -171,8 +176,8 @@ export function OnboardingButtons({ onClick={dismiss} iconStart={{ icon: 'close', + className: 'text-chalkboard-10', bgClassName: 'bg-destroy-80 group-hover:bg-destroy-80', - iconClassName: 'text-destroy-20 group-hover:text-destroy-10', }} className="hover:border-destroy-40 hover:bg-destroy-10/50 dark:hover:bg-destroy-80/50" >