Commit Graph
1 Commits
Author SHA1 Message Date
gac berninaandClaude Sonnet 5 59b8d30b53 Add a Log Viewer button to eco's JupyterLab and Voila dashboards
Native menu bars are frontend-only in JupyterLab (same conclusion reached
earlier this session for auto-opening a Console tab -- no server-side hook
exists), so eco desktop's Tools -> Log Viewer menu action has no direct
equivalent there. A button on the dashboard is the closest achievable
analogue, wired through eco.logs's existing prefer= mechanism so all three
front-ends share one code path instead of three parallel ones:

- eco.logs._open_timeline gained a "sidecar" prefer option: renders the
  timeline's HTML into a new eco.widgets.jupyter_sidecar.open_html_in_
  sidecar() panel -- a real, separate dockable Sidecar, matching desktop's
  menu action opening its own window.
- eco.widgets.jupyter_sidecar.NamespaceDashboard (the JupyterLab
  counterpart to EcoDesktopApp) gained a "Log Viewer" button above the
  Namespace launcher, calling eco.logs.widget(prefer="sidecar"); reopening
  replaces (closes) the previous panel rather than piling up, and it's
  torn down in .close() alongside everything else.
- eco.widgets.widget_tray.make_namespace_dashboard (Voila) gained the same
  button, calling eco.logs.widget(prefer="jupyter") into a dedicated
  ipywidgets.Output() -- Voila has no Sidecar shell to dock into, so this
  renders inline instead, same reasoning as its existing WidgetTray.

Verified via scripted construction against fake namespaces (button
present, opens, reopening replaces, torn down on close) and the full test
suite (347/349 -- the 2 failures are pre-existing in
test_config_lazy_init.py, unrelated). Along the way, found and worked
around a real pre-existing test-isolation hazard: IPython's
InteractiveShell.instance() is a process-wide singleton, and an earlier,
unrelated test building a real ipykernel-backed shell leaves a stale one
behind that later display()/Output.clear_output() calls in the same
pytest session crash against -- not something this change caused, but the
first tests to actually exercise that code path, so the new tests
short-circuit the specific stale calls rather than depending on that
global state.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-22 08:43:34 +02:00