Skip to content

Conversation

@anttimaki
Copy link
Contributor

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Dec 18, 2025

Walkthrough

The component in packageListingVersion.tsx has been refactored to remove hydration logic and React hooks. Community data fetching from loader/clientLoader has been eliminated, with metadata now derived directly from listing data. The component has been renamed from PackageVersion to PackageListingVersion. Additionally, the route for displaying a specific package version within a community context has been updated to use this refactored component instead of the previous packageVersion.tsx component.

Possibly related PRs

  • Package Version pages #1547: Introduces packageVersion pages and route/component implementations that share the same package version routing configuration updated in this PR.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a brief description explaining the purpose of the cleanup, such as why hydration logic was removed or what benefit this refactoring provides.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Listing version cleanup' directly reflects the main changes: refactoring the PackageVersion component to PackageListingVersion and simplifying its logic by removing hooks and hydration complexity.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch listing-version-cleanup

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.

The required information is now available in the listing data too.
I must admit I'm meddling with powers I don't comprehend. Why was this
implemented this way? Is it still needed? At least for me both SSR and
client side loading seem to work without issues.
Considered PackageVersionListing too but I think this pairs nicer with
PackageListing component.
@anttimaki anttimaki force-pushed the listing-version-cleanup branch from 8f7247d to 1b17ae0 Compare December 18, 2025 14:00
@anttimaki
Copy link
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Dec 18, 2025

✅ Actions performed

Full review triggered.

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

🧹 Nitpick comments (1)
apps/cyberstorm-remix/app/p/packageListingVersion.tsx (1)

162-162: Optional: Simplify redundant nullish coalescing.

The ?? undefined is redundant since listing.icon_url already resolves to undefined if nullish.

🔎 Simplify to:
-      <meta property="og:image" content={listing.icon_url ?? undefined} />
+      <meta property="og:image" content={listing.icon_url} />
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e384759 and 1b17ae0.

📒 Files selected for processing (2)
  • apps/cyberstorm-remix/app/p/packageListingVersion.tsx (6 hunks)
  • apps/cyberstorm-remix/app/routes.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-09T12:41:16.448Z
Learnt from: CR
Repo: thunderstore-io/thunderstore-ui PR: 0
File: apps/cyberstorm-remix/docs/error-boundary.md:0-0
Timestamp: 2025-12-09T12:41:16.448Z
Learning: Applies to apps/cyberstorm-remix/docs/**/*.route.{ts,tsx} : Use `RouteErrorBoundary` in route components by exporting it as `ErrorBoundary` from the route component file

Applied to files:

  • apps/cyberstorm-remix/app/routes.ts
📚 Learning: 2025-12-09T12:41:16.448Z
Learnt from: CR
Repo: thunderstore-io/thunderstore-ui PR: 0
File: apps/cyberstorm-remix/docs/error-boundary.md:0-0
Timestamp: 2025-12-09T12:41:16.448Z
Learning: Applies to apps/cyberstorm-remix/docs/**/*.route.{ts,tsx} : `RouteErrorBoundary` catches errors in loaders and Promise rejections - ensure Suspense and Await are used in the main component to handle loader Promise rejections

Applied to files:

  • apps/cyberstorm-remix/app/routes.ts
🧬 Code graph analysis (1)
apps/cyberstorm-remix/app/p/packageListingVersion.tsx (1)
apps/cyberstorm-remix/cyberstorm/security/publicEnvVariables.ts (1)
  • getPublicEnvVariables (19-48)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build
  • GitHub Check: Generate visual diffs
🔇 Additional comments (5)
apps/cyberstorm-remix/app/p/packageListingVersion.tsx (4)

31-31: LGTM - Clean import simplification.

Removing unused hooks aligns well with the refactoring goals.


125-128: LGTM - Component rename is consistent.

The rename to PackageListingVersion aligns with the file name and clarifies the component's purpose.


243-243: LGTM - Consistent with simplified function signature.

Both calls correctly pass only the listing parameter.

Also applies to: 333-333


383-388: Verify if suppressHydrationWarning is still necessary.

Since the hydration logic was removed from the component, double-check whether suppressHydrationWarning is still needed on RelativeTime. It may still be required if RelativeTime internally uses Date.now() or similar time-based values that differ between server and client renders.

apps/cyberstorm-remix/app/routes.ts (1)

36-47: LGTM - Route correctly updated to use refactored component.

The route now points to packageListingVersion.tsx, which aligns with the component rename and refactoring work.

Comment on lines +140 to +144
<meta
title={`${formatToDisplayName(
listing.full_version_name
)} | Thunderstore - The ${listing.community_name} Mod Database`}
/>
Copy link

@coderabbitai coderabbitai bot Dec 18, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix invalid title attribute on <meta> tag.

Line 140 uses <meta title={...}> which is invalid HTML. For setting the document title in React 19, use <title>{...}</title> instead.

🔎 Apply this diff to fix the title tag:
-      <meta
-        title={`${formatToDisplayName(
-          listing.full_version_name
-        )} | Thunderstore - The ${listing.community_name} Mod Database`}
-      />
+      <title>
+        {`${formatToDisplayName(
+          listing.full_version_name
+        )} | Thunderstore - The ${listing.community_name} Mod Database`}
+      </title>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<meta
title={`${formatToDisplayName(
listing.full_version_name
)} | Thunderstore - The ${listing.community_name} Mod Database`}
/>
<title>
{`${formatToDisplayName(
listing.full_version_name
)} | Thunderstore - The ${listing.community_name} Mod Database`}
</title>
🤖 Prompt for AI Agents
In apps/cyberstorm-remix/app/p/packageListingVersion.tsx around lines 140 to
144, the JSX uses an invalid <meta title={...}> attribute; replace that meta tag
with a proper <title>{...}</title> element (rendered inside the document head or
the component that controls the page head) so the document title is set
correctly in React 19, keeping the same formatted string
`${formatToDisplayName(listing.full_version_name)} | Thunderstore - The
${listing.community_name} Mod Database`.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Oksamies do you reckon this is a valid issue? Would affect other pages as well if it is.

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 0% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 11.65%. Comparing base (e384759) to head (1b17ae0).

Files with missing lines Patch % Lines
...s/cyberstorm-remix/app/p/packageListingVersion.tsx 0.00% 36 Missing ⚠️
apps/cyberstorm-remix/app/routes.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                   @@
##           secure-listing-version    #1672   +/-   ##
=======================================================
  Coverage                   11.64%   11.65%           
=======================================================
  Files                         322      322           
  Lines                       22990    22963   -27     
  Branches                      512      511    -1     
=======================================================
- Hits                         2678     2676    -2     
+ Misses                      20312    20287   -25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@VilppeRiskidev VilppeRiskidev left a comment

Choose a reason for hiding this comment

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

Changes look good and don't seem to break anything, IDK about the title attribute though, so your call if you want to ask/wait for oksamies' comment.

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