-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export data view #3056
Export data view #3056
Conversation
OAGr
commented
Feb 7, 2024
•
edited
edited
🦋 Changeset detectedLatest commit: c2fd7f5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
packages/hub/src/app/models/[owner]/[slug]/EditSquiggleSnippetModel.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, this looks solid.
One more minor thing: this doesn't work for SquiggleEditor
, and eventually we'll want feature parity there (e.g. when we start using imports in doc examples).
packages/hub/src/app/models/[owner]/[slug]/EditSquiggleSnippetModel.tsx
Outdated
Show resolved
Hide resolved
packages/hub/src/app/models/[owner]/[slug]/EditSquiggleSnippetModel.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/components/SquiggleViewer/ValueWithContextViewer.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/components/SquiggleViewer/ValueWithContextViewer.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/components/SquiggleViewer/ValueWithContextViewer.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/components/SquiggleViewer/ValueWithContextViewer.tsx
Show resolved
Hide resolved
onOpenExport( | ||
exportData.sourceId, | ||
exportData.path[0] || undefined | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to cmd+click to open these in new tabs, but I can't.
This doesn't seem easily fixable with a single onOpenExport
; simulating the precise behavior of native links is hard (also, links won't work properly before the hydration).
How about this?
- pass
linkComponent
through props and context (the appropriate type for it isFC<PropsWithChildren<{ href: string }> | "a"
, defaulting to"a"
) - wrap
<LinkIcon>
with it (rename to capitalized version to use it in JSX) - change
onOpenExport
togetExportLink
or something
linkComponent
could be in Playground props. Or, even better, we could have a single global provider for it in @quri/ui
, because I suspect it'll be useful in a few other places too. (One example: DropdownMenuLinkItem
vs DropdownMenuNextLinkItem
).
It's not a problem if we improve this after this PR is merged, but I'd like to do it before the next release, to avoid versioned-components complications.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to figure out in a different PR!
{taggedName || name} | ||
</span> | ||
{showColon && <span className="text-gray-400 font-mono">:</span>} | ||
{(isRootImport && exportData?.sourceId) || taggedName || name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When something is imported and then copied to a local var (not sure why someone would do that, but...), it's displayed as its source id:
I can also imagine that seeing "as" name in "Imports" tab can be useful in other cases (e.g. I'm reading the code and want to refer to things that are available).
Maybe we could show both here, "foo from hub:source1"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should figure out some better solution here, likely a bit later on.
…gle into export-data * 'export-data' of github.com:quantified-uncertainty/squiggle: fix route and router import