-
Notifications
You must be signed in to change notification settings - Fork 240
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
Revert "Add non-stacking buff back to NO4 in a smarter way" #2629
Conversation
This reverts commit dd6dac4.
WalkthroughThis pull request introduces significant changes to the handling of non-stacking buffs and artifact set effects across multiple libraries. The modifications primarily involve removing Changes
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
[frontend] [Sun Jan 26 17:46:10 UTC 2025] - Deployed 447f85b to https://genshin-optimizer-prs.github.io/pr/2629/frontend (Takes 3-5 minutes after this completes to be available) [Sun Jan 26 17:50:41 UTC 2025] - Deleted deployment |
There was a problem hiding this 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
🧹 Nitpick comments (2)
libs/gi/wr/src/api.ts (1)
249-249
: Improve code readability by avoiding assignment in expression.The current code uses assignment within an expression, which can be confusing. Consider restructuring for better readability:
- const base = path[0] === 'tally' ? ((path = path.slice(1)), tally) : input + let base = input + if (path[0] === 'tally') { + path = path.slice(1) + base = tally + }🧰 Tools
🪛 Biome (1.9.4)
[error] 249-249: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.(lint/suspicious/noAssignInExpressions)
libs/gi/ui/src/util/getCalcDisplay.tsx (1)
223-227
: Remove unnecessary Fragment.The Fragment wrapper is redundant as it only contains a single map operation.
- <> {components.map((x, i) => ( <span key={i}>{x}</span> ))} - </>🧰 Tools
🪛 Biome (1.9.4)
[error] 223-227: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment(lint/complexity/noUselessFragments)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
libs/gi/sheets/src/Artifacts/NoblesseOblige/index.tsx
(2 hunks)libs/gi/sheets/src/SheetUtil.tsx
(1 hunks)libs/gi/ui/src/components/FieldDisplay.tsx
(1 hunks)libs/gi/ui/src/util/getCalcDisplay.tsx
(1 hunks)libs/gi/uidata/src/uiData.ts
(0 hunks)libs/gi/wr/src/api.ts
(3 hunks)libs/gi/wr/src/formula.ts
(1 hunks)libs/gi/wr/src/type.d.ts
(2 hunks)
💤 Files with no reviewable changes (1)
- libs/gi/uidata/src/uiData.ts
🧰 Additional context used
🪛 Biome (1.9.4)
libs/gi/wr/src/api.ts
[error] 249-249: The assignment should not be in an expression.
The use of assignments in expressions is confusing.
Expressions are often considered as side-effect free.
(lint/suspicious/noAssignInExpressions)
libs/gi/ui/src/util/getCalcDisplay.tsx
[error] 223-227: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment
(lint/complexity/noUselessFragments)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: lint
🔇 Additional comments (8)
libs/gi/sheets/src/Artifacts/NoblesseOblige/index.tsx (2)
3-4
: LGTM! Import changes improve type safety.The switch to
equal
andgreaterEq
functions provides better type checking compared to string-based comparisons.
15-18
: LGTM! Simplified set4 calculation.The calculation has been simplified while maintaining the same functionality:
- Checks if Noblesse Oblige pieces >= 4
- Applies 20% ATK buff when condition is 'on'
libs/gi/sheets/src/SheetUtil.tsx (1)
8-12
: LGTM! Clean import statements.The removal of
NonStackBuff
type import aligns with the codebase-wide removal of non-stacking buff functionality.libs/gi/wr/src/api.ts (2)
24-24
: LGTM! Simplified imports.The removal of
nonStacking
import aligns with the codebase-wide removal of non-stacking buff functionality.
Line range hint
44-48
: LGTM! Simplified error handling.The error handling has been streamlined to only check for non-existent paths in non-tally cases.
libs/gi/ui/src/components/FieldDisplay.tsx (1)
132-132
: LGTM!The removal of the
strikethrough
property from the destructuring is consistent with the PR's objective of removing non-stacking buff functionality.libs/gi/wr/src/formula.ts (1)
607-607
: LGTM!The removal of
nonStacking
from exports aligns with the PR's objective and doesn't impact other formula calculations.libs/gi/ui/src/util/getCalcDisplay.tsx (1)
223-227
: LGTM!The replacement of Typography with Fragment aligns with the removal of strikethrough functionality.
🧰 Tools
🪛 Biome (1.9.4)
[error] 223-227: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment(lint/complexity/noUselessFragments)
tally?: NodeData<NumNode> | ||
nonStacking?: Record<NonStackBuff, StrNode> | ||
} | ||
teamBuff?: Input & { tally?: NodeData } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Maintain the numeric type constraint for teamBuff.tally
The codebase consistently uses teamBuff.tally
with numeric values (e.g., constant(1)
). Removing the NumNode
type parameter could allow non-numeric nodes, potentially causing runtime errors. The suggested type constraint should be kept:
teamBuff?: Input & { tally?: NodeData<NumNode> }
🔗 Analysis chain
Consider maintaining type safety for the tally
property.
The tally
property type has been changed from NodeData<NumNode>
to just NodeData
, which could potentially allow non-numeric nodes. Consider keeping the numeric type constraint:
- teamBuff?: Input & { tally?: NodeData }
+ teamBuff?: Input & { tally?: NodeData<NumNode> }
🏁 Scripts executed
The following scripts were executed for the analysis:
Error: No shell scripts found
Script:
#!/bin/bash
# Search for usages of teamBuff.tally
rg "teamBuff.*tally" -t typescript -t javascript
# Look for NodeData and NumNode type definitions
ast-grep --pattern 'type NodeData'
ast-grep --pattern 'type NumNode'
ast-grep --pattern 'interface NodeData'
ast-grep --pattern 'interface NumNode'
# Find files that might contain tests related to teamBuff
fd "test|spec" -e ts -e js | grep -i "team.*buff"
Length of output: 293
Script:
#!/bin/bash
# Search for usages of teamBuff.tally with file extensions
rg "teamBuff.*tally" --type-add 'ts:*.{ts,tsx}' --type-add 'js:*.{js,jsx}' -t ts -t js -A 2 -B 2
# Look for NodeData and NumNode definitions and imports
rg "(type|interface) (NodeData|NumNode)" --type-add 'ts:*.{ts,tsx}' -t ts -A 2 -B 2
rg "import.*NodeData.*from" --type-add 'ts:*.{ts,tsx}' -t ts
rg "import.*NumNode.*from" --type-add 'ts:*.{ts,tsx}' -t ts
# Find the specific file we're reviewing to see its imports
fd "type.d.ts" -p "libs/gi/wr/src"
Length of output: 6490
* Add nonstacking to all relevant buffs * fix * dumdum proof * Reapply "Add non-stacking buff back to NO4 in a smarter way (#2592)" (#2629) This reverts commit e8a420a. * Reapply "Fix formula text being janky (#2618)" (#2627) This reverts commit 72d89fb. --------- Co-authored-by: lantua <[email protected]>
Reverts #2592
Summary by CodeRabbit
Release Notes
Refactor
strikethrough
property from display componentsCode Cleanup
These changes represent internal optimizations that do not directly impact end-user functionality.