Repository navigation
feat: Continue in notebook card, History row menu items and Download code (E4.3) - #692
Conversation
…(E4.3) Adds the Notebook entry points block to the widget: a quiet card under the last reply after a successful run, Continue in notebook and Download code (.ipynb or .py) from the runtime bundle's builder, and the two History row menu items. Tested in the next commit with the frontend suites.
Runs the real widget and runtime bundle over the shared notebook conversations: card visibility rules, Continue and Open notebook, Download code files, the History row items, escaping and a failing builder. Passes with the other frontend suites.
Preview Deployment
This preview will be updated automatically when you push new commits. |
… its list (E4.3 review) Focus returns to Continue (or Download code) when an import fails with focus nowhere, and to the History button when a History import is refused on the chat tab. The Download code popup keeps only menu items inside role=menu, with the note beside it, aria-controls, Home/End and Up from the button. The card's build is cached per chat state and a builder failure is logged once. importNotebookToTab now has a record-returning core used by the card, and a superseded import keeps the path its answer named. The History row menu is capped at the list's height and scrolled into view. Comments and the ADR say the card calls the import. Tested: frontend suites and the real-Chrome check pass.
…ths for the notebook entry points Adds 46 checks to the notebook entry suite (174 in all): the card waits for the reveal, a refusal before and after the tab opens, focus after a failed import, the menu's roles and keys, the build cache, History builder errors, a deleted chat and a refusal on the chat tab, and a superseded import. Tested: bun frontend/test-widget-notebook-entry.js.
Measures the card and the Download code menu at 400 px in light and dark (inside the panel, 44 px controls, 4.5:1 text) and that the tallest History row menu is wholly inside the list that clips it. Tested: passes locally, and fails without the menu's height cap.
|
Review round 1: outcome for each finding. Fixes are in 07fb653, e783ca0 and 7be6e4b on this branch.
Tests rerun at 7be6e4b: notebook-entry 174/174, history-panel 200/200, notebook-import 117/117, notebook-tab 168/168, notebook-strip 169/169, capsule 133/133, tools 443/443, run-card 261/261, notebook-builder 130/130, |
…test (tests/test_frontend: 144 passed)
…the last assistant reply without building an array per message (JS suites pass)
|
Review round 2 outcomes (commits 8c3e5b2, 4c7dc57):
Tests run: |
|
PM verdict at 4c7dc57: all acceptance criteria checked against the diff and tests and met; every review finding from rounds 1 and 2 has an outcome in a PR comment. All checks pass (Lint, Test 3.11, Test 3.12, Frontend Tests, deploy; Integration Tests skipping). Branch is not behind develop. Re-ran locally: notebook-entry 177/177, history-panel 200/200 (file unchanged), notebook-import 117/117, notebook-builder 130/130, bundle --check current, node --check ok. Not merged by this run: the merge was blocked by the permission system because the PR has no approving review, so it is waiting on a maintainer other than the author to approve and merge (squash). |
# Conflicts: # CHANGELOG.md # frontend/osa-chat-widget.js
Summary
E4.3 of the NEMAR AI experience plan: a way out of a chat's code.
--osa-danger-texttoken, light and dark).OSARuntime.buildConversationNotebookand callsimportNotebookToTab; disabled while it waits, errors inline withrole="alert", becomes Open notebook (no second import) until a new run changes the step count or the import is undone. Offered only for a capsule widget whose page dataset (with a Zarr copy) is the chat's dataset; otherwise only Download code.saveFileas<dataset>-chat.ipynb/.py, with the builder's exact notebook JSON and script text. Escape closes and returns focus.// --- Notebook entry points (E4.3) ---, with one-line hooks inrenderMessages,renderLauncherIcons,startBrowserToolsand the History row, sheet and click handler. New suitefrontend/test-widget-notebook-entry.jsis wired intotests.ymlafter the notebook strip step.docs/community-widget.mdandCHANGELOG.mdupdated.Closes #675
Commands run
bun installbun frontend/test-widget-notebook-entry.js(128 passed)frontend/test-widget-*.jsalso exits 0bun scripts/build-runtime-bundle.js --check(bundle is current)node --check frontend/osa-chat-widget.jsuv run pytest tests/test_frontend -q(144 passed; the attribute-escaping drift test caught my first draft and is green)uv run ruff check .passes;uv run ruff format --check .reports 8 pre-existing Markdown files under.context/(none touched here)