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

@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.

Comment on lines +54 to +66
if self.props.link then
return Div{
children = {
Link{
link = self.props.link,
linktype = self.props.linktype,
children = {item}
}
}
}
end

return item
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
if self.props.link then
return Div{
children = {
Link{
link = self.props.link,
linktype = self.props.linktype,
children = {item}
}
}
}
end
return item
if not self.props.link then
return item
end
return Div{
children = {
Link{
link = self.props.link,
linktype = self.props.linktype,
children = {item}
}
}
}

if you want to reduce indent by 1 :P

Comment on lines +27 to +29
---@class DropdownItemWidget: Widget
---@operator call(DropdownItemWidgetParameters): DropdownItemWidget
local DropdownItem = Class.new(Widget)
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 DropdownItemWidget: Widget
---@operator call(DropdownItemWidgetParameters): DropdownItemWidget
local DropdownItem = Class.new(Widget)
---@class DropdownItemWidget: Widget
---@operator call(DropdownItemWidgetParameters): DropdownItemWidget
---@field props DropdownItemWidgetParameters
local DropdownItem = Class.new(Widget)

}

return Div{
classes = Array.extend({'dropdown-widget'}, 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'}, self.props.classes or {}),
classes = Array.extend('dropdown-widget', self.props.classes),


---@class DropdownContainerWidgetParameters
---@field button any
---@field content Widget|string|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
---@field content Widget|string|table
---@field children string|number|Widget|Html|(string|number|Widget|Html)[]

toggleButton,
Div{
classes = {'dropdown-widget__menu'},
children = self.props.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 = self.props.content
children = self.props.children

Comment on lines +27 to +28
---@return Widget
function DropdownContainer:render()
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this return a widget even if content/children is empty?

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