Skip to content

feat: new table widget#7079

Merged
Rathoz merged 52 commits intomainfrom
new-tables
Feb 17, 2026
Merged

feat: new table widget#7079
Rathoz merged 52 commits intomainfrom
new-tables

Conversation

@Eetwalt
Copy link
Collaborator

@Eetwalt Eetwalt commented Feb 11, 2026

Summary

This PR introduces the base for the new Table widget with the new designs.

Core features:

  • Column Schema: Define column properties (alignment, sizing, sorting) once; all cells inherit automatically
  • Smart Striping: Auto odd/even row coloring that intelligently respects rowspan for grouped rows
  • Native Sorting: MediaWiki sortable plugin integration with sort-type support
  • Theming: Light/dark mode variants (generic and themed)
  • Flexible Layouts: Support colspan/rowspan with automatic column index tracking
  • Auto-Detection: Header rows auto-detect title (first) vs column headers (subsequent rows)
  • Row highlighting (better design solution incoming at some point)
  • Horizontal scrolling when width exceeds available space
  • Manual Mediawiki tables can also be styled the same with class=table2__table

Open questions:

  • Naming: Named it Table2 for now to keep it isolated from other table modules. Eventually, this could be renamed to Table, once it's completely rolled out. Is this a good temporary name?
  • Utils: I made a ColumnUtil file in the Table2/ directory since it's utilities are relevant only for this widget. Even so, should the utilities live somewhere else or is the Table2 directory the right place?

Known limitations:

  • Hovering rows that have a column with rowspan only highlights the single row, not the whole rowgroup. Not sure if this is desired or not (I'd assume user expects the rowgroup to be highlighted, but not sure).
    • Since rowspan usage is quite rare, I suggest this can be tackled at later point since I didn't find a quick and sensible fix to do this without introducing Javascript solution.

How did you test this change?

dev + dev tools
https://liquipedia.net/rainbowsix/User:Eetwalt
Test module:
https://liquipedia.net/commons/Module:Table2Test

image image image image

TableFooter was never used in the codebase. Table2 uses the footer
property
on the Table widget instead, which wraps footer content in a div rather
than
using a dedicated widget.

Changes:
- Remove lua/wikis/commons/Widget/Table2/TableFooter.lua
- Remove TableFooter import from lua/wikis/commons/Widget/Table2/All.lua

All tests pass (417 successes).
- Remove wrapper-level styling props (wrapperClasses, wrapperCss,
wrapperAttributes)
- Remove table-level styling props (tableClasses, tableCss,
tableAttributes)
- Remove colspan/rowspan from Cell and CellHeader (never used)
- Remove Table utility dependency from Cell and CellHeader
- Consolidate props to single-level styling (classes, css, attributes on
wrapper)
- Reorder prop definitions: Structure → Behavior → Content → Styling
- Reduces API complexity by 26% (9 props removed)
- All 417 tests pass with no regressions
- Remove 'foot' from Table2SectionName alias (was defined but never
used)
- Remove foot handling logic from Row.lua (elseif for 'foot' section)
- Remove unused sortClass and sortbottom CSS class logic
- Table footer is rendered as a separate div in Table.lua, not as table
rows
- All 417 tests pass
- Cell and CellHeader were missing attributes = {} in defaultProps
- This caused nil to be passed to HtmlWidgets.Td/Th when attributes
weren't provided
- HtmlWidgets expects attributes to be a table, not nil
- Fixes 'bad argument to attr' error when rendering cells without
explicit attributes
- All 417 tests pass
- WidgetUtil.collect() is for flattening arrays/class lists, not for
merging tables
- Using it on attributes caused invalid table entries (arrays mixed with
table pairs)
- Changed to direct assignment: attributes['data-sort-type'] =
props.sortType
- This properly merges the sortType into the attributes table
- Fixes 'bad argument to attr' error when rendering CellHeaders with
sortType
- All 417 tests pass
Copilot AI review requested due to automatic review settings February 11, 2026 08:55
@Eetwalt Eetwalt added the stylesheets Changes to stylesheets label Feb 11, 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

Introduces a new “Table2” widget foundation (Lua widgets + SCSS) to support updated table designs including column schemas, striping, sorting, and theming.

Changes:

  • Added Table2 widget components (Table, Header/Body, Row/Cell, and supporting contexts/utils).
  • Added SCSS styling for Table2 (light/dark surfaces, header/title, striping, theming).
  • Wired Table2 stylesheet into the main stylesheet bundle.

Reviewed changes

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

Show a summary per file
File Description
stylesheets/commons/Table2.scss New Table2 styling (surface, header/title, striping, themed variant).
stylesheets/Main.scss Includes the new Table2 stylesheet in the build.
lua/wikis/commons/Widget/Table2/Table.lua Main Table2 widget with optional column schema + sortable support.
lua/wikis/commons/Widget/Table2/TableHeader.lua Header section that auto-classifies first header row as title vs columns.
lua/wikis/commons/Widget/Table2/TableBody.lua Body section with “smart striping” that accounts for rowspan grouping.
lua/wikis/commons/Widget/Table2/Row.lua Row widget applying section/kind/stripe/highlight classes and cell indexing.
lua/wikis/commons/Widget/Table2/Cell.lua Body cell widget that inherits column schema props and applies sizing/classes.
lua/wikis/commons/Widget/Table2/CellHeader.lua Header cell widget with inherited column schema props + sorting attributes.
lua/wikis/commons/Widget/Table2/CellIndexer.lua Assigns implicit column indices per row, accounting for colspan.
lua/wikis/commons/Widget/Table2/ColumnUtil.lua Utilities for validating/merging column defs and building css/classes.
lua/wikis/commons/Widget/Table2/ColumnContext.lua Context provider for the column schema.
lua/wikis/commons/Widget/Table2/ColumnIndexContext.lua Context provider for implicit column index propagation.
lua/wikis/commons/Widget/Table2/Section.lua Context provider for section (“head” vs “body”) classification.
lua/wikis/commons/Widget/Table2/HeaderRowKind.lua Context provider for header row kind (“title” vs “columns”).
lua/wikis/commons/Widget/Table2/BodyStripe.lua Context provider for body stripe (“odd” vs “even”).
lua/wikis/commons/Widget/Table2/All.lua Convenience exports for the Table2 widget set.

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

@hjpalpha
Copy link
Collaborator

runtime seems a bit better with the recent changes^^

Yeah quite minor though. I'm thinking if rendering 2k row tables is sensible thing to allow anyway for UX, or should we force pagination or something.

But since client-side pagination isn't useful for this and server-side pagination would be bad user experience so not sure if there's anything to do there

you have tables with hundreds of rows and way more columns
i just upped the row count as it was the easiest solution for producing large stuff
also keep in mind those tables will not necesarrily be the only things on the page

and fwiw i think the memory issue is the biggest problem

@Eetwalt
Copy link
Collaborator Author

Eetwalt commented Feb 12, 2026

Got it down a bit with the recent changes

image

@Eetwalt
Copy link
Collaborator Author

Eetwalt commented Feb 13, 2026

Getting rid of the column index context wrapper and doing the index setting in Row.lua seemed to do wonders. Down to ~30MB with the 2k rows test

image

@Eetwalt
Copy link
Collaborator Author

Eetwalt commented Feb 17, 2026

With the recent changes, mediawiki tables can also be styled the same with class=table2__table:

Before class=wikitable:
image

After class=table2__table:
image
image

@Rathoz Rathoz merged commit 6c29419 into main Feb 17, 2026
8 checks passed
@Rathoz Rathoz deleted the new-tables branch February 17, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stylesheets Changes to stylesheets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants