Skip to content

Conversation

@meganrm
Copy link
Collaborator

@meganrm meganrm commented Dec 10, 2025

Problem

we had a lot of warnings cluttering up the console. also prettier wasn't working consistently for me

Solution

added keys to the data, updated some props
changed the prettier config file to json based on stackoverflow answers that had the same issue

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Steps to Verify:

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses console warnings by adding missing keys to mapped data elements and updates deprecated Ant Design component props. Additionally, it refactors navigation to support browser back button functionality and converts the Prettier configuration from JavaScript to JSON format.

  • Adds missing key props to mapped elements in tables and lists
  • Updates deprecated Ant Design Descriptions component props (labelStyle/contentStylestyles.label/styles.content)
  • Implements custom hook for catalog navigation that respects browser history

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/templates/disease-cell-line.tsx Replaces Link component with button using new navigation hook
src/templates/cell-line.tsx Replaces Link component with button using new navigation hook
src/hooks/useReturnToCatalog.ts New hook for handling catalog navigation with history state
src/components/shared/SubpageTable.tsx Removes empty line (formatting)
src/components/shared/InfoPanel.tsx Updates Ant Design Descriptions props to use styles object
src/components/SubPage/types.ts Adds optional key property to data types and reformats type definitions
src/components/SubPage/convert-data.ts Adds keys to mapped data, reformats imports and function signatures
src/components/ParentalLineModal.tsx Updates Ant Design Descriptions props to use styles object
src/components/CellLineTable/index.tsx Passes navigation state when navigating to cell line pages
src/components/CellLineInfoCard/CellLineInfoCardBase.tsx Adds key parameter to getOrderButton function and passes keys when mapping
.prettierrc.json New JSON-based Prettier configuration file
.prettierrc.js Deleted JavaScript-based Prettier configuration file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

})
}
plasmid: ddpcr.plasmid,
key: ddpcr.clone,
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

Using clone as a key could lead to duplicate keys if multiple rows have the same clone value. Consider using a combination of fields or the array index to ensure uniqueness.

Copilot uses AI. Check for mistakes.
Comment on lines 250 to 254
data: (scc.trilineage_differentiation ?? []).map((row, index) => ({
germLayer: row.germ_layer,
marker: row.marker,
percentPositiveCells: row.percent_positive_cells,
key: index.toString(),
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

Using array index as key is acceptable here since the data appears to be static (from frontmatter). However, be aware that this could cause issues if the array order changes during re-renders.

Suggested change
data: (scc.trilineage_differentiation ?? []).map((row, index) => ({
germLayer: row.germ_layer,
marker: row.marker,
percentPositiveCells: row.percent_positive_cells,
key: index.toString(),
data: (scc.trilineage_differentiation ?? []).map((row) => ({
germLayer: row.germ_layer,
marker: row.marker,
percentPositiveCells: row.percent_positive_cells,
key: `${row.germ_layer}-${row.marker}`,

Copilot uses AI. Check for mistakes.
meganrm and others added 6 commits December 10, 2025 13:00
Copy link
Contributor

@interim17 interim17 left a comment

Choose a reason for hiding this comment

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

Seems good, happy to pick up tickets for the remaining warnings if we want to merge this now.

@meganrm meganrm merged commit cfdf334 into main Dec 11, 2025
3 checks passed
@meganrm meganrm deleted the fix/warnings branch December 11, 2025 18:44
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