From 4da7a707351c69af80ce5eb5f6d4c9135f2d2119 Mon Sep 17 00:00:00 2001 From: Frank Noirot Date: Thu, 27 Feb 2025 13:14:18 -0500 Subject: [PATCH 1/4] Add expandable disclosure to Text-to-CAD success toast Closes #5258 by adding a details element that the user can open if they don't like the result of their "successful" prompt. --- src/components/ToastTextToCad.tsx | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/components/ToastTextToCad.tsx b/src/components/ToastTextToCad.tsx index 6ebd5177d4..1bd7c38876 100644 --- a/src/components/ToastTextToCad.tsx +++ b/src/components/ToastTextToCad.tsx @@ -33,12 +33,50 @@ import { EventFrom } from 'xstate' import { fileMachine } from 'machines/fileMachine' import { reportRejection } from 'lib/trap' import { codeManager, kclManager } from 'lib/singletons' +import { openExternalBrowserIfDesktop } from 'lib/openWindow' const CANVAS_SIZE = 128 const PROMPT_TRUNCATE_LENGTH = 128 const FRUSTUM_SIZE = 0.5 const OUTPUT_KEY = 'source.glb' +function TextToCadImprovementMessage({ + label, + ...rest +}: React.HTMLElementAttributes & { label: string }) { + return ( +
+ + {label} + +

+ Text-to-CAD is a new ML model. There will be prompts that work and + prompts that don't and prompts that generate something a little bit off. + Sometimes even a small tweak to your prompt will make it better on the + next run. Or using prompt to edit to make it better. We look at all the + failures to make the model better and see our weaknesses. Over time the + model will get better. See our{' '} + + Discord + {' '} + or{' '} + + Discourse + {' '} + or some prompting tips from the community or our team. +

+
+ ) +} + export function ToastTextToCadError({ toastId, message, @@ -286,6 +324,10 @@ export function ToastTextToCadSuccess({ : data.prompt} "

+
Date: Thu, 27 Feb 2025 13:15:57 -0500 Subject: [PATCH 2/4] Add the same disclosure to the Prompt-to-Edit toast --- src/components/ToastTextToCad.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/ToastTextToCad.tsx b/src/components/ToastTextToCad.tsx index 1bd7c38876..3d117d1765 100644 --- a/src/components/ToastTextToCad.tsx +++ b/src/components/ToastTextToCad.tsx @@ -478,6 +478,10 @@ export function ToastPromptToEditCadSuccess({ : data.prompt} "

+

Do you want to keep the change?

From afca41739682a522c2cf5ea73f21871c9c9c5a88 Mon Sep 17 00:00:00 2001 From: Frank Noirot Date: Thu, 27 Feb 2025 13:19:31 -0500 Subject: [PATCH 3/4] Rework text per @greg-kcio's feedback --- src/components/ToastTextToCad.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/ToastTextToCad.tsx b/src/components/ToastTextToCad.tsx index 3d117d1765..b01cea08a8 100644 --- a/src/components/ToastTextToCad.tsx +++ b/src/components/ToastTextToCad.tsx @@ -53,9 +53,9 @@ function TextToCadImprovementMessage({ Text-to-CAD is a new ML model. There will be prompts that work and prompts that don't and prompts that generate something a little bit off. Sometimes even a small tweak to your prompt will make it better on the - next run. Or using prompt to edit to make it better. We look at all the - failures to make the model better and see our weaknesses. Over time the - model will get better. See our{' '} + next run. Try our prompt-to-edit feature to iterate on your result with + AI. We look at all the failures to make the model better and see our + weaknesses. Over time the model will get better. See our{' '} Date: Thu, 27 Feb 2025 22:26:17 -0500 Subject: [PATCH 4/4] Fix tsc --- src/components/ToastTextToCad.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ToastTextToCad.tsx b/src/components/ToastTextToCad.tsx index b01cea08a8..c4d90babb0 100644 --- a/src/components/ToastTextToCad.tsx +++ b/src/components/ToastTextToCad.tsx @@ -43,7 +43,7 @@ const OUTPUT_KEY = 'source.glb' function TextToCadImprovementMessage({ label, ...rest -}: React.HTMLElementAttributes & { label: string }) { +}: React.HTMLAttributes & { label: string }) { return (