feat(python-notebook-migration, frontend): add Jupyter panel service (visibility surface and notebook-exists signal) - #5265
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5265 +/- ##
============================================
- Coverage 77.70% 76.68% -1.03%
+ Complexity 3606 3452 -154
============================================
Files 1161 1161
Lines 46034 45933 -101
Branches 5099 5104 +5
============================================
- Hits 35773 35225 -548
- Misses 8660 9174 +514
+ Partials 1601 1534 -67
*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:
|
# Conflicts: # frontend/src/app/app.module.ts
…controls # Conflicts: # frontend/src/app/app.module.ts # frontend/src/app/workspace/component/workflow-editor/mini-map/mini-map.component.ts
Automated Reviewer SuggestionsBased on the
|
…nto migration-tool-panel-controls
|
/request-review @mengw15 |
# Conflicts: # frontend/src/app/workspace/service/jupyter-panel/jupyter-panel.service.spec.ts # frontend/src/app/workspace/service/jupyter-panel/jupyter-panel.service.ts
|
Could you also add a screenshot of the frontend to the PR description? Thanks. Also is there a specific reason we put the button on the mini map? (for example do we want to put it on the top menu?) |
I added a screenshot. The placement of the button doesn't have a particular reason, that was just the most logical place we thought to put it at the time. The top menu has many buttons already so we didn't want to pollute it, but I am open to this change. What do you think? |
Semantically, I think placing the button on the minimap feels a bit unusual, so I would still prefer putting it in the top menu. I also think the current button icon is a little bit confusing |
Ok, I will make the change to move it to the top. In terms of the icon I can change it to the Jupyter logo. |
adopt main's reviewed versions for the already merged migration slices: backend notebook-migration-service, frontend migration service, config, build, and sql. pull the reviewed open PR content from its branches: jupyter panel visibility surface and mini-map button (apache#5265), jupyter notebook iframe panel (apache#5271), and the AI generate workflow modal and panel host (apache#5273). reconcile app.module.ts by keeping main's JupyterPanelService bootstrap listener and registering JupyterNotebookPanelComponent.
|
I moved the button out of the mini-map and into the top menu bar next to the AI generate button, and switched the icon to the Jupyter logo. To keep this reviewable, the button and the service it drives are now split across two PRs:
I also updated this PR's title and description to reflect the narrower scope. |
What changes were proposed in this PR?
Extends
JupyterPanelServicewith the panel-visibility surface (aBehaviorSubjectplus four open/close/minimize methods) and a reactivejupyterNotebookExists$signal. This PR is the service layer only. The button that consumes it lives in the workspace top menu bar via #5273; #5265 provides the service, #5273 consumes it.jupyter-panel.service.ts:BehaviorSubjectto therxjsimport and re-adds theNotificationServiceinjection.private jupyterNotebookPanelVisible = new BehaviorSubject<boolean>(false)with publicjupyterNotebookPanelVisible$ = this.jupyterNotebookPanelVisible.asObservable().private jupyterNotebookExists = new BehaviorSubject<boolean>(false)with publicjupyterNotebookExists$.init()resets it tofalseon every workflow change and sets it totruein thefetchNotebookAndMappingsuccess branch (result === 1). It staystruethrough minimize and resets when switching workflows. The menu button in feat(python-notebook-migration, frontend): add AI-generate-workflow modal, panel host, and LLM loading spinner #5273 binds to this to decide whether to show.if (!this.enabled) return;-gated methods:openPanel(panelName: string)— flips visibility totruewhenpanelName === "JupyterNotebookPanel"(the existing workspace panel-system convention).closeJupyterNotebookPanel()— flips visibility tofalse, thennotebookMigrationService.deleteMapping("mapping_wid_" + workflowActionService.getWorkflow().wid).minimizeJupyterNotebookPanel()— flips visibility tofalse.openJupyterNotebookPanel()— checksnotebookMigrationService.hasMapping(...); warns vianotificationService.warning("No Jupyter notebook associated with this workflow.")and returns if there is no cached mapping, otherwise flips visibility totrue.init()'s subscribe handler: on every workflow change it callscloseJupyterNotebookPanel()(which also does the stale-mapping cleanup), clears the highlight index, and resetsjupyterNotebookExiststofalse; on a successful fetch it setsjupyterNotebookExiststotrue, precomputes the highlight index, and auto-opens viaopenJupyterNotebookPanel().No mini-map changes: the expand control moved out of the mini-map and into the top menu bar (see #5273), so
mini-map.component.*is back to itsmainversion here.Any related issues, documentation, discussions?
Closes #5264
Parent issue #4301
Builds on #5263 (
migration-tool-mapping-highlighting), merged. The consuming menu button lives in #5273 (migration-tool-modal): #5265 providesopenJupyterNotebookPanelandjupyterNotebookExists$, #5273 consumes them.How was this PR tested?
jupyter-panel.service.spec.tsadds visibility coverage (enabled-flag cases for open/close, minimize, and the warn-vs-open branch ofopenJupyterNotebookPanel; disabled-flag short-circuit cases per method) and ajupyterNotebookExists$case (startsfalse, flipstrueafter a successful fetch).Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.8)