Repository navigation
OpenConceptLab/ocl_issues#1892, OpenConceptLab/ocl_issues#3025 | Repository About tab and Verified chip on versions - #108
Conversation
* Show version-specific verification, overview, and source details in the About tab * Add verified badges to repository and version views * Add About section translations and tests across supported languages
* Show repository descriptions in Overview when About text is unavailable * Refine verified badges, colors, and section navigation styles * Add coverage for description-based Overview sections
The lockfile was regenerated while working on the About tab and bumped 41 transitive dependencies. Restore it to origin/main so the PR carries none.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e783f00e2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }, (checkbox ? {} : {borderTopLeftRadius: '50px', borderBottomLeftRadius: '50px'})]} onClick={isDisabled ? undefined : () => onVersionChange(version)}> | ||
| {version.id} | ||
| <ProcessingFlag entity={version} showLabel={false} sx={{ ml: 1 }} /> | ||
| <VerifiedChip version={version} sx={{ ml: 1 }} /> |
There was a problem hiding this comment.
Close the version picker when a Verified chip navigates
In the header's version dropdown, this chip navigates through RouterLink and stops propagation, bypassing the normal row-selection callback and therefore RepoVersionChip.onSelect()'s call to onClose(). Because App.jsx keys RepoHome by repository rather than version, navigating to About preserves the picker and its non-null anchorEl, leaving the modal menu and backdrop over the content just opened. Pass a close callback for chip navigation or close the picker when the route changes.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in ae8ccad. VerifiedChip takes an onNavigate callback that runs on click, and RepoVersionChip passes its onClose through VersionsTable to each row, so the picker closes when the chip navigates. There is no component-test setup in this repo (node:test on .js only), so this one has no automated test; it is covered by the build and lint only.
Decide the tab fallback only once the repo in state is the one the route points at, so opening a release's About while HEAD is still loaded keeps /<release>/about. The About panel is gated the same way. OpenConceptLab#108 (comment)
The chip stops click propagation, so the row selection that closes the picker never ran. VerifiedChip takes an onNavigate callback and the picker passes its close handler. OpenConceptLab#108 (comment)
snyaggarwal
left a comment
There was a problem hiding this comment.
Requesting changes for one thing: the Overview renders the repository's text as raw HTML. The rest is small.
What works: verification reads only the API's record and never extras. The tab fallback now waits for the version the route points at, and tabFallback.test.js covers that. Source rows only link http(s) URLs and plain email addresses, and the four locale files have the same keys.
Blocking:
- XSS in Overview.
common/Aboutputsrepo.textintodangerouslySetInnerHTMLwithout sanitizing it. Anyone who can create a source can settext, so every visitor who opens that repo's About tab runs whatever it holds.MarkdownContentgoes throughrehype-raw+rehype-sanitizeand already accepts HTML, so swapping it in fixes this (suggestion inline).
Non-blocking:
- The "Changes listed" check says "Everything OCL added is listed below" even when there are no
verification_notes. - The "On this page" chips hard-code hex values that match existing palette tokens.
- The process checks and the docs URL are fixed in the client. A new process, or a different docs location, needs a frontend release.
| getOverviewText(repo) ? | ||
| <About text={getOverviewText(repo)} expanded style={{ marginTop: 0 }} /> : |
There was a problem hiding this comment.
Blocking: XSS. About renders text through dangerouslySetInnerHTML with no sanitizing. Source owners control text, so a <img src=x onerror=...> in it runs for every visitor who opens this tab. MarkdownContent (already imported) parses HTML through rehype-raw and then rehype-sanitize, so it renders the same content safely:
| getOverviewText(repo) ? | |
| <About text={getOverviewText(repo)} expanded style={{ marginTop: 0 }} /> : | |
| getOverviewText(repo) ? | |
| <MarkdownContent markdown={getOverviewText(repo)} /> : |
(OrgOverview and UserStatistics have the same issue with About, but that's outside this PR.)
There was a problem hiding this comment.
Fixed in 03bfe00. The Overview now renders text with MarkdownContent (rehype-raw + rehype-sanitize) and common/About is no longer used on this page. aboutSections.test.js has a test that the pipeline strips onerror, <script> and javascript: links. It covers the renderer, not the wiring in RepoAbout.jsx (the repo has no component tests), so I left the thread open for you to confirm. Note that #1892 asked for common/About; this deviates on purpose, and OrgOverview/UserStatistics still have the same problem, as you said.
| export const VERIFICATION_PROCESS_CHECKS = { | ||
| 'ocl-verification-v1': [ | ||
| 'from-the-publisher', | ||
| 'license-and-citation', | ||
| 'correctly-identified', | ||
| 'complete', | ||
| 'changes-listed', | ||
| 'checked-independently', | ||
| ], | ||
| } | ||
|
|
||
| export const VERIFIED_REPOSITORIES_DOCS_URL = 'https://docs.openconceptlab.org/en/latest/oclonline/verified-repositories.html' |
There was a problem hiding this comment.
Non-blocking: the client keeps each process's list of checks and the docs URL. When ocl-verification-v2 ships, verified versions will show the banner with no checks until a frontend release adds them. Also, any deployment whose API returns verification will link to this one docs page. Could the API's verification record (OpenConceptLab/ocl_issues#3024) carry the process's check ids and its docs URL, so this file only maps ids to labels? Fine as a follow-up.
There was a problem hiding this comment.
Agreed, and left for a follow-up: the API's verification record (#3024) would carry the process's check ids and docs URL, and this file would only map ids to labels. Until then a new process needs a frontend entry in VERIFICATION_PROCESS_CHECKS. Leaving the thread open.
…tion Only the four translation files conflicted; both sides added keys under "repo" (about_tab and verification here, seeded_from and seeded_from_import upstream), and both are kept in all locales.
…renderer common/About puts the text in dangerouslySetInnerHTML unsanitized, and a source's text is set by its owner. MarkdownContent parses HTML through rehype-raw and rehype-sanitize. OpenConceptLab#108 (comment)
…no notes The Changes listed check read "Everything OCL added is listed below" even without verification_notes. It now says no changes by OCL are listed. OpenConceptLab#108 (comment)
Replaces "What OCL added" (key what_ocl_added -> verification_notes) in the four locales; the block renders extras.verification_notes.
* The Changes listed check said "Everything OCL added is listed below", but the block below is now titled Verification notes, so the line names it * Updated the line in all four locales; the key set is unchanged
There was a problem hiding this comment.
Requesting changes: three changes to how Verified is shown (where the badge sits, the heading, the wording) and one bug that would empty the Verified card for ATC. One-click suggestions are inline for everything inside the diff. Moving the badge into the dropdown touches lines outside the diff, so that patch is at the end.
Now and requested, on a local build against production WHO ATC data with a mock verification record (the notes in the second image are reworded the way OpenConceptLab/ocl_online#662 asks):
1. Bug: the checks disappear when the process has a terminology suffix. Process names carry a suffix where the recipe is adapted (OpenConceptLab/ocl_online#500, 19 Nov), e.g. ocl-verification-v1.atc. VERIFICATION_PROCESS_CHECKS is matched exactly, so with that name the card shows Verified with no checks under it. Suggestion and test inline.
2. The badge belongs to a repo version, so put it inside the version dropdown. Next to the dropdown it reads as if the whole repository were verified. On the compare-versions page, which shows the header without a version dropdown, it sits next to the repository chip with no version at all. Remove it from RepoHeader and show it inside the version chip (patch below). Inside the chip it isn't a link: the chip opens the version picker, whose verified row has the linked chip, and the About tab is one click away. That keeps a link from sitting inside the dropdown button. The chips on the Versions tab and in the picker stay as they are: each is on its own version's row, so they read correctly. The compare toolbar's version chips get the mark too, since they use RepoVersionChip.
3. The section heading is "Verified Repo Version", not "Verified". It needs its own key, since repo.verification.verified is also the chip label.
4. Wording: describe the content and the process, not who did it. No "OCL compared", "What OCL checked", "reviewed by OCL" or "Everything OCL added". The notes aren't things OCL added. They are the differences between this repo version and the publisher's release, each one reviewed and accepted. So:
- the notes block has one sub-header line, "Reviewed and accepted differences from the publisher's release", and the list straight after it;
- "Changes listed" becomes "Differences listed" (check id and docs anchor
differences-listed; ocl-docs#82 gets the matching rename); - the process link's anchor
#what-ocl-checksbecomes#what-is-checked, to match ocl-docs#82.
The English strings are inline. es, pt-BR and zh need the same keys and meaning.
Related, outside this PR (details on OpenConceptLab/ocl_online#662):
- The generated ATC notes start with their own heading, "What OCL added to or changed in the publisher's content:", and say "OCL adds" and "OCL derives". Under the new heading they should be just the list, each item describing the content.
- WHOATC 2026's About text on production still holds the old "Publication Notes" (sourced from Bioportal, with deviations made to load it into OCL). It becomes this tab's Overview, right under the Verified card, and contradicts it.
Patch: the badge inside the version chip (RepoVersionChip.jsx, HeaderChip.jsx)
HeaderChip builds its label as a string, so it now passes a node label through as is; the verified label carries its own "Version: " prefix.
diff --git a/src/components/common/HeaderChip.jsx b/src/components/common/HeaderChip.jsx
index c2359e15..6d918bcb 100644
--- a/src/components/common/HeaderChip.jsx
+++ b/src/components/common/HeaderChip.jsx
@@ -3,7 +3,7 @@ import Chip from '@mui/material/Chip';
import Skeleton from '@mui/material/Skeleton';
const HeaderChip = ({ labelPrefix, label, labelSuffix, sx, ...rest }) => {
- let _label = label ? `${labelPrefix || ''}${label}${labelSuffix || ''}` : <Skeleton variant="text" sx={{ width: '60px' }} />
+ let _label = label ? (typeof label === 'string' || typeof label === 'number' ? `${labelPrefix || ''}${label}${labelSuffix || ''}` : label) : <Skeleton variant="text" sx={{ width: '60px' }} />
return (
<Chip
label={_label}
diff --git a/src/components/repos/RepoVersionChip.jsx b/src/components/repos/RepoVersionChip.jsx
index d136ffd6..c352b481 100644
--- a/src/components/repos/RepoVersionChip.jsx
+++ b/src/components/repos/RepoVersionChip.jsx
@@ -8,6 +8,23 @@ import { find, reject, orderBy, merge, compact } from 'lodash'
import { SURFACE_COLORS } from '../../common/colors'
import VersionsTable from './VersionsTable'
import RepoTooltip from './RepoTooltip'
+import { Box, Tooltip } from '@mui/material'
+import VerifiedIcon from '@mui/icons-material/GppGoodOutlined'
+import { isVerified } from './aboutSections'
+import { VERIFIED_COLORS } from './verifiedColors'
+
+// The Verified mark sits inside the version chip, so it reads as the version's, not the repository's (ocl_issues#3025)
+const VerifiedMark = () => {
+ const { t } = useTranslation()
+ return (
+ <Tooltip title={t('repo.verification.chip_tooltip')}>
+ <Box component="span" sx={{ display: 'inline-flex', alignItems: 'center', gap: '3px', ml: '8px', px: '6px', height: '22px', borderRadius: '11px', border: '1px solid', borderColor: VERIFIED_COLORS.main, bgcolor: VERIFIED_COLORS.background, color: VERIFIED_COLORS.dark, fontSize: '13px', fontWeight: 500 }}>
+ <VerifiedIcon sx={{ fontSize: '15px !important', color: `${VERIFIED_COLORS.dark} !important`, mr: '0 !important', mt: '0 !important' }} />
+ {t('repo.verification.verified')}
+ </Box>
+ </Tooltip>
+ )
+}
const normalizeVersions = versions => {
if (Array.isArray(versions))
@@ -43,6 +60,9 @@ const RepoVersionChip = ({ version, versions, versionsLoading, previewVersions,
}
const allVersions = getVersions()
+ const versionLabel = version?.version && isVerified(version) ?
+ <Box component="span" sx={{ display: 'inline-flex', alignItems: 'center' }}>{`${t('common.version')}: ${version.version}`}<VerifiedMark /></Box> :
+ version?.version
const showSkeleton = Boolean(versionsLoading) && !normalizeVersions(versions).length
return (
@@ -53,7 +73,7 @@ const RepoVersionChip = ({ version, versions, versionsLoading, previewVersions,
<HeaderChip
id='versions-dropdown'
labelPrefix={`${t('common.version')}: `}
- label={version?.version}
+ label={versionLabel}
icon={<VersionIcon color='surface.contrastText' fontSize='inherit' />}
sx={merge({backgroundColor: 'surface.main'}, (sx || {}))}
deleteIcon={<DownIcon color='surface.contrastText' fontSize='inherit' />}
@@ -65,7 +85,7 @@ const RepoVersionChip = ({ version, versions, versionsLoading, previewVersions,
<HeaderChip
id='versions-dropdown'
labelPrefix={`${t('common.version')}: `}
- label={version?.version}
+ label={versionLabel}
icon={<VersionIcon color='surface.contrastText' fontSize='inherit' />}
sx={merge({backgroundColor: 'surface.main'}, (sx || {}))}
deleteIcon={<DownIcon color='surface.contrastText' fontSize='inherit' />}Checked on a local build of this branch with every suggestion and the patch applied: npm run test 187 pass (the new suffix assertions fail on this head), eslint clean, webpack compiles. I also rendered it against production WHO ATC data with a mock verification record.
…terminology suffix A process named `ocl-verification-v1.atc` or `.icd11` (ocl_online#500) matched no entry of VERIFICATION_PROCESS_CHECKS, so the card said Verified with no checks under it. Fall back to the name before the first dot. Review: OpenConceptLab#108 (review)
…e it Next to the version dropdown the mark read as if the whole repository were verified, and on the compare-versions page (a header with no version dropdown) it sat beside the repository chip with no version at all. It now sits inside RepoVersionChip, so it belongs to the version it labels. It is not a link there (the chip opens the picker, whose verified row has the linked chip). HeaderChip passes a node label through as is. The chips on the Versions tab and in the picker stay: each is on its own version's row. Review: OpenConceptLab#108 (review)
…who did it Describe the content and the process; never name OCL as the actor. The notes are the reviewed and accepted differences between the repo version and the publisher's release. - the section heading is "Verified Repo Version" (new key `repo.verification.heading`; `repo.verification.verified` stays the chip label) - the notes block gets one sub-header, "Reviewed and accepted differences from the publisher's release" - the "Changes listed" check becomes "Differences listed" (`differences-listed`), and the process link anchor `#what-ocl-checks` becomes `#what-is-checked`, to match ocl-docs#82 - headline, detail, checks label, tooltip, fine print and the independent-check line no longer say "OCL compared", "What OCL checked" or "reviewed by OCL" - es, pt-BR and zh carry the same keys and meaning Review: OpenConceptLab#108 (review)
Follow-up to the Verified review
On The component placement and link wiring still need browser verification; this repository has no component tests. The relevant threads are left open for that reason. The documentation anchor changes are coordinated with OpenConceptLab/ocl-docs#82. Real API-backed validation remains pending the verification field; the related generated notes and WHOATC metadata are tracked in OpenConceptLab/ocl_online#662. |
snyaggarwal
left a comment
There was a problem hiding this comment.
Approving at 3287096. My Nov 20 review is answered:
- XSS (blocking): confirmed fixed. The Overview renders
textthroughMarkdownContent(rehype-rawthenrehype-sanitize), and so do the verification notes. Nothing on this page usescommon/Aboutany more, so the thread can be resolved. - "Differences listed" without notes now reads "No differences from the publisher's release were found" (Jon's wording), so it never points at a list that isn't there.
- The "On this page" chips use
primary.20,primary.95andprimary.90. - Process checks and docs URL in the client: agreed as a follow-up. #3024's
verificationrecord should carry the check ids and docs URL, so a new process doesn't need a frontend release.
Jon's Nov 20 requests are in at this head too:
getVerificationChecksfalls back to the base process, soocl-verification-v1.atcgets its checks.- The Verified mark sits inside the version chip, not in
RepoHeader. - The heading is "Verified Repo Version", with the
#what-is-checkedanchor and thedifferences-listedid. - The wording describes the content and the process, not OCL, in all four locales (31 keys each).
CI is green, and it merges cleanly with main. I haven't run it in a browser.
Separately: OrgOverview and UserStatistics still render owner-set text through common/About's unsanitized dangerouslySetInnerHTML. That needs its own fix, swapping in MarkdownContent as here.
|
Hey @paynejd. Up to you to approve and merge! Thanks! @snyaggarwal Follow up
|


TL;DR: Adds the repository About tab (Verification, Overview, Source and license) and the Verified chip on repository versions, both driven only by the API's version fields. Delivers OpenConceptLab/ocl_issues#1892 and OpenConceptLab/ocl_issues#3025.
Closes OpenConceptLab/ocl_issues#1892
Closes OpenConceptLab/ocl_issues#3025
Part of OpenConceptLab/ocl_online#500. The Verification section and the chip read the
verificationrecord from OpenConceptLab/ocl_issues#3024 (API side); until the API returns it they stay hidden by design.Main Changes
Totals against
OpenConceptLab/oclweb3main(upstreammainmerged in at9ece1ba): 20 files, +945 / −89 (fromgit diff --numstat).src/components/repos/aboutSections.jsisVerified,getVerification,getVerificationChecks,getVerificationNotes,getCheckLineKey,getSourceRows,getAboutSections,hasAboutContent. Reads API fields only;extrasis used solely forverification_notes.src/components/repos/RepoAbout.jsx#verification,#overview,#source, each with a link button and shown only when it has content; "On this page" chips (theme tokensprimary.20/90/95); scrolls to the URL fragment. Overview renderstextwithMarkdownContent(sanitized). The notes block is titled "Reviewed and accepted differences from the publisher's release".src/components/repos/RepoHome.jsx,tabFallback.jshasAboutContent(version); follows the selected version. The fallback from a missing tab and the About panel wait untilisSameRepoScope(repoRoute, route), so/<release>/aboutsurvives while the release loads.src/components/repos/VerifiedChip.jsx,verifiedColors.jsGppGoodOutlined), links to…/<version>/about#verification;onNavigatecallback.RepoHeader.jsx,SourceVersionsTab.jsx,CollectionVersionsTab.jsx,VersionsTable.jsx,RepoVersionChip.jsxonNavigate={onClose}).RepoOverview.jsx,RepoEmptyOverview.jsx,RepoOverviewEmptyGraphic.jsxgit grep RepoOverviewis empty).src/i18n/locales/{en,es,pt-BR,zh}/translations.jsonrepo.verification.*/repo.about_tab.*keys per locale, identical across the four files. Added next to the upstreamseeded_fromkeys (merge kept both).__tests__/aboutSections.test.js(+120, 14 tests),__tests__/tabFallback.test.js(+40, 6 tests)The branch also carries a
chorecommit that restorespackage-lock.jsontomain(an earlier commit had regenerated it and bumped 41 unrelated transitive dependencies). The PR touches no lockfile.Key Decisions
verificationrecordextras; an empty or non-object record counts as not verified.extras.verification_notes, rendered as markdown under "Reviewed and accepted differences from the publisher's release"verification_notesas the onlyextraskey shown on the tab; the heading says what the block is, not who wrote it.MarkdownContentinstead ofcommon/Aboutcommon/About, but it usesdangerouslySetInnerHTMLunsanitized and a repository'stextis owner-controlled (review finding).MarkdownContentparses HTML and sanitizes it./<release>/about.GppGoodOutlinedVerifiedOutlinedalready means "released" in the version picker.verifiedColors.jswith the values of the approved mockup; the rest uses theme tokensverification.process(ocl-verification-v1), with terminology suffix fallback; unknown base process lists nonetextdescriptiontextwins when present (tested).http(s)URLs and plain emails become linksjavascript:links from repository data.Verification Checklist
Executed on the current head:
npm run test: 187 tests, 187 pass, 0 faileslint src --ext .jsx,.js: no findingsnpm run build:webpack 5.100.2 compiled successfullyLint and testpassed on head3287096mainand from this branch is present after the mergepackage-lock.jsonabsent from the diff againstmainverificationrecord: mark inside the header version chip, linked chips on the Versions tab and picker; clicking a linked chip opens/about#verificationand closes the picker; the Verification section is firstverification: no chip; no Verification section/aboutfalls back to the first tab/<release>/aboutverification(Repository versions: averificationrecord only staff can set ocl_issues#3024); the UI boxes above were not exercised against real dataOpen PRs that touch the same areas (#99, #105, #109: versions tabs and translation files) were not test-merged with this branch. The picker fix has no automated test (the repo has no component tests).