Skip to content

feat(python-notebook-migration, frontend): add Jupyter panel service (visibility surface and notebook-exists signal) - #5265

Merged
mengw15 merged 30 commits into
apache:mainfrom
zyratlo:migration-tool-panel-controls
Jul 25, 2026
Merged

feat(python-notebook-migration, frontend): add Jupyter panel service (visibility surface and notebook-exists signal)#5265
mengw15 merged 30 commits into
apache:mainfrom
zyratlo:migration-tool-panel-controls

Conversation

@zyratlo

@zyratlo zyratlo commented May 28, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Extends JupyterPanelService with the panel-visibility surface (a BehaviorSubject plus four open/close/minimize methods) and a reactive jupyterNotebookExists$ 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:

  • Restores BehaviorSubject to the rxjs import and re-adds the NotificationService injection.
  • Panel-visibility stream: private jupyterNotebookPanelVisible = new BehaviorSubject<boolean>(false) with public jupyterNotebookPanelVisible$ = this.jupyterNotebookPanelVisible.asObservable().
  • Notebook-exists signal: private jupyterNotebookExists = new BehaviorSubject<boolean>(false) with public jupyterNotebookExists$. init() resets it to false on every workflow change and sets it to true in the fetchNotebookAndMapping success branch (result === 1). It stays true through 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.
  • Four if (!this.enabled) return;-gated methods:
    • openPanel(panelName: string) — flips visibility to true when panelName === "JupyterNotebookPanel" (the existing workspace panel-system convention).
    • closeJupyterNotebookPanel() — flips visibility to false, then notebookMigrationService.deleteMapping("mapping_wid_" + workflowActionService.getWorkflow().wid).
    • minimizeJupyterNotebookPanel() — flips visibility to false.
    • openJupyterNotebookPanel() — checks notebookMigrationService.hasMapping(...); warns via notificationService.warning("No Jupyter notebook associated with this workflow.") and returns if there is no cached mapping, otherwise flips visibility to true.
  • init()'s subscribe handler: on every workflow change it calls closeJupyterNotebookPanel() (which also does the stale-mapping cleanup), clears the highlight index, and resets jupyterNotebookExists to false; on a successful fetch it sets jupyterNotebookExists to true, precomputes the highlight index, and auto-opens via openJupyterNotebookPanel().

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 its main version 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 provides openJupyterNotebookPanel and jupyterNotebookExists$, #5273 consumes them.

How was this PR tested?

jupyter-panel.service.spec.ts adds visibility coverage (enabled-flag cases for open/close, minimize, and the warn-vs-open branch of openJupyterNotebookPanel; disabled-flag short-circuit cases per method) and a jupyterNotebookExists$ case (starts false, flips true after a successful fetch).

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 4.8)

@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label May 28, 2026
@codecov-commenter

codecov-commenter commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.68%. Comparing base (d5b852a) to head (db9ccb0).

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     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 931b0d4
agent-service 76.76% <ø> (ø) Carriedforward from 931b0d4
amber 67.33% <ø> (-2.73%) ⬇️ Carriedforward from 931b0d4
computing-unit-managing-service 20.49% <ø> (ø) Carriedforward from 931b0d4
config-service 66.66% <ø> (ø) Carriedforward from 931b0d4
file-service 67.21% <ø> (ø) Carriedforward from 931b0d4
frontend 82.64% <100.00%> (+0.06%) ⬆️
notebook-migration-service 78.94% <ø> (ø) Carriedforward from 931b0d4
pyamber 92.14% <ø> (-0.15%) ⬇️ Carriedforward from 931b0d4
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from 931b0d4

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zyratlo
zyratlo marked this pull request as draft June 5, 2026 21:28
…controls

# Conflicts:
#	frontend/src/app/app.module.ts
#	frontend/src/app/workspace/component/workflow-editor/mini-map/mini-map.component.ts
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • No candidates found from git blame history.

@zyratlo
zyratlo marked this pull request as ready for review July 21, 2026 19:17
@zyratlo

zyratlo commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

/request-review @mengw15

@github-actions
github-actions Bot requested a review from mengw15 July 21, 2026 19:18
@zyratlo
zyratlo marked this pull request as draft July 21, 2026 21:43
zyratlo added 2 commits July 22, 2026 15:24
# Conflicts:
#	frontend/src/app/workspace/service/jupyter-panel/jupyter-panel.service.spec.ts
#	frontend/src/app/workspace/service/jupyter-panel/jupyter-panel.service.ts
@zyratlo
zyratlo marked this pull request as ready for review July 22, 2026 22:35
@mengw15

mengw15 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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?)

@zyratlo

zyratlo commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

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?

@mengw15

mengw15 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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

@zyratlo

zyratlo commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

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.

zyratlo added a commit to zyratlo/texera that referenced this pull request Jul 23, 2026
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.
@zyratlo zyratlo changed the title feat(python-notebook-migration, frontend): add Jupyter panel visibility surface and mini-map expand-panel button feat(python-notebook-migration, frontend): add Jupyter panel service (visibility surface and notebook-exists signal) Jul 24, 2026
@zyratlo

zyratlo commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

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.

@mengw15 mengw15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mengw15
mengw15 enabled auto-merge July 25, 2026 07:11
@mengw15
mengw15 added this pull request to the merge queue Jul 25, 2026
Merged via the queue into apache:main with commit 81d4612 Jul 25, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Notebook Migration] Add Jupyter panel visibility surface and mini-map expand-panel button

3 participants