refactor/dedupe history row details - #35
Open
tkitsunai wants to merge 3 commits into
Open
Conversation
Mobile and desktop layouts each had an identical Collapse-expanded match detail table (opponent_id === "0" branching included). Extract it into a shared MatchDetailTable component used by both.
…yRow Repeated `opponent_id === "0"` checks (3x) and a duplicated rating-change sign calculation (2x) made the branching intent hard to read. Extracted into named `isByeMatch`/`formatRatingChange` helpers, no behavior change.
Owner
|
Hello, I looked this over and have 1 suggestion:
Since this component is being refactored, could we remove these special-case branches instead of extracting them into isByeMatch? “Bye” is also not what 0 originally meant. |
Removed the function that checked whether `opponent_id` was 0 (which utilized `isByeMatch`) and consolidated the branching logic; the code no longer references `opponent_id` as a result of this consolidation. This change assumes that, due to backend API specification updates, `opponent_id` is guaranteed not to be 0.
Contributor
Author
|
Hello. I sincerely apologize for the delay in responding. Following the proposal, I removed the function that checked whether Thank you very much. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
match detail table (including the
opponent_id === "0"branching).Extracted it into a shared
MatchDetailTablecomponent used by both.opponent_id === "0"checks (3x) and a duplicatedrating-change sign calculation (2x) made the branching intent hard
to read. Extracted into named
isByeMatch/formatRatingChangehelpers.
No visual/behavior change.