Skip to content

docs(tradable): explain component check#858

Open
Clarity-89 wants to merge 6 commits intoWFCD:masterfrom
Clarity-89:fix/tradable-status
Open

docs(tradable): explain component check#858
Clarity-89 wants to merge 6 commits intoWFCD:masterfrom
Clarity-89:fix/tradable-status

Conversation

@Clarity-89
Copy link

@Clarity-89 Clarity-89 commented Feb 12, 2026

And a comment to clarify how the tradable status is computed.

Considerations

  • Does this contain a new dependency? [No]
  • Does this introduce opinionated data formatting or manual data entry? [No]
  • Does this pr include updated data files in a separate commit that can be reverted for a clean code-only pr? [No]
  • Have I run the linter? [Yes]
  • Is is a bug fix, feature request, or enhancement? [Bug Fix]

Summary by CodeRabbit

  • Documentation
    • Added clarification on item tradability mechanics and how configuration overrides are applied.

…items

The tradableConditions function was blocking all Prime items with
weapon/warframe types (Rifle, Pistol, Melee, Warframe, etc.), making
148 Prime items incorrectly untradable. Most of these (143) have
tradable components and represent tradable sets.

Replace the blanket block with a three-layer approach:
1. Explicit override map for edge cases (Baro weapons, quest-locked items)
2. Component-based detection as the default fallback
3. Items with no tradable components remain untradable (Founders items)

Also simplifies the Wraith regex from Wraith\w|\wWraith to just Wraith,
which properly matches item names with spaces (e.g. "Strun Wraith").

Adds 25 unit tests for the tradable function covering all cases.
@Clarity-89 Clarity-89 requested a review from a team as a code owner February 12, 2026 10:26
@Clarity-89 Clarity-89 requested a review from TobiTenno February 12, 2026 10:26
@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

📝 Walkthrough

Walkthrough

Changes introduce explicit tradability overrides for built Prime items through a builtPrimeOverrides mapping and revise the tradableConditions function logic. Priority order: check override status, then apply specific Prime overrides for Gotva, Galariak, and Sagek Prime, then fall back to component-based tradability checks.

Changes

Cohort / File(s) Summary
Tradability Logic Enhancement
build/tradable.mjs
Adds builtPrimeOverrides mapping for quest-locked Prime variants; revises tradableConditions function to prioritize explicit overrides before component-based tradability checks, affecting control flow for Prime items.
Test Suite
test/tradable.spec.mjs
Comprehensive test suite validating tradability across item categories: standard Prime frames/weapons with tradable components, Founders-exclusive items, override scenarios, special Prime types (Dual Pistols, Sentinel), non-Prime items, and type-based checks (mods, arcanes, relics, glyphs, skins, exalted weapons).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Prime items now trade without a fret,
Overrides sort each Prime asset,
Gotva, Galariak, Sagek align,
Components and logic combine,
Tests ensure the path is true! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title states 'docs(tradable): explain component check' but the PR is actually a bug fix that replaces blanket Prime item blocks with component-based tradability logic and explicit overrides—not a documentation change. Update the title to reflect the actual change, such as 'fix(tradable): use component check for Prime item tradability' or similar to accurately describe the logic modification.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Update JSDoc to use plain Object types instead of import() syntax
to satisfy valid-jsdoc rule. Remove Wraith name-match test that was
left over after reverting the Wraith regex change.
Comment on lines 16 to 20
const builtPrimeOverrides = {
'Gotva Prime': true,
'Galariak Prime': false,
'Sagek Prime': false,
};
Copy link
Member

@TobiTenno TobiTenno Feb 12, 2026

Choose a reason for hiding this comment

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

If you're making an override, move it out of code and into a config file, and use the unique names, not the localized name.

Copy link
Member

Choose a reason for hiding this comment

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

this is also not exhaustive of all baro prime weapons, and should probably use something on the item, like either a drop source or add that it's a baro weapon in the weapon overrides, and key off of that, instead of making an explicit list of tradable weapons, because that requires an extra PR to add to this specific list, and adding to configs is a bit more straightforward

Clarity-89 and others added 3 commits February 13, 2026 08:37
Revert component-check approach per review feedback. Built Prime items
are not directly tradable; only their parts are. Components get their
own tradable flag. To determine if a Prime set is tradable, check
item.components for parts with tradable: true.
@TobiTenno TobiTenno enabled auto-merge (squash) February 13, 2026 21:45
@Clarity-89 Clarity-89 changed the title fix(tradable): use component check docs(tradable): explain component check Feb 14, 2026
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.

2 participants

Comments