Skip to content

Conversation

@Eetwalt
Copy link
Collaborator

@Eetwalt Eetwalt commented Jan 19, 2026

Summary

Adds a basic dropdown widget. Will be used for an upcoming export feature.

How did you test this change?

https://liquipedia.net/leagueoflegends/User:Eetwalt + css & js

image

@Eetwalt Eetwalt self-assigned this Jan 19, 2026
@Eetwalt Eetwalt added stylesheets Changes to stylesheets javascript Changes to JavaScript files labels Jan 19, 2026
Copilot AI review requested due to automatic review settings January 19, 2026 14:52
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 introduces a reusable dropdown widget component that will be used for an upcoming export feature. The implementation includes styling, Lua widget modules, JavaScript functionality, and comprehensive test coverage.

Changes:

  • Added a dropdown widget with toggle button and menu capabilities
  • Implemented styling for both light and dark themes with appropriate hover states
  • Added three new icon definitions (share, copy, download) for export functionality

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
stylesheets/commons/Dropdown.scss Defines dropdown widget styles with theme support and interactive states
stylesheets/Main.scss Imports the new dropdown stylesheet
lua/wikis/commons/Widget/Basic/DropdownItem.lua Implements individual dropdown item widget with icon and link support
lua/wikis/commons/Widget/Basic/Dropdown.lua Implements main dropdown wrapper widget with toggle button
lua/wikis/commons/Icon/Data.lua Adds icon definitions for export-related actions
lua/spec/dropdown_spec.lua Provides comprehensive test coverage for dropdown functionality
javascript/commons/Dropdown.js Implements click handling to toggle dropdown visibility
javascript/Main.js Registers the dropdown JavaScript module

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

Eetwalt and others added 2 commits January 20, 2026 09:45
Co-authored-by: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com>
table.insert(content, self.props.text)

local item = Div{
classes = Array.extend({'dropdown-widget__item'}, self.props.classes or {}),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
classes = Array.extend({'dropdown-widget__item'}, self.props.classes or {}),
classes = Array.extend('dropdown-widget__item', self.props.classes),

Comment on lines 19 to 25
---@class DropdownItemWidgetParameters
---@field icon string|Widget?
---@field text string
---@field link string?
---@field linktype 'internal'|'external'|nil
---@field classes table?
---@field attributes table?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
---@class DropdownItemWidgetParameters
---@field icon string|Widget?
---@field text string
---@field link string?
---@field linktype 'internal'|'external'|nil
---@field classes table?
---@field attributes table?
---@class DropdownItemWidgetParameters
---@field icon string|Widget?
---@field children string|number|Widget|Html|(string|number|Widget|Html)[]
---@field link string?
---@field linktype 'internal'|'external'|nil
---@field classes string[]?
---@field attributes table?

local item = Div{
classes = Array.extend({'dropdown-widget__item'}, self.props.classes or {}),
attributes = self.props.attributes,
children = content
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
children = content
children = WidgetUtil.collect(getIcon(), self props.children)

Comment on lines 37 to 47
local content = {}
if self.props.icon then
local iconWidget
if type(self.props.icon) == 'string' then
iconWidget = Icon{iconName = self.props.icon, size = 'sm'}
else
iconWidget = self.props.icon
end
table.insert(content, iconWidget)
end
table.insert(content, self.props.text)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
local content = {}
if self.props.icon then
local iconWidget
if type(self.props.icon) == 'string' then
iconWidget = Icon{iconName = self.props.icon, size = 'sm'}
else
iconWidget = self.props.icon
end
table.insert(content, iconWidget)
end
table.insert(content, self.props.text)
---@return Widget?
local function getIcon()
if Logic.isEmpty(self.props.icon) then
return
elseif type(self.props.icon) == 'string' then
return Icon{iconName = self.props.icon, size = 'sm'}
end
return self.props.icon
end

written on phone; untested

@Eetwalt Eetwalt requested a review from ElectricalBoy January 21, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Changes to JavaScript files stylesheets Changes to stylesheets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants