zyratlo opened a new pull request, #5265:
URL: https://github.com/apache/texera/pull/5265
### What changes were proposed in this PR?
Adds the panel-visibility surface to `JupyterPanelService`
(`BehaviorSubject` + four open/close/minimize methods) and the mini-map
expand-panel button that drives `openJupyterNotebookPanel`.
**`jupyter-panel.service.ts` amends:**
- Restores `BehaviorSubject` to the `rxjs` import.
- Adds `private jupyterNotebookPanelVisible = new
BehaviorSubject<boolean>(false)` and the public `jupyterNotebookPanelVisible$ =
this.jupyterNotebookPanelVisible.asObservable()`.
- Adds four `if (!this.enabled) return;`-gated methods:
- `openPanel(panelName: string)` — flips visibility to `true` when
`panelName === "JupyterNotebookPanel"`. (The `panelName` string is the existing
convention used elsewhere in the workspace's panel system.)
- `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 the workflow has no cached mapping, otherwise flips
visibility to `true`.
- Refactors `init()`'s subscribe handler
- replaces the inlined `deleteMapping` placeholder with the actual
`this.closeJupyterNotebookPanel()` call
- re-adds the `this.openJupyterNotebookPanel()` auto-open after
`precomputeHighlightMapping()`.
**`jupyter-panel.service.spec.ts` amends:**
- Adds 5 enabled-flag visibility tests in a "Panel visibility" section:
- `openPanel` then `closeJupyterNotebookPanel` round-trips the
visibility stream
- `minimizeJupyterNotebookPanel` flips to `false`
- `openJupyterNotebookPanel` warns when no mapping is cached
- `openJupyterNotebookPanel` flips to `true` when one is; `openPanel`
only flips for the correct panel name.
- Adds 4 disabled-flag tests inside the existing `when the feature flag is
disabled` describe block — one per gated method — asserting the short-circuit
via observable / spy checks (no `next()` emission from the method itself, no
`deleteMapping` call, no `notification.warning`).
**Mini-map expand-panel button (`mini-map.component.{ts,html,scss}`, ~37
lines):**
- New `*ngIf="pythonNotebookMigrationEnabled"`-gated button (icon
`expand-alt`) at the top of the mini-map's button cluster.
- The component injects `JupyterPanelService` and `GuiConfigService`; the
click handler calls `jupyterPanelService.openJupyterNotebookPanel()`. With the
flag at its default `false` on `main`, the button doesn't render and the rest
of the mini-map UI is unchanged.
### Any related issues, documentation, discussions?
Closes #5264
Parent issue #4301
- Hard dependency: **must be merged after
`migration-tool-mapping-highlighting`** #5263
### How was this PR tested?
`jupyter-panel.service.spec.ts` is amended with 5 more visibility cases and
4 more disabled-flag cases
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Claude Opus 4.7)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]