Repository navigation
feat: one run card with Show code, visible errors and warnings - #681
Conversation
Adds record-run-card-fixtures.js, which runs a KeyError, a SyntaxError, an error with no line, cut stdout, cut stderr and a run with warnings through the worker core on the npm Pyodide, and the recorded data (stdout, stderr, traceback). Not yet used; the run card tests read it. Tested: regenerated and diffed.
…672) Replaces the consent/progress panel, the 'Ran Python' disclosure and the 'Code' disclosure with one card (a Run card block of pure builders in the widget). Done cards show figures first, then Show code (aria-expanded/controls), Copy code with a visible Copied, Output, Download and an in-card Edit and run. A restored card is the same card without figures. Failed runs open with Type: message, the failing line marked, All code, Full traceback (new stored traceback field) and Copy error, plus a retry line while the reply waits. Warnings of ok runs show as a collapsed count; cut output says how many characters are not shown. Stored stdout, stderr and traceback are cut from the middle so an error at the end of stderr survives. Tests: new test-widget-run-card.js (wired into CI), updated tools, popout and color-scheme suites, run-card-check.mjs screenshots at 400 px light and dark; docs rewritten. All frontend suites and tests/test_frontend pass.
Preview Deployment
This preview will be updated automatically when you push new commits. |
…rontend 113 passed, harness passes locally)
…m the traceback (run card tests 233 passed)
…ard-scoped panels; docs and changelog (run card tests 246 passed, all widget suites and Chrome harness pass)
|
Review round 1: outcome for each finding. Fixes are on this branch (head baea372).
Checks: run card tests 246 passed, all other widget suites pass, |
… is refused; type read from a module-qualified traceback; error text has a role and name (run card tests 261 passed, all widget suites and Chrome harness pass)
|
Review round 2 outcomes (fix commit d4675e3 on this branch):
Tested: run card tests 261 passed, every |
|
PM verdict: ready to merge (not merged). Every acceptance criterion is met against head d4675e3: run card suite (261 checks) wired after the activity-status step, updated widget suites green locally (all frontend/test-*.js), Chrome harness passes, screenshots attached in the PR body, docs section rewritten, and both review rounds have an outcome for every finding. CI is green (Lint re-run after a transient actionlint download failure). The branch is 8 commits behind develop, but those are docs and version bumps only; it merges cleanly, and I verified a local rebase onto origin/develop passes the frontend suites, harness and tests/test_frontend. I could not force-push the rebase, so squash-merge as is. |
The run card stores a traceback on every run, and loading fills a missing one with an empty string. The conversation store test now feeds v2 runs without it and expects it on load. All frontend suites pass locally.
Summary
Replaces the widget's three run UIs (the consent/progress panel, the "Ran Python: ..." disclosure, the "Code" disclosure) with one run card, then makes failures and noise legible.
// --- Run card ---block of pure builders infrontend/osa-chat-widget.js(state in, HTML out; no new script or loader). Consent, running, done and every non-ok status render through it; a restored card is the same card without figures.Show code · N lines(aria-expanded, aria-controls, state inrun._codeOpen), Copy code with a visible "Copied",Output · N lines, figure Download, and Edit and run with its editor inside the card.Type: message, the failing line marked, All code, Full traceback (new storedtracebackfield, hidden when empty) and Copy error; a retry line while the reply is pending ("run K of 20"); a collapsed "N warnings" for ok runs; "N characters not shown" for cut output.docs/community-widget.md, "A run in the chat", rewritten.Closes #664
Closes #672
Commands run
bun install: okbun frontend/test-widget-run-card.js: 223 passed (new, wired into the frontend-tests job after the activity-status step)bun frontend/test-widget-tools.js,popout,color-scheme,activity-status,dataset-questions: 440, 141, 149, 303, 60 passed; host-styles, settings, first-paint, capsule, notebook-tab, launcher-geometry, paced-streaming and test-controller also passnode --check frontend/osa-chat-widget.js: ok;bun scripts/build-runtime-bundle.js --check: bundle currentuv run pytest tests/test_frontend -q: 113 passeduv run ruff check .anduv run ruff format --check .: cleanbun frontend/browser-harness/run-card-check.mjs <dir>: all checks pass in headless Chrome 157 (every state at 400 px, light and dark; no overflow, buttons at least 36 px tall, failing line marked, Show code works)Screenshots (400 px)
The PNGs are on the
screenshots/issue-664-run-cardbranch (not part of this change; delete it after merge).Notes
/pr-review-toolkit:review-pr(Sonnet) before merge.