Skip to content

feat: enable Team Participant controls to be used separately#7194

Open
Eetwalt wants to merge 25 commits intomainfrom
tp-controls
Open

feat: enable Team Participant controls to be used separately#7194
Eetwalt wants to merge 25 commits intomainfrom
tp-controls

Conversation

@Eetwalt
Copy link
Collaborator

@Eetwalt Eetwalt commented Mar 2, 2026

Summary

Problem: When there's multiple teamparticipant card groups on page, each render their own switches, which makes no sense from UX stand point. This PR:

  • Extracts the controls to it's own widget
    • includes compact view, show roster switches and newly added 'Player info' button
    • Player info button is not rendered by default, can be rendered with |playerinfo = true
  • If no controls template is added on page, TeamParticipants renders their own controls as before. Player info button can be added with the same playerinfo=true flag
  • Modified CSS nesting as controls will no longer be inside team participants always.

How did you test this change?

dev + dev tools:
https://liquipedia.net/valorant/User:Eetwalt

Usage:

==Participants==

{{TeamParticipantsControls|playerinfo=true}}

===Subheader===
{{TeamParticipants
|{{Opponent|FURIA|import=true|qualification={{Qualification|method=qual|page=VCT/2026/Americas League/Kickoff|text=Americas Kickoff|placement=1}}
  |players={{Persons
    |{{Person|basic|played=false|type=sub}}
    |{{Person|shaW|role=Head Coach|type=staff}}
    |{{Person|Kamino|role=Assistant Coach|type=staff}}
  }}
}}
...

===Subheader 2===
{{TeamParticipants
|{{Opponent|G2 Esports|import=true|qualification={{Qualification|method=qual|page=VCT/2026/Americas League/Kickoff|text=Americas Kickoff|placement=2}}
  |players={{Persons
    |{{Person|JoshRT|role=Head Coach|type=staff}}
	|{{Person|shhhack|role=Assistant Coach|type=staff}}
  }}
}}

OR

{{TeamParticipants|playerinfo=true
|{{Opponent|G2 Esports|import=true|qualification={{Qualification|method=qual|page=VCT/2026/Americas League/Kickoff|text=Americas Kickoff|placement=2}}
  |players={{Persons
    |{{Person|JoshRT|role=Head Coach|type=staff}}
	|{{Person|shhhack|role=Assistant Coach|type=staff}}
  }}
}}

@Eetwalt Eetwalt requested a review from a team as a code owner March 2, 2026 14:25
Copilot AI review requested due to automatic review settings March 2, 2026 14:25
@Eetwalt Eetwalt requested a review from a team as a code owner March 2, 2026 14:25
@Eetwalt Eetwalt added stylesheets Changes to stylesheets c: team_participant labels Mar 2, 2026
@Eetwalt
Copy link
Collaborator Author

Eetwalt commented Mar 2, 2026

This doesn't nesessarily exclude also having #6986 as an option, but I think this is a viable approach for smaller tournaments like https://liquipedia.net/valorant/VCT/2026/Stage_1/Masters . Tabs feels like an overkill there when there's only handful of teams in each category

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR separates Team Participant UI controls (compact view, show rosters, optional “Player Info” button) into a dedicated widget so pages with multiple TeamParticipants blocks can share a single control set, while preserving the previous “inline controls” behavior when no external controls are used.

Changes:

  • Added ParticipantControls widget to render switches (and optional Player Info button) independently of the cards group.
  • Updated TeamParticipants controller + cards group to optionally suppress inline controls when external controls were rendered on the page.
  • Adjusted TeamParticipantCard SCSS to reflect the new controls container class and to apply compact styling based on controls existing outside the cards group.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
stylesheets/commons/TeamParticipantCard.scss Renames switches container styling to controls and changes compact-mode selector scope to work with external controls.
lua/wikis/commons/Widget/Participants/Team/ParticipantControls.lua New widget that renders shared controls and optional Player Info link.
lua/wikis/commons/Widget/Participants/Team/CardsGroup.lua Uses the extracted controls widget and adds a showControls prop to suppress inline controls.
lua/wikis/commons/TeamParticipants/Controller.lua Detects external controls via page variables and passes showControls / playerinfo into the display widget.

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

Comment on lines +38 to +44
---@param frame Frame
---@return ParticipantsTeamParticipantControls
function ParticipantsTeamParticipantControls.fromTemplate(frame)
local args = Arguments.getArgs(frame)
teamParticipantsVars:set('externalControlsRendered', 'true')
return ParticipantsTeamParticipantControls(args)
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

imo move this to constructor (we already have Module:Widget/Factory as entrypoint for widgets from wikicode)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moving this to constructor would set the externalControlsRendered = true no matter where it's initialized from right? So it would set it also when called from CardsGroup, which is not inteded. I might be wrong so just asking

Copy link
Collaborator

Choose a reason for hiding this comment

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

we could make externalControlsRendered to be passed as constructor arg and adjust the rest as accordingly

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could do like that yes, but what's main benefit over the current one?

Copy link
Collaborator

Choose a reason for hiding this comment

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

we pretty much standardized all widgets' wikicode entrypoint to Module:Widget/Factory
I'm not a huge fan of adding a separate entrypoint just for this widget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants