Repository navigation
Suggest questions about the dataset on screen - #478
Merged
Merged
Conversation
The general suggested question, the prompt's example identifier and its describe-dataset step, and the setDataset example in the widget docs now name nm000132, a public EEG dataset with a Zarr copy, instead of nm000219, nm000329 and nm000103. Tested: test_communities_endpoint.py and test_community.py pass.
A widget block can now carry question templates for a dataset page (#477): {dataset_id} required, {subject} and {task} optional, nothing else, and needs_zarr on the ones that run code against a recording. resolve() and the API omit the field when a community sets none. Tested: test_community.py (the new TestDatasetSuggestedQuestions: blank, brace, markup, length, unknown-field and count refusals); full offline pytest, 2947 passed.
setDataset takes subject and task, BIDS labels, beside id and zarr. On a dataset page the opening screen shows up to three filled templates, needs_zarr ones only with a Zarr copy, and the general list when none fits; mid-conversation a dataset new to the conversation gets a compact row of two. Each sent message records the dataset on screen, so the row goes once the reader sends from that page, and stays gone on reload. Tested: test-widget-dataset-questions.js (51, in both CI workflows), and 22 single-line mutations of the new code each fail it; every other Bun suite CI runs passes; checked in Chrome, light, dark and at phone width.
Five templates: what the dataset is and how it was recorded, a 10 second plot and a power spectrum of the page's first Zarr recording (needs_zarr), how to download it, and which events it annotates. The two that run code stay within the chat runtime, which has no scipy. Tested: test_communities_endpoint.py (NEMAR alone sends the field, every template names its dataset, three need no Zarr copy).
The dataset_suggested_questions field and its rules, setDataset's new subject and task, and the setConfig key. Tested: docs only.
Contributor
Preview Deployment
This preview will be updated automatically when you push new commits. |
Review of #478. An invalid subject or task no longer refuses the whole setDataset call, which kept the previous dataset, and its notebook icon, on screen; only that fact is dropped. A pop-out is told the dataset on screen when it opens and on every later setDataset, so its suggestions follow the page. The harness page takes subject and task too. Tested: test-widget-dataset-questions.js (64), with tests for both, for a malformed setConfig value and for the hidden empty area; 29 single-line mutations each fail it; the color-scheme, first-paint, capsule, notebook and tools suites pass; bundle check.
Review of #478: an unquoted YAML number or a null where the text belongs must fail as a config error, not as an AttributeError. Tested: TestDatasetSuggestedQuestions, 22 pass; removing the isinstance guard fails the five new cases.
Review of #478: NEMAR's config comment no longer says nemar.org passes subject and task (website#356 is open); BIDS is spelled out where the widget docs first use it; long sentences break at clause punctuation; the pop-out and the dropped-label rule are documented; and a CHANGELOG entry. Tested: docs and comments only; test_communities_endpoint.py passes.
Member
Author
Review responseFour Sonnet reviews (code, tests, error handling, docs). Every finding is addressed in 6553b29, c939a29 and 196dd7b. Error handling
Code
Tests
Docs
|
This was referenced Sep 24, 2026
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.
Summary
Closes #477. On a page that names a dataset with
setDataset, the widget suggests questions about that dataset, filled from facts the page passes, rather than the community's general list. NEMAR is the only community that sets any; every other community is unchanged.Also makes nm000132 (ERP CORE) NEMAR's example dataset: the general suggestion "Tell me about dataset nm000132" replaces nm000219, and the prompt's example identifier and its describe-dataset step name it too.
Changes
widget.dataset_suggested_questions(DatasetSuggestedQuestion):{text, needs_zarr}templates.textmust name its dataset with{dataset_id}, may use{subject}and{task}, and accepts no other blank, no unbalanced brace and no markup; at most 10.resolve()and the API omit the field when unset.setDataset({ id, zarr, subject, task }):subjectandtaskare optional BIDS labels (^[A-Za-z0-9]{1,64}$, no prefix); an invalid one is refused with a warning and leaves the previous dataset in place, as an invalidzarralready is.needs_zarrone without a Zarr copy and one with a blank the page did not fill; the general list when none fits.dataseton the user message, validated when history loads), so the row goes once the reader sends from that page and stays gone after a reload. Nothing is offered while a reply streams.needs_zarrand stay within the chat runtime, which has no scipy.docs/community-widget.md.The website half, passing
subjectandtaskfrom the Zarr index, is a separate nemarOrg/website PR; until it lands, nemar.org's dataset pages show the three templates without those blanks.Testing
frontend/test-widget-dataset-questions.js, new, 51 checks, in both CI workflows; 22 single-line mutations of the new widget code each fail it.build-runtime-bundle.js --check.test_version_shows_versiondeselected, the local-only test_version_shows_version fails locally and passes in CI, because rich colorizes on a TTY #434).widget_e2e.py --nemar: the opening three and the compact row, light and dark, and no overflow at phone width.