Skip to content

Render URLs and DOIs in dataset names and descriptions as links - #211

Merged
skearnes merged 3 commits into
mainfrom
linkify-dataset-descriptions
Jul 25, 2026
Merged

Render URLs and DOIs in dataset names and descriptions as links#211
skearnes merged 3 commits into
mainfrom
linkify-dataset-descriptions

Conversation

@skearnes

@skearnes skearnes commented Jul 25, 2026

Copy link
Copy Markdown
Member

Dataset names and descriptions routinely cite a publication, but the reference was plain text everywhere it appeared. This makes it clickable in the browse table (Name and Description columns) and in the dataset details modal.

LinkedText handles the reference styles that actually occur in ord-data:

  • http(s)://… URLs and bare www. hosts
  • bare DOIs — 10.1021/jacs.8b01523, with or without a DOI: / doi: prefix — linked through doi.org
  • the DOI inside a doi.org URL stays part of the URL rather than matching twice

Trailing punctuation is left out of the link, so …available at https://doi.org/10.1021/jacs.6c05959. doesn't swallow the period and (DOI: 10.15227/orgsyn.095.0080) drops the paren, while a link that opened its own bracket (…/Foo_(bar)) keeps it. Links open in a new tab with rel="noopener noreferrer".

Tests

This adds the first JavaScript tests in the repo: vitest renders the component with react-dom/server, so no DOM environment (jsdom, testing-library) is needed. npm test runs them, and the check_javascript job now runs it alongside prettier.

The cases come from real ord-data text: URLs, bare hosts, bare DOIs with and without a prefix, a DOI inside a doi.org URL, trailing sentence punctuation, and brackets the link did or didn't open.

Verification

Checked against every dataset description available in ord-data (via the parquet metadata): 30 distinct links, all correct, with the rendered text byte-identical to the input in every case. Exercised end to end against the local stack (ORD_INTERFACE_TESTING=TRUE backend + Vite) in headless Chrome — the bundled test datasets cover both a bare URL and a bare DOI.

Two descriptions in ord-data are missing a space after the reference, so the link absorbs the following word:

  • ord_dataset-ac78456835404910b3a4c840248b6ac9https://doi.org/10.1021/acs.accounts.0c00760Data from Figure S12…
  • ord_dataset-d319c2a22ecf4ce59db1a18ae71d529cdoi: 10.1039/c5sc04751jThis palladium catalyzed…

Any heuristic that splits those also breaks legitimate mixed-case DOIs such as 10.48550/arXiv.2506.07619, so the fix belongs upstream in the data.

Also bumps the footer copyright year to 2026.

🤖 Generated with Claude Code

Greptile Summary

Adds automatic URL and DOI linking to dataset names and descriptions.

  • Introduces the LinkedText component with punctuation-aware link parsing and styling.
  • Applies linked text rendering to the browse table and dataset details modal.
  • Adds Vitest coverage and runs the tests in the JavaScript CI job.
  • Updates the footer copyright year to 2026.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failures eligible for this follow-up review remain.

No blocking failure remains.

Important Files Changed

Filename Overview
app/src/components/LinkedText.tsx Adds URL and DOI detection, punctuation trimming, and secure external-link rendering.
app/src/components/LinkedText.test.tsx Covers supported reference formats, punctuation handling, text preservation, and external-link attributes.
app/src/views/browse/MainBrowse.tsx Uses LinkedText for dataset names and descriptions in browse cells and the details modal.
app/package.json Adds the Vitest test command and development dependency.
.github/workflows/checks.yml Runs the new JavaScript test suite after installing locked dependencies.

Reviews (3): Last reviewed commit: "Record optional platform packages in pac..." | Re-trigger Greptile

skearnes and others added 3 commits July 24, 2026 21:13
Dataset names and descriptions often cite a publication as a bare URL
("...available at https://doi.org/10.1021/jacs.6c05959.") or a bare DOI
("Reactions from Figure 1 of DOI: 10.1021/jacs.8b01523"), neither of
which was clickable in the browse table or its details modal.

LinkedText renders free text with those references as links: http(s)
URLs, bare www. hosts, and bare DOIs (linked through doi.org). Trailing
punctuation is left out of the link, so a sentence-ending period or a
closing paren from the surrounding prose doesn't end up in the href,
while a bracket the link itself opened is kept.

Verified against every dataset description in ord-data: 30 distinct
links, with the rendered text byte-identical to the input in all cases.
Two descriptions there are missing a space after the reference
(ord_dataset-ac78456835404910b3a4c840248b6ac9 and
ord_dataset-d319c2a22ecf4ce59db1a18ae71d529c), so the link absorbs the
next word; any heuristic that splits those also breaks legitimate
mixed-case DOIs like 10.48550/arXiv.2506.07619, so they need fixing
upstream.

Also bumps the footer copyright year.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Covers the reference styles seen in ord-data: URLs, bare hosts, bare
DOIs with and without a prefix, a DOI inside a doi.org URL, trailing
sentence punctuation, and brackets the link did or didn't open.

Vitest renders the component with react-dom/server, so no DOM
environment is needed; the tests run as part of the JavaScript checks.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
npm ci installs only what the lock file names, so on Linux the rollup
native binary was missing and any command that loads rollup (vitest)
failed with "Cannot find module '@rollup/rollup-linux-x64-gnu'".
Regenerating the lock adds the per-platform optional dependencies for
rollup, esbuild, and @parcel/watcher.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@skearnes
skearnes merged commit 8d2a176 into main Jul 25, 2026
16 checks passed
@skearnes
skearnes deleted the linkify-dataset-descriptions branch July 25, 2026 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant