Skip to content

refactor/dedupe history row details - #35

Open
tkitsunai wants to merge 3 commits into
nemasu:masterfrom
tkitsunai:refactor/dedupe-history-row-details
Open

refactor/dedupe history row details#35
tkitsunai wants to merge 3 commits into
nemasu:masterfrom
tkitsunai:refactor/dedupe-history-row-details

Conversation

@tkitsunai

Copy link
Copy Markdown
Contributor

Summary

  • Mobile and desktop layouts each had an identical Collapse-expanded
    match detail table (including the opponent_id === "0" branching).
    Extracted it into a shared MatchDetailTable component used by both.
  • 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 visual/behavior change.

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.
@nemasu

nemasu commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Hello,

I looked this over and have 1 suggestion:

opponent_id === "0" was used for hidden/redacted opponents. That behavior was removed from the backend when we switched to game-provided ratings, so the current history endpoint no longer outputs this.

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.
@tkitsunai

Copy link
Copy Markdown
Contributor Author

Hello. I sincerely apologize for the delay in responding.

Following the proposal, I removed the function that checked whether opponent_id was 0 (which utilized the isByeMatch function) and consolidated the branching logic. As a result of this consolidation, opponent_id is no longer referenced.

Thank you very much.

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