feat: enable Team Participant controls to be used separately#7194
feat: enable Team Participant controls to be used separately#7194
Conversation
|
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 |
There was a problem hiding this comment.
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
ParticipantControlswidget 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.
lua/wikis/commons/Widget/Participants/Team/ParticipantControls.lua
Outdated
Show resolved
Hide resolved
lua/wikis/commons/Widget/Participants/Team/ParticipantControls.lua
Outdated
Show resolved
Hide resolved
| ---@param frame Frame | ||
| ---@return ParticipantsTeamParticipantControls | ||
| function ParticipantsTeamParticipantControls.fromTemplate(frame) | ||
| local args = Arguments.getArgs(frame) | ||
| teamParticipantsVars:set('externalControlsRendered', 'true') | ||
| return ParticipantsTeamParticipantControls(args) | ||
| end |
There was a problem hiding this comment.
imo move this to constructor (we already have Module:Widget/Factory as entrypoint for widgets from wikicode)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
we could make externalControlsRendered to be passed as constructor arg and adjust the rest as accordingly
There was a problem hiding this comment.
Could do like that yes, but what's main benefit over the current one?
There was a problem hiding this comment.
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
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:
|playerinfo = trueplayerinfo=trueflagHow 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}} }} }}