Repository navigation
Open the notebook as a tab of the widget's panel - #474
Merged
Merged
Conversation
The capsule's notebook icon opens the community's starter on the notebook site as a tab of the widget (#470). Without a notebook section the site has no starter for the community, so the loader now refuses the config instead of shipping an icon that can only open an error. Tested: pytest tests/test_core/test_config/test_community.py (new TestCommunityConfigCapsule); disabling the check fails the rejection test.
The capsule's notebook circle opened the notebook site in a new browser tab. It now opens the panel on a Notebook tab, framing the same open.html address, and the chat circle goes back to chat (#470). - One frame, made when the tab first opens and kept while the reader is on chat, so its Python keeps running; a new dataset replaces it, one with no Zarr copy drops it and returns to chat. - The header follows the tab: "Notebook" with a status line driven by notebook/osa-bridge.js's messages, heard only from the widget's own frame at the notebook's origin. Chat-only header buttons are hidden. - The widget's scheme is posted to the notebook's origin on load, on ready and on every change. - No ready 12 s after load or 45 s after creation, or a startup error before ready, shows a fallback: Try again, or Open in a new tab. - The capsule's circles are 46px (15% over the 40px Send button); a filled indicator slides to the open tab, the pill grows out of the chat button, the icons stagger in, the views fade through, and a ring turns on the notebook circle while Python starts off-tab. Reduced motion keeps only a short fade. - The capsule's panel resizes to 1400px wide and the window's height; the frame takes no pointer events during a drag. Tested: bun frontend/test-widget-notebook-tab.js (108, new, in both CI workflows), test-widget-capsule.js (127), test-widget-tools.js (312), test-widget-color-scheme.js (128); 30 single mutations, 26 killed, the other 4 each backed by a second guard and killed as pairs.
notebook-tab-check.mjs drives the capsule's notebook tab against the live develop notebook: circle sizes, the indicator, ready and setup from the bridge's own messages, dark applied inside the frame, the frame kept across a tab switch, and a resize across the frame. widget_e2e.py's policy allows both notebook hosts in frame-src, as a host page must. Needs the network, so it is not in CI. Tested: 12/12 in Chrome 153 against widget_e2e.py --nemar; setting the capsule's width limit back to 600px fails the resize step.
community-widget.md gains "The notebook tab" (behavior, fallback, the host page's frame-src, the pop-out not carrying it yet) and the capsule's new look; community-notebook.md drops "opens a new tab today"; ADR 0012 records the widget's half of the decision. Tested: docs only; the frame-src load behavior the ADR cites was measured in Chrome 153 with a one-off page.
Contributor
Preview Deployment
This preview will be updated automatically when you push new commits. |
- Only a capsule listens for the notebook's messages. - The pre-set config's notebookUrl is validated like setConfig's, so every reader can rely on a normalized URL; the raw fallbacks go. - A failed frame is kept when the reader returns to the tab, so the fallback stays until Try again, and a slow notebook still recovers. - A failure, or a setup that did not finish, while the reader is on chat puts a dot on the notebook circle, with a tooltip saying which. - A theme the notebook could not apply, and any message from it the widget does not recognize, reach the console. - The staleness check in setDataset no longer depends on operand order to avoid reading a null dataset. Tested: bun frontend/test-widget-notebook-tab.js (148; new checks for each item above, the exact chat icon, focus by identity, reopening via the notebook circle, setDataset(null) with a frame, a bubble's 56px); 44 single mutations, 39 killed, the other 5 killed as pairs with the guard that backs each; capsule, tools and color-scheme suites unchanged.
notebook-tab-check.mjs now opens the notebook with Enter on the focused circle and returns to it with Space, as real key presses, and times from the key press. Tested: 14/14 in Chrome 153 against widget_e2e.py --nemar.
The widget guide covers the kept failed frame, the circle's cue, the console warnings, and the resize floor at a bubble's 600 by 800; ADR 0012 records why a failed frame is kept. NEMAR's config comment and the launcher and notebook field docstrings say the notebook opens as a tab and that the capsule requires a notebook section. Tested: docs and comments only; pytest (2930 passed) and ruff.
Member
Author
Review responseFour reviews (code, tests, error handling, docs and comments). Every finding is addressed in df69d4e, b90b506 and 4e7210f, except the one noted at the end. Code
Tests
Error handling
Docs and comments
Gates
|
This was referenced Sep 24, 2026
neuromechanist
added a commit
that referenced
this pull request
Sep 24, 2026
Release review: add the widget's Notebook tab (#471, #474), color_scheme auto (#472), the first-paint fix (#476) and the dark-page field colors; the capsule and notebook-site bullets described the notebook opening in a new tab, which #474 replaced. Tested: docs-only; each claim checked against origin/develop (config.yaml color_scheme, osa-widget-config- key, ADR 0012 path).
neuromechanist
added a commit
that referenced
this pull request
Sep 24, 2026
* Title the changelog's release as 0.8.14 Tested: docs only. * Complete the 0.8.14 changelog Release review: add the widget's Notebook tab (#471, #474), color_scheme auto (#472), the first-paint fix (#476) and the dark-page field colors; the capsule and notebook-site bullets described the notebook opening in a new tab, which #474 replaced. Tested: docs-only; each claim checked against origin/develop (config.yaml color_scheme, osa-widget-config- key, ADR 0012 path).
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The capsule's notebook circle opened the notebook site in a new browser tab. This opens it inside the widget instead, as a Notebook tab of the same panel, next to the chat (first part of #470). It also makes the capsule's circles smaller and gives them the motion from the design canvas.
What changes
open.htmladdress the notebook site already serves; the chat circle goes back to chat, and the open tab's own circle, or the header's close button, closes the panel.notebook/osa-bridge.js's messages (Opening the notebook…,Starting Python…,Python ready, and so on). The widget acts on a message only if it comes from its own frame and from the notebook site's origin. The chat's Settings, reset and pop-out buttons are hidden on the notebook tab.prefers-reduced-motion: reduce, only a short fade between the views remains.launcher: capsulewithout anotebooksection, since the icon would open only an error. NEMAR, the only capsule community, has one.docs/community-widget.mdgains "The notebook tab", including what a host page with a Content Security Policy (CSP) needs (frame-srcfor the notebook host).docs/community-notebook.mddrops "opens a new tab today". ADR 0012 records the widget's half of the decision.Only the capsule changes. A bubble widget, every community but NEMAR, renders as before, and
test-widget-notebook-tab.jschecks that first.Not in this PR
frame-src. Their policy hasdefault-src 'self'and noframe-src, so today the frame is refused and the fallback shows. That change, and the re-pin to this commit, goes in a website PR to staging after this merges.Tests
frontend/test-widget-notebook-tab.js(new, 148 checks, added to bothtest.ymlandtests.yml): the bubble untouched, and not listening for messages; the views; the frame's address and attributes; the header and buttons per tab; the chat circle's exact icon; focus, compared by identity, following the tab; reopening through either circle; the frame kept across tab switches and a closed panel; the bridge's messages driving the status, overlays and ring; messages from another origin, another source or another shape ignored, and the bridge's unrecognized ones and a failed theme logged; theme posts addressed and deduplicated; each timeout on its own; a replaced frame's timer never failing its successor; a failed frame kept on return and recovering when late; the circle's cue for a failure or a failed setup; a startup error after ready ignored; dataset changes, includingsetDataset(null)with a frame open; an invalid pre-setnotebookUrldropped; the resize class; 46px against the 40px Send button, and a bubble's 56px; the reduced-motion block.frontend/test-widget-capsule.jsupdated for the tab (127),test-widget-tools.js(312) andtest-widget-color-scheme.js(128) unchanged and passing.inertalready refuses), and each fails when paired with removing that second guard.tests/test_core/test_config/test_community.py::TestCommunityConfigCapsule(new); disabling the check fails it.frontend/browser-harness/notebook-tab-check.mjs(new), 14 of 14 in Chrome 153 againstwidget_e2e.py --nemarand the live develop notebook: Enter on the focused circle opens the notebook and Space returns to it, as real key presses; ready 3.2 seconds after the key press and "Python ready" at 7.7 seconds on a cold profile; dark applied inside the notebook; the same frame after a switch; and a resize to 940px across the frame. Setting the capsule's width limit back to 600px fails it. It needs the network, so it is not in CI.frame-srcrefuses firesloadonce and never speaks, which is why the shorter timeout counts from the load.uv run pytest(2930 passed),ruff check,ruff format --check, every Bun suite CI runs,build-runtime-bundle.js --check.