Repository navigation
Tell the assistant which dataset is on screen, for its notebook button - #351
Merged
Merged
Conversation
Deploying nemar-website with
|
| Latest commit: |
c3461a1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4f43c9cc.nemar-website.pages.dev |
| Branch Preview URL: | https://feature-osa-widget-dataset.nemar-website.pages.dev |
3 of 8 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.
Tells the Open Science Assistant (OSA) widget which dataset is on screen and whether it has a Zarr copy, so its new notebook button (OpenScience-Collective/osa#436) can open that dataset in a hosted JupyterLite notebook when it can, and say why it cannot when it cannot. Staging only; production keeps the widget off until OSA releases.
What changes
src/lib/osa-dataset.ts:announceOsaDataset(value)records the latestnullor{id, zarr}onwindow.__nemarOsaDatasetand callsOSAChatWidget.setDatasetwhen the loaded widget has it. Invalid input is dropped with a warning.src/lib/osa-widget.ts: an optionalPUBLIC_OSA_NOTEBOOK_URL(absolutehttps:; malformed makes the embedmisconfigured, as a bad endpoint does), passed asnotebookUrlin the samesetConfigcall and escaped like every other value. The generatedonloadreplays a recorded dataset intosetDatasetbeforeinit(), so the order in which the widget and the page script run does not matter. Both halves feature-detectsetDataset, so this is harmless against the widget pinned today, which lacks it.src/pages/dataset/[id].astro: announces{id}when the tree hydrates, then{id, zarr: state.paths.size > 0}beside the existing "View data" reveal, from the same already-fetched index (no second request), and{id, zarr: false}when the index fetch returns nothing or throws.deploy-test.yml,wrangler.test.toml):PUBLIC_OSA_NOTEBOOK_URL=https://develop-notebook.osc.earth/osa/(the project in the path, per OSC hostnames: a shared plane is a subdomain, a project is a path). Productionwrangler.toml: a comment only.The widget pin moves to the OSA commit that ships
setDatasetin a follow-up commit on this branch, once that commit exists.Tests
osa-dataset.test.ts(10): records, callssetDatasetonly when it is a function, ignores 11 malformed shapes, warns.osa-widget.test.ts(+18): the notebook URL resolved, trimmed, rejected, omitted and escaped (quote and</script>breakouts); the generatedonloadexecuted against a recording stand-in, assertingsetConfig, thensetDataset, theninit, and that it never throws with or withoutsetDataset.bun run test2,381 passed;bun run lint,bun run typecheckandbun run buildclean.The inline
hydrateTreecall sites have no unit harness in this repository (like the "View data" reveal beside them); they get a staging walk-through once the widget pin moves.