Skip to content

Conversation

@anttimaki
Copy link
Contributor

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Oct 13, 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.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch enable-package-reporting

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.

@codecov
Copy link

codecov bot commented Oct 13, 2025

Codecov Report

❌ Patch coverage is 2.27273% with 172 lines in your changes missing coverage. Please review.
✅ Project coverage is 9.91%. Comparing base (3b7b553) to head (668b921).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
...x/app/p/components/ReportPackage/ReportPackage.tsx 0.00% 139 Missing ⚠️
apps/cyberstorm-remix/app/p/packageListing.tsx 0.00% 32 Missing ⚠️
...ckages/thunderstore-api/src/post/packageListing.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #1582      +/-   ##
=========================================
- Coverage    9.93%   9.91%   -0.02%     
=========================================
  Files         303     304       +1     
  Lines       22378   22435      +57     
  Branches      399     400       +1     
=========================================
+ Hits         2223    2225       +2     
- Misses      20155   20210      +55     

☔ 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.

@anttimaki anttimaki force-pushed the packageListing-imports branch from 7da8d23 to d3c3726 Compare October 13, 2025 11:16
@anttimaki anttimaki force-pushed the enable-package-reporting branch from cf3841c to 58bcf93 Compare October 13, 2025 11:16
The parts regarding opening the modal are discarded as they're outdated
and wouldn't work anymore.

async function awaitAndSetProps() {
if (!props) {
setProps(await formProps);

Choose a reason for hiding this comment

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

Since the formProps here is a Promise and awaitAndSetProps is called from useEffect. Should potential Promise rejections be handled in useEffect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I commented on this in the commit message. The page where the reporting feat resides currently renders a 500 error page if the promise rejects, so I chose to ignore it here too. Do you find that reasonable?

Copy link

@Roffenlund Roffenlund left a comment

Choose a reason for hiding this comment

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

Left one comment related to Promise handling and the automated review comment is probably valid as well.

@anttimaki anttimaki force-pushed the packageListing-imports branch from d3c3726 to 3b7b553 Compare October 15, 2025 07:56
@anttimaki anttimaki force-pushed the enable-package-reporting branch from 58bcf93 to 34828c4 Compare October 15, 2025 07:56
The idea here is to further separate the sub component from the main
view component. The view component had made some optimizations that
assumed everything is located in the same file. To circumvent this,
small changes were required to its markup structure.

Some corners were cut short on the hook's side when it comes to
handling the props-as-promise. E.g. it's assumed the listing always
eventually resolves to correct values, but if that doesn't happen, the
whole page is broken anyway. Also no fallback is currently provided
while the promise is resolving (null is returned instead, but this can
be changed). useEffect is used to resolve the props rather than
Suspense and Await components, as the latters caused ~1s delay for the
modal to open, since when moved to hook, they started processing only
when the user clicked the report button.
I'm not entirely sure how modal widths are supposed to be adjusted, or
if they're supposed to just take the space required by the content.
Currently the "Additional information (optional)" label sets the width
for the modal, which means the textarea on the form is very narrow on
desktop, making annoying to write anything longer than a couple of
words. On the other hand setting a min width to the textarea makes it
not that responsive on mobile layouts. I think this should be addressed
in some generic fashion, perhaps in the Modal component, and is
therefore outside the scope of these changes.
@anttimaki anttimaki force-pushed the enable-package-reporting branch from 34828c4 to 668b921 Compare October 15, 2025 08:16

export const packageListingReportRequestDataSchema = z.object({
version: z.number().optional(),
version: z.number().optional(), // TODO: use SemVer string
Copy link
Contributor

Choose a reason for hiding this comment

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

A good TODO, but the SemVer string requires proper SemVer from the backend too. Currently the backend doesn't fully dishout proper SemVer.

Also this should probably be a string instead of number? (bad me)

Base automatically changed from packageListing-imports to master October 15, 2025 10:35
@Oksamies Oksamies merged commit 9b5272b into master Oct 15, 2025
26 of 30 checks passed
@Oksamies Oksamies deleted the enable-package-reporting branch October 15, 2025 10:35
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