Skip to content

Conversation

@Eetwalt
Copy link
Collaborator

@Eetwalt Eetwalt commented Jan 21, 2026

Summary

This introduces a new feature of exporting these elements as images by either downloading or copying to clipboard:

  • Brackets
  • Group tables
  • Cross tables
  • Match list

How did you test this change?

Locally compiled css & js. Can use dev tools too.

Dropdown examples

image image

Export examples:

Liquipedia CBLOL_2026_Cup Regular Season Group Table
Liquipedia StarLadder_2025_Major_Stage 1 Round 1
Liquipedia CBLOL_2026_Cup Regular Season Crosstable

@Eetwalt Eetwalt added the stylesheets Changes to stylesheets label Jan 21, 2026
Copilot AI review requested due to automatic review settings January 21, 2026 11:00
@Eetwalt Eetwalt added the javascript Changes to JavaScript files label Jan 21, 2026
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 an export-as-image feature that allows users to download or copy brackets, group tables, cross tables, and match lists as images to the clipboard.

Changes:

  • Added dropdown UI components for selecting export options (copy to clipboard or download)
  • Implemented image export functionality using html2canvas to capture content and compose branded images with headers and footers
  • Added Font Awesome icons for share, copy, and download actions

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
stylesheets/commons/Dropdown.scss Styling for dropdown widget components with light/dark theme support
stylesheets/Main.scss Imported Dropdown styles and removed basic body styling
lua/wikis/commons/Widget/Basic/Dropdown/Item.lua Lua widget for individual dropdown menu items with optional icons and links
lua/wikis/commons/Widget/Basic/Dropdown/Container.lua Lua widget for dropdown container with toggle button
lua/wikis/commons/Icon/Data.lua Added icon definitions for share, copy, and download
lua/spec/dropdown_spec.lua Test suite for dropdown widget functionality
javascript/commons/ExportImage.js Core export functionality including canvas composition, image caching, and clipboard operations
javascript/commons/Dropdown.js JavaScript for dropdown menu toggle behavior
javascript/Main.js Registered new Dropdown and ExportImage modules

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

@Eetwalt Eetwalt requested review from FO-nTTaX and liquidely January 21, 2026 11:10
@Eetwalt Eetwalt changed the base branch from main to dropdown-widget January 21, 2026 11:41
@Eetwalt Eetwalt changed the base branch from dropdown-widget to main January 21, 2026 12:07
);
context.fill();

const mainTitle = mw.config.get( 'wgTitle' );
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe retrieve the DISPLAYTITLE here instead of the MW Pagename?
Not sure if that is exposed in the config, or whether you'd need to get that from the h1.firstHeading.

Copy link
Member

Choose a reason for hiding this comment

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

It's not in the config rn, but it could be added if we want this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

tend to agree with Salt

Copy link
Collaborator

Choose a reason for hiding this comment

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

agree that displaytitle seems more fitting

Copy link
Collaborator

Choose a reason for hiding this comment

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

There's an argument to be made that only the pagename is a reliable way to get back to the page, with displayname you are always relying on the search.
But I think we'd probably value a nice display more than that.

Copy link
Member

Choose a reason for hiding this comment

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

mw.config.get('wgDisplayTitle'); this now returns the display title, either the one set by a user, or if none is set the default one built from the url

Copy link
Member

Choose a reason for hiding this comment

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

(mind pages need to be purged for it to be available)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

using wgDisplayTitle with fallback to wgTitle now

);
context.fill();

const mainTitle = mw.config.get( 'wgTitle' );
Copy link
Member

Choose a reason for hiding this comment

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

It's not in the config rn, but it could be added if we want this.

Comment on lines 352 to 355
generateFilename( title ) {
const pageTitle = mw.config.get( 'wgTitle' );
return `Liquipedia ${ pageTitle } ${ title }`;
}
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add something more to the file name like the current date and time in case someone wants to export more than one thing from the same page, say multiple groups etc

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point, added

Copy link
Member

Choose a reason for hiding this comment

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

also do we have any thoughts on illegal characters in filenames? mediawiki titles can have / chars, which on most systems are not allowed in file names. Might need some research

Copy link
Collaborator

@hjpalpha hjpalpha Jan 22, 2026

Choose a reason for hiding this comment

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

could just gsub those to underscores

/ (forward slash)
< (less than)
> (greater than)
: (colon - sometimes works, but is actually NTFS Alternate Data Streams)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)
* (asterisk)

come to mind from the top of my head

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh and windoofs has length restrictions too

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If we used the display name for the file name too, would that work? Do those have illegal characters

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah displayname allows those chars too

Copy link
Member

Choose a reason for hiding this comment

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

either way displaytitles are optional, so we need to be able to support page names, but hjpa correctly pointed out that displaytitles have few rules

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added illegal character sanitation and fallback to wgTitle if wgDisplayTitle is not available

Eetwalt and others added 9 commits January 22, 2026 22:17
* Add Metafy link

* add metafy suffix and fix to alphab order in suffixes

* Update Icons.scss

---------

Co-authored-by: hjpalpha <75081997+hjpalpha@users.noreply.github.com>
Co-authored-by: Eetu Rantanen <75437856+Eetwalt@users.noreply.github.com>
* create shopmerch module

* add to all

* add default for url

* always show icon

* add default icon

* change defaults

* chore: update visual snapshots

* constant char pattern

* fix

* use I18n, lose option to customize text and icon

* use mw existings methods when possible

* remove redundant props

Co-authored-by: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com>

* simplify by only allowing slug input and show errors on bad inputs

* fix asserts and consider escaped chars by constructing the final url before check

* plain

Co-authored-by: SyntacticSalt <mail@mbergen.de>

---------

Co-authored-by: ElectricalBoy <15651807+ElectricalBoy@users.noreply.github.com>
Co-authored-by: SyntacticSalt <mail@mbergen.de>
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.

7 participants