feat(python-notebook-migration, frontend): add an AI generate workflow entry point on the dashboard - #7601
feat(python-notebook-migration, frontend): add an AI generate workflow entry point on the dashboard#7601zyratlo wants to merge 9 commits into
Conversation
…ntry point on the dashboard
Automated Reviewer SuggestionsBased on the
|
|
/request-review @mengw15 |
There was a problem hiding this comment.
Pull request overview
Adds dashboard-based AI notebook-to-workflow generation, persistence, notebook mapping, and one-time workspace layout.
Changes:
- Adds the dashboard entry point and generation pipeline.
- Adds a locked modal with loading status and elapsed time.
- Shares mapping keys and auto-layouts generated workflows.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
notebook-migration.service.ts |
Adds notebook parsing, typing, and mapping-key helper. |
notebook-migration.service.spec.ts |
Tests parsing and storage behavior. |
jupyter-panel.service.ts |
Uses the shared mapping key. |
workspace.component.ts |
Auto-layouts generated workflows. |
workspace.component.spec.ts |
Tests auto-layout behavior. |
notebook-import-modal.component.ts |
Adds locked loading state and timer. |
notebook-import-modal.component.spec.ts |
Tests submission locking and timing. |
notebook-import-modal.component.scss |
Styles the loading overlay. |
notebook-import-modal.component.html |
Adds the loading UI. |
user-workflow.component.ts |
Implements dashboard generation and persistence. |
user-workflow.component.spec.ts |
Tests generation success and failures. |
user-workflow.component.html |
Adds the AI-generation toolbar button. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…generated workflows
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7601 +/- ##
============================================
+ Coverage 89.67% 89.69% +0.01%
+ Complexity 4399 4395 -4
============================================
Files 1177 1177
Lines 46976 47090 +114
Branches 5260 5271 +11
============================================
+ Hits 42127 42238 +111
Misses 3092 3092
- Partials 1757 1760 +3
*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:
|
mengw15
left a comment
There was a problem hiding this comment.
Left two comments. I also checked Copilot's four independently — all four hold up and the fixes look right, including the vid pushback, since the fetch side hardcodes the same value.
…stall cannot trap the modal
…tion if the dashboard was left
mengw15
left a comment
There was a problem hiding this comment.
Both of my comments are fixed. Two follow-ups on the timeout itself.
| * Terminal UDFs (no outgoing edge) declare their outputs as `string` so the result panel | ||
| * renders viewable values rather than opaque binary blobs. | ||
| */ | ||
| export const LLM_REQUEST_TIMEOUT_MS = 10 * 60 * 1000; |
There was a problem hiding this comment.
A fixed bound can't tell "stalled" from "slow": a conversion that would have finished at 11 minutes now fails, and retrying hits the same wall, so the tool is permanently unusable for that notebook rather than just slow. The cost is lopsided — too generous only means waiting longer on a real stall, too tight discards work that would have succeeded.
Worth making this configurable rather than compiled in, so a deployment can match it to its own models and notebook sizes.
| try { | ||
| generated = await this.notebookMigrationService.sendToAIGenerateWorkflow(notebook, model); | ||
| } catch (error) { | ||
| this.notificationService.error("Error while communicating with the LLM, check console for details."); |
There was a problem hiding this comment.
A timeout lands here too, and "Error while communicating with the LLM" points at the network when the request was fine and just slow — the real reason only reaches the console, so the user spends the full limit waiting and then goes off debugging connectivity.
This is the half of my earlier comment that's still open: the hang is bounded now, but the user still can't tell what happened. A distinct message on the timeout rejection would close it.
What changes were proposed in this PR?
Adds an "AI generate workflow" entry point on the workflow dashboard for the Python notebook to Texera workflow migration tool. A user can upload a Jupyter notebook (
.ipynb) and get a generated Texera workflow without opening a workflow first.Dashboard button (
user-workflow.component.{ts,html})roboticon button in the workflows toolbar, styled like the existing "Upload ZIP/JSON" button and gated onpythonNotebookMigrationEnabledwith a non read-only access level.openAiGenerateModal()opens the sameNotebookImportModalComponentused elsewhere, with no footer and centered.generateWorkflowFromNotebook(file, model)runs the pipeline in stages, each with its own error toast: validate the.ipynbextension,parseAndTagNotebook(file)to read and uuid-tag the cells,sendToAIGenerateWorkflow(notebook, model)to call the LLM, thencreateWorkflow(...)to persist the result. After the workflow exists, it best-effort adds it to the current project, stores the notebook and cell mapping, and navigates to the new workflow with?autolayout=1. Once the workflow is created the flow never re-runs generation and never orphans the workflow.Import modal (
notebook-import-modal.component.{ts,html,scss})Workspace auto-layout (
workspace.component.ts)?autolayout=1, renders the workflow synchronously so the operators exist, runs auto-layout once, and then strips the query param. The Jupyter notebook panel opens on its own through the wid-drivenJupyterPanelService. No generation code lives in the workspace.Shared mapping key (
notebook-migration.service.ts,jupyter-panel.service.ts)notebookMappingKey(wid)is now the single source of truth for the cache key shared by the dashboard store step and the Jupyter panel lookup.Behavior note
Demo
pr11demo.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 and updated unit specs, with full line and branch coverage on the changed code:
user-workflow.component.spec.tsnotebook-import-modal.component.spec.tsworkspace.component.spec.tsnotebook-migration.service.spec.tsWas this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.8)