feat: exalted weapons on webui #644
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "web-exalted"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #478
Walkthrough
The pull request introduces changes to support special items and exalted weapons across multiple files in the codebase. The modifications include adding a new
SpecialItem
type to theItemType
enum, updating thesellController
to handle special items, creating anaddSpecialItem
function in the inventory service, and enhancing thegetItemListsController
to include exalted weapons information. The web interface (index.html
andscript.js
) has been updated to display and manage exalted weapons, providing users with more detailed inventory interaction capabilities.Assessment against linked issues
The changes provide a foundation for handling frame-specific weapons, but the full implementation of XP transfer or automatic leveling is not definitively demonstrated in the provided diff. While the infrastructure for managing special and exalted items has been established, the specific mechanics of leveling frame-specific weapons remain unclear and would require additional review or implementation details.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
❤️ Share
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
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.
@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.
@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 generate docstrings
to generate docstrings for this PR. (Beta)@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
@coderabbitai ignore
anywhere in the PR description to prevent this PR from being reviewed.@coderabbitai summary
to generate the high-level summary at a specific location in the PR description.@coderabbitai
anywhere in the PR title to generate the title automatically.Documentation and Community
Actionable comments posted: 2
🧹 Nitpick comments (6)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between
4d1bbff99e
and1184d18244
.📒 Files selected for processing (8)
src/controllers/api/sellController.ts
(1 hunks)src/controllers/custom/addItemController.ts
(2 hunks)src/controllers/custom/getItemListsController.ts
(3 hunks)src/helpers/customHelpers/addItemHelpers.ts
(1 hunks)src/services/inventoryService.ts
(2 hunks)src/types/sellTypes.ts
(1 hunks)static/webui/index.html
(2 hunks)static/webui/script.js
(1 hunks)🧰 Additional context used
🪛 Biome (1.9.4)
src/controllers/custom/addItemController.ts
[error] 22-22: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.
The declaration is defined in this switch clause:
Unsafe fix: Wrap the declaration in a block.
(lint/correctness/noSwitchDeclarations)
🪛 eslint
static/webui/script.js
[error] 544-544: '$' is not defined.
(no-undef)
🔇 Additional comments (9)
static/webui/script.js (3)
455-469
: Verify safe access toexalted
property.Before accessing
itemMap[item.ItemType].exalted
, consider verifyingitemMap[item.ItemType]
is defined. Otherwise, ifitemMap
lacks an entry for theItemType
, it could result in a runtime error.524-565
: Evaluate jQuery “$ is not defined” lint error and factor out repeated post logic.• The static analysis hint indicates a potential
'no-undef'
for$
. Ensure that the environment or bundler properly includes jQuery or that$
is declared globally.• The logic to add special items, inside the
revalidateAuthz
callback, appears in multiple places. Factor it out into a single helper to avoid duplication and clarify how special items get added.🧰 Tools
🪛 eslint
[error] 544-544: '$' is not defined.
(no-undef)
566-569
: Hide the Exalted Weapons card in an explicit manner.This effectively hides the card when no exalted weapons are available. The approach is fine, but consider toggling classes instead of directly manipulating the style property for consistency with other UI parts.
src/types/sellTypes.ts (1)
10-10
: Addition ofSpecialItems
key looks consistent.Allowing
SpecialItems
in theISellRequest
interface aligns perfectly with the structure for other item categories. No issues noted.src/controllers/custom/addItemController.ts (1)
4-4
: Import statement looks correct.Importing
addSpecialItem
from theinventoryService
is appropriately scoped and consistent with the usage in this file.src/controllers/api/sellController.ts (1)
48-52
: Good integration of special items into sell logic.This matches the existing pattern for removing items from arrays like
Suits
,LongGuns
, etc. Ensure that test coverage includes removing special items to confirm intended functionality.src/services/inventoryService.ts (1)
32-32
: ImportingEquipmentFeatures
is consistent.Pivoting to typed features such as
DOUBLE_CAPACITY
is a clean approach to track item capabilities in a strongly typed ecosystem.src/helpers/customHelpers/addItemHelpers.ts (1)
5-6
: LGTM! Clean enum extension.The addition of
SpecialItem
to theItemType
enum is well-integrated and maintains type safety through the existing validation functions.static/webui/index.html (1)
150-157
: LGTM! Consistent table structure.The exalted weapons table follows the same structure as other tables in the file, maintaining consistency in the UI.
⚠️ Potential issue
Add null check for exalted items.
The code assumes that either
ExportWeapons[element]
orExportSentinels[element]
exists. Add a null check to prevent potential runtime errors.Apply this fix:
⚠️ Potential issue
Fix the duplicate-check logic in
addSpecialItem
.Current check:
This unintentionally adds the new item if there is at least one differently named item in
SpecialItems
. Instead, you likely want to verify none of the existing items matchitemName
. For instance:Actionable comments posted: 1
🧹 Nitpick comments (1)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between
1184d18244
and603c98e348
.📒 Files selected for processing (1)
src/services/inventoryService.ts
(2 hunks)🔇 Additional comments (1)
src/services/inventoryService.ts (1)
32-32
: LGTM!The import statement correctly includes
EquipmentFeatures
which is used in theaddSpecialItem
function.⚠️ Potential issue
Fix the duplicate check logic
The current logic is incorrect and will add duplicate items. The condition:
will add the item if ANY existing item has a different name, rather than preventing duplicates.
Fix the logic by replacing it with:
This is wrong, e.g. Titania has 2 exalted weapons (arch-gun & arch-melee).
@coderabbitai resolve
@coderabbitai pause
@Sainan: All set!
✅ Actions performed
Comments resolved.
Reviews paused.
looks better now?
As far as I can tell, it is not possible to sell exalted weapons, so this doesn't seem needed.
Exalted Weapons don't appear in your inventory on live, so it should be impossible to sell them without selling the Warframe itself.
I'm having my doubts that even selling the warframe would sell the exalted weapon as multiples of the same warframe use the same exalted weapon.
I added this to be able to get rid of duplicates via web
Getting duplicates was a bug which has now been fixed (#645).
Pull request closed