From eec3bc0b5657070beb9de0211d9a8f91a6ad3093 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 14:41:16 +0900 Subject: [PATCH 01/48] adjust type annotations --- lua/wikis/commons/BroadcastTalentTable.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 70ffd359e55..eb44d7db62a 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -40,9 +40,9 @@ local ACHIEVEMENTS_SORT_ORDER = 'weight desc, date desc' local ACHIEVEMENTS_IGNORED_STATUSES = {'cancelled', 'postponed'} local RESULTS_SORT_ORDER = 'date desc' ----@class BroadcastTalentTable ----@operator call():BroadcastTalentTable -local BroadcastTalentTable = Class.new(function(self, ...) self:init(...) end) +---@class BroadcastTalentTable: BaseClass +---@operator call(table): BroadcastTalentTable +local BroadcastTalentTable = Class.new(function(self, args) self:init(args) end) ---@class argsValues ---@field broadcaster string? From 5a037cb1c2d83cda33af1c1dbfc7fd37406fb2d6 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 14:43:51 +0900 Subject: [PATCH 02/48] access modifier --- lua/wikis/commons/BroadcastTalentTable.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index eb44d7db62a..c2713d22897 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -79,6 +79,7 @@ function BroadcastTalentTable.run(frame) return BroadcastTalentTable(Arguments.getArgs(frame)):create() end +---@private ---@param args table function BroadcastTalentTable:_readArgs(args) local isAchievementsTable = Logic.readBool(args.achievements) @@ -105,6 +106,7 @@ function BroadcastTalentTable:_readArgs(args) table.insert(self.aliases, self.broadcaster) end +---@private ---@return string? function BroadcastTalentTable:_getBroadcaster() local title = mw.title.getCurrentTitle() @@ -116,6 +118,7 @@ function BroadcastTalentTable:_getBroadcaster() return title.baseText end +---@private ---@return table[]? function BroadcastTalentTable:_fetchTournaments() local args = self.args @@ -224,6 +227,7 @@ function BroadcastTalentTable:create() :node(display) end +---@private ---@return Html function BroadcastTalentTable:_header() local header = mw.html.create('tr') @@ -241,6 +245,7 @@ function BroadcastTalentTable:_header() return header:tag('th'):wikitext('Partner List'):css('width', '160px'):done() end +---@private ---@param seperatorTitle string|number ---@return Html function BroadcastTalentTable._seperator(seperatorTitle) @@ -248,6 +253,7 @@ function BroadcastTalentTable._seperator(seperatorTitle) :tag('td'):attr('colspan', 42):wikitext(seperatorTitle):done() end +---@private ---@param tournament table ---@return Html function BroadcastTalentTable:_row(tournament) @@ -291,6 +297,7 @@ function BroadcastTalentTable:_row(tournament) return row:tag('td'):node(self:_partnerList(tournament)):done() end +---@private ---@param tournament table ---@return table function BroadcastTalentTable._fetchTournamentData(tournament) @@ -317,6 +324,7 @@ function BroadcastTalentTable._fetchTournamentData(tournament) return Table.merge(queryData[1], tournament) end +---@private ---@param tournament table ---@return string function BroadcastTalentTable:_tournamentDisplayName(tournament) @@ -338,6 +346,7 @@ function BroadcastTalentTable:_tournamentDisplayName(tournament) return displayName .. ' - Showmatch' end +---@private ---@param tournament table ---@return string?, string function BroadcastTalentTable:_tierDisplay(tournament) @@ -351,6 +360,7 @@ function BroadcastTalentTable:_tierDisplay(tournament) return Tier.display(tier, tierType, options), Tier.toSortValue(tier, tierType) end +---@private ---@param tournament table ---@return Html|string function BroadcastTalentTable:_partnerList(tournament) @@ -375,6 +385,7 @@ function BroadcastTalentTable:_partnerList(tournament) :tag('div'):addClass('NavContent broadcast-talent-partner-list'):node(list):done() end +---@private ---@param tournament table ---@return table function BroadcastTalentTable:_getPartners(tournament) @@ -411,6 +422,7 @@ function BroadcastTalentTable:_getPartners(tournament) }) end +---@private ---@param partners table ---@return {id: string, page: string, flag: string}[] function BroadcastTalentTable._removeDuplicatePartners(partners) @@ -419,6 +431,7 @@ function BroadcastTalentTable._removeDuplicatePartners(partners) return Array.extractValues(uniquePartners) end +---@private ---@return Html function BroadcastTalentTable:_footer() local footer = mw.html.create('small') From 78047b3d897335189c37ae60d9a476beb73f2f5d Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 14:45:13 +0900 Subject: [PATCH 03/48] type annotations --- lua/wikis/commons/BroadcastTalentTable.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index c2713d22897..000a697dcaf 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -44,7 +44,7 @@ local RESULTS_SORT_ORDER = 'date desc' ---@operator call(table): BroadcastTalentTable local BroadcastTalentTable = Class.new(function(self, args) self:init(args) end) ----@class argsValues +---@class BroadcastTalentTableArgs ---@field broadcaster string? ---@field aliases string? ---@field showtiertype string|boolean|nil @@ -60,7 +60,7 @@ local BroadcastTalentTable = Class.new(function(self, args) self:init(args) end) ---@field displayPartnerLists string|boolean|nil --- Init function for BroadcastTalentTable ----@param args argsValues +---@param args BroadcastTalentTableArgs ---@return self function BroadcastTalentTable:init(args) self:_readArgs(args) @@ -80,7 +80,7 @@ function BroadcastTalentTable.run(frame) end ---@private ----@param args table +---@param args BroadcastTalentTableArgs function BroadcastTalentTable:_readArgs(args) local isAchievementsTable = Logic.readBool(args.achievements) From 1677b8c0afd755b108ff6bd84d5ff3169aa14946 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 14:50:47 +0900 Subject: [PATCH 04/48] Page.pageifyLink --- lua/wikis/commons/BroadcastTalentTable.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 000a697dcaf..9c6da45dff2 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -100,7 +100,7 @@ function BroadcastTalentTable:_readArgs(args) } local broadcaster = String.isNotEmpty(args.broadcaster) and args.broadcaster or self:_getBroadcaster() - self.broadcaster = broadcaster and mw.ext.TeamLiquidIntegration.resolve_redirect(broadcaster):gsub(' ', '_') or nil + self.broadcaster = Page.pageifyLink(broadcaster) self.aliases = args.aliases and Array.map(mw.text.split(args.aliases:gsub(' ', '_'), ','), String.trim) or {} table.insert(self.aliases, self.broadcaster) From f5436c15a4147d3524e655d0d4e364cb0d29e3ea Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 14:52:50 +0900 Subject: [PATCH 05/48] Array operations --- lua/wikis/commons/BroadcastTalentTable.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 9c6da45dff2..58846357f4e 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -102,8 +102,8 @@ function BroadcastTalentTable:_readArgs(args) local broadcaster = String.isNotEmpty(args.broadcaster) and args.broadcaster or self:_getBroadcaster() self.broadcaster = Page.pageifyLink(broadcaster) - self.aliases = args.aliases and Array.map(mw.text.split(args.aliases:gsub(' ', '_'), ','), String.trim) or {} - table.insert(self.aliases, self.broadcaster) + self.aliases = Array.map(Array.parseCommaSeparatedString(args.aliases), Page.pageifyLink) + Array.appendWith(self.aliases, self.broadcaster) end ---@private From 8352b5acf1b53221cfccefc8653b5ad090a8ebf9 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 14:53:35 +0900 Subject: [PATCH 06/48] type annotation --- lua/wikis/commons/BroadcastTalentTable.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 58846357f4e..ca32ab4c44c 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -42,6 +42,8 @@ local RESULTS_SORT_ORDER = 'date desc' ---@class BroadcastTalentTable: BaseClass ---@operator call(table): BroadcastTalentTable +---@field broadcaster string? +---@field aliases string[] local BroadcastTalentTable = Class.new(function(self, args) self:init(args) end) ---@class BroadcastTalentTableArgs From 35af94dc9700aa94fa5512c0d5e8b71860e71354 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 14:56:00 +0900 Subject: [PATCH 07/48] anyOf --- lua/wikis/commons/BroadcastTalentTable.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index ca32ab4c44c..bd600200604 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -29,6 +29,7 @@ local ConditionNode = Condition.Node local Comparator = Condition.Comparator local BooleanOperator = Condition.BooleanOperator local ColumnName = Condition.ColumnName +local ConditionUtil = Condition.Util local DEFAULT_LIMIT = 500 local DEFAULT_ACHIEVEMENTS_LIMIT = 10 @@ -127,11 +128,7 @@ function BroadcastTalentTable:_fetchTournaments() local conditions = ConditionTree(BooleanOperator.all) - local broadCasterConditions = ConditionTree(BooleanOperator.any) - for _, broadcaster in pairs(self.aliases) do - broadCasterConditions:add{ConditionNode(ColumnName('page'), Comparator.eq, broadcaster)} - end - conditions:add(broadCasterConditions) + conditions:add(ConditionUtil.anyOf(ColumnName('page'), self.aliases)) if args.year then conditions:add{ConditionNode(ColumnName('date_year'), Comparator.eq, args.year)} From cf1fc91b4576235a76c5ed29eed74c14f25967e7 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 14:57:21 +0900 Subject: [PATCH 08/48] simplify condition building --- lua/wikis/commons/BroadcastTalentTable.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index bd600200604..1d5caf8cd90 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -131,15 +131,15 @@ function BroadcastTalentTable:_fetchTournaments() conditions:add(ConditionUtil.anyOf(ColumnName('page'), self.aliases)) if args.year then - conditions:add{ConditionNode(ColumnName('date_year'), Comparator.eq, args.year)} + conditions:add(ConditionNode(ColumnName('date_year'), Comparator.eq, args.year)) else -- mirrors current implementation -- should we change it to use <= instead of < ? (same for >) if args.startDate then - conditions:add{ConditionNode(ColumnName('date'), Comparator.gt, args.startDate)} + conditions:add(ConditionNode(ColumnName('date'), Comparator.gt, args.startDate)) end if args.endDate then - conditions:add{ConditionNode(ColumnName('date'), Comparator.lt, args.endDate)} + conditions:add(ConditionNode(ColumnName('date'), Comparator.lt, args.endDate)) end end From 6cf0bc853b3e96739c582e7b374099658e1dcb37 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 14:59:10 +0900 Subject: [PATCH 09/48] noneOf --- lua/wikis/commons/BroadcastTalentTable.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 1d5caf8cd90..7a17983dc5c 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -144,9 +144,7 @@ function BroadcastTalentTable:_fetchTournaments() end if args.isAchievementsTable then - Array.forEach(ACHIEVEMENTS_IGNORED_STATUSES, function(ignoredStatus) - conditions:add{ConditionNode(ColumnName('extradata_status'), Comparator.neq, ignoredStatus)} - end) + conditions:add(ConditionUtil.noneOf(ColumnName('extradata_status'), ACHIEVEMENTS_IGNORED_STATUSES)) end -- double the limit for the query due to potentional merging of results further down the line From f7161cfd161e9e76493792a1a7b4b8f5067d6030 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 15:00:19 +0900 Subject: [PATCH 10/48] spelling --- lua/wikis/commons/BroadcastTalentTable.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 7a17983dc5c..4c17b78dce0 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -147,7 +147,7 @@ function BroadcastTalentTable:_fetchTournaments() conditions:add(ConditionUtil.noneOf(ColumnName('extradata_status'), ACHIEVEMENTS_IGNORED_STATUSES)) end - -- double the limit for the query due to potentional merging of results further down the line + -- double the limit for the query due to potential merging of results further down the line local queryLimit = args.limit * 2 local queryData = mw.ext.LiquipediaDB.lpdb('broadcasters', { From ffb01309f5998a50cfc6eb5ad3e07a0392235be8 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 15:17:15 +0900 Subject: [PATCH 11/48] Array.forEach --- lua/wikis/commons/BroadcastTalentTable.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 4c17b78dce0..66186e6f492 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -163,18 +163,18 @@ function BroadcastTalentTable:_fetchTournaments() local tournaments = {} local pageNames = {} - for _, tournament in pairs(queryData) do - tournament.extradata = tournament.extradata or {} - if not pageNames[tournament.pagename] or Logic.readBool(tournament.extradata.showmatch) then - tournament.positions = {tournament.position} - table.insert(tournaments, tournament) - if not Logic.readBool(tournament.extradata.showmatch) then - pageNames[tournament.pagename] = tournament + Array.forEach(queryData, function (record) + record.extradata = record.extradata or {} + if not pageNames[record.pagename] or Logic.readBool(record.extradata.showmatch) then + record.positions = {record.position} + table.insert(tournaments, record) + if not Logic.readBool(record.extradata.showmatch) then + pageNames[record.pagename] = record end else - table.insert(pageNames[tournament.pagename].positions, tournament.position) + table.insert(pageNames[record.pagename].positions, record.position) end - end + end) tournaments = Array.sub(tournaments, 1, args.limit) From 82ff417a17ab0f369c8577b83a3e3a5a92177fe5 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 15:21:31 +0900 Subject: [PATCH 12/48] type annotation --- lua/wikis/commons/BroadcastTalentTable.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 66186e6f492..f1b9845268d 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -41,6 +41,15 @@ local ACHIEVEMENTS_SORT_ORDER = 'weight desc, date desc' local ACHIEVEMENTS_IGNORED_STATUSES = {'cancelled', 'postponed'} local RESULTS_SORT_ORDER = 'date desc' +---@class EnrichedBroadcast +---@field date string +---@field pagename string +---@field parent string +---@field position string +---@field positions string[] +---@field language string +---@field extradata table + ---@class BroadcastTalentTable: BaseClass ---@operator call(table): BroadcastTalentTable ---@field broadcaster string? @@ -161,9 +170,14 @@ function BroadcastTalentTable:_fetchTournaments() return end + ---@type EnrichedBroadcast[] local tournaments = {} + + ---@type table local pageNames = {} + Array.forEach(queryData, function (record) + ---@cast record EnrichedBroadcast record.extradata = record.extradata or {} if not pageNames[record.pagename] or Logic.readBool(record.extradata.showmatch) then record.positions = {record.position} From 3520c1d1a95e28fad7e4c02476e60404036ce2ae Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 15:32:11 +0900 Subject: [PATCH 13/48] use executeMassQuery --- lua/wikis/commons/BroadcastTalentTable.lua | 28 ++++++++++------------ 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index f1b9845268d..0f2ea6618a5 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -15,6 +15,7 @@ local Game = Lua.import('Module:Game') local HighlightConditions = Lua.import('Module:HighlightConditions') local LeagueIcon = Lua.import('Module:LeagueIcon') local Logic = Lua.import('Module:Logic') +local Lpdb = Lua.import('Module:Lpdb') local Namespace = Lua.import('Module:Namespace') local Operator = Lua.import('Module:Operator') local Page = Lua.import('Module:Page') @@ -156,27 +157,20 @@ function BroadcastTalentTable:_fetchTournaments() conditions:add(ConditionUtil.noneOf(ColumnName('extradata_status'), ACHIEVEMENTS_IGNORED_STATUSES)) end - -- double the limit for the query due to potential merging of results further down the line - local queryLimit = args.limit * 2 - - local queryData = mw.ext.LiquipediaDB.lpdb('broadcasters', { - query = 'pagename, parent, date, extradata, language, position', - conditions = conditions:toString(), - order = args.sortBy, - limit = queryLimit, - }) - - if not queryData[1] then - return - end - ---@type EnrichedBroadcast[] local tournaments = {} ---@type table local pageNames = {} - Array.forEach(queryData, function (record) + Lpdb.executeMassQuery('broadcasters', { + query = 'pagename, parent, date, extradata, language, position', + conditions = conditions:toString(), + order = args.sortBy, + }, function (record) + if #tournaments == args.limit then + return false + end ---@cast record EnrichedBroadcast record.extradata = record.extradata or {} if not pageNames[record.pagename] or Logic.readBool(record.extradata.showmatch) then @@ -190,7 +184,9 @@ function BroadcastTalentTable:_fetchTournaments() end end) - tournaments = Array.sub(tournaments, 1, args.limit) + if Logic.isEmpty(tournaments) then + return + end if args.isAchievementsTable then table.sort(tournaments, function(item1, item2) From aea8b44bede08e74d026079caa89926ae09e405c Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 15:32:49 +0900 Subject: [PATCH 14/48] rename var --- lua/wikis/commons/BroadcastTalentTable.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 0f2ea6618a5..fa299a4e38c 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -195,10 +195,9 @@ function BroadcastTalentTable:_fetchTournaments() return {[''] = tournaments} end - local _ - _, tournaments = Array.groupBy(tournaments, function(tournament) return tournament.date:sub(1, 4) end) + local _, tournamentsByYear = Array.groupBy(tournaments, function(tournament) return tournament.date:sub(1, 4) end) - return tournaments + return tournamentsByYear end --- Creates the display From 33a62cdfc5551425075fe2d635ee1a5c84c52169 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 15:33:52 +0900 Subject: [PATCH 15/48] type annotation --- lua/wikis/commons/BroadcastTalentTable.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index fa299a4e38c..bc94f1b8f10 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -132,7 +132,7 @@ function BroadcastTalentTable:_getBroadcaster() end ---@private ----@return table[]? +---@return table? function BroadcastTalentTable:_fetchTournaments() local args = self.args From 842eae6a48a01fdeb561aaab2877e3f38efe3c8b Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 15:37:52 +0900 Subject: [PATCH 16/48] type annotation --- lua/wikis/commons/BroadcastTalentTable.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index bc94f1b8f10..3402cf11c3d 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -260,7 +260,7 @@ function BroadcastTalentTable._seperator(seperatorTitle) end ---@private ----@param tournament table +---@param tournament EnrichedBroadcast ---@return Html function BroadcastTalentTable:_row(tournament) local row = mw.html.create('tr') From beebb5c00e154a4e333e64fe8cf5200124d74b06 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 15:39:00 +0900 Subject: [PATCH 17/48] rename arg --- lua/wikis/commons/BroadcastTalentTable.lua | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 3402cf11c3d..7206fd4cf45 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -260,47 +260,47 @@ function BroadcastTalentTable._seperator(seperatorTitle) end ---@private ----@param tournament EnrichedBroadcast +---@param broadcast EnrichedBroadcast ---@return Html -function BroadcastTalentTable:_row(tournament) +function BroadcastTalentTable:_row(broadcast) local row = mw.html.create('tr') - tournament = BroadcastTalentTable._fetchTournamentData(tournament) + broadcast = BroadcastTalentTable._fetchTournamentData(broadcast) - if HighlightConditions.tournament(tournament, self.args) then + if HighlightConditions.tournament(broadcast, self.args) then row:addClass('tournament-highlighted-bg') end - local tierDisplay, tierSortValue = self:_tierDisplay(tournament) + local tierDisplay, tierSortValue = self:_tierDisplay(broadcast) row - :tag('td'):wikitext(tournament.date):done() + :tag('td'):wikitext(broadcast.date):done() :tag('td'):wikitext(tierDisplay):attr('data-sort-value', tierSortValue):done() if self.args.displayGameIcon then - row:tag('td'):node(Game.icon{game = tournament.game}) + row:tag('td'):node(Game.icon{game = broadcast.game}) end row :tag('td'):wikitext(LeagueIcon.display{ - icon = tournament.icon, - iconDark = tournament.icondark, - series = tournament.series, - date = tournament.date, - link = tournament.pagename, - name = tournament.name, + icon = broadcast.icon, + iconDark = broadcast.icondark, + series = broadcast.series, + date = broadcast.date, + link = broadcast.pagename, + name = broadcast.name, }):done() :tag('td'):css('text-align', 'left'):wikitext(Page.makeInternalLink({}, - self:_tournamentDisplayName(tournament), - tournament.pagename + self:_tournamentDisplayName(broadcast), + broadcast.pagename )):done() - :tag('td'):wikitext(table.concat(tournament.positions, '
')):done() + :tag('td'):wikitext(table.concat(broadcast.positions, '
')):done() if not self.args.displayPartnerListColumn then return row end - return row:tag('td'):node(self:_partnerList(tournament)):done() + return row:tag('td'):node(self:_partnerList(broadcast)):done() end ---@private From b4306c8e3ed8fc44ae232c1fb7a03f3049f31966 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 16:05:51 +0900 Subject: [PATCH 18/48] integrate Tier.parseFromQueryData into StandardTournament --- lua/wikis/commons/Tournament.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/Tournament.lua b/lua/wikis/commons/Tournament.lua index caf2eb2b469..d42b4106e0f 100644 --- a/lua/wikis/commons/Tournament.lua +++ b/lua/wikis/commons/Tournament.lua @@ -14,7 +14,7 @@ local Lpdb = Lua.import('Module:Lpdb') local Logic = Lua.import('Module:Logic') local Page = Lua.import('Module:Page') local Table = Lua.import('Module:Table') -local Tier = Lua.import('Module:Tier/Utils') +local Tier = Lua.import('Module:Tier/Custom') local Tournament = {} @@ -44,6 +44,7 @@ local TOURNAMENT_PHASE = { ---@field featured boolean ---@field status string? ---@field phase TournamentPhase +---@field tierOptions table ---@field extradata table ---@field isHighlighted fun(self: StandardTournament, options?: table): boolean @@ -119,6 +120,7 @@ function Tournament.tournamentFromRecord(record) local extradata = record.extradata or {} local startDate = Tournament.parseDateRecord(Logic.nilOr(extradata.startdatetext, record.startdate)) local endDate = Tournament.parseDateRecord(Logic.nilOr(extradata.enddatetext, record.sortdate, record.enddate)) + local tier, tierType, tierOptions = Tier.parseFromQueryData(record) local tournament = { displayName = Logic.emptyOr(record.tickername, record.name) or record.pagename:gsub('_', ' '), @@ -126,8 +128,8 @@ function Tournament.tournamentFromRecord(record) pageName = record.pagename, startDate = startDate, endDate = endDate, - liquipediaTier = Tier.toIdentifier(record.liquipediatier), - liquipediaTierType = Tier.toIdentifier(record.liquipediatiertype), + liquipediaTier = Tier.toIdentifier(tier), + liquipediaTierType = Tier.toIdentifier(tierType), publisherTier = record.publishertier, region = (record.locations or {}).region1, status = record.status, @@ -135,6 +137,7 @@ function Tournament.tournamentFromRecord(record) iconDark = record.icondark, series = record.series, game = record.game, + tierOptions = tierOptions, extradata = extradata, } From b042d23b4a8c366cf8d8e6ccea768e814c121777 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 16:19:54 +0900 Subject: [PATCH 19/48] make type checker shut up --- lua/wikis/commons/Tournament.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/Tournament.lua b/lua/wikis/commons/Tournament.lua index d42b4106e0f..2f62664f16d 100644 --- a/lua/wikis/commons/Tournament.lua +++ b/lua/wikis/commons/Tournament.lua @@ -33,7 +33,7 @@ local TOURNAMENT_PHASE = { ---@field iconDark string? ---@field series string? ---@field liquipediaTier integer|string|nil ----@field liquipediaTierType integer|string|nil +---@field liquipediaTierType string? ---@field game string? ---@field publisherTier string? @@ -105,7 +105,7 @@ function Tournament.partialTournamentFromMatch(match) fullName = match.tournament, pageName = match.parent, liquipediaTier = Tier.toIdentifier(match.liquipediatier), - liquipediaTierType = Tier.toIdentifier(match.liquipediatiertype), + liquipediaTierType = Tier.toIdentifier(match.liquipediatiertype) --[[ @as string? ]], icon = match.icon, iconDark = match.iconDark, series = match.series, @@ -129,7 +129,7 @@ function Tournament.tournamentFromRecord(record) startDate = startDate, endDate = endDate, liquipediaTier = Tier.toIdentifier(tier), - liquipediaTierType = Tier.toIdentifier(tierType), + liquipediaTierType = Tier.toIdentifier(tierType) --[[ @as string? ]], publisherTier = record.publishertier, region = (record.locations or {}).region1, status = record.status, From 1c2e7ff7dea421e8e3da74022f51ff5d41107e82 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 16:24:56 +0900 Subject: [PATCH 20/48] use StandardTournament --- lua/wikis/commons/BroadcastTalentTable.lua | 87 +++++++--------------- 1 file changed, 26 insertions(+), 61 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 7206fd4cf45..1af58699963 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -21,6 +21,7 @@ local Operator = Lua.import('Module:Operator') local Page = Lua.import('Module:Page') local String = Lua.import('Module:StringUtils') local Table = Lua.import('Module:Table') +local Tournament = Lua.import('Module:Tournament') local Tier = Lua.import('Module:Tier/Custom') @@ -36,7 +37,6 @@ local DEFAULT_LIMIT = 500 local DEFAULT_ACHIEVEMENTS_LIMIT = 10 local NONBREAKING_SPACE = ' ' local DASH = '–' -local DEFAULT_TIERTYPE = 'General' local DEFAULT_ABOUT_LINK = 'Template:Weight/doc' local ACHIEVEMENTS_SORT_ORDER = 'weight desc, date desc' local ACHIEVEMENTS_IGNORED_STATUSES = {'cancelled', 'postponed'} @@ -265,34 +265,43 @@ end function BroadcastTalentTable:_row(broadcast) local row = mw.html.create('tr') - broadcast = BroadcastTalentTable._fetchTournamentData(broadcast) + local tournament = Tournament.getTournament(broadcast.parent) + ---@cast tournament -nil - if HighlightConditions.tournament(broadcast, self.args) then + if tournament:isHighlighted(self.args) then row:addClass('tournament-highlighted-bg') end - local tierDisplay, tierSortValue = self:_tierDisplay(broadcast) + local tierDisplay = Tier.display(tournament.liquipediaTier, tournament.liquipediaTierType, Table.merge( + tournament.tierOptions, + { + link = true, + shortIfBoth = true, + onlyTierTypeIfBoth = self.args.showTierType and String.isNotEmpty(tournament.liquipediaTierType) + } + )) + local tierSortValue = Tier.toSortValue(tournament.liquipediaTier, tournament.liquipediaTierType) row :tag('td'):wikitext(broadcast.date):done() :tag('td'):wikitext(tierDisplay):attr('data-sort-value', tierSortValue):done() if self.args.displayGameIcon then - row:tag('td'):node(Game.icon{game = broadcast.game}) + row:tag('td'):node(Game.icon{game = tournament.game}) end row :tag('td'):wikitext(LeagueIcon.display{ - icon = broadcast.icon, - iconDark = broadcast.icondark, - series = broadcast.series, + icon = tournament.icon, + iconDark = tournament.iconDark, + series = tournament.series, date = broadcast.date, - link = broadcast.pagename, - name = broadcast.name, + link = tournament.pageName, + name = tournament.fullName, }):done() :tag('td'):css('text-align', 'left'):wikitext(Page.makeInternalLink({}, - self:_tournamentDisplayName(broadcast), - broadcast.pagename + self:_tournamentDisplayName(broadcast, tournament), + tournament.pageName )):done() :tag('td'):wikitext(table.concat(broadcast.positions, '
')):done() @@ -304,46 +313,16 @@ function BroadcastTalentTable:_row(broadcast) end ---@private ----@param tournament table ----@return table -function BroadcastTalentTable._fetchTournamentData(tournament) - local queryData = mw.ext.LiquipediaDB.lpdb('tournament', { - conditions = '[[pagename::' .. tournament.parent .. ']] OR [[pagename::' .. tournament.pagename .. ']]', - query = 'name, tickername, icon, icondark, series, game, ' - .. 'liquipediatier, liquipediatiertype, publishertier, extradata', - }) - - local extradata = tournament.extradata or {} - if String.isNotEmpty(extradata.liquipediatier) then - tournament.liquipediatier = extradata.liquipediatier - end - if String.isNotEmpty(extradata.liquipediatiertype) then - tournament.liquipediatiertype = extradata.liquipediatiertype - end - - if type(queryData[1]) ~= 'table' then - return tournament - end - - queryData[1].tournamentExtradata = queryData[1].extradata - - return Table.merge(queryData[1], tournament) -end - ----@private ----@param tournament table +---@param broadcast EnrichedBroadcast +---@param tournament StandardTournament ---@return string -function BroadcastTalentTable:_tournamentDisplayName(tournament) - -- this is not the extradata of the tournament but of the broadcaster (they got merged together) - local extradata = tournament.extradata or {} +function BroadcastTalentTable:_tournamentDisplayName(broadcast, tournament) + local extradata = broadcast.extradata or {} if Logic.readBool(extradata.showmatch) and String.isNotEmpty(extradata.showmatchname) then return extradata.showmatchname end - local displayName = String.isNotEmpty(tournament.tickername) - and self.args.useTickerNames and tournament.tickername - or String.isNotEmpty(tournament.name) and tournament.name - or tournament.parent:gsub('_', ' ') + local displayName = self.args.useTickerNames and tournament.displayName or tournament.fullName if not Logic.readBool(extradata.showmatch) then return displayName @@ -352,20 +331,6 @@ function BroadcastTalentTable:_tournamentDisplayName(tournament) return displayName .. ' - Showmatch' end ----@private ----@param tournament table ----@return string?, string -function BroadcastTalentTable:_tierDisplay(tournament) - local tier, tierType, options = Tier.parseFromQueryData(tournament) - assert(Tier.isValid(tier, tierType), 'Broadcaster event with unset or invalid tier/tiertype: ' .. tournament.pagename) - - options.link = true - options.shortIfBoth = true - options.onlyTierTypeIfBoth = self.args.showTierType and tournament.liquipediatiertype ~= DEFAULT_TIERTYPE - - return Tier.display(tier, tierType, options), Tier.toSortValue(tier, tierType) -end - ---@private ---@param tournament table ---@return Html|string From ae3b2ca6c0bdd04eab4158cb7af7ed639877b6ac Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 16:25:24 +0900 Subject: [PATCH 21/48] type anno --- lua/wikis/commons/BroadcastTalentTable.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 1af58699963..459690ba92c 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -68,7 +68,7 @@ local BroadcastTalentTable = Class.new(function(self, args) self:init(args) end) ---@field displayGameIcon string|boolean|nil ---@field useTickerNames string|boolean|nil ---@field limit string|number|nil ----@field aboutAchievementsLink string|boolean|nil +---@field aboutAchievementsLink string? ---@field onlyHighlightOnValue string? ---@field displayPartnerLists string|boolean|nil From 537141d910fa3a89f36068730351ee39b117f51f Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 16:25:29 +0900 Subject: [PATCH 22/48] emptyOr --- lua/wikis/commons/BroadcastTalentTable.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 459690ba92c..e4af77a5803 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -98,7 +98,7 @@ function BroadcastTalentTable:_readArgs(args) local isAchievementsTable = Logic.readBool(args.achievements) self.args = { - aboutAchievementsLink = args.aboutAchievementsLink or DEFAULT_ABOUT_LINK, + aboutAchievementsLink = Logic.emptyOr(args.aboutAchievementsLink, DEFAULT_ABOUT_LINK), showTierType = Logic.nilOr(Logic.readBoolOrNil(args.showtiertype), true), displayGameIcon = Logic.readBool(args.displayGameIcon), useTickerNames = Logic.readBool(args.useTickerNames), From 89c11bc093cc5902af0dcf3faa081475d678d6f2 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 16:29:33 +0900 Subject: [PATCH 23/48] clean up partner query --- lua/wikis/commons/BroadcastTalentTable.lua | 35 +++++++++------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index e4af77a5803..7ed450b5763 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -357,39 +357,32 @@ function BroadcastTalentTable:_partnerList(tournament) end ---@private ----@param tournament table ----@return table -function BroadcastTalentTable:_getPartners(tournament) - local conditions = ConditionTree(BooleanOperator.all) - :add{ - ConditionNode(ColumnName('parent'), Comparator.eq, tournament.parent), - } +---@param broadcast EnrichedBroadcast +---@return {id: string, page: string, flag: string}[] +function BroadcastTalentTable:_getPartners(broadcast) + local conditions = ConditionTree(BooleanOperator.all):add( + ConditionNode(ColumnName('parent'), Comparator.eq, broadcast.parent) + ) - local positionConditions = ConditionTree(BooleanOperator.any) - for _, position in pairs(tournament.positions) do - positionConditions:add{ConditionNode(ColumnName('position'), Comparator.eq, position)} - end - conditions:add(positionConditions) + conditions:add(ConditionUtil.anyOf(ColumnName('position'), broadcast.positions)) - for _, caster in pairs(self.aliases) do - conditions:add{ConditionNode(ColumnName('page'), Comparator.neq, caster)} - end + conditions:add(ConditionUtil.noneOf(ColumnName('page'), self.aliases)) - if String.isNotEmpty(tournament.language) then - conditions:add{ConditionNode(ColumnName('language'), Comparator.eq, tournament.language)} + if String.isNotEmpty(broadcast.language) then + conditions:add(ConditionNode(ColumnName('language'), Comparator.eq, broadcast.language)) end - local extradata = tournament.extradata or {} + local extradata = broadcast.extradata or {} if Logic.readBool(extradata.showmatch) then - conditions:add{ConditionNode(ColumnName('extradata_showmatch'), Comparator.eq, 'true')} + conditions:add(ConditionNode(ColumnName('extradata_showmatch'), Comparator.eq, 'true')) if String.isNotEmpty(extradata.showmatchname) then - conditions:add{ConditionNode(ColumnName('extradata_showmatchname'), Comparator.eq, extradata.showmatchname)} + conditions:add(ConditionNode(ColumnName('extradata_showmatchname'), Comparator.eq, extradata.showmatchname)) end end return mw.ext.LiquipediaDB.lpdb('broadcasters', { query = 'id, page, flag', - conditions = conditions:toString(), + conditions = tostring(conditions), }) end From 51b6941821efe48d9e5e700dced5abcad767beca Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 16:32:50 +0900 Subject: [PATCH 24/48] type anno --- lua/wikis/commons/BroadcastTalentTable.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 7ed450b5763..de6cce2d781 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -387,7 +387,7 @@ function BroadcastTalentTable:_getPartners(broadcast) end ---@private ----@param partners table +---@param partners {id: string, page: string, flag: string}[] ---@return {id: string, page: string, flag: string}[] function BroadcastTalentTable._removeDuplicatePartners(partners) local uniquePartners = Table.map(partners, function(_, partner) return partner.page, partner end) From 8fd62e9949a36bbd2298f1eafcf7dd0eac0a3c74 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 16:38:29 +0900 Subject: [PATCH 25/48] remove unused import --- lua/wikis/commons/BroadcastTalentTable.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index de6cce2d781..8190368fabf 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -12,7 +12,6 @@ local Array = Lua.import('Module:Array') local Class = Lua.import('Module:Class') local Flags = Lua.import('Module:Flags') local Game = Lua.import('Module:Game') -local HighlightConditions = Lua.import('Module:HighlightConditions') local LeagueIcon = Lua.import('Module:LeagueIcon') local Logic = Lua.import('Module:Logic') local Lpdb = Lua.import('Module:Lpdb') From f0a0d963561d8cbbe4513bcfadcb80d5b7e4a35a Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 17:10:59 +0900 Subject: [PATCH 26/48] use table2 --- lua/wikis/commons/BroadcastTalentTable.lua | 169 ++++++++++++--------- 1 file changed, 98 insertions(+), 71 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 8190368fabf..2b504cd3980 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -32,6 +32,11 @@ local BooleanOperator = Condition.BooleanOperator local ColumnName = Condition.ColumnName local ConditionUtil = Condition.Util +local HtmlWidgets = Lua.import('Module:Widget/Html/All') +local LinkWidget = Lua.import('Module:Widget/Basic/Link') +local TableWidgets = Lua.import('Module:Widget/Table2/All') +local WidgetUtil = Lua.import('Module:Widget/Util') + local DEFAULT_LIMIT = 500 local DEFAULT_ACHIEVEMENTS_LIMIT = 10 local NONBREAKING_SPACE = ' ' @@ -206,71 +211,88 @@ function BroadcastTalentTable:create() return end - local display = mw.html.create('table') - :addClass('wikitable wikitable-striped sortable') - :css('text-align', 'center') - :node(self:_header()) + local bodyElements = {} for seperatorTitle, sectionData in Table.iter.spairs(self.tournaments, function (_, key1, key2) - return tonumber(key1) > tonumber(key2) end) do - - if String.isNotEmpty(seperatorTitle) then - display:node(BroadcastTalentTable._seperator(seperatorTitle)) - end - - for _, tournament in ipairs(sectionData) do - display:node(self:_row(tournament)) - end + return tonumber(key1) > tonumber(key2) + end) do + Array.extendWith(bodyElements, BroadcastTalentTable._seperator(seperatorTitle), Array.map(sectionData, function (broadcast) + return self:_row(broadcast) + end)) end if self.args.isAchievementsTable then - display:node(self:_footer()) + self:_footer() end - return mw.html.create('div') - :addClass('table-responsive') - :node(display) + return TableWidgets.Table{ + sortable = true, + columns = WidgetUtil.collect( + { + align = 'center', + minWidth = '120px', + sortType = 'isoDate' + }, + { + align = 'center', + shrink = true, + }, + self.args.displayGameIcon and {align = 'center'} or nil, + {align = 'center'}, + {align = 'center'}, + {align = 'center'}, + {align = 'center'}, + self.args.displayPartnerListColumn and {align = 'center'} or nil + ), + children = WidgetUtil.collect( + self:_header(), + TableWidgets.TableBody{children = bodyElements} + ) + } end ---@private ----@return Html +---@return Widget function BroadcastTalentTable:_header() - local header = mw.html.create('tr') - :tag('th'):wikitext('Date'):css('width', '120px'):done() - :tag('th'):wikitext('Tier'):css('width', '50px'):done() - :tag('th'):wikitext('Tournament') - :attr('colspan', self.args.displayGameIcon and 3 or 2) - :css('width', self.args.displayGameIcon and '350px' or '300px'):done() - :tag('th'):wikitext('Position'):css('width', '130px'):done() - - if not self.args.displayPartnerListColumn then - return header - end - - return header:tag('th'):wikitext('Partner List'):css('width', '160px'):done() + return TableWidgets.TableHeader{children = { + TableWidgets.Row{children = WidgetUtil.collect( + TableWidgets.CellHeader{children = {'Date'}}, + TableWidgets.CellHeader{children = {'Tier'}}, + TableWidgets.CellHeader{ + colspan = self.args.displayGameIcon and 3 or 2, + children = {'Tournament'} + }, + TableWidgets.CellHeader{children = {'Position'}}, + self.args.displayPartnerListColumn and TableWidgets.CellHeader{children = {'Partner List'}} or nil + )} + }} end ---@private ----@param seperatorTitle string|number ----@return Html -function BroadcastTalentTable._seperator(seperatorTitle) - return mw.html.create('tr'):addClass('sortbottom'):css('font-weight', 'bold') - :tag('td'):attr('colspan', 42):wikitext(seperatorTitle):done() +---@param separatorTitle string|number? +---@return Widget? +function BroadcastTalentTable._seperator(separatorTitle) + if Logic.isEmpty(separatorTitle) then + return + end + return TableWidgets.Row{ + classes = {'sortbottom'}, + css = {['font-weight'] = 'bold'}, + children = TableWidgets.Cell{ + align = 'center', + colspan = 42, + children = separatorTitle + } + } end ---@private ---@param broadcast EnrichedBroadcast ---@return Html function BroadcastTalentTable:_row(broadcast) - local row = mw.html.create('tr') - local tournament = Tournament.getTournament(broadcast.parent) ---@cast tournament -nil - if tournament:isHighlighted(self.args) then - row:addClass('tournament-highlighted-bg') - end - local tierDisplay = Tier.display(tournament.liquipediaTier, tournament.liquipediaTierType, Table.merge( tournament.tierOptions, { @@ -279,36 +301,41 @@ function BroadcastTalentTable:_row(broadcast) onlyTierTypeIfBoth = self.args.showTierType and String.isNotEmpty(tournament.liquipediaTierType) } )) - local tierSortValue = Tier.toSortValue(tournament.liquipediaTier, tournament.liquipediaTierType) - row - :tag('td'):wikitext(broadcast.date):done() - :tag('td'):wikitext(tierDisplay):attr('data-sort-value', tierSortValue):done() - - if self.args.displayGameIcon then - row:tag('td'):node(Game.icon{game = tournament.game}) - end - - row - :tag('td'):wikitext(LeagueIcon.display{ - icon = tournament.icon, - iconDark = tournament.iconDark, - series = tournament.series, - date = broadcast.date, - link = tournament.pageName, - name = tournament.fullName, - }):done() - :tag('td'):css('text-align', 'left'):wikitext(Page.makeInternalLink({}, - self:_tournamentDisplayName(broadcast, tournament), - tournament.pageName - )):done() - :tag('td'):wikitext(table.concat(broadcast.positions, '
')):done() - - if not self.args.displayPartnerListColumn then - return row - end - - return row:tag('td'):node(self:_partnerList(broadcast)):done() + return TableWidgets.Row{ + highlighted = tournament:isHighlighted(self.args), + children = WidgetUtil.collect( + TableWidgets.Cell{children = broadcast.date}, + TableWidgets.Cell{ + attributes = { + ['data-sort-value'] = Tier.toSortValue(tournament.liquipediaTier, tournament.liquipediaTierType) + }, + children = tierDisplay + }, + self.args.displayGameIcon and TableWidgets.Cell{ + children = Game.icon{game = tournament.game} + } or nil, + TableWidgets.Cell{children = LeagueIcon.display{ + icon = tournament.icon, + iconDark = tournament.iconDark, + series = tournament.series, + date = broadcast.date, + link = tournament.pageName, + name = tournament.fullName, + }}, + TableWidgets.Cell{ + align = 'left', + children = LinkWidget{ + link = tournament.pageName, + children = self:_tournamentDisplayName(broadcast, tournament) + } + }, + TableWidgets.Cell{children = Array.interleave(broadcast.positions, HtmlWidgets.Br{})}, + self.args.displayPartnerListColumn and TableWidgets.Cell{ + children = self:_partnerList(broadcast) + } or nil + ) + } end ---@private From 1bbdbad87f9f706db6f55937ea59d9743f8c2c48 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 17:18:17 +0900 Subject: [PATCH 27/48] reenable footer --- lua/wikis/commons/BroadcastTalentTable.lua | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 2b504cd3980..a54896412f4 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -221,10 +221,6 @@ function BroadcastTalentTable:create() end)) end - if self.args.isAchievementsTable then - self:_footer() - end - return TableWidgets.Table{ sortable = true, columns = WidgetUtil.collect( @@ -247,7 +243,8 @@ function BroadcastTalentTable:create() children = WidgetUtil.collect( self:_header(), TableWidgets.TableBody{children = bodyElements} - ) + ), + footer = self.args.isAchievementsTable and self:_footer() or nil } end @@ -436,9 +433,7 @@ function BroadcastTalentTable:_footer() )):done() :done() - return mw.html.create('tr') - :tag('th'):attr('colspan', 42) - :node(footer) + return footer end return BroadcastTalentTable From 99ccbb8405d639c0c1e424d6a3cbfd66a60ceb37 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 17:20:07 +0900 Subject: [PATCH 28/48] spelling --- lua/wikis/commons/BroadcastTalentTable.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index a54896412f4..a7c903a6473 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -213,10 +213,10 @@ function BroadcastTalentTable:create() local bodyElements = {} - for seperatorTitle, sectionData in Table.iter.spairs(self.tournaments, function (_, key1, key2) + for separatorTitle, sectionData in Table.iter.spairs(self.tournaments, function (_, key1, key2) return tonumber(key1) > tonumber(key2) end) do - Array.extendWith(bodyElements, BroadcastTalentTable._seperator(seperatorTitle), Array.map(sectionData, function (broadcast) + Array.extendWith(bodyElements, BroadcastTalentTable._separator(separatorTitle), Array.map(sectionData, function (broadcast) return self:_row(broadcast) end)) end @@ -268,7 +268,7 @@ end ---@private ---@param separatorTitle string|number? ---@return Widget? -function BroadcastTalentTable._seperator(separatorTitle) +function BroadcastTalentTable._separator(separatorTitle) if Logic.isEmpty(separatorTitle) then return end From e3c9d7f9059240336171248c57dda19ddb99a9b1 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Sat, 21 Feb 2026 17:51:02 +0900 Subject: [PATCH 29/48] make partner list column unsortable --- lua/wikis/commons/BroadcastTalentTable.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index a7c903a6473..c7a0affa804 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -238,7 +238,10 @@ function BroadcastTalentTable:create() {align = 'center'}, {align = 'center'}, {align = 'center'}, - self.args.displayPartnerListColumn and {align = 'center'} or nil + self.args.displayPartnerListColumn and { + align = 'center', + unsortable = true, + } or nil ), children = WidgetUtil.collect( self:_header(), From 8d38fe971793e7c3c79585a4e474fb07d68e6f78 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:47:12 +0900 Subject: [PATCH 30/48] make extendWith behave --- lua/wikis/commons/BroadcastTalentTable.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index c7a0affa804..ba39ea8de88 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -216,9 +216,13 @@ function BroadcastTalentTable:create() for separatorTitle, sectionData in Table.iter.spairs(self.tournaments, function (_, key1, key2) return tonumber(key1) > tonumber(key2) end) do - Array.extendWith(bodyElements, BroadcastTalentTable._separator(separatorTitle), Array.map(sectionData, function (broadcast) - return self:_row(broadcast) - end)) + Array.extendWith( + bodyElements, + {BroadcastTalentTable._separator(separatorTitle)}, + Array.map(sectionData, function (broadcast) + return self:_row(broadcast) + end) + ) end return TableWidgets.Table{ From c77c99b4a0c7023ab56a7ab5f16798ba78a0e00f Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:49:10 +0900 Subject: [PATCH 31/48] use CellHeader for separator --- lua/wikis/commons/BroadcastTalentTable.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index ba39ea8de88..dd9f8fa818c 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -282,7 +282,7 @@ function BroadcastTalentTable._separator(separatorTitle) return TableWidgets.Row{ classes = {'sortbottom'}, css = {['font-weight'] = 'bold'}, - children = TableWidgets.Cell{ + children = TableWidgets.CellHeader{ align = 'center', colspan = 42, children = separatorTitle From 1d2b3fe89297ee8b2ec3a6c4831bbc4e9c1c632d Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:51:51 +0900 Subject: [PATCH 32/48] use GeneralCollapsible --- lua/wikis/commons/BroadcastTalentTable.lua | 11 +++++++---- stylesheets/commons/Miscellaneous.scss | 10 ---------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index dd9f8fa818c..4e1c50dcefc 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -32,6 +32,8 @@ local BooleanOperator = Condition.BooleanOperator local ColumnName = Condition.ColumnName local ConditionUtil = Condition.Util +local CollapsibleToggle = Lua.import('Module:Widget/GeneralCollapsible/Toggle') +local GeneralCollapsible = Lua.import('Module:Widget/GeneralCollapsible/Default') local HtmlWidgets = Lua.import('Module:Widget/Html/All') local LinkWidget = Lua.import('Module:Widget/Basic/Link') local TableWidgets = Lua.import('Module:Widget/Table2/All') @@ -380,10 +382,11 @@ function BroadcastTalentTable:_partnerList(tournament) .. Page.makeInternalLink({}, partner.id, partner.page)) end - return mw.html.create('div') - :addClass('NavFrame collapsible broadcast-talent-partner-list-frame collapsed') - :tag('div'):addClass('NavHead'):addClass('transparent-bg'):done() - :tag('div'):addClass('NavContent broadcast-talent-partner-list'):node(list):done() + return GeneralCollapsible{ + titleWidget = CollapsibleToggle{}, + shouldCollapse = true, + children = list, + } end ---@private diff --git a/stylesheets/commons/Miscellaneous.scss b/stylesheets/commons/Miscellaneous.scss index 3c40675fee7..1e5a597bee3 100644 --- a/stylesheets/commons/Miscellaneous.scss +++ b/stylesheets/commons/Miscellaneous.scss @@ -722,16 +722,6 @@ td.bold-white-text { column-width: auto; } -/* Broadcast talent partner list */ -.broadcast-talent-partner-list { - margin-left: -0.5em; - text-align: left; - - &-frame { - border: 0 !important; - } -} - /* tournament overview page boxes */ .tournament-image-link { text-align: center; From 1d8a52069006658d5792d2792ba121bb397a5826 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:07:44 +0900 Subject: [PATCH 33/48] use Widget for partner list --- lua/wikis/commons/BroadcastTalentTable.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 4e1c50dcefc..9f93394c087 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -37,6 +37,7 @@ local GeneralCollapsible = Lua.import('Module:Widget/GeneralCollapsible/Default' local HtmlWidgets = Lua.import('Module:Widget/Html/All') local LinkWidget = Lua.import('Module:Widget/Basic/Link') local TableWidgets = Lua.import('Module:Widget/Table2/All') +local UnorderedList = Lua.import('Module:Widget/List/Unordered') local WidgetUtil = Lua.import('Module:Widget/Util') local DEFAULT_LIMIT = 500 @@ -365,7 +366,7 @@ end ---@private ---@param tournament table ----@return Html|string +---@return string|Widget function BroadcastTalentTable:_partnerList(tournament) local partners = self:_getPartners(tournament) @@ -376,16 +377,18 @@ function BroadcastTalentTable:_partnerList(tournament) partners = BroadcastTalentTable._removeDuplicatePartners(partners) Array.sortInPlaceBy(partners, Operator.property('page')) - local list = mw.html.create('ul') - for _, partner in ipairs(partners) do - list:tag('li'):wikitext(Flags.Icon{flag = partner.flag} .. NONBREAKING_SPACE - .. Page.makeInternalLink({}, partner.id, partner.page)) - end - return GeneralCollapsible{ titleWidget = CollapsibleToggle{}, shouldCollapse = true, - children = list, + children = UnorderedList{ + children = Array.map(partners, function (partner) + return { + Flags.Icon{flag = partner.flag}, + NONBREAKING_SPACE, + LinkWidget{link = partner.page, children = partner.id} + } + end) + }, } end From 545b5ae211879647c962f8c7bde17f88c0321d81 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:10:48 +0900 Subject: [PATCH 34/48] allow passing array to title/caption/footer --- lua/wikis/commons/Widget/Table2/Table.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lua/wikis/commons/Widget/Table2/Table.lua b/lua/wikis/commons/Widget/Table2/Table.lua index a2b6f43ffc4..d05bdce3e26 100644 --- a/lua/wikis/commons/Widget/Table2/Table.lua +++ b/lua/wikis/commons/Widget/Table2/Table.lua @@ -34,9 +34,9 @@ local Table2Contexts = Lua.import('Module:Widget/Contexts/Table2') ---@field variant 'generic'|'themed'? ---@field sortable (string|number|boolean)? ---@field striped (string|number|boolean)? ----@field caption Widget|Html|string|number? ----@field title Widget|Html|string|number? ----@field footer Widget|Html|string|number? +---@field caption Renderable|Renderable[]? +---@field title Renderable|Renderable[]? +---@field footer Renderable|Renderable[]? ---@field classes string[]? ---@field tableClasses string[]? ---@field columns Table2ColumnDef[]? @@ -79,12 +79,12 @@ function Table2:render() local captionNode = props.caption and HtmlWidgets.Div{ classes = {'table2__caption'}, - children = {props.caption}, + children = props.caption, } or nil local titleNode = props.title and HtmlWidgets.Div{ classes = {'table2__title'}, - children = {props.title}, + children = props.title, } or nil local tableChildren = props.children @@ -115,7 +115,7 @@ function Table2:render() local footerNode = props.footer and HtmlWidgets.Div{ classes = {'table2__footer'}, - children = {props.footer}, + children = props.footer, } or nil local tableWrapperNode = HtmlWidgets.Div{ From b8daa44c0e6f3b936b8cfbf8cf0c0f616bef6a80 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:14:50 +0900 Subject: [PATCH 35/48] use widget for footer --- lua/wikis/commons/BroadcastTalentTable.lua | 29 +++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 9f93394c087..637e365017c 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -432,21 +432,22 @@ function BroadcastTalentTable._removeDuplicatePartners(partners) end ---@private ----@return Html +---@return Widget function BroadcastTalentTable:_footer() - local footer = mw.html.create('small') - :tag('span') - :css('float', 'left'):css('padding-left', '20px'):css('font-style', 'italic') - :wikitext(Page.makeInternalLink({}, 'About achievements', self.args.aboutAchievementsLink)) - :done() - :tag('b') - :wikitext(Page.makeInternalLink({}, - 'Broadcasts from any Tournament', - self.broadcaster .. '/Broadcasts#Detailed Broadcasts' - )):done() - :done() - - return footer + return HtmlWidgets.Small{children = { + HtmlWidgets.Span{ + css = { + float = 'left', + ['padding-left'] = '20px', + ['font-style'] = 'italic', + }, + children = LinkWidget{children = 'About achievements', link = self.args.aboutAchievementsLink} + }, + HtmlWidgets.B{children = LinkWidget{ + children = 'Broadcasts from any Tournament', + link = self.broadcaster .. '/Broadcasts#Detailed Broadcasts' + }} + }} end return BroadcastTalentTable From ec572581cff06cb5f958500d69a924449e69c753 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:17:53 +0900 Subject: [PATCH 36/48] adjust layout --- lua/wikis/commons/BroadcastTalentTable.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 637e365017c..05fc35417d3 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -438,7 +438,7 @@ function BroadcastTalentTable:_footer() HtmlWidgets.Span{ css = { float = 'left', - ['padding-left'] = '20px', + ['padding-left'] = '1rem', ['font-style'] = 'italic', }, children = LinkWidget{children = 'About achievements', link = self.args.aboutAchievementsLink} From 35ca2aeeddc25f6500a5041369ff5877f3afb3a5 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:21:22 +0900 Subject: [PATCH 37/48] fix unsortable --- lua/wikis/commons/BroadcastTalentTable.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 05fc35417d3..153de3a34b5 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -244,7 +244,6 @@ function BroadcastTalentTable:create() {align = 'center'}, {align = 'center'}, {align = 'center'}, - {align = 'center'}, self.args.displayPartnerListColumn and { align = 'center', unsortable = true, From ee30c4ca1951ff3aebcec7e95649bafd42a60574 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:22:36 +0900 Subject: [PATCH 38/48] fix list alignment --- lua/wikis/commons/BroadcastTalentTable.lua | 1 + lua/wikis/commons/Widget/List.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 153de3a34b5..42ec6f7a6c9 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -380,6 +380,7 @@ function BroadcastTalentTable:_partnerList(tournament) titleWidget = CollapsibleToggle{}, shouldCollapse = true, children = UnorderedList{ + css = {['text-align'] = 'left'}, children = Array.map(partners, function (partner) return { Flags.Icon{flag = partner.flag}, diff --git a/lua/wikis/commons/Widget/List.lua b/lua/wikis/commons/Widget/List.lua index a15a99dafb0..535678ca468 100644 --- a/lua/wikis/commons/Widget/List.lua +++ b/lua/wikis/commons/Widget/List.lua @@ -17,7 +17,7 @@ local WidgetUtil = Lua.import('Module:Widget/Util') ---@class ListWidget: Widget ---@operator call(table): ListWidget ----@field props {children: (Renderable|Renderable[])[]} +---@field props {css: table?, children: (Renderable|Renderable[])[]} local ListWidget = Class.new(Widget) ---@return Widget? @@ -25,6 +25,7 @@ function ListWidget:render() local children = self.props.children if Logic.isEmpty(children) then return end return self:getType(){ + css = self.props.css, children = Array.map(children, function (item) return HtmlWidgets.Li{ children = WidgetUtil.collect(item) From 4a882bc890f73943469e5c8515e33e90f3d219b2 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:26:10 +0900 Subject: [PATCH 39/48] revert to using css class --- lua/wikis/commons/BroadcastTalentTable.lua | 2 +- lua/wikis/commons/Widget/List.lua | 3 +-- stylesheets/commons/Miscellaneous.scss | 5 +++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 42ec6f7a6c9..f304b9f82db 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -379,8 +379,8 @@ function BroadcastTalentTable:_partnerList(tournament) return GeneralCollapsible{ titleWidget = CollapsibleToggle{}, shouldCollapse = true, + collapseAreaClasses = {'broadcast-talent-partner-list'}, children = UnorderedList{ - css = {['text-align'] = 'left'}, children = Array.map(partners, function (partner) return { Flags.Icon{flag = partner.flag}, diff --git a/lua/wikis/commons/Widget/List.lua b/lua/wikis/commons/Widget/List.lua index 535678ca468..a15a99dafb0 100644 --- a/lua/wikis/commons/Widget/List.lua +++ b/lua/wikis/commons/Widget/List.lua @@ -17,7 +17,7 @@ local WidgetUtil = Lua.import('Module:Widget/Util') ---@class ListWidget: Widget ---@operator call(table): ListWidget ----@field props {css: table?, children: (Renderable|Renderable[])[]} +---@field props {children: (Renderable|Renderable[])[]} local ListWidget = Class.new(Widget) ---@return Widget? @@ -25,7 +25,6 @@ function ListWidget:render() local children = self.props.children if Logic.isEmpty(children) then return end return self:getType(){ - css = self.props.css, children = Array.map(children, function (item) return HtmlWidgets.Li{ children = WidgetUtil.collect(item) diff --git a/stylesheets/commons/Miscellaneous.scss b/stylesheets/commons/Miscellaneous.scss index 1e5a597bee3..3d601d63ce4 100644 --- a/stylesheets/commons/Miscellaneous.scss +++ b/stylesheets/commons/Miscellaneous.scss @@ -722,6 +722,11 @@ td.bold-white-text { column-width: auto; } +/* Broadcast talent partner list */ +.broadcast-talent-partner-list { + text-align: left; +} + /* tournament overview page boxes */ .tournament-image-link { text-align: center; From b2f7264a3f3238e3798a00a30c269e2b4c4deaf4 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 10:27:34 +0900 Subject: [PATCH 40/48] restore margin --- stylesheets/commons/Miscellaneous.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/stylesheets/commons/Miscellaneous.scss b/stylesheets/commons/Miscellaneous.scss index 3d601d63ce4..2369d5af2a7 100644 --- a/stylesheets/commons/Miscellaneous.scss +++ b/stylesheets/commons/Miscellaneous.scss @@ -724,6 +724,7 @@ td.bold-white-text { /* Broadcast talent partner list */ .broadcast-talent-partner-list { + margin-left: -0.5em; text-align: left; } From 9f5b282cea466abe043ad82a723ee87233f07c56 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:03:31 +0900 Subject: [PATCH 41/48] add hidden tr --- lua/wikis/commons/BroadcastTalentTable.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index f304b9f82db..848d243bfdb 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -251,6 +251,11 @@ function BroadcastTalentTable:create() ), children = WidgetUtil.collect( self:_header(), + -- Hidden tr that contains a td to prevent the first yearHeader from being inside thead + Logic.isNotEmpty(bodyElements) and HtmlWidgets.Tr{ + css = {display = 'none'}, + children = HtmlWidgets.Td{} + } or nil, TableWidgets.TableBody{children = bodyElements} ), footer = self.args.isAchievementsTable and self:_footer() or nil From 95088d9a4b4fd63c0a0d38154e9620369fa18d50 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Wed, 25 Feb 2026 20:52:51 +0900 Subject: [PATCH 42/48] use subheader --- lua/wikis/commons/BroadcastTalentTable.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 848d243bfdb..12143f5fcbb 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -287,6 +287,7 @@ function BroadcastTalentTable._separator(separatorTitle) return end return TableWidgets.Row{ + section = 'subhead', classes = {'sortbottom'}, css = {['font-weight'] = 'bold'}, children = TableWidgets.CellHeader{ From c511851d5ccefb3f18f7fe49c3538823e6ecaf1e Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Fri, 27 Feb 2026 10:21:41 +0900 Subject: [PATCH 43/48] adjust column def --- lua/wikis/commons/BroadcastTalentTable.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 12143f5fcbb..083151e87b6 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -232,18 +232,17 @@ function BroadcastTalentTable:create() sortable = true, columns = WidgetUtil.collect( { - align = 'center', - minWidth = '120px', + align = 'left', sortType = 'isoDate' }, { - align = 'center', + align = 'left', shrink = true, }, self.args.displayGameIcon and {align = 'center'} or nil, {align = 'center'}, - {align = 'center'}, - {align = 'center'}, + {align = 'left'}, + {align = 'left'}, self.args.displayPartnerListColumn and { align = 'center', unsortable = true, @@ -270,6 +269,7 @@ function BroadcastTalentTable:_header() TableWidgets.CellHeader{children = {'Date'}}, TableWidgets.CellHeader{children = {'Tier'}}, TableWidgets.CellHeader{ + align = 'left', colspan = self.args.displayGameIcon and 3 or 2, children = {'Tournament'} }, From 5ccbcb62281e1b8f60bc9a6e366f2d5466b960a8 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Fri, 27 Feb 2026 10:22:01 +0900 Subject: [PATCH 44/48] adjust footer --- lua/wikis/commons/BroadcastTalentTable.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 083151e87b6..18ba01b9dd1 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -442,6 +442,7 @@ end function BroadcastTalentTable:_footer() return HtmlWidgets.Small{children = { HtmlWidgets.Span{ + classes = {'mobile-hide'}, css = { float = 'left', ['padding-left'] = '1rem', @@ -449,6 +450,13 @@ function BroadcastTalentTable:_footer() }, children = LinkWidget{children = 'About achievements', link = self.args.aboutAchievementsLink} }, + HtmlWidgets.Span{ + classes = {'mobile-only'}, + children = LinkWidget{children = 'About achievements', link = self.args.aboutAchievementsLink} + }, + HtmlWidgets.Br{ + classes = {'mobile-only'} + }, HtmlWidgets.B{children = LinkWidget{ children = 'Broadcasts from any Tournament', link = self.broadcaster .. '/Broadcasts#Detailed Broadcasts' From f79cec1ab5f92a6f8fe2e9be3d596a410cc10df6 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Fri, 27 Feb 2026 10:29:10 +0900 Subject: [PATCH 45/48] use dialog for partner list --- lua/wikis/commons/BroadcastTalentTable.lua | 27 ++++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 18ba01b9dd1..00a6fda55a4 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -32,8 +32,8 @@ local BooleanOperator = Condition.BooleanOperator local ColumnName = Condition.ColumnName local ConditionUtil = Condition.Util -local CollapsibleToggle = Lua.import('Module:Widget/GeneralCollapsible/Toggle') -local GeneralCollapsible = Lua.import('Module:Widget/GeneralCollapsible/Default') +local Button = Lua.import('Module:Widget/Basic/Button') +local Dialog = Lua.import('Module:Widget/Basic/Dialog') local HtmlWidgets = Lua.import('Module:Widget/Html/All') local LinkWidget = Lua.import('Module:Widget/Basic/Link') local TableWidgets = Lua.import('Module:Widget/Table2/All') @@ -344,7 +344,7 @@ function BroadcastTalentTable:_row(broadcast) }, TableWidgets.Cell{children = Array.interleave(broadcast.positions, HtmlWidgets.Br{})}, self.args.displayPartnerListColumn and TableWidgets.Cell{ - children = self:_partnerList(broadcast) + children = self:_partnerList(broadcast, tournament) } or nil ) } @@ -370,10 +370,11 @@ function BroadcastTalentTable:_tournamentDisplayName(broadcast, tournament) end ---@private ----@param tournament table +---@param broadcast EnrichedBroadcast +---@param tournament StandardTournament ---@return string|Widget -function BroadcastTalentTable:_partnerList(tournament) - local partners = self:_getPartners(tournament) +function BroadcastTalentTable:_partnerList(broadcast, tournament) + local partners = self:_getPartners(broadcast) if Table.isEmpty(partners) then return DASH @@ -382,10 +383,16 @@ function BroadcastTalentTable:_partnerList(tournament) partners = BroadcastTalentTable._removeDuplicatePartners(partners) Array.sortInPlaceBy(partners, Operator.property('page')) - return GeneralCollapsible{ - titleWidget = CollapsibleToggle{}, - shouldCollapse = true, - collapseAreaClasses = {'broadcast-talent-partner-list'}, + return Dialog{ + trigger = Button{ + children = 'Show', + variant = 'secondary', + size = 'xs', + }, + title = LinkWidget{ + link = tournament.pageName, + children = self:_tournamentDisplayName(broadcast, tournament) + }, children = UnorderedList{ children = Array.map(partners, function (partner) return { From 2ec96840802e457ac4bc8b9bf5170e1c40beb4c9 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Fri, 27 Feb 2026 10:31:25 +0900 Subject: [PATCH 46/48] use html entity over unicode --- lua/wikis/commons/BroadcastTalentTable.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 00a6fda55a4..87693f5c938 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -43,7 +43,7 @@ local WidgetUtil = Lua.import('Module:Widget/Util') local DEFAULT_LIMIT = 500 local DEFAULT_ACHIEVEMENTS_LIMIT = 10 local NONBREAKING_SPACE = ' ' -local DASH = '–' +local DASH = '–' local DEFAULT_ABOUT_LINK = 'Template:Weight/doc' local ACHIEVEMENTS_SORT_ORDER = 'weight desc, date desc' local ACHIEVEMENTS_IGNORED_STATUSES = {'cancelled', 'postponed'} From 44ce9deb1d1531f6646c94f1a389c82f2e5e5fe7 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Fri, 27 Feb 2026 10:34:10 +0900 Subject: [PATCH 47/48] adjust partner list column --- lua/wikis/commons/BroadcastTalentTable.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 87693f5c938..3ecc1424be0 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -244,7 +244,7 @@ function BroadcastTalentTable:create() {align = 'left'}, {align = 'left'}, self.args.displayPartnerListColumn and { - align = 'center', + align = 'right', unsortable = true, } or nil ), @@ -274,7 +274,7 @@ function BroadcastTalentTable:_header() children = {'Tournament'} }, TableWidgets.CellHeader{children = {'Position'}}, - self.args.displayPartnerListColumn and TableWidgets.CellHeader{children = {'Partner List'}} or nil + self.args.displayPartnerListColumn and TableWidgets.CellHeader{children = {'Partners'}} or nil )} }} end From 9e52b1e8a1c009672cd3cd0143222b5a61e0aee6 Mon Sep 17 00:00:00 2001 From: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com> Date: Wed, 4 Mar 2026 18:05:53 +0900 Subject: [PATCH 48/48] simplify self.aliases logic --- lua/wikis/commons/BroadcastTalentTable.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/wikis/commons/BroadcastTalentTable.lua b/lua/wikis/commons/BroadcastTalentTable.lua index 3ecc1424be0..17484cb8290 100644 --- a/lua/wikis/commons/BroadcastTalentTable.lua +++ b/lua/wikis/commons/BroadcastTalentTable.lua @@ -122,8 +122,10 @@ function BroadcastTalentTable:_readArgs(args) local broadcaster = String.isNotEmpty(args.broadcaster) and args.broadcaster or self:_getBroadcaster() self.broadcaster = Page.pageifyLink(broadcaster) - self.aliases = Array.map(Array.parseCommaSeparatedString(args.aliases), Page.pageifyLink) - Array.appendWith(self.aliases, self.broadcaster) + self.aliases = Array.unique(Array.extend( + self.broadcaster, + Array.map(Array.parseCommaSeparatedString(args.aliases), Page.pageifyLink) + )) end ---@private