Skip to content
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

adding weekly stats to reselling search #505

Merged
merged 1 commit into from
Sep 22, 2024
Merged

Conversation

cohenaj194
Copy link
Contributor

@cohenaj194 cohenaj194 commented Sep 22, 2024

Summary by CodeRabbit

  • New Features

    • Expanded sales metrics in the results display, including weekly median, average, sales amount, and quantity sold for both non-quality (NQ) and high-quality (HQ) items.
    • Enhanced sorting capabilities with new criteria for sales metrics.
  • Improvements

    • Added new items to the item map, enriching the in-game item catalog.
    • Refined existing item definitions for better clarity on quality levels.

Copy link
Contributor

coderabbitai bot commented Sep 22, 2024

Walkthrough

The pull request introduces several enhancements across multiple files, primarily focusing on expanding the data structure related to item sales metrics in the game. New entries have been added to the cvsFileList and defaultSortOrder, allowing for more detailed insights and sorting options. Additionally, the wowItemsMap has been updated with new items and refined existing items to improve the representation of game assets.

Changes

Files Change Summary
app/components/FFXIVResults/FullScan/Results.tsx Added eight new entries to cvsFileList for item sales metrics (NQ and HQ). Corresponding accessor methods were added to columnHelper for each entry to format displayed values.
app/redux/localStorage/ffScanOrderHelpers.ts Expanded defaultSortOrder by adding eight new sorting criteria related to item sales metrics.
app/utils/items/wowItems.ts Introduced multiple new items to wowItemsMap and modified existing entries for 'Duskthread Lining' to specify different quality levels. New items include 'Lethargy Root', 'Half-Eaten Fish', and several others with unique IDs.

Possibly related PRs

  • add expansion number filter to marketshare #485: The changes in this PR introduce new entries related to market share data filtering based on expansion numbers, which aligns with the new metrics added in the main PR for item sales, enhancing the overall data handling capabilities in the application.

Poem

In the fields where numbers play,
New metrics hop and dance today.
Sales and items, all in line,
A rabbit's joy, oh how they shine!
With every entry, data grows,
In our world, excitement flows! 🐇✨


Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Tip

Early access features: enabled

We are currently testing new code review model(s) that may lead to higher noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

Copy link

sonarcloud bot commented Sep 22, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
51.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Copy link

Deploying saddlebag-with-pockets with  Cloudflare Pages  Cloudflare Pages

Latest commit: cf27a68
Status: ✅  Deploy successful!
Preview URL: https://4a44602b.saddlebag-with-pockets.pages.dev
Branch Preview URL: https://reselling-region-stats.saddlebag-with-pockets.pages.dev

View logs

Copy link
Contributor

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3037c7a and cf27a68.

Files selected for processing (3)
  • app/components/FFXIVResults/FullScan/Results.tsx (2 hunks)
  • app/redux/localStorage/ffScanOrderHelpers.ts (1 hunks)
  • app/utils/items/wowItems.ts (6 hunks)
Additional comments not posted (9)
app/utils/items/wowItems.ts (7)

2503-2503: LGTM: New item added correctly

The addition of 'Lethargy Root' with ID '3777' follows the existing pattern and fits well within the surrounding context.


28755-28758: LGTM: New items added correctly

The additions of 'Half-Eaten Fish' (ID '220439') and 'Desecrated Arathi Tinderbox' (ID '220443') follow the existing pattern and fit well within the surrounding context.


29064-29064: LGTM: New item added correctly

The addition of 'Sticky Sweet Treat' with ID '222748' follows the existing pattern and fits well within the surrounding context.


29107-29109: LGTM: Duskthread Lining entries added with quality levels

The additions of 'Duskthread Lining' entries with different quality levels (IDs '222871', '222872', '222873') follow the existing pattern and are consistent with similar items in the map.


29852-29852: LGTM: New item added correctly

The addition of 'Extra Large Bag of Popped Pebbles' with ID '228453' follows the existing pattern and fits well within the surrounding context.


Line range hint 2503-29852: Overall assessment: Changes look good, with one minor query

The additions and modifications to the wowItemsMap are consistent and well-structured. They expand the item database, which aligns with the PR objective of "adding weekly stats to reselling search".

As a final step, I recommend:

  1. Addressing the query about the ID gap between '225728' and '225744'.
  2. Double-checking that all new items are correctly named and categorized.
#!/bin/bash
# Description: Verify the consistency of new items

# Test 1: Check for any duplicate item names. Expect: No results.
echo "Checking for duplicate item names:"
rg --type typescript -o "'.+': '.+'" app/utils/items/wowItems.ts | sort | uniq -d

# Test 2: Verify that all new item IDs are unique. Expect: No results.
echo "Checking for duplicate item IDs:"
rg --type typescript -o "'[0-9]+'" app/utils/items/wowItems.ts | sort | uniq -d

# Test 3: Check for any items with non-numeric IDs. Expect: No results.
echo "Checking for non-numeric IDs:"
rg --type typescript "'.+': '.+'" app/utils/items/wowItems.ts | rg -v "'[0-9]+': '.+'"

29623-29631: LGTM: New equipment items added correctly

The additions of multiple new equipment items (IDs '225720' to '225744') follow the existing pattern and fit well within the surrounding context.

However, there's a gap in the ID sequence between '225728' and '225744'. Can you confirm if this is intentional or if there are missing items?

app/redux/localStorage/ffScanOrderHelpers.ts (1)

18-26: LGTM! New sorting options added successfully.

The additions to the defaultSortOrder array align well with the PR objective of adding weekly stats to reselling search. The new entries provide more granular sorting options for users, which is beneficial. The naming convention is consistent, and the entries are logically grouped.

To ensure these changes are properly integrated, please run the following script to check if these new sorting options are being used elsewhere in the codebase:

This will help identify if there are any areas in the codebase that might need to be updated to handle these new sorting options.

Verification successful

Verified: New sorting options are utilized appropriately.

  • Found usage in app/components/FFXIVResults/FullScan/Results.tsx.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for usage of new sorting options in the codebase

# Test: Search for usage of new sorting options
echo "Searching for usage of new sorting options:"
rg --type typescript --type javascript -i "(regionWeeklyMedianNQ|regionWeeklyAverageNQ|regionWeeklySalesAmountNQ|regionWeeklyQuantitySoldNQ|regionWeeklyMedianHQ|regionWeeklyAverageHQ|regionWeeklySalesAmountHQ|regionWeeklyQuantitySoldHQ)"

# Test: Check for any TODO comments related to sorting or weekly stats
echo "Checking for related TODO comments:"
rg --type typescript --type javascript -i "TODO.*sort|TODO.*weekly"

Length of output: 557


Script:

#!/bin/bash
# Description: Check for usage of new sorting options in the codebase

# Test: Search for usage of new sorting options
echo "Searching for usage of new sorting options:"
rg --type ts --type js -i "(regionWeeklyMedianNQ|regionWeeklyAverageNQ|regionWeeklySalesAmountNQ|regionWeeklyQuantitySoldNQ|regionWeeklyMedianHQ|regionWeeklyAverageHQ|regionWeeklySalesAmountHQ|regionWeeklyQuantitySoldHQ)"

# Test: Check for any TODO comments related to sorting or weekly stats
echo "Checking for related TODO comments:"
rg --type ts --type js -i "TODO.*sort|TODO.*weekly"

Length of output: 2716

app/components/FFXIVResults/FullScan/Results.tsx (1)

78-98: LGTM: New entries in cvsFileList are correctly added and consistently named

The additional entries for regional weekly statistics are appropriately added to the cvsFileList array, enhancing CSV export capabilities.

Comment on lines +224 to +254
columnHelper.accessor('regionWeeklyMedianNQ', {
header: 'Region Weekly Median NQ',
cell: (info) => info.getValue().toLocaleString()
}),
columnHelper.accessor('regionWeeklyAverageNQ', {
header: 'Region Weekly Average NQ',
cell: (info) => info.getValue().toLocaleString()
}),
columnHelper.accessor('regionWeeklySalesAmountNQ', {
header: 'Region Weekly Sales Amount NQ',
cell: (info) => info.getValue().toLocaleString()
}),
columnHelper.accessor('regionWeeklyQuantitySoldNQ', {
header: 'Region Weekly Quantity Sold NQ',
cell: (info) => info.getValue().toLocaleString()
}),
columnHelper.accessor('regionWeeklyMedianHQ', {
header: 'Region Weekly Median HQ',
cell: (info) => info.getValue().toLocaleString()
}),
columnHelper.accessor('regionWeeklyAverageHQ', {
header: 'Region Weekly Average HQ',
cell: (info) => info.getValue().toLocaleString()
}),
columnHelper.accessor('regionWeeklySalesAmountHQ', {
header: 'Region Weekly Sales Amount HQ',
cell: (info) => info.getValue().toLocaleString()
}),
columnHelper.accessor('regionWeeklyQuantitySoldHQ', {
header: 'Region Weekly Quantity Sold HQ',
cell: (info) => info.getValue().toLocaleString()
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider refactoring column definitions to reduce code duplication

The new column accessors added to columnHelper have repetitive structures. To improve maintainability and reduce potential for errors, consider programmatically generating these columns.

@cohenaj194 cohenaj194 merged commit dd55151 into master Sep 22, 2024
4 of 5 checks passed
@cohenaj194 cohenaj194 deleted the reselling-region-stats branch September 22, 2024 15:47
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