refactor: extract bracket opponent entry as separate widget#7668
refactor: extract bracket opponent entry as separate widget#7668ElectricalBoy wants to merge 12 commits into
Conversation
|
Smash's custom score container gone? |
There was a problem hiding this comment.
Pull request overview
This PR refactors bracket opponent rendering by removing the legacy OpponentDisplay.BracketOpponentEntry-based implementation and replacing it with widget3 components (Widget/Match/Bracket/OpponentEntry, .../Opponent, .../ScoreContainer, .../Score). It also updates several wikis to either rely on the shared bracket display directly or provide wiki-specific widget overrides.
Changes:
- Introduces widget3 bracket opponent entry + score display components in
commons, and updates the shared bracket display to use them. - Replaces Trackmania/RocketLeague custom
OpponentDisplay+ custom bracket display overrides withWidget/Match/Bracket/ScoreContainer/Custommodules. - Updates Starcraft/Starcraft2 bracket container configuration hooks to inject bracket config (match summary, opponent entry), and simplifies some wiki-specific routing.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| lua/wikis/trackmania/Widget/Match/Bracket/ScoreContainer/Custom.lua | Adds Trackmania widget3 score container to support additional scores/status logic. |
| lua/wikis/trackmania/OpponentDisplay/Custom.lua | Removes legacy Trackmania BracketOpponentEntry override (migrated to widgets). |
| lua/wikis/trackmania/MatchGroup/Display/Bracket/Custom.lua | Removes Trackmania custom bracket container (now uses shared bracket display). |
| lua/wikis/trackmania/Brkts/WikiSpecific.lua | Routes Trackmania bracket container to shared MatchGroup/Display/Bracket. |
| lua/wikis/starcraft2/Widget/Match/Bracket/ScoreContainer/Custom.lua | Adds Starcraft2 score container alias module. |
| lua/wikis/starcraft2/Brkts/WikiSpecific.lua | Adds bracket-container config wrapper (match summary + opponent entry). |
| lua/wikis/starcraft/Widget/Match/Bracket/ScoreContainer/Custom.lua | Adds Starcraft score container alias module. |
| lua/wikis/starcraft/Brkts/WikiSpecific.lua | Adds bracket-container config wrapper (match summary + opponent entry). |
| lua/wikis/smash/MatchGroup/Display/Bracket/Custom.lua | Removes Smash custom bracket display (previously added character/head row). |
| lua/wikis/smash/Brkts/WikiSpecific.lua | Removes Smash matchgroup container override, relying on base routing. |
| lua/wikis/rocketleague/Widget/Match/Bracket/ScoreContainer/Custom.lua | Adds RocketLeague widget3 score container for additional scores. |
| lua/wikis/rocketleague/OpponentDisplay/Custom.lua | Removes legacy RocketLeague BracketOpponentEntry override (migrated to widgets). |
| lua/wikis/rocketleague/MatchGroup/Display/Bracket/Custom.lua | Removes RocketLeague custom bracket container (now uses shared bracket display). |
| lua/wikis/rocketleague/Brkts/WikiSpecific.lua | Simplifies RocketLeague WikiSpecific to just use the base implementation. |
| lua/wikis/commons/Widget/Match/Bracket/ScoreContainer/Starcraft.lua | Adds shared Starcraft-specific score container widget. |
| lua/wikis/commons/Widget/Match/Bracket/ScoreContainer/Custom.lua | Adds shared “Custom” score container passthrough module. |
| lua/wikis/commons/Widget/Match/Bracket/ScoreContainer.lua | Adds shared default score container widget (uses OpponentDisplay.InlineScore*). |
| lua/wikis/commons/Widget/Match/Bracket/Score.lua | Adds widget3 bracket score display component (HTML structure + bolding). |
| lua/wikis/commons/Widget/Match/Bracket/OpponentEntry/Starcraft.lua | Adds Starcraft-specific opponent entry wrapper (faction bg + custom opponent renderer). |
| lua/wikis/commons/Widget/Match/Bracket/OpponentEntry.lua | Adds shared widget3 bracket opponent entry component (highlighting + score container inclusion). |
| lua/wikis/commons/Widget/Match/Bracket/Opponent/Starcraft.lua | Adds Starcraft-specific opponent renderer (teams/players/literals). |
| lua/wikis/commons/Widget/Match/Bracket/Opponent.lua | Adds shared default opponent renderer (teams/players/literals). |
| lua/wikis/commons/OpponentDisplay/Starcraft.lua | Removes legacy Starcraft BracketOpponentEntry class implementation. |
| lua/wikis/commons/OpponentDisplay.lua | Removes legacy BracketOpponentEntry + BracketScore, switches to widget3 Html primitives. |
| lua/wikis/commons/MatchGroup/Display/Helper.lua | Adds addOpponentHighlightToProps helper for widget3 props tables. |
| lua/wikis/commons/MatchGroup/Display/Bracket.lua | Updates shared bracket display to use widget3 OpponentEntry and remove post-call HTML mutations. |
| lua/wikis/commons/Bracket/Template.lua | Updates template bracket container to new blank opponent + widget3 placeholder opponent entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| local function InlineScoreSpecial(score) | ||
| if score == -1 then | ||
| return '' | ||
| elseif score == 0 and Opponent.isTbd(opponent) then | ||
| return '' | ||
| end | ||
| return tostring(score) | ||
| end |
There was a problem hiding this comment.
Lua-Modules/lua/wikis/rocketleague/OpponentDisplay/Custom.lua
Lines 67 to 78 in b8641a6
technically true, but this is consistent with the current behavior
imo okay to leave as-is
intended for several reasons:
|
fwiw smash will cry because of this change |
7d93853 to
fc765c5
Compare
their match1 had a mix of numeric score display and the character display |
Summary
This PR removes
OpponentDisplay.BracketOpponentEntry(and its subclasses), replacing with widget3-based components.How did you test this change?
dev in LoL/sc2/smash