Skip to content

fix(workbench): make JupyterLab launch/exec resilient to SPA timing#494

Merged
ian-flores merged 2 commits into
mainfrom
workbench-launch-gates
Jul 17, 2026
Merged

fix(workbench): make JupyterLab launch/exec resilient to SPA timing#494
ian-flores merged 2 commits into
mainfrom
workbench-launch-gates

Conversation

@ian-flores

Copy link
Copy Markdown
Collaborator

Summary

Fixes #478 — the JupyterLab launch/extension tests skipped with a false "IDE
may not be installed" on deployments that open JupyterLab without an
auto-opened Launcher tab.

Root cause (found by live diagnosis on dev.demo)

The tests gated on .jp-Launcher, which only exists while the Launcher tab is
open; when JupyterLab opens without it, they read as "not installed." The
code-exec path had three further blockers: the #jupyterlab-splash overlay
lingers after the shell mounts and intercepts clicks, no Launcher auto-opens,
and a racy modal "Select Kernel" dialog appears just after the notebook opens.

Fix

  • Gate readiness on the JupyterLab app shell (.jp-LabShell), present on every
    load regardless of active view.
  • Code-exec: wait out #jupyterlab-splash, open a Launcher via launcher:create
    when none is auto-opened, target the visible notebook panel, and
    poll-dismiss the "Select Kernel" modal before typing.

Live validation (dev.demo.posit.team)

Both JupyterLab tests now pass end-to-end (were skipping):

  • test_jupyterlab_extensions PASSED
  • test_launch_jupyter PASSED (launcher → notebook → accept kernel → run 1+1 → assert 2)

Not in this PR

#477 (Positron) is deferred with a definitive finding: dev.current's
Positron has no interpreters (the "Start New Console Session" picker is
empty), so no console renders and the test can't be validated there. The
Positron console tab/panel selectors have also drifted (this also affects
exec.py's Positron readback). Needs a Positron deployment with interpreters —
tracked in #477.

Test plan

  • ruff + format clean; selftests unaffected (product-only UI steps)

Demo

Fix #478: JupyterLab launch/exec resilient to SPA timing

2026-07-17T17:21:08Z by Showboat 0.6.1

test_launch_jupyter and test_jupyterlab_extensions skipped with a false 'IDE may not be installed' because they gated on .jp-Launcher, which only exists while the Launcher tab is open -- some deployments open JupyterLab with no Launcher tab. Root causes found by live diagnosis on dev.demo: (1) gate on the wrong element; (2) the #jupyterlab-splash overlay lingers after the shell mounts and intercepts clicks; (3) no Launcher auto-opens; (4) a modal 'Select Kernel' dialog appears a moment after the notebook opens.

Fix: gate readiness on the JupyterLab app shell (.jp-LabShell), present on every load; then in code-exec, wait out the splash, open a Launcher via launcher:create, target the visible notebook, and poll-dismiss the kernel dialog.

grep -n "SHELL = \|SPLASH = \|LAUNCHER_CREATE_COMMAND = \|DIALOG = " src/vip_tests/workbench/pages/jupyterlab_session.py
17:    SHELL = ".jp-LabShell"
21:    SPLASH = "#jupyterlab-splash"
26:    DIALOG = ".jp-Dialog"
55:    LAUNCHER_CREATE_COMMAND = '[data-command="launcher:create"]:visible'

The readiness gate now uses the app shell, not the Launcher tab:

grep -n "JupyterLabSession.SHELL" src/vip_tests/workbench/test_ide_launch.py src/vip_tests/workbench/test_ide_extensions.py
src/vip_tests/workbench/test_ide_launch.py:306:    _expect_ide_or_skip(page, JupyterLabSession.SHELL, "JupyterLab")
src/vip_tests/workbench/test_ide_extensions.py:236:    _expect_ide_or_skip(page, JupyterLabSession.SHELL, "JupyterLab")

Lint clean:

env -u UV_PROJECT uv run --frozen --no-sync --project . ruff check src/vip_tests/workbench/test_ide_launch.py src/vip_tests/workbench/test_ide_extensions.py src/vip_tests/workbench/pages/jupyterlab_session.py
All checks passed!

Live validation on dev.demo.posit.team (not re-runnable here -- needs a live deployment + browser auth): with JupyterLab installed but no auto-opened Launcher, both JupyterLab tests now PASS end-to-end -- test_jupyterlab_extensions PASSED (was skipping with false 'not installed') and test_launch_jupyter PASSED (opens a Launcher, creates a notebook, dismisses the Select-Kernel dialog, runs 1+1, asserts 2). Before this change both skipped claiming JupyterLab may not be installed.

test_launch_jupyter and test_jupyterlab_extensions skipped with a false "IDE
may not be installed" because they gated on .jp-Launcher, which only exists
while the Launcher tab is open -- some deployments open JupyterLab without it.

- Gate readiness on the JupyterLab app shell (.jp-LabShell), present on every
  load regardless of active view.
- In the code-exec step: wait out the #jupyterlab-splash overlay (it lingers
  after the shell mounts and intercepts clicks), open a Launcher via the
  launcher:create command when none is auto-opened, target the visible notebook
  panel, and poll-dismiss the modal "Select Kernel" dialog before typing.

Validated live against a Workbench 2026.06 deployment: both JupyterLab tests
pass end-to-end (were skipping).

Fixes #478

Copilot AI 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.

Pull request overview

This PR fixes false skips in the Workbench JupyterLab UI tests by switching the “IDE is ready” gate from the transient Launcher tab to the always-present JupyterLab app shell, and hardens notebook code execution against SPA boot timing (splash overlay, missing Launcher tab, and late-appearing kernel dialog).

Changes:

  • Update JupyterLab readiness gating to wait for .jp-LabShell instead of .jp-Launcher (fixes false “IDE may not be installed” skips).
  • Make the JupyterLab notebook exec flow resilient: wait for splash to clear, open a Launcher via launcher:create when needed, target the visible notebook panel, and best-effort dismiss modal dialogs.
  • Add a Showboat demo doc capturing live validation details for issue #478.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
validation_docs/demo-478-jupyterlab-launch.md Adds demo/validation notes and commands documenting the fix and lint status.
src/vip_tests/workbench/test_ide_launch.py Switches JupyterLab readiness gate to SHELL and hardens the code-execution path (splash, launcher creation, modal handling, visible notebook targeting).
src/vip_tests/workbench/test_ide_extensions.py Switches JupyterLab readiness gate to SHELL for extension checks.
src/vip_tests/workbench/pages/jupyterlab_session.py Introduces new selectors for .jp-LabShell, splash, modal dialog accept, and launcher:create.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ian-flores
ian-flores marked this pull request as ready for review July 17, 2026 17:37
@ian-flores
ian-flores merged commit 31f2728 into main Jul 17, 2026
34 checks passed
@ian-flores
ian-flores deleted the workbench-launch-gates branch July 17, 2026 17:37
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-17 17:37 UTC

@posit-vip-triage

Copy link
Copy Markdown
Contributor

📸 Preview Screenshots

7 screenshots captured across the website and report previews for this PR.


🌐 Website Preview — https://posit-dev.github.io/vip/pr-preview-site/pr-494/

Home

website home

Getting Started

website getting-started

Test Inventory

website tests

Feature Matrix

website feature-matrix

Example Report

website report


📊 Report Preview — https://posit-dev.github.io/vip/pr-preview/pr-494/

Summary (index)

report home

Detailed Results

report details


URLs captured:

  • https://posit-dev.github.io/vip/pr-preview-site/pr-494/ (home)
  • https://posit-dev.github.io/vip/pr-preview-site/pr-494/getting-started/
  • https://posit-dev.github.io/vip/pr-preview-site/pr-494/tests/
  • https://posit-dev.github.io/vip/pr-preview-site/pr-494/feature-matrix/
  • https://posit-dev.github.io/vip/pr-preview-site/pr-494/report/
  • https://posit-dev.github.io/vip/pr-preview/pr-494/ (report summary)
  • https://posit-dev.github.io/vip/pr-preview/pr-494/details.html (report details)

Note: The report preview pages timed out on full-page screenshot (font loading); viewport-only screenshots were captured instead.

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • fonts.gstatic.com
  • mtalk.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "fonts.gstatic.com"
    - "mtalk.google.com"

See Network Configuration for more information.

Generated by Capture preview screenshots for PRs · 70.2 AIC · ⌖ 6.46 AIC · ⊞ 6.1K ·

bdeitte added a commit that referenced this pull request Jul 17, 2026
PR #494's showboat demo (demo-478-jupyterlab-launch.md) landed on main
after this branch removed the validation_docs archive; drop it to keep
the branch's removal of the showboat convention complete.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(workbench): JupyterLab tests skip (.jp-Launcher not found) though JupyterLab is installed

2 participants