Closed berekuk closed 1 month ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
quri-hub | ✅ Ready (Inspect) | Visit Preview | May 12, 2024 1:56am |
squiggle-components | ✅ Ready (Inspect) | Visit Preview | May 12, 2024 1:56am |
squiggle-website | ✅ Ready (Inspect) | Visit Preview | May 12, 2024 1:56am |
Latest commit: e145e9302fce5eb4f9c1e43a202aceb25084d086
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
show
action now select the range in editor instead of just a starting position.
This seems better in most cases, e.g. long dicts that are below the current viewport in editor will scroll into range:
One awkward corner case here is that if the dict or a function is very long, and won't fit in the viewport, Codemirror will scroll to the end of it even if this means that the beginning of the selection won't be in the viewport. This is a consequence of selection "head" (cursor position) being at the end. But this is probably fine.
This seems very reasonable, let's go with it for now.
We now pass
externalViewerActions
toViewerProvider
instead of an editor object, becauseeditor.scrollTo
doesn't make sense in some non-playground contexts, e.g. GUCEM.To avoid boilerplate, there's a
useExternalViewerActionsForEditor
hook which converts the editor handle to theexternalViewerActions
.Also, the viewer behavior regarding these actions is now more flexible and has a better support for imports, thanks to the two new methods:
isFocusable
andisDefaultSourceId
.Example screenshot from the modified story; the error here comes from the function defined in an import, and the line in imported file is not clickable (for now), but the top-level call location is clickable.
I didn't commit this story to the repo, but I did implemented some basic tests.