Skip to content

fixed duplicate errors#131

Closed
sweta-126-ux wants to merge 12 commits into
rushikesh-bobade:mainfrom
sweta-126-ux:main
Closed

fixed duplicate errors#131
sweta-126-ux wants to merge 12 commits into
rushikesh-bobade:mainfrom
sweta-126-ux:main

Conversation

@sweta-126-ux

@sweta-126-ux sweta-126-ux commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description

Related Issues

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Screenshots (if applicable)

@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

@sweta-126-ux is attempting to deploy a commit to the participationcorner2025-8967's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the ECSoC26 Required label for ECSOC Sentinel scoring label Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

📝 Summary

The provided pull request diff includes changes to several files in the app/blocks/inventory-item-detail directory, as well as updates to the app/routes directory. The changes appear to be related to the inventory item detail page, including updates to the item header, item info card, price history chart, and related items components.

📂 Files Changed

  • app/blocks/inventory-item-detail/item-header.tsx: Updated the ItemHeader component to format the condition and status of the item.
  • app/blocks/inventory-item-detail/item-info-card.tsx: Updated the ItemInfoCard component to format the purchase date and currency.
  • app/blocks/inventory-item-detail/price-history-chart.tsx: Updated the PriceHistoryChart component to handle missing price history data and to use a more robust date formatting approach.
  • app/blocks/inventory-item-detail/related-items.tsx: Updated the RelatedItems component to accept a list of related items as a prop.
  • app/routes/app-layout.tsx: No significant changes.
  • app/routes/inventory-item-detail.tsx: Updated the loader function to fetch related items for the inventory item detail page.

🎭 Code Poem

Code changes abound, with updates so fine,
Inventory item details, now more divine.
Price history charts, and related items too,
All updated with care, for me and for you.

🚨 Bugs & Architectural Violations * The `PriceHistoryChart` component is using `any` as the type for the `priceHistory` prop, which could lead to type errors and bugs. It would be better to define a specific type for this prop. * The `RelatedItems` component is using `any` as the type for the `items` prop, which could lead to type errors and bugs. It would be better to define a specific type for this prop. * The `item-info-card.tsx` file is using a `// Format condition and status (e.g., "new_mint" -> "New Mint")` comment, but the code is not actually formatting the condition and status. This comment should be removed or updated to reflect the actual behavior of the code. * The `price-history-chart.tsx` file is using a `// Format date to "Jan 5, 2026"` comment, but the code is not actually formatting the date in this way. This comment should be removed or updated to reflect the actual behavior of the code. * The `related-items.tsx` file is using a `// Format currency handling nulls and dynamic currency codes` comment, but the code is not actually handling currency codes. This comment should be removed or updated to reflect the actual behavior of the code. * The `app/routes/inventory-item-detail.tsx` file is using a `const relatedItems = await prisma.inventoryItem.findMany({` line, but it is not checking if the `relatedItems` variable is null or undefined before using it. This could lead to a runtime error if `relatedItems` is null or undefined.
💡 Suggestions & Best Practices * Consider adding more robust error handling to the `PriceHistoryChart` component to handle cases where the `priceHistory` prop is null or undefined. * Consider adding more robust error handling to the `RelatedItems` component to handle cases where the `items` prop is null or undefined. * Consider using a more robust date formatting approach in the `item-info-card.tsx` file, such as using a library like `moment` or `date-fns`. * Consider using a more robust currency formatting approach in the `item-info-card.tsx` file, such as using a library like `intl` or `currency-format`. * Consider adding accessibility features to the `PriceHistoryChart` component, such as adding `aria-label` attributes to the chart elements. * Consider adding accessibility features to the `RelatedItems` component, such as adding `aria-label` attributes to the item elements. * Consider using a more consistent coding style throughout the codebase, such as using consistent indentation and spacing. * Consider adding more comments to the code to explain the purpose and behavior of each component and function. * Consider using a code linter or formatter to enforce coding standards and best practices.

@sweta-126-ux

Copy link
Copy Markdown
Contributor Author

@rushikesh-bobade i have made all the changes so please review this and merge it..

@rushikesh-bobade

Copy link
Copy Markdown
Owner

Hi @sweta-126-ux,

Great job wiring up the real Prisma data to the Inventory Item detail page! The query you wrote to fetch related items by brand is excellent, and the date/currency formatting is exactly what we needed.

However, before we can merge this, there are three critical bugs that were accidentally introduced in this PR that break the page. Please fix the following:

1. You accidentally erased the props for the Marketplace and Sales components
In inventory-item-detail.tsx, you changed the bottom components to receive hardcoded empty arrays and nulls, which completely breaks them.
Please change:

<MarketplaceComparison priceHistory={[]} />
<SalesHistory sale={null} />

Back to the original dynamic data:

<MarketplaceComparison priceHistory={item.priceHistory} />
<SalesHistory sale={item.sale} />

2. You removed the date sorting logic in the Price History Chart
In price-history-chart.tsx, you removed the sortKey = d.getTime() logic. Because JavaScript objects don't guarantee insertion order, the line chart will now render the dates randomly instead of chronologically! Please restore the _sortTime key and the .sort((a, b) => a._sortTime - b._sortTime) logic.

3. marketValue does not exist on the database model
In related-items.tsx, you are rendering ${item.marketValue ?? "N/A"}. However, if you look at schema.prisma, InventoryItem does not have a marketValue field. It only has purchasePrice and askingPrice. Please change it to use askingPrice instead.

(Tip: This is exactly why you had to type items: any[] instead of using the proper Prisma type! Once you change it to askingPrice, you won't need any anymore!)

Please push a quick commit to fix these three layout/logic bugs, and I will be happy to get this merged!

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

📝 Summary

The provided pull request diff includes changes to several files in the app/blocks/inventory-item-detail directory, as well as updates to app/routes/app-layout.tsx and app/routes/inventory-item-detail.tsx. The changes appear to be related to the inventory item detail page, including updates to the item header, item info card, price history chart, and related items section.

📂 Files Changed

  • app/blocks/inventory-item-detail/item-header.tsx: Updated the item header component to include a new displayCondition variable and modified the JSX to display the item's condition.
  • app/blocks/inventory-item-detail/item-info-card.tsx: Updated the item info card component to include new variables for formatting the condition and purchase date, and modified the JSX to display the formatted values.
  • app/blocks/inventory-item-detail/price-history-chart.tsx: Updated the price history chart component to include a new groupedData object and modified the JSX to display the chart data.
  • app/blocks/inventory-item-detail/related-items.tsx: Updated the related items component to accept a new items prop and modified the JSX to display the related items.
  • app/routes/app-layout.tsx: No significant changes.
  • app/routes/inventory-item-detail.tsx: Updated the loader function to include a new relatedItems variable and modified the JSX to display the related items.

🎭 Code Poem

Changes abound in this code so fine,
Inventory item details now shine.
Price history charts and related items too,
Updated and improved, for me and you.

🚨 Bugs & Architectural Violations * The `priceHistory` prop in `PriceHistoryChart` is now typed as `any[]`, which could lead to type errors. It should be typed as an array of `MarketPrice` objects. * The `items` prop in `RelatedItems` is not properly typed. It should be typed as an array of `InventoryItem` objects. * The `displayCondition` variable in `ItemHeader` and `ItemInfoCard` is not properly handling null or undefined values. It should be updated to handle these cases. * The `formatMoney` function in `ItemInfoCard` is not properly handling null or undefined values. It should be updated to handle these cases. * The `groupedData` object in `PriceHistoryChart` is not properly typed. It should be typed as an object with date strings as keys and objects with marketplace data as values. * The `relatedItems` variable in `inventory-item-detail.tsx` is not properly typed. It should be typed as an array of `InventoryItem` objects.
💡 Suggestions & Best Practices * Consider adding more robust error handling to the `loader` function in `inventory-item-detail.tsx`. * Consider adding more robust type checking to the `priceHistory` prop in `PriceHistoryChart`. * Consider adding more robust type checking to the `items` prop in `RelatedItems`. * Consider using a more robust formatting library, such as `moment` or `date-fns`, to format dates in `ItemInfoCard`. * Consider using a more robust formatting library, such as ` numeral` or ` accounting`, to format currency values in `ItemInfoCard`. * Consider adding more accessibility features to the components, such as `aria-label` attributes and `role` attributes. * Consider using a more consistent coding style throughout the codebase.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

📝 Summary

The provided pull request diff includes changes to several files in the app/blocks/inventory-item-detail directory, as well as updates to app/routes/app-layout.tsx and app/routes/inventory-item-detail.tsx. The changes appear to be related to the inventory item detail page, including updates to the item header, item info card, price history chart, and related items section.

📂 Files Changed

  • app/blocks/inventory-item-detail/item-header.tsx: Updated the item header component to include a new displayCondition variable and updated the rendering of the item's condition.
  • app/blocks/inventory-item-detail/item-info-card.tsx: Updated the item info card component to include new fields for purchase price, purchase date, and condition.
  • app/blocks/inventory-item-detail/price-history-chart.tsx: Updated the price history chart component to use a new groupedData object and updated the rendering of the chart.
  • app/blocks/inventory-item-detail/related-items.tsx: Updated the related items component to use a new items prop and updated the rendering of the related items grid.
  • app/routes/app-layout.tsx: No significant changes.
  • app/routes/inventory-item-detail.tsx: Updated the loader function to include a new relatedItems variable and updated the rendering of the inventory item detail page.

🎭 Code Poem

Changes abound in this code so fine,
Updates to components, a new design.
Inventory item details, now on display,
With related items, in a new way.

🚨 Bugs & Architectural Violations * The `price-history-chart.tsx` file uses the `any` type for the `priceHistory` prop, which could lead to type errors and should be updated to use a more specific type. * The `related-items.tsx` file uses the `InventoryItem` type from `@prisma/client`, but does not import it correctly. The import statement should be updated to `import { InventoryItem } from '@prisma/client';`. * The `item-info-card.tsx` file uses the `formatMoney` function, but does not handle null values correctly. The function should be updated to handle null values and return a default value. * The `price-history-chart.tsx` file uses a `ResponsiveContainer` component, but does not provide a `height` prop. The `height` prop should be added to ensure the chart is rendered correctly. * The `app/routes/inventory-item-detail.tsx` file uses a `useLoaderData` hook, but does not handle errors correctly. The hook should be updated to handle errors and return a default value.
💡 Suggestions & Best Practices * The `item-header.tsx` file could be updated to use a more robust way of formatting the item's condition, such as using a separate component or a utility function. * The `item-info-card.tsx` file could be updated to use a more consistent naming convention for the fields, such as using camelCase or PascalCase. * The `price-history-chart.tsx` file could be updated to use a more efficient way of rendering the chart, such as using a library like `d3.js` or `chart.js`. * The `related-items.tsx` file could be updated to use a more robust way of rendering the related items grid, such as using a library like `react-grid-layout` or `react-virtualized`. * The `app/routes/inventory-item-detail.tsx` file could be updated to use a more consistent naming convention for the variables, such as using camelCase or PascalCase.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

📝 Summary

The provided pull request diff includes changes to several files in the app/blocks/inventory-item-detail directory, as well as updates to app/routes/app-layout.tsx and app/routes/inventory-item-detail.tsx. The changes appear to be related to the inventory item detail page, including updates to the item header, info card, price history chart, and related items section.

📂 Files Changed

  • app/blocks/inventory-item-detail/item-header.tsx: Updated the item header component to include a new displayCondition variable and modified the JSX to display the item's condition.
  • app/blocks/inventory-item-detail/item-info-card.tsx: Updated the item info card component to include new fields for purchase price, purchase date, condition, and status.
  • app/blocks/inventory-item-detail/price-history-chart.tsx: Updated the price history chart component to use a new groupedData object and modified the JSX to display the chart.
  • app/blocks/inventory-item-detail/related-items.tsx: Updated the related items component to accept a new items prop and modified the JSX to display the related items.
  • app/routes/app-layout.tsx: No significant changes.
  • app/routes/inventory-item-detail.tsx: Updated the loader function to include a new relatedItems query and modified the JSX to display the related items.

🎭 Code Poem

Code changes abound, a new sight
Inventory item details, shining bright
Price history charts, and related items too
Updates galore, for me and you

🚨 Bugs & Architectural Violations * The `priceHistory` prop in `PriceHistoryChart` is now typed as `any[]`, which could lead to type errors and bugs. It should be typed as an array of `MarketPrice` objects. * The `groupedData` object in `PriceHistoryChart` is not properly typed, which could lead to type errors and bugs. * The `relatedItems` query in `inventory-item-detail.tsx` is not properly typed, which could lead to type errors and bugs. * The `ItemHeader` component is not using the `aria-hidden` attribute, which could lead to accessibility issues. * The `ItemInfoCard` component is not using the `role` attribute, which could lead to accessibility issues. * The `PriceHistoryChart` component is not using the `role` attribute, which could lead to accessibility issues. * The `RelatedItems` component is not using the `role` attribute, which could lead to accessibility issues.
💡 Suggestions & Best Practices * Consider using a more robust typing system for the `priceHistory` prop in `PriceHistoryChart`. * Consider using a more robust typing system for the `groupedData` object in `PriceHistoryChart`. * Consider using a more robust typing system for the `relatedItems` query in `inventory-item-detail.tsx`. * Consider adding the `aria-hidden` attribute to the `ItemHeader` component to improve accessibility. * Consider adding the `role` attribute to the `ItemInfoCard`, `PriceHistoryChart`, and `RelatedItems` components to improve accessibility. * Consider using a more efficient data structure for the `groupedData` object in `PriceHistoryChart`. * Consider using a more efficient algorithm for grouping the data in `PriceHistoryChart`. * Consider adding more robust error handling to the `loader` function in `inventory-item-detail.tsx`. * Consider adding more robust error handling to the `PriceHistoryChart` component.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

📝 Summary

The provided pull request diff includes changes to several files in the app/blocks/inventory-item-detail directory, as well as updates to the app/routes directory. The changes appear to be focused on improving the display of inventory item details, including the addition of related items and price history charts.

📂 Files Changed

  • app/blocks/inventory-item-detail/item-header.tsx: Updated to improve the display of item headers, including the addition of a displayCondition variable to format the item condition.
  • app/blocks/inventory-item-detail/item-info-card.tsx: Updated to improve the display of item information, including the addition of formatted dates and currency handling.
  • app/blocks/inventory-item-detail/price-history-chart.tsx: Updated to improve the display of price history charts, including the addition of a ResponsiveContainer and updated styling.
  • app/blocks/inventory-item-detail/related-items.tsx: Updated to display related items, including the addition of a Link component to navigate to related item pages.
  • app/routes/app-layout.tsx: No significant changes.
  • app/routes/inventory-item-detail.tsx: Updated to include related items in the loader data and to display the related items component.

🎭 Code Poem

Code changes abound, with updates so fine,
Improving displays, making data shine.
Related items and charts, a new view to see,
Inventory details, now more clear to me.

🚨 Bugs & Architectural Violations * The `priceHistory` prop in `PriceHistoryChart` is now typed as `any[]`, which could lead to type errors and bugs. It should be typed more specifically to ensure data integrity. * The `RelatedItems` component is now expecting an `items` prop, but it is not clear if this prop is always provided. This could lead to errors if the prop is missing. * The `ItemInfoCard` component is using a `formatMoney` function that is not defined in the provided code. This could lead to errors if the function is not properly defined. * The `PriceHistoryChart` component is using a `ResponsiveContainer` from the `recharts` library, but it is not clear if this library is properly installed and configured. * The `app/routes/inventory-item-detail.tsx` file is using a `prisma` client to fetch related items, but it is not clear if this client is properly configured and authenticated.
💡 Suggestions & Best Practices * Consider adding more specific type annotations for the `priceHistory` prop in `PriceHistoryChart` to ensure data integrity. * Consider adding a default value or a check for the `items` prop in `RelatedItems` to prevent errors if the prop is missing. * Consider defining the `formatMoney` function in a separate utility file to make it reusable and easier to maintain. * Consider adding more documentation and comments to the code to explain the purpose and behavior of each component and function. * Consider using a more robust and scalable solution for fetching related items, such as using a GraphQL API or a dedicated backend service.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

📝 Summary

The provided pull request diff includes changes to several files in the app/blocks/inventory-item-detail directory, as well as updates to app/routes/app-layout.tsx and app/routes/inventory-item-detail.tsx. The changes appear to be related to the inventory item detail page, including updates to the item header, info card, price history chart, and related items section.

📂 Files Changed

  • app/blocks/inventory-item-detail/item-header.tsx: Updated the item header component to include a new displayCondition variable and to display the item's condition.
  • app/blocks/inventory-item-detail/item-info-card.tsx: Updated the item info card component to include new fields for purchase price, purchase date, and condition.
  • app/blocks/inventory-item-detail/price-history-chart.tsx: Updated the price history chart component to use a new groupedData object and to display the chart data in a more readable format.
  • app/blocks/inventory-item-detail/related-items.tsx: Updated the related items component to accept a new items prop and to display the related items in a grid.
  • app/routes/app-layout.tsx: No significant changes.
  • app/routes/inventory-item-detail.tsx: Updated the loader function to include a new relatedItems query and to return the related items in the loader data.

🎭 Code Poem

Code changes abound, a new sight
Inventory item details, shining bright
Price history charts, and related items too
Updates galore, for me and for you

🚨 Bugs & Architectural Violations * The `priceHistory` prop in `PriceHistoryChart` is now typed as `any[]`, which could lead to type errors and make the code harder to maintain. It would be better to define a specific type for the `priceHistory` prop. * The `groupedData` object in `PriceHistoryChart` is not properly typed, which could lead to type errors. * The `relatedItems` component is not properly handling the case where the `items` prop is empty or null. * The `item-header.tsx` file is missing a newline at the end of the file, which could cause issues with some text editors. * The `item-info-card.tsx` file is using the `var` keyword to declare variables, which is not recommended in modern JavaScript. Instead, `let` or `const` should be used. * The `price-history-chart.tsx` file is using a lot of inline styles, which could make the code harder to maintain and less flexible. It would be better to define the styles in a separate CSS file.
💡 Suggestions & Best Practices * Consider adding more type annotations to the code to make it easier to understand and maintain. * Consider using a more robust way to handle errors and edge cases, such as using try-catch blocks and error boundaries. * Consider using a more efficient way to render the related items, such as using a virtualized list or a pagination system. * Consider adding more accessibility features to the code, such as ARIA attributes and screen reader support. * Consider using a more consistent coding style throughout the codebase, such as using a linter and a code formatter. * Consider adding more tests to the codebase to ensure that the changes are working as expected and to catch any regressions.

@sweta-126-ux

Copy link
Copy Markdown
Contributor Author

@rushikesh-bobade I have fixed the bugs you mentioned earlier.

@rushikesh-bobade

Copy link
Copy Markdown
Owner

Hi @sweta-126-ux,

Thanks for pushing those updates! You successfully fixed the date sorting logic and the askingPrice bug.

However, it looks like you missed the very first requested fix, and in the process of resolving the TypeScript errors, a few sloppy type definitions were introduced:

  1. MarketplaceComparison is still broken: In inventory-item-detail.tsx, you still have <MarketplaceComparison priceHistory={[]} />. Please change it back to <MarketplaceComparison priceHistory={item.priceHistory} />.
  2. Syntax/Type issues: In price-history-chart.tsx, you wrote }[]; at the end of the Props interface. Please fix this syntax typo. Additionally, please do not use any[]. Open-source projects rely heavily on strict types. You can revert priceHistory: any[]; back to the original strict Prisma type you had before.

Please take your time to thoroughly double-check the files before pushing. Once these are fixed, we'll get this merged!

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

📝 Summary

The provided pull request diff includes changes to several files in the app/blocks/inventory-item-detail directory, as well as updates to the app/routes directory. The changes appear to be focused on improving the display of inventory item details, including the addition of related items and price history charts.

📂 Files Changed

  • app/blocks/inventory-item-detail/item-header.tsx: Updated to display item details, including SKU, name, brand, size, and condition.
  • app/blocks/inventory-item-detail/item-info-card.tsx: Updated to display item details, including purchase price, purchase date, condition, and asking price.
  • app/blocks/inventory-item-detail/price-history-chart.tsx: Updated to display a 30-day price history chart for the item.
  • app/blocks/inventory-item-detail/related-items.tsx: Updated to display related items, including their name, price, and image.
  • app/routes/app-layout.tsx: No significant changes.
  • app/routes/inventory-item-detail.tsx: Updated to include related items in the loader data.

🎭 Code Poem

Changes abound, in code so fine,
Improving details, one line at a time.
Related items, and price history too,
Making the app, more useful to you.

🚨 Bugs & Architectural Violations * The `item-header.tsx` file uses the `replace()` method with a regular expression to format the condition string. This could potentially lead to issues if the condition string contains special characters. Consider using a more robust formatting method. * The `price-history-chart.tsx` file uses the `recharts` library, which is not explicitly mentioned in the critical codebase architecture rules. Ensure that this library is approved for use in the project. * The `related-items.tsx` file uses the `Link` component from `react-router`, but does not include any accessibility attributes. Consider adding `aria-label` or `aria-describedby` attributes to improve accessibility. * The `inventory-item-detail.tsx` file uses the `useLoaderData` hook to load data, but does not include any error handling. Consider adding try-catch blocks or error handling mechanisms to ensure that the app remains stable in case of data loading errors.
💡 Suggestions & Best Practices * Consider adding more robust error handling mechanisms to the `inventory-item-detail.tsx` file to ensure that the app remains stable in case of data loading errors. * In the `price-history-chart.tsx` file, consider using a more efficient data structure, such as a `Map`, to store the grouped data. * In the `related-items.tsx` file, consider using a more efficient method to render the related items, such as using a `useMemo` hook to memoize the related items data. * Consider adding more accessibility attributes to the `item-header.tsx` and `item-info-card.tsx` files to improve the overall accessibility of the app. * Consider using a more consistent coding style throughout the codebase, including consistent indentation and spacing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ECSoC26 Required label for ECSOC Sentinel scoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants