Skip to content

[OSDEV-2375] Create location name, OS ID, and "Understanding Data Sources" sections#893

Merged
VadimKovalenkoSNF merged 38 commits intomainfrom
OSDEV-2375-location-name-os-id-understanging-data-source
Mar 3, 2026
Merged

[OSDEV-2375] Create location name, OS ID, and "Understanding Data Sources" sections#893
VadimKovalenkoSNF merged 38 commits intomainfrom
OSDEV-2375-location-name-os-id-understanging-data-source

Conversation

@VadimKovalenkoSNF
Copy link
Contributor

@VadimKovalenkoSNF VadimKovalenkoSNF commented Feb 28, 2026

Implements OSDEV-2375

Create location name, OS ID, and "Understanding Data Sources" sections

@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds frontend typography documentation; introduces a new interactive Data Sources UI (toggle, tooltip, item components and frozen constants); refactors LocationTitle to render dynamic name and OS ID with copy actions; adds HandshakeIcon; migrates several styles to theme-derived typography/spacing; adjusts tooltip prop and small typography/colour updates; adds tests.

Changes

Cohort / File(s) Summary
Typography docs & util
doc/frontend.md, src/react/src/util/typographyStyles.js
Adds a frontend Typography guide and switches several typography sizes from px to rem.
Data Sources feature
src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourceItem.jsx, src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourcesInfo.jsx, src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/constants.js, src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/styles.js
New DataSourceItem component; DataSourcesInfo gains toggle state, info tooltip, and renders items from a deeply frozen constants array; styles rewritten to compute values from theme (typography, spacing, colors).
Location title & usage
src/react/src/components/ProductionLocation/Heading/LocationTitle/LocationTitle.jsx, src/react/src/components/ProductionLocation/Heading/LocationTitle/styles.js, src/react/src/components/ProductionLocation/ProductionLocationDetailsContent/ProductionLocationDetailsContent.jsx
LocationTitle now accepts data and renders dynamic name and OS ID row with tooltip and copy actions; styles use theme-derived tokens; parent passes data prop.
Icons & colour palette
src/react/src/components/HandshakeIcon.jsx, src/react/src/util/COLOURS.js
Adds HandshakeIcon SVG component and new color constant TEAL_GREEN.
Styles adjustments
src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/styles.js, src/react/src/components/ProductionLocation/Heading/LocationTitle/styles.js, src/react/src/components/ProductionLocation/Heading/ClosureStatus/styles.js
Multiple style modules refactored to compute typography and spacing from theme and return frozen style objects; ClosureStatus spacing and font-size tweaked.
Tooltip change
src/react/src/components/Contribute/DialogTooltip.jsx
Removes the interactive prop passed to Tooltip (changes tooltip interactivity behavior).
Tests
src/react/src/__tests__/components/DataSourcesInfo.test.jsx, src/react/src/__tests__/components/LocationTitle.test.jsx
Adds tests covering DataSourcesInfo and LocationTitle rendering, toggle behavior, conditional details, tooltip, and copy button presence.

Sequence Diagram(s)

sequenceDiagram
  participant User as User
  participant DSInfo as DataSourcesInfo
  participant DSItem as DataSourceItem
  participant Tooltip as DialogTooltip

  User->>DSInfo: Click toggle (show extra info)
  DSInfo->>DSInfo: setState(showSubsectionInfo = true)
  DSInfo->>DSItem: Render items with showSubsectionInfo=true
  User->>DSInfo: Click info IconButton
  DSInfo->>Tooltip: Open tooltip (display learn more link)
  User->>DSItem: Click "Learn more" link
  DSItem->>User: Navigate to item's learnMoreUrl
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • protsack-stephan
  • vlad-shapik
  • roman-stolar
  • mazursasha1990
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately summarizes the main changes: creating location name, OS ID, and data sources sections, which aligns with the changeset additions of LocationTitle, DataSourcesInfo, and related components.
Description check ✅ Passed The PR description references the OSDEV-2375 issue and correctly states the intent to create location name, OS ID, and 'Understanding Data Sources' sections, which directly relates to the implemented changes across multiple components.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch OSDEV-2375-location-name-os-id-understanging-data-source

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
doc/frontend.md (1)

106-106: Polish repeated wording in hierarchy guidance.

Line 106 repeats “right” close together; consider replacing one instance (e.g., “appropriate”) to improve readability.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@doc/frontend.md` at line 106, Edit the sentence that repeats "right" in the
hierarchy guidance so it reads more smoothly; in the line starting "Keep **one**
clear hierarchy per page: one h1, then h2/h3 as needed; use the table in §2 to
pick the right style key and component/variant." replace the second "right" with
a synonym like "appropriate" (or "correct"/"suitable") so it becomes "...use the
table in §2 to pick the appropriate style key and component/variant." to remove
the repeated wording.
src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourcesInfo.jsx (1)

77-77: Prevent potential horizontal scroll from the spaced Grid container.

Grid containers with spacing can create negative-margin overflow in this codebase. Add the standard width/margin guard.

Proposed fix
-            <Grid container className={classes.descriptionList} spacing={2}>
+            <Grid
+                container
+                className={classes.descriptionList}
+                spacing={2}
+                style={{ margin: 0, width: '100%' }}
+            >

Based on learnings: In React components that use Material-UI Grid, when a Grid container with spacing causes horizontal scroll, apply style={{ margin: 0, width: '100%' }} to the container.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourcesInfo.jsx`
at line 77, The Grid container in DataSourcesInfo.jsx (the <Grid container ...
className={classes.descriptionList} spacing={2} />) can create negative-margin
overflow; update that Grid element to include the guard style prop (style={{
margin: 0, width: '100%' }}) so the container no longer causes horizontal scroll
while preserving spacing. Ensure you modify the Grid instance that uses
classes.descriptionList in the DataSourcesInfo component.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourceItem.jsx`:
- Line 16: The Grid item in DataSourceItem.jsx (the <Grid item sm={12} md={4}
className={classes.descriptionItem}> element) is missing an explicit xs
breakpoint; update this Grid element to include xs={12} so it mirrors similar
components (e.g., ClaimSubtitleRow/ClaimStatusRow) and ensures full-width
behavior on extra-small screens while preserving sm and md settings.

In
`@src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/styles.js`:
- Around line 45-50: The nth-child padding in the descriptionList style is
applied at all sizes and causes misalignment on stacked/small screens; move the
'& > *:nth-child(2)' rule so it only applies at desktop breakpoints (e.g., nest
it inside the theme breakpoint/media query like theme.breakpoints.up('md') or an
equivalent '@media (min-width: ...)' block) so the paddingLeft/paddingRight are
added only on larger screens while leaving small-screen stacking unaffected.

---

Nitpick comments:
In `@doc/frontend.md`:
- Line 106: Edit the sentence that repeats "right" in the hierarchy guidance so
it reads more smoothly; in the line starting "Keep **one** clear hierarchy per
page: one h1, then h2/h3 as needed; use the table in §2 to pick the right style
key and component/variant." replace the second "right" with a synonym like
"appropriate" (or "correct"/"suitable") so it becomes "...use the table in §2 to
pick the appropriate style key and component/variant." to remove the repeated
wording.

In
`@src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourcesInfo.jsx`:
- Line 77: The Grid container in DataSourcesInfo.jsx (the <Grid container ...
className={classes.descriptionList} spacing={2} />) can create negative-margin
overflow; update that Grid element to include the guard style prop (style={{
margin: 0, width: '100%' }}) so the container no longer causes horizontal scroll
while preserving spacing. Ensure you modify the Grid instance that uses
classes.descriptionList in the DataSourcesInfo component.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9bc895d and 89610eb.

📒 Files selected for processing (9)
  • doc/frontend.md
  • src/react/src/components/ProductionLocation/Heading/ClaimFlag/ClaimFlag.jsx
  • src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourceItem.jsx
  • src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourcesInfo.jsx
  • src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/constants.js
  • src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/styles.js
  • src/react/src/components/ProductionLocation/Heading/LocationTitle/LocationTitle.jsx
  • src/react/src/components/ProductionLocation/Heading/LocationTitle/styles.js
  • src/react/src/components/ProductionLocation/ProductionLocationDetailsContent/ProductionLocationDetailsContent.jsx

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourceItem.jsx (1)

16-16: ⚠️ Potential issue | 🟡 Minor

Add explicit xs={12} for consistent mobile layout (still pending).

Line 16 still omits xs, so extra-small breakpoints can fall back to auto item sizing instead of guaranteed full-width cards.

🐛 Proposed fix
-    <Grid item sm={12} md={4} className={classes.descriptionItem}>
+    <Grid item xs={12} sm={12} md={4} className={classes.descriptionItem}>

Based on learnings: For Material-UI Grid usage in this repository, breakpoint props like xs should be applied on Grid items to maintain predictable responsive behavior.

#!/bin/bash
# Verify current breakpoint configuration on the DataSourceItem Grid item.
cat -n src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourceItem.jsx | sed -n '12,22p'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourceItem.jsx`
at line 16, The Grid item in DataSourceItem.jsx currently uses sm={12} md={4}
but omits xs, causing unpredictable extra-small layouts; update the Grid element
(the one with className={classes.descriptionItem} inside the DataSourceItem
component) to include xs={12} so cards are full-width on mobile (i.e., change
the Grid props from sm={12} md={4} to xs={12} sm={12} md={4}); no other behavior
changes required.
🧹 Nitpick comments (2)
src/react/src/components/HandshakeIcon.jsx (1)

4-49: Consider adding PropTypes for documentation.

The component works correctly, but adding PropTypes would improve documentation and provide runtime validation consistent with other components in the codebase.

📝 Suggested PropTypes addition
 import React from 'react';
+import PropTypes from 'prop-types';
 import SvgIcon from '@material-ui/core/SvgIcon';
 
 export default function HandshakeIcon(props) {
     return (
         <SvgIcon viewBox="0 0 24 24" {...props}>
             {/* ... paths ... */}
         </SvgIcon>
     );
 }
+
+HandshakeIcon.propTypes = {
+    className: PropTypes.string,
+    color: PropTypes.string,
+    fontSize: PropTypes.oneOf(['inherit', 'default', 'small', 'large']),
+};
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/react/src/components/HandshakeIcon.jsx` around lines 4 - 49, Add
PropTypes to the HandshakeIcon component: import PropTypes from 'prop-types',
then declare HandshakeIcon.propTypes to document/validate incoming props (e.g.,
accept className, style, sx, color, fontSize or a generic object/any for spread
props) and optionally HandshakeIcon.defaultProps for sensible defaults;
reference the HandshakeIcon function and its props spread ({...props}) and
ensure the prop names match how other icon components define PropTypes in the
codebase.
src/react/src/util/typographyStyles.js (1)

40-40: Keep shared typography token units consistent with repository convention.

Line 40, Line 44, and Line 48 now use 1rem; consider keeping these at 16px to avoid mixed units in core style tokens.

♻️ Proposed adjustment
         sectionDescription: Object.freeze({
-            fontSize: '1rem', // 16px
+            fontSize: '16px',
             marginBottom: '10px',
         }),
         bodyText: Object.freeze({
-            fontSize: '1rem', // 16px
+            fontSize: '16px',
             color: theme.palette.text.secondary,
         }),
         inlineHighlight: Object.freeze({
-            fontSize: '1rem', // 16px
+            fontSize: '16px',
             fontWeight: 500,
             color: theme.palette.text.primary,
             display: 'inline',
         }),

Based on learnings: In the Open Supply Hub project, when defining font sizes in styles, prefer using px units directly.

Also applies to: 44-44, 48-48

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/react/src/util/typographyStyles.js` at line 40, Shared typography core
tokens use '1rem' causing mixed units; change those fontSize entries to '16px'
so tokens stay in px units. Locate the fontSize properties (e.g., the token
object that currently has fontSize: '1rem') in typographyStyles.js and replace
'1rem' with '16px' for all core/shared tokens (the occurrences at the same token
keys around the shown snippet and the other instances noted) to keep unit
convention consistent across the file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourcesInfo.jsx`:
- Line 77: The Grid container rendering (Grid with spacing={2}) can cause
horizontal overflow because the descriptionList class only sets marginTop;
update the CSS rules for the descriptionList style (used where Grid container
className={classes.descriptionList}) to include margin: 0 and width: 100% so the
negative margins from spacing are contained and horizontal overflow is
prevented; modify the descriptionList style definition (where it's declared for
the DataSourcesInfo component) to add these properties.

In
`@src/react/src/components/ProductionLocation/Heading/LocationTitle/LocationTitle.jsx`:
- Line 32: The OS ID label/tooltip block (rendered using classes.osIdRow inside
the LocationTitle component) is shown even when the osId value is empty; update
the JSX to conditionally render that entire OS ID block only when osId is a
non-empty string (e.g., check Boolean(osId) or osId.trim() !== ''), and apply
the same guard to the duplicate OS ID rendering region around the other block
mentioned (the section covering the other OS ID lines ~68-108) so the "OS ID:"
label and tooltip never appear without a value.

---

Duplicate comments:
In
`@src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourceItem.jsx`:
- Line 16: The Grid item in DataSourceItem.jsx currently uses sm={12} md={4} but
omits xs, causing unpredictable extra-small layouts; update the Grid element
(the one with className={classes.descriptionItem} inside the DataSourceItem
component) to include xs={12} so cards are full-width on mobile (i.e., change
the Grid props from sm={12} md={4} to xs={12} sm={12} md={4}); no other behavior
changes required.

---

Nitpick comments:
In `@src/react/src/components/HandshakeIcon.jsx`:
- Around line 4-49: Add PropTypes to the HandshakeIcon component: import
PropTypes from 'prop-types', then declare HandshakeIcon.propTypes to
document/validate incoming props (e.g., accept className, style, sx, color,
fontSize or a generic object/any for spread props) and optionally
HandshakeIcon.defaultProps for sensible defaults; reference the HandshakeIcon
function and its props spread ({...props}) and ensure the prop names match how
other icon components define PropTypes in the codebase.

In `@src/react/src/util/typographyStyles.js`:
- Line 40: Shared typography core tokens use '1rem' causing mixed units; change
those fontSize entries to '16px' so tokens stay in px units. Locate the fontSize
properties (e.g., the token object that currently has fontSize: '1rem') in
typographyStyles.js and replace '1rem' with '16px' for all core/shared tokens
(the occurrences at the same token keys around the shown snippet and the other
instances noted) to keep unit convention consistent across the file.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 89610eb and e080926.

📒 Files selected for processing (9)
  • src/react/src/components/HandshakeIcon.jsx
  • src/react/src/components/ProductionLocation/Heading/ClosureStatus/styles.js
  • src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourceItem.jsx
  • src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourcesInfo.jsx
  • src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/constants.js
  • src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/styles.js
  • src/react/src/components/ProductionLocation/Heading/LocationTitle/LocationTitle.jsx
  • src/react/src/components/ProductionLocation/Heading/LocationTitle/styles.js
  • src/react/src/util/typographyStyles.js

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourcesInfo.jsx (1)

77-77: ⚠️ Potential issue | 🟡 Minor

Add an overflow guard to the spacing Grid container.

Line 77 uses Grid container with spacing={2}; without a margin: 0 / width: '100%' guard, this can introduce horizontal overflow due to spacing negative margins.

#!/bin/bash
set -euo pipefail

# Verify current container usage
sed -n '72,86p' src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourcesInfo.jsx

# Verify whether the descriptionList style already contains overflow guards
fd -p 'styles.js' src/react/src/components/ProductionLocation/Heading/DataSourcesInfo \
  -x sh -c 'echo "==> $1"; rg -n "descriptionList|margin|width" "$1"' sh {}
Proposed fix
-            <Grid container className={classes.descriptionList} spacing={2}>
+            <Grid
+                container
+                className={classes.descriptionList}
+                spacing={2}
+                style={{ margin: 0, width: '100%' }}
+            >

Based on learnings: In React components that use Material-UI Grid, when a Grid container with spacing causes horizontal scroll, apply style={{ margin: 0, width: '100%' }} to the container.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourcesInfo.jsx`
at line 77, The Grid container in DataSourcesInfo.jsx (the element using
className={classes.descriptionList} and spacing={2}) can cause horizontal
overflow due to spacing negative margins; update the overflow guard by adding
margin: 0 and width: '100%' to the container – either inline on the Grid element
or by adding these rules to the descriptionList style in the component's
styles.js so the Grid container (descriptionList) explicitly sets margin: 0 and
width: '100%'.
🧹 Nitpick comments (3)
src/react/src/__tests__/components/LocationTitle.test.jsx (1)

34-39: Optional: align null-data expectations with real runtime contract.

Line 34–39 asserts an OS ID: heading for data: null; if that state is not reachable in production flow, this test may be brittle and can be replaced with a more representative scenario.

Based on learnings: The LocationTitle component will never render with an empty OS ID because this is enforced higher in the hierarchy.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/react/src/__tests__/components/LocationTitle.test.jsx` around lines 34 -
39, The test "renders without crashing when data is null" relies on a runtime
state that doesn't occur; update the test in LocationTitle.test.jsx to use a
representative prop shape instead of data: null (or remove the OS ID assertion)
by calling renderLocationTitle with realistic data including an OS ID, then
assert expected headings accordingly; locate the renderLocationTitle helper and
the LocationTitle component reference to adjust the test so it matches the real
contract (either remove the expect for the OS ID when passing null, or supply an
object with osId and assert its presence).
src/react/src/components/ProductionLocation/Heading/LocationTitle/LocationTitle.jsx (1)

48-54: Consider moving tooltip/link/icon inline styles into JSS classes.

This would keep styling centralized and easier to theme consistently.

Also applies to: 67-67

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/react/src/components/ProductionLocation/Heading/LocationTitle/LocationTitle.jsx`
around lines 48 - 54, In LocationTitle.jsx (component LocationTitle) replace the
inline styles on the <p> wrapper (marginTop: 8, marginBottom: 0) and the <a> tag
(style: { color: 'white' }) — and the similar inline style used at the other
occurrence — with JSS class names: add rules (e.g., locationTitleText,
learnMoreLink) to the component's JSS/styles object and apply those className
props to the <p> and <a> elements; keep the href using OS_ID_LEARN_MORE_URL and
retain target/rel, but centralize color/margins in the new JSS classes so the
look can be themed consistently.
src/react/src/__tests__/components/DataSourcesInfo.test.jsx (1)

23-37: Consolidate the two title-render tests.

Line 23–29 and Line 31–37 assert nearly the same heading behavior; merging them would reduce test maintenance noise.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/react/src/__tests__/components/DataSourcesInfo.test.jsx` around lines 23
- 37, Merge the two redundant tests into a single test that calls
renderDataSourcesInfo() once and asserts the heading appears with the expected
text and level; update or replace the two tests named 'renders without crashing'
and 'renders section title "Understanding Data Sources"' with one test (e.g.,
'renders "Understanding Data Sources" heading') that uses
screen.getByRole('heading', { level: 3, name: 'Understanding Data Sources' })
(or asserts both getByRole('heading', { name: 'Understanding Data Sources' })
and checks its tagName/level) to keep the same assertions while reducing
duplication; ensure only renderDataSourcesInfo() is invoked once in the new
test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@doc/frontend.md`:
- Around line 116-117: The Quick Reference table entries for "Page title (e.g.
facility name)" and "Section title" incorrectly list MUI v3 variants as
variant="h1" and variant="h3"; update those entries to use the correct MUI v3
variants variant="headline" for the Page title and variant="title" for the
Section title so the table matches the MUI v3 Typography guidance referenced
earlier and the rest of the docs/codebase.

---

Duplicate comments:
In
`@src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourcesInfo.jsx`:
- Line 77: The Grid container in DataSourcesInfo.jsx (the element using
className={classes.descriptionList} and spacing={2}) can cause horizontal
overflow due to spacing negative margins; update the overflow guard by adding
margin: 0 and width: '100%' to the container – either inline on the Grid element
or by adding these rules to the descriptionList style in the component's
styles.js so the Grid container (descriptionList) explicitly sets margin: 0 and
width: '100%'.

---

Nitpick comments:
In `@src/react/src/__tests__/components/DataSourcesInfo.test.jsx`:
- Around line 23-37: Merge the two redundant tests into a single test that calls
renderDataSourcesInfo() once and asserts the heading appears with the expected
text and level; update or replace the two tests named 'renders without crashing'
and 'renders section title "Understanding Data Sources"' with one test (e.g.,
'renders "Understanding Data Sources" heading') that uses
screen.getByRole('heading', { level: 3, name: 'Understanding Data Sources' })
(or asserts both getByRole('heading', { name: 'Understanding Data Sources' })
and checks its tagName/level) to keep the same assertions while reducing
duplication; ensure only renderDataSourcesInfo() is invoked once in the new
test.

In `@src/react/src/__tests__/components/LocationTitle.test.jsx`:
- Around line 34-39: The test "renders without crashing when data is null"
relies on a runtime state that doesn't occur; update the test in
LocationTitle.test.jsx to use a representative prop shape instead of data: null
(or remove the OS ID assertion) by calling renderLocationTitle with realistic
data including an OS ID, then assert expected headings accordingly; locate the
renderLocationTitle helper and the LocationTitle component reference to adjust
the test so it matches the real contract (either remove the expect for the OS ID
when passing null, or supply an object with osId and assert its presence).

In
`@src/react/src/components/ProductionLocation/Heading/LocationTitle/LocationTitle.jsx`:
- Around line 48-54: In LocationTitle.jsx (component LocationTitle) replace the
inline styles on the <p> wrapper (marginTop: 8, marginBottom: 0) and the <a> tag
(style: { color: 'white' }) — and the similar inline style used at the other
occurrence — with JSS class names: add rules (e.g., locationTitleText,
learnMoreLink) to the component's JSS/styles object and apply those className
props to the <p> and <a> elements; keep the href using OS_ID_LEARN_MORE_URL and
retain target/rel, but centralize color/margins in the new JSS classes so the
look can be themed consistently.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e080926 and 544ee14.

📒 Files selected for processing (9)
  • doc/frontend.md
  • src/react/src/__tests__/components/DataSourcesInfo.test.jsx
  • src/react/src/__tests__/components/LocationTitle.test.jsx
  • src/react/src/components/Contribute/DialogTooltip.jsx
  • src/react/src/components/ProductionLocation/Heading/ClosureStatus/ClosureStatus.jsx
  • src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourcesInfo.jsx
  • src/react/src/components/ProductionLocation/Heading/LocationTitle/LocationTitle.jsx
  • src/react/src/components/ProductionLocation/ProductionLocationDetails/ProductionLocationDetails.jsx
  • src/react/src/components/ProductionLocation/ProductionLocationDetailsContainer/ProductionLocationDetailsContainer.jsx
💤 Files with no reviewable changes (1)
  • src/react/src/components/Contribute/DialogTooltip.jsx

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
doc/frontend.md (1)

108-108: Minor wording polish for clarity on Line 108.

You use “right” twice in nearby guidance; consider replacing one with “appropriate” to improve readability.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@doc/frontend.md` at line 108, The sentence "Keep **one** clear hierarchy per
page: one h1, then h2/h3 as needed; use the table in §2 to pick the right style
key and component/variant." repeats the word "right"; change one occurrence
(e.g., "pick the right style key") to "pick the appropriate style key" so it
reads smoothly while preserving meaning and emphasis on a single hierarchy.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@doc/frontend.md`:
- Line 108: The sentence "Keep **one** clear hierarchy per page: one h1, then
h2/h3 as needed; use the table in §2 to pick the right style key and
component/variant." repeats the word "right"; change one occurrence (e.g., "pick
the right style key") to "pick the appropriate style key" so it reads smoothly
while preserving meaning and emphasis on a single hierarchy.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 544ee14 and bc34dc9.

📒 Files selected for processing (5)
  • doc/frontend.md
  • src/react/src/__tests__/components/DataSourcesInfo.test.jsx
  • src/react/src/__tests__/components/LocationTitle.test.jsx
  • src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourceItem.jsx
  • src/react/src/components/ProductionLocation/Heading/LocationTitle/styles.js
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/react/src/components/ProductionLocation/Heading/LocationTitle/styles.js
  • src/react/src/tests/components/LocationTitle.test.jsx
  • src/react/src/tests/components/DataSourcesInfo.test.jsx

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/styles.js (1)

44-46: ⚠️ Potential issue | 🟡 Minor

Add overflow guards to descriptionList used by the spacing Grid container.

Line 45 only sets marginTop; this class is applied to a Grid container with spacing={2} (in DataSourcesInfo.jsx Line 77), so negative spacing margins can still trigger horizontal scroll.

Proposed fix
         descriptionList: Object.freeze({
             marginTop: 0,
+            margin: 0,
+            width: '100%',
             '& > *:nth-child(2)': {
                 [theme.breakpoints.up('md')]: {
                     paddingLeft: spacing * 2,
                     paddingRight: spacing * 2,
                 },
             },
         }),

Based on learnings: in this repository’s Material-UI Grid usage, spacing-related overflow should be guarded with margin: 0 and width: '100%' on the container style.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/styles.js`
around lines 44 - 46, The descriptionList style applied to the Grid container
(used in DataSourcesInfo.jsx on the Grid with spacing={2}) lacks overflow
guards; update the descriptionList Object.freeze entry to include margin: 0 and
width: '100%' (in addition to marginTop: 0) so the spacing negative margins
cannot cause horizontal scroll.
🧹 Nitpick comments (1)
src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourceItem.jsx (1)

40-47: Add contextual aria-label to repeated “Learn more” links.

On Line 46, each card exposes identical link text; adding item-specific labeling improves screen-reader link navigation.

Proposed fix
                             <a
                                 href={learnMoreUrl}
                                 target="_blank"
                                 rel="noopener noreferrer"
                                 className={classes.learnMoreLink}
+                                aria-label={`Learn more about ${title}`}
                             >
                                 Learn more →
                             </a>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourceItem.jsx`
around lines 40 - 47, The repeated "Learn more →" links in the DataSourceItem
component lack contextual aria-labels for screen readers; update the anchor (the
element using className={classes.learnMoreLink} and href={learnMoreUrl}) to
include an item-specific aria-label such as "Learn more about {dataSourceName}"
using the component's title/name prop (e.g., props.name, props.title, or
dataSource.name) so each link is uniquely announced to assistive technologies.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In
`@src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/styles.js`:
- Around line 44-46: The descriptionList style applied to the Grid container
(used in DataSourcesInfo.jsx on the Grid with spacing={2}) lacks overflow
guards; update the descriptionList Object.freeze entry to include margin: 0 and
width: '100%' (in addition to marginTop: 0) so the spacing negative margins
cannot cause horizontal scroll.

---

Nitpick comments:
In
`@src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourceItem.jsx`:
- Around line 40-47: The repeated "Learn more →" links in the DataSourceItem
component lack contextual aria-labels for screen readers; update the anchor (the
element using className={classes.learnMoreLink} and href={learnMoreUrl}) to
include an item-specific aria-label such as "Learn more about {dataSourceName}"
using the component's title/name prop (e.g., props.name, props.title, or
dataSource.name) so each link is uniquely announced to assistive technologies.

ℹ️ Review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bc34dc9 and 52ff8ef.

📒 Files selected for processing (5)
  • src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourceItem.jsx
  • src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/DataSourcesInfo.jsx
  • src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/constants.js
  • src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/styles.js
  • src/react/src/util/COLOURS.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/react/src/components/ProductionLocation/Heading/DataSourcesInfo/constants.js

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2026

Copy link
Collaborator

@protsack-stephan protsack-stephan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

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.

3 participants