feat(python-notebook-migration, frontend): add an AI generate workflow entry point on the dashboard - #7392
Conversation
…ntry point on the dashboard
Automated Reviewer SuggestionsBased on the
|
|
/request-review @mengw15 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7392 +/- ##
============================================
- Coverage 86.73% 86.64% -0.10%
+ Complexity 4218 4209 -9
============================================
Files 1169 1169
Lines 46754 46842 +88
Branches 5203 5230 +27
============================================
+ Hits 40553 40587 +34
- Misses 4489 4536 +47
- Partials 1712 1719 +7
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a second UI entry point for the Python-notebook → workflow migration flow by enabling “AI generate workflow” from the workflow dashboard, then deferring execution to the workspace once the newly created workflow loads.
Changes:
- Adds a dashboard toolbar button that opens the existing notebook import modal and creates a new empty workflow before navigating to the workspace.
- Implements a one-time handoff mechanism in
NotebookMigrationServiceso the dashboard can pass (file, model, wid) to the workspace menu for deferred execution. - Updates the import modal to optionally hide the “overwrite current workflow” warning for the dashboard flow, and adds unit tests covering the new behaviors.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/app/workspace/service/notebook-migration/notebook-migration.service.ts | Adds a pending-generation handoff slot keyed by wid for dashboard→workspace deferred execution. |
| frontend/src/app/workspace/service/notebook-migration/notebook-migration.service.spec.ts | Adds unit tests for the pending-generation consume/clear behavior. |
| frontend/src/app/workspace/component/notebook-import-modal/notebook-import-modal.component.ts | Adds showOverwriteWarning option (default-on) to support dashboard flow hiding the warning. |
| frontend/src/app/workspace/component/notebook-import-modal/notebook-import-modal.component.html | Conditionally renders the overwrite warning based on showOverwriteWarning. |
| frontend/src/app/workspace/component/notebook-import-modal/notebook-import-modal.component.spec.ts | Adds coverage ensuring the overwrite warning can be hidden via modal data. |
| frontend/src/app/workspace/component/menu/menu.component.ts | Consumes the pending-generation handoff once the loaded workflow becomes modifiable. |
| frontend/src/app/workspace/component/menu/menu.component.spec.ts | Adds tests ensuring the deferred trigger calls onClickImportNotebook only for matching wid/modifiable state. |
| frontend/src/app/dashboard/component/user/user-workflow/user-workflow.component.ts | Adds dashboard entry point: opens modal, validates .ipynb, creates empty workflow, stashes handoff, navigates to workspace. |
| frontend/src/app/dashboard/component/user/user-workflow/user-workflow.component.html | Adds the dashboard toolbar icon button gated by feature flag and access level. |
| frontend/src/app/dashboard/component/user/user-workflow/user-workflow.component.spec.ts | Adds unit tests for dashboard modal opening, validation, workflow creation/project add, and handoff+navigation behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
Suppressed comments (1)
frontend/src/app/dashboard/component/user/user-workflow/user-workflow.component.ts:392
Router.navigateresolves tofalsewhen navigation is cancelled, but this callback always returnstrue. The modal then closes while the newly set handoff remains pending, so it may unexpectedly run if this workflow is opened later. Handle both afalseresult and rejection, clear the handoff, and report that opening the workflow failed.
return this.router.navigate([USER_WORKSPACE, wid]).then(() => true);
…t when starting AI generate from the dashboard
…etadata in the dashboard handoff trigger
…erate button click binding
mengw15
left a comment
There was a problem hiding this comment.
Left one comment on the handoff lifetime.
…n handoff on any workspace load
What changes were proposed in this PR?
Adds a second entry point for the Python notebook to Texera workflow migration tool. Until now the only way to start a conversion was the "AI generate workflow" button in the workspace toolbar, which requires a workflow already open on the canvas. This PR adds an equivalent button on the workflow dashboard so a user can start the flow without opening a workflow first. It reuses the existing import modal (#7314) and the existing generation pipeline (#5273) rather than duplicating them.
Dashboard button (
user-workflow.component.{ts,html})openAiGenerateModal()opens the sameNotebookImportModalComponentused by the canvas menustartAiGeneratedWorkflow(file, model)validates the.ipynbextension, creates a new empty workflow, records the selected file and model for the workspace to pick up, and navigates to the new workflow.Handoff and workspace trigger (
notebook-migration.service.ts,menu.component.ts)NotebookMigrationServicegains a one time handoff slot (setPendingGeneration/consumePendingGeneration) keyed by the new workflow's wid.onClickImportNotebook(file, model)pipeline the toolbar button usesImport modal (
notebook-import-modal.component.{ts,html})NotebookImportModalDatagains an optionalshowOverwriteWarningflag. It defaults to shown when unset (canvas behavior unchanged) and the dashboard sets it false, since the dashboard always creates a new workflow and has nothing to overwrite.Behavior note
workflow/:id). If generation then fails, an empty "Untitled workflow" remains saved, which differs from the canvas flow where an already open workflow is overwritten.Demo
pr11.demo.mov
Note: a mock LLM API was used in this demo so that we don't need to wait for real-time generation. This does not affect any functionality for this PR.
Any related issues, documentation, discussions?
Closes #7360
Parent issue #4301
How was this PR tested?
Added unit specs:
notebook-migration.service.spec.tsmenu.component.spec.tsnotebook-import-modal.component.spec.tsuser-workflow.component.spec.tsWas this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.8)