-
Notifications
You must be signed in to change notification settings - Fork 83
AI-First Starting UX: Build from scratch #4918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lmac-1
wants to merge
13
commits into
4848-ai-first-starting-ux-parent
Choose a base branch
from
4895-ai-first-build-from-scratch
base: 4848-ai-first-starting-ux-parent
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
290612b
feat(build-from-scratch): create webhook workflow from landing screen
lmac-1 46d5125
fix(build-from-scratch): dedupe workflow names via shared unique_work…
lmac-1 d59cb23
feat(build-from-scratch): lock the card while creation is in flight
lmac-1 e2c90c3
feat(build-from-scratch): open trigger inspector on picker step
lmac-1 bb571af
fix(url-state): add replace option to updateSearchParams
lmac-1 19aca92
fix(build-from-scratch): replace history entry when redirecting to ca…
lmac-1 1f16d23
fix(build-from-scratch): auto-disable trigger at workflow activation …
lmac-1 93de352
fix(build-from-scratch): handle push failures with timeout and error …
lmac-1 db7af6c
fix(workflows): correct save_workflow's error spec
lmac-1 55adb03
refactor(collaborate): remove unreachable creating_workflow? guard
lmac-1 243586d
fix(test): pass streamingApplyActions mock in globalStep test
lmac-1 8b8ec72
fix(workflows): simplify save_workflow's error spec
lmac-1 53ace55
fix(build-from-scratch): capitalize placeholder workflow name
lmac-1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,10 +19,14 @@ import { VersionDropdown } from './components/VersionDropdown'; | |
| import { WorkflowEditor } from './components/WorkflowEditor'; | ||
| import { YAMLImportModal } from './components/YAMLImportModal'; | ||
| import { CredentialModalProvider } from './contexts/CredentialModalContext'; | ||
| import { LiveViewActionsProvider } from './contexts/LiveViewActionsContext'; | ||
| import { | ||
| LiveViewActionsProvider, | ||
| useLiveViewActions, | ||
| } from './contexts/LiveViewActionsContext'; | ||
| import { MonacoRefProvider } from './contexts/MonacoRefContext'; | ||
| import { SessionProvider } from './contexts/SessionProvider'; | ||
| import { StoreProvider } from './contexts/StoreProvider'; | ||
| import { useActionLock } from './hooks/useActionLock'; | ||
| import { | ||
| useIsNewWorkflow, | ||
| useLatestSnapshotLockVersion, | ||
|
|
@@ -36,6 +40,7 @@ import { | |
| import { useVersionSelect } from './hooks/useVersionSelect'; | ||
| import { useWorkflowState } from './hooks/useWorkflow'; | ||
| import { KeyboardProvider } from './keyboard'; | ||
| import { notifications } from './lib/notifications'; | ||
|
|
||
| export interface CollaborativeEditorDataProps { | ||
| 'data-workflow-id': string; | ||
|
|
@@ -190,6 +195,27 @@ function LandingScreenWrapper({ | |
| dismissLandingScreen, | ||
| openAIAssistantPanel, | ||
| } = useUICommands(); | ||
| const { pushEventTo } = useLiveViewActions(); | ||
| const { run: runBuildFromScratch, isPending: isBuildingFromScratch } = | ||
| useActionLock(async () => { | ||
| try { | ||
| await new Promise<void>((resolve, reject) => { | ||
| const timeout = setTimeout( | ||
| () => reject(new Error('build_from_scratch timed out')), | ||
| 10_000 | ||
| ); | ||
| pushEventTo('build_from_scratch', {}, () => { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Claude tells me it's okay to use |
||
| clearTimeout(timeout); | ||
| resolve(); | ||
| }); | ||
| }); | ||
| } catch { | ||
| notifications.alert({ | ||
| title: 'Failed to create workflow', | ||
| description: 'Please check your connection and try again.', | ||
| }); | ||
| } | ||
| }); | ||
|
|
||
| if (!showLandingScreen) return null; | ||
|
|
||
|
|
@@ -201,7 +227,8 @@ function LandingScreenWrapper({ | |
| dismissLandingScreen(); | ||
| openAIAssistantPanel(prompt); | ||
| }} | ||
| onBuildFromScratch={() => {}} | ||
| onBuildFromScratch={() => void runBuildFromScratch()} | ||
| isBuildingFromScratch={isBuildingFromScratch} | ||
| onBrowseTemplates={openTemplateBrowserModal} | ||
| onImportYAML={openYAMLImportModal} | ||
| /> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useActionLockrequires a promise, so we create a timeout in order to only build from scratch if successful.