-
Notifications
You must be signed in to change notification settings - Fork 0
Fix/warnings #379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/warnings #379
Conversation
There was a problem hiding this 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
keyprops to mapped elements in tables and lists - Updates deprecated Ant Design
Descriptionscomponent props (labelStyle/contentStyle→styles.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, |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
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.
| data: (scc.trilineage_differentiation ?? []).map((row, index) => ({ | ||
| germLayer: row.germ_layer, | ||
| marker: row.marker, | ||
| percentPositiveCells: row.percent_positive_cells, | ||
| key: index.toString(), |
Copilot
AI
Dec 10, 2025
There was a problem hiding this comment.
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.
| 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}`, |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
interim17
left a comment
There was a problem hiding this 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.
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.
Steps to Verify: