Update provenance links in browser#6071
Conversation
…over the URL. This required an update to the provenance endpoint to provide the information that we want, as wall as small changes to multiple files in the frontend.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a user experience issue where provenance links in the browser displayed the source URL, which could be confusing. The changes involve updating the backend API to provide a more descriptive provenance name and modifying the frontend to utilize this name for display in the UI, making the links more intuitive and user-friendly. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the provenance links in the browser to display the provenance name instead of its URL, which improves the user interface's clarity. The backend is updated to fetch and return the provenance name, and the frontend is adjusted to consume this new data structure and display it. The changes are well-executed. I've suggested a minor simplification in the frontend code to make it more concise by removing a redundant check, taking advantage of the guarantees provided by the updated backend API.
…es that now exist in the backend.
…tain data sources more sensible or human-readable. It currently only contains a mapping of the very common `HumanReadableStatVars` to `Data Commons`. Update tests for changes in this PR.
static/js/browser/app.tsx
Outdated
| /** | ||
| * Mapping of raw provenance names (returned by the API) to custom display names. | ||
| * This can be used to make certain data sources more human-readable in the UI. | ||
| * If a provenance name is not in this map, the original string will be used. |
There was a problem hiding this comment.
What does "original string" mean? Is it the DCID?
There was a problem hiding this comment.
Sorry - that was unclear! The original string is the provenance name given by the API. It would only ever be a DCID if there isn't a name (although as you verified, there should always be a name).
I'll update the comment.
| } | ||
| const predicates = Object.keys(this.state.data); | ||
| predicates.sort(this.predicateComparator); | ||
| return ( |
There was a problem hiding this comment.
I'm not sure where the best place to put this comment is, but I just thought of another consideration. We really should not show the Provenance column at all when the node is of type Provenance itself. It doesn't make sense to show a link that just links back to the same page (i.e. goes nowhere). Could we add some logic to check if the subject node is of type Provenance and then show a 2-column table consisting of property and value only?
| )} | ||
| className="arc-group-title" | ||
| > | ||
| <span className="mp">Subject Type: {this.props.parentType}</span> |
There was a problem hiding this comment.
Again, not sure where to put this comment, but if the "Subject type" is "Provenance", we shouldn't show the third column, since it will just show the same content and link as the second one. Can we put a check in for subject type "Provenance" and then render a 2-table column only?
There was a problem hiding this comment.
This is now done as well. As I was doing this, I noticed that there are at least two other "special DC provenances" where the provenance name is a little unusual: ExperimentalStatVars and RawStatVars.
What do you think of doing away with the explicit override map we are using, but rather label all "dc/base/..." Provenances as Data Commons?
|
Thank you so much for this. Put a few comments in.
…On Tue, Mar 10, 2026 at 4:15 PM Nicholas Blumberg ***@***.***> wrote:
@nick-nlb <https://github.com/nick-nlb> requested your review on:
datacommonsorg/website#6071
<#6071> Update provenance
links in browser.
—
Reply to this email directly, view it on GitHub
<#6071 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BHMM7UHKKLGSKL3BEKZS33D4QCO2HAVCNFSM6AAAAACWNNLK6WVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMRTGQ2TAMJXHE3DGNQ>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
… "Provenance" and the out-arcs to hide the provenance column when the node is of type provenance. To keep the widths of the columns consistent regardless of whether there are two or three columns, the CSS now explicitly targets the provenance column for width, rather than the last column.
kmoscoe
left a comment
There was a problem hiding this comment.
Thanks so much! Leaving the answer to your latest question up to you. :-)
As per our discussion, we've gone the careful route and removed the mapping, showing the provenance names directly regardless of what they are. |
Update provenance links in browser
Issue
b/491143381
Description
The provenance links were previously using the URL of the source of the provenance as the link text, while the link itself correctly went to the browser entry for that provenance.
This created a confusing UI where the link the user clicked on was not the link that the user was then directed to.
The update required that the
/provenanceendpoint (which is only used in this place) be updated to return the name of the provenance rather than the URL.Screenshots
Before
After