The GitHub Actions job "Required Checks" on texera.git/main has failed.
Run started by GitHub user github-merge-queue[bot] (triggered by 
github-merge-queue[bot]).

Head commit for run:
81d4612dc796ed3ea5dc6d98bd5bcc5f7fce0b41 / Ryan Zhang 
<[email protected]>
feat(python-notebook-migration, frontend): add Jupyter panel service 
(visibility surface and notebook-exists signal) (#5265)

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

---------

Co-authored-by: Meng Wang <[email protected]>

Report URL: https://github.com/apache/texera/actions/runs/30150067777

With regards,
GitHub Actions via GitBox

Reply via email to