Skip to content

Conversation

Oksamies
Copy link
Contributor

@Oksamies Oksamies commented Sep 17, 2025

Look at the commits for more information

Copy link

coderabbitai bot commented Sep 17, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 09-18-add_package_version_pages

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Oksamies Oksamies changed the base branch from 09-17-update_thunderstore-api_to_match_up_coming_cyberstorm_api_changes to graphite-base/1547 September 18, 2025 16:47
@Oksamies Oksamies force-pushed the 09-18-add_package_version_pages branch from 895c5a8 to 4582600 Compare September 18, 2025 16:47
@Oksamies Oksamies changed the base branch from graphite-base/1547 to 09-17-update_thunderstore-api_to_match_up_coming_cyberstorm_api_changes September 18, 2025 16:47
@Oksamies Oksamies changed the base branch from 09-17-update_thunderstore-api_to_match_up_coming_cyberstorm_api_changes to graphite-base/1547 September 18, 2025 17:29
@Oksamies Oksamies force-pushed the 09-18-add_package_version_pages branch from 4582600 to b1e3d73 Compare September 18, 2025 17:30
@Oksamies Oksamies changed the base branch from graphite-base/1547 to 09-17-update_thunderstore-api_to_match_up_coming_cyberstorm_api_changes September 18, 2025 17:30
@Oksamies Oksamies force-pushed the 09-18-add_package_version_pages branch from b1e3d73 to e6817ad Compare September 18, 2025 20:03
@Oksamies Oksamies changed the base branch from 09-17-update_thunderstore-api_to_match_up_coming_cyberstorm_api_changes to graphite-base/1547 September 19, 2025 11:19
@Oksamies Oksamies force-pushed the 09-18-add_package_version_pages branch from e6817ad to e6956ff Compare September 19, 2025 11:21
@Oksamies Oksamies changed the base branch from graphite-base/1547 to 09-17-update_thunderstore-api_to_match_up_coming_cyberstorm_api_changes September 19, 2025 11:21
@Oksamies Oksamies changed the base branch from 09-17-update_thunderstore-api_to_match_up_coming_cyberstorm_api_changes to graphite-base/1547 September 19, 2025 12:49
@Oksamies Oksamies force-pushed the 09-18-add_package_version_pages branch from e6956ff to 73cc06b Compare September 19, 2025 12:49
@Oksamies Oksamies changed the base branch from graphite-base/1547 to 09-17-update_thunderstore-api_to_match_up_coming_cyberstorm_api_changes September 19, 2025 12:50
Add function for using the endpoint and related schemas
Add packageVersion method for Dapper and DapperFake
This enables componens like NewLink to auto resolve links and it's used props, with the linkId prop. (the method name in LinkLibrary interface)
These pages are more or less the same as PackageListing pages/tabs. The biggest difference being the ommited Team and Package Listing related information as it's not relevant when viewing a package.

The "Required" is mostly commented out, because the endpoint isn't yet available. (even for local development testing)
These pages are and should be exactly the same, not including community related features and functionalities.

The reason these have to be their own files is that, react-router doesn't support using the same files for two routes at the same time.

The "Required" is mostly commented out, because the endpoint isn't yet available. (even for local development testing)
Note that the ones that do not require a community to fetch the package version data, are not under the /c/ path
So that no-community-needing package pages are accessible through the proxy
@Oksamies Oksamies force-pushed the 09-18-add_package_version_pages branch from 73cc06b to 7a9bbdb Compare September 19, 2025 14:47
@Oksamies Oksamies changed the title Add Version Detail api endpoint to thunderstore-api Package Version pages Sep 19, 2025
@Oksamies Oksamies marked this pull request as ready for review September 19, 2025 14:49
Comment on lines +153 to +172
useEffect(() => {
if (!startsHydrated.current && isHydrated) return;
if (isPromise(version)) {
version.then((versionData) => {
setFirstUploaded(
<RelativeTime
time={versionData.datetime_created}
suppressHydrationWarning
/>
);
});
} else {
setFirstUploaded(
<RelativeTime
time={version.datetime_created}
suppressHydrationWarning
/>
);
}
}, []);
Copy link

Choose a reason for hiding this comment

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

The useEffect hook depends on the version variable but it's not included in the dependency array. This could lead to stale closures if version changes after the initial render. Consider adding version to the dependency array:

}, [version]);

This ensures the effect runs when version changes, keeping the displayed upload time in sync with the current version data.

Suggested change
useEffect(() => {
if (!startsHydrated.current && isHydrated) return;
if (isPromise(version)) {
version.then((versionData) => {
setFirstUploaded(
<RelativeTime
time={versionData.datetime_created}
suppressHydrationWarning
/>
);
});
} else {
setFirstUploaded(
<RelativeTime
time={version.datetime_created}
suppressHydrationWarning
/>
);
}
}, []);
useEffect(() => {
if (!startsHydrated.current && isHydrated) return;
if (isPromise(version)) {
version.then((versionData) => {
setFirstUploaded(
<RelativeTime
time={versionData.datetime_created}
suppressHydrationWarning
/>
);
});
} else {
setFirstUploaded(
<RelativeTime
time={version.datetime_created}
suppressHydrationWarning
/>
);
}
}, [version]);

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Comment on lines +190 to +194
<meta
title={`${formatToDisplayName(
resolvedValue[0].full_version_name
)} | Thunderstore - The ${resolvedValue[1].name} Mod Database`}
/>
Copy link

Choose a reason for hiding this comment

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

The title attribute is being used incorrectly on the meta tag. For page titles, use the standard <title> element instead. If using a meta tag for title information, the proper attribute would be name="title".

Consider replacing:

<meta
  title={`${formatToDisplayName(
    resolvedValue[0].full_version_name
  )} | Thunderstore - The ${resolvedValue[1].name} Mod Database`}
/>

with:

<title>
  {formatToDisplayName(resolvedValue[0].full_version_name)} | Thunderstore - The {resolvedValue[1].name} Mod Database
</title>

This ensures proper SEO and browser display of the page title.

Suggested change
<meta
title={`${formatToDisplayName(
resolvedValue[0].full_version_name
)} | Thunderstore - The ${resolvedValue[1].name} Mod Database`}
/>
<title>{`${formatToDisplayName(
resolvedValue[0].full_version_name
)} | Thunderstore - The ${resolvedValue[1].name} Mod Database`}</title>

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

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.

1 participant