Skip to main content

jupyterlab_server_proxy_launcher_fix

GitHub Actions npm version PyPI version Total PyPI downloads JupyterLab 4 Brought To You By KOLOMOLO Donate PayPal

JupyterLab extension that fixes SVG icon display for jupyter-server-proxy launchers when placed in custom categories other than "Notebook" or "Console".

[!WARNING] This extension is a temporary fix for jupyterhub/jupyter-server-proxy. Once the upstream project implements proper icon support for custom launcher categories, this extension will be deprecated. We look forward to our own obsolescence.

The Problem

When configuring jupyter-server-proxy launchers with custom categories (e.g., "Services", "Tools"), SVG icons fail to display. This happens because JupyterLab's launcher widget handles icons differently based on category:

  • Notebook/Console categories: Uses kernelIconUrl property - works correctly
  • Other categories: Calls commands.icon(command, args) to get the icon - server-proxy's server-proxy:open command doesn't define an icon property, so icons are missing

The Fix

This extension wraps JupyterLab's commands.icon() method to intercept calls for the server-proxy:open command and return pre-cached LabIcon instances.

How it works:

  • Fetches server-proxy configuration from /server-proxy/servers-info endpoint
  • Pre-fetches SVG icons and creates LabIcon instances for non-kernel categories
  • Wraps app.commands.icon() to return cached icons when command is server-proxy:open
  • Matches icons by args.title (handles both plain titles and titles with [↗] suffix for new_browser_tab: true)

Implementation details:

  • No command override: Preserves server-proxy's original execute function completely
  • No timing issues: Wrapper intercepts all calls regardless of extension load order
  • No private API access: Uses public method wrapping instead of accessing internal _commands Map
  • Non-destructive: Original behavior preserved for all other commands

Fix Implementation Details

The extension consists of frontend TypeScript code that wraps the commands registry icon method.

Frontend Implementation (src/index.ts):

  • Icon Caching: Fetches server info, creates LabIcon from icon_url for each non-kernel category launcher, caches by title
  • Title Matching: Caches icons under both plain title and ${title} [↗] suffix (server-proxy appends this when new_browser_tab: true)
  • Method Wrapping: const originalIcon = app.commands.icon.bind(app.commands) preserves original, then (app.commands as any).icon = ... installs wrapper
  • Conditional Return: If id === 'server-proxy:open' and args.title matches cache key, returns cached LabIcon; otherwise delegates to original

Icon Utilities (src/iconUtils.ts):

  • SVG Fetching: fetchSvgIcon(url, name) fetches SVG content and creates LabIcon instance
  • Fallback Icons: createTextIcon(name, title) generates simple SVG with first letter when icon_url unavailable

Requirements

Install

To install the extension, execute:

pip install jupyterlab_server_proxy_launcher_fix

Uninstall

To remove the extension, execute:

pip uninstall jupyterlab_server_proxy_launcher_fix

Metadata

Release files for jupyterlab-server-proxy-launcher-fix 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jupyterlab-server-proxy-launcher-fix 1.0.4
File Size Uploaded
jupyterlab_server_proxy_launcher_fix-1.0.4.tar.gz 279.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jupyterlab-server-proxy-launcher-fix 1.0.4
File Interpreter ABI Platform
jupyterlab_server_proxy_launcher_fix-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 303.1 kB

Release files / jupyterlab_server_proxy_launcher_fix-1.0.4.tar.gz

Download URL jupyterlab_server_proxy_launcher_fix-1.0.4.tar.gz
Size 279.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fe9d62391827a71a558234d4840da094abd551755db2baaf39e5f1ca9e0dada1
BLAKE2b-256 checksum
How to use checksums
ca502bcac27c3b0f4ea2198d359b18cd207e7a922638e318025e551365da6a51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / jupyterlab_server_proxy_launcher_fix-1.0.4-py3-none-any.whl

Download URL jupyterlab_server_proxy_launcher_fix-1.0.4-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ceb5a6a396df227fdc8e718c67bbd0948c8b5221f9ba232acffa71977f744a8
BLAKE2b-256 checksum
How to use checksums
1a17ffa0b9de6a639db8ee85b154c75df0930cde6884bab7c910eb50050875ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page