-
Notifications
You must be signed in to change notification settings - Fork 238
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" #2626
Conversation
This reverts commit dd6dac4.
WalkthroughThis pull request involves a comprehensive cleanup and simplification of non-stacking buff functionality across multiple files in the Genshin Optimizer project. The changes primarily focus on removing the Changes
Possibly related PRs
Suggested Labels
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 14:54:09 UTC 2025] - Deployed f2a6017 to https://genshin-optimizer-prs.github.io/pr/2626/frontend (Takes 3-5 minutes after this completes to be available) [frontend] [Sun Jan 26 17:39:11 UTC 2025] - Deployed 20a75b8 to https://genshin-optimizer-prs.github.io/pr/2626/frontend (Takes 3-5 minutes after this completes to be available) [Sun Jan 26 17:42:12 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: 0
🧹 Nitpick comments (2)
libs/gi/wr/src/type.d.ts (1)
182-182
: Consider using a more explicit type definition.The current type definition might be simplified further:
- teamBuff?: Input & { tally?: NodeData } + teamBuff?: Input & { tally?: NodeData<T> }This change would make the generic type parameter
T
consistent throughout the interface.libs/gi/wr/src/api.ts (1)
249-249
: Refactor assignment for better readability.The current code combines assignment with expression evaluation, which could be confusing.
- const base = path[0] === 'tally' ? ((path = path.slice(1)), tally) : input + let base = input + if (path[0] === 'tally') { + path = path.slice(1) + base = tally + }This change:
- Separates the assignment from the expression
- Makes the code more readable
- Addresses the static analysis warning
🧰 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)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
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/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)
🔇 Additional comments (7)
libs/gi/sheets/src/Artifacts/NoblesseOblige/index.tsx (3)
3-4
: LGTM! Code simplification improves readability.The changes simplify the logic by using direct comparison functions and removing string-based comparisons, making the code more maintainable.
Also applies to: 15-19
Line range hint
21-29
: LGTM! Simplified teamBuff structure.The removal of non-stacking buff functionality from the teamBuff object aligns with the PR objectives.
Line range hint
31-55
: LGTM! Sheet object structure maintained.The sheet object structure remains clean and functionally equivalent after the changes.
libs/gi/sheets/src/SheetUtil.tsx (1)
8-13
: LGTM! Clean removal of non-stacking functionality.The removal of non-stacking buff related code simplifies the module while maintaining its core functionality.
libs/gi/wr/src/api.ts (1)
24-24
: LGTM! Simplified imports and error handling.The removal of non-stacking related code and the updated error message improve code clarity.
Also applies to: 44-47
libs/gi/ui/src/components/FieldDisplay.tsx (1)
132-132
: Verify the UI feedback for buff stacking.The removal of the
strikethrough
property changes how buff stacking is visually represented to users. Please ensure that users can still understand when buffs are not stacking through other visual cues or tooltips.✅ Verification successful
Buff stacking visualization is well-implemented through alternative visual cues
The removal of the
strikethrough
property is adequately compensated by a comprehensive set of visual indicators:
- Color-coded differences (green for positive, red for negative changes)
- Explicit numerical comparisons with +/- signs
- Tooltips showing detailed comparison values
- Percentage differences for significant values
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining visual indicators or tooltips related to buff stacking # Search for any remaining UI elements that might indicate buff stacking rg -i "stack|buff" --type tsx --type ts # Search for any tooltip text that might explain buff stacking ast-grep --pattern 'title={$_}'Length of output: 103
Script:
#!/bin/bash # Search for buff/stack related code in TypeScript files rg -i "stack|buff" --type ts --type typescript --type tsx # Look for visual feedback mechanisms in FieldDisplay component fd "FieldDisplay" --type f --exec cat {} # Search for tooltip or visual indicator related code rg -i "tooltip|title=|className|style" --type ts --type typescript --type tsx -g "FieldDisplay*"Length of output: 16152
libs/gi/wr/src/formula.ts (1)
607-607
: Verify buff calculations after removing non-stacking logic.The removal of non-stacking buff functionality changes how buffs are calculated. Please ensure that:
- All buff calculations still work correctly without the non-stacking logic
- The game mechanics remain accurate
- There are no unintended buff stacking effects
✅ Verification successful
Buff calculations verified and working correctly after non-stacking removal
The current implementation maintains proper buff calculations through:
- Clean additive accumulation of similar bonuses
- Correct multiplicative interactions between different bonus types
- Proper handling of base stats, modifiers, and total calculations
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining references to non-stacking buffs and verify buff calculations # Search for any remaining references to non-stacking buffs rg -i "nonstack|no4" --type ts # Check for buff-related calculations ast-grep --pattern 'function $_(buff, $_) { $$$ }'Length of output: 1449
Script:
#!/bin/bash # Get the implementation of exported symbols and buff calculations ast-grep --pattern 'function customBonus($$$) { $$$ }' ast-grep --pattern 'const customBonus = $_' # Check the complete file content to understand the context cat libs/gi/wr/src/formula.ts # Find usages of these exports rg -l "import.*\{.*(customBonus|tally|target).*\} from.*formula" --type tsLength of output: 21414
Reverts #2592
Summary by CodeRabbit
Release Notes
Refactor
nonStacking
functionality across multiple componentsBug Fixes
strikethrough
property from field displaysThe changes primarily focus on cleaning up and streamlining the codebase by removing non-essential functionality and simplifying type definitions.