Skip to content

refactor(match2): grid-based matchsummary to widget3#7772

Open
ElectricalBoy wants to merge 19 commits into
mainfrom
matchsummary-grid-widget3
Open

refactor(match2): grid-based matchsummary to widget3#7772
ElectricalBoy wants to merge 19 commits into
mainfrom
matchsummary-grid-widget3

Conversation

@ElectricalBoy

@ElectricalBoy ElectricalBoy commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

How did you test this change?

dev in AoE / LoL

@ElectricalBoy ElectricalBoy force-pushed the matchsummary-grid-widget3 branch from 0e9b719 to fca500f Compare July 6, 2026 00:59
@ElectricalBoy ElectricalBoy marked this pull request as ready for review July 6, 2026 02:43
@ElectricalBoy ElectricalBoy requested review from a team as code owners July 6, 2026 02:43
@Rathoz Rathoz requested a review from Copilot July 6, 2026 07:43
---@param defaultProps P
---@return Component<P>
---@overload fun(implProps: MatchSummaryGameRowComponentImpl): Component<MatchSummaryGameRowProps>
function MatchSummaryGameRow.createComponent(implProps, defaultProps)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does the "impl" stand for?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

implementation

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors match summary rendering to the Widget3 component model by converting the shared GameRow implementation to a component factory and updating multiple wiki-specific MatchSummary.lua modules to use the new createComponent API.

Changes:

  • Converted Widget/Match/Summary/GameRow from a class-based widget to a Widget3 component factory (createComponent) with an impl table.
  • Updated multiple game wikis’ MatchSummary implementations to use GameRow.createComponent and the new static helpers (mapDisplay, lengthDisplay, scoreDisplay).
  • Tightened/standardized CSS prop typing via HtmlStyleProps and updated HTML widget usage (Html/AllHtml) where touched.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
lua/wikis/valorant/MatchSummary.lua Migrates Valorant match summary row to GameRow.createComponent and Widget3 return types.
lua/wikis/rainbowsix/MatchSummary.lua Migrates Rainbow Six match summary row to GameRow.createComponent and Widget3 return types.
lua/wikis/overwatch/MatchSummary.lua Migrates Overwatch match summary row to GameRow.createComponent and Widget3 return types.
lua/wikis/mobilelegends/MatchSummary.lua Migrates Mobile Legends match summary row to GameRow.createComponent and Widget3 return types.
lua/wikis/leagueoflegends/MatchSummary.lua Migrates LoL match summary row to GameRow.createComponent and Widget3 return types.
lua/wikis/identityv/MatchSummary.lua Migrates IdentityV match summary row to GameRow.createComponent and Widget3 return types.
lua/wikis/honorofkings/MatchSummary.lua Migrates HoK match summary row to GameRow.createComponent and Widget3 return types.
lua/wikis/dota2/MatchSummary.lua Migrates Dota 2 match summary row to GameRow.createComponent and Widget3 return types.
lua/wikis/deadlock/MatchSummary.lua Migrates Deadlock match summary row to GameRow.createComponent and Widget3 return types.
lua/wikis/counterstrike/MatchSummary.lua Updates Counter-Strike row override to the new scoreDisplay calling convention.
lua/wikis/ageofempires/MatchSummary.lua Migrates AoE match summary row to GameRow.createComponent and Html module usage.
lua/wikis/commons/Widget/Match/Summary/GameRow.lua Core refactor: introduces createComponent, moves helpers to static functions, updates rendering to Widget3.
lua/wikis/commons/Widget/Match/Summary/GameCenter.lua Updates CSS prop typing to HtmlStyleProps.
lua/wikis/commons/Widget/Component.lua Introduces HtmlStyleProps alias for consistent CSS typing.
Comments suppressed due to low confidence (5)

lua/wikis/overwatch/MatchSummary.lua:43

  • Returning a table literal here can create a non-array table when optional widgets (Mvp/CharacterBanTable) return nil. MatchSummary/Base later calls WidgetUtil.collect on the result; if the table has gaps, Array.isArray() is false and rendering can break. Build the list without gaps (e.g., start with {GamesContainer} and append optional elements via table.insert).
	return {
		MatchSummaryWidgets.GamesContainer{
			children = Array.map(match.games, function (game, gameIndex)
				if Logic.isEmpty(game.map) then
					return

lua/wikis/mobilelegends/MatchSummary.lua:54

  • Returning a table literal here can create a non-array table when optional widgets (Mvp/CharacterBanTable) return nil. MatchSummary/Base later passes createBody() into WidgetUtil.collect; if Array.isArray() is false due to gaps, the raw table is inserted and can break rendering. Build the body list incrementally (table.insert) so nil entries are skipped and the result remains a proper array.
	return {
		MatchSummaryWidgets.GamesContainer{
			children = Array.map(match.games, function (game, gameIndex)
				if Logic.isEmpty(game.length) and Logic.isEmpty(game.winner) and not hasCharacterData(game) then
					return

lua/wikis/identityv/MatchSummary.lua:50

  • Returning a table literal here can create a non-array table when optional widgets (Mvp/MapVeto/CharacterBanTable) return nil. MatchSummary/Base later wraps the body via WidgetUtil.collect; if Array.isArray() is false due to gaps, the raw table is inserted and can break rendering. Build the body list incrementally (table.insert) so nil entries are skipped and the result remains a proper array.
	return {
		MatchSummaryWidgets.GamesContainer{
			children = Array.map(match.games, function (game, gameIndex)
				if not game.map and not CustomMatchSummary.hasScores(game) then
					return

lua/wikis/honorofkings/MatchSummary.lua:54

  • Returning a table literal here can create a non-array table when optional widgets (Mvp/CharacterBanTable) return nil. MatchSummary/Base later passes this into WidgetUtil.collect; if Array.isArray() is false due to gaps, the raw table is inserted and can break rendering. Build the body list without gaps (e.g., start with {GamesContainer} and append optional elements via table.insert).
	return {
		MatchSummaryWidgets.GamesContainer{
			children = Array.map(match.games, function (game, gameIndex)
				if Logic.isEmpty(game.length) and Logic.isEmpty(game.winner) and not hasCharacterData(game) then
					return

lua/wikis/deadlock/MatchSummary.lua:50

  • Returning a table literal here can create a non-array table when optional widgets (CharacterBanTable) return nil. MatchSummary/Base later passes this into WidgetUtil.collect; if Array.isArray() is false due to gaps, the raw table is inserted and can break rendering. Build the body list without gaps (e.g., start with {GamesContainer} and append optional elements via table.insert).
	return {
		MatchSummaryWidgets.GamesContainer{
			children = Array.map(match.games, function (game, gameIndex)
				if game.status == STATUS_NOT_PLAYED then
					return

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +37 to 41
return {
MatchSummaryWidgets.GamesContainer{
gridLayout = 'standard',
children = Array.map(match.games, function (game, gameIndex)
if Logic.isEmpty(game.map) then
return
Comment on lines +66 to 70
return {
MatchSummaryWidgets.GamesContainer{
gridLayout = 'standard',
children = Array.map(match.games, function (game, gameIndex)
if Logic.isEmpty(game.map) then
return
Comment on lines +40 to 44
return {
MatchSummaryWidgets.GamesContainer{
gridLayout = 'standard',
children = Array.map(match.games, function (game, gameIndex)
if game.status == STATUS_NOT_PLAYED then
return
Comment on lines +40 to 44
return {
MatchSummaryWidgets.GamesContainer{
gridLayout = 'standard',
children = Array.map(match.games, function (game, gameIndex)
if game.status == STATUS_NOT_PLAYED then
return
Comment on lines +118 to +126
function GameRowComponentImpl._createOpponentDisplay(game, opponentId)
local flipped = opponentId == 1
return Array.map(
Array.sortBy(
Array.filter(self.props.game.opponents[opponentId].players, Table.isNotEmpty),
Array.filter(game.opponents[opponentId].players, Table.isNotEmpty),
Operator.property('index')
),
function (player)
return self:_createParticipant(player, flipped)
return GameRowComponentImpl._createParticipant(player, flipped)
Comment on lines +161 to 162
return GameRowComponentImpl._createOpponentDisplay(props.game, opponentIndex)
end
Comment on lines +67 to +70
---@param props MatchSummaryGameRowProps
---@param opponentIndex integer
---@return Widget
function DeadlockMatchSummaryGameRow:createGameOpponentView(opponentIndex)
local props = self.props
---@return VNode
function GameRowComponentImpl.createGameOpponentView(props, opponentIndex)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants