Conversation
Rathoz
commented
May 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the Table2 widget set from the legacy Widget (class-based) system to widget3 functional components + ComponentContext, aligning Table2 with the newer rendering pipeline.
Changes:
- Refactors Table2 components (Table, Header, Body, Row, Cell, CellHeader) to
Component.component(...)and widget3Html. - Replaces legacy Widget contexts with
ComponentContextproviders/readers. - Updates Table2 context definitions to use
Context.create(...).
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| lua/wikis/commons/Widget/Table2/TableHeader.lua | Migrates header to widget3 component + context provider usage. |
| lua/wikis/commons/Widget/Table2/TableBody.lua | Migrates body to widget3 component and rewrites striping/rowspan logic. |
| lua/wikis/commons/Widget/Table2/Table.lua | Migrates table wrapper to widget3 + new Html module; reintroduces defaults via Component.component. |
| lua/wikis/commons/Widget/Table2/Row.lua | Migrates row rendering to widget3 and updates context reads + cell indexing logic. |
| lua/wikis/commons/Widget/Table2/CellHeader.lua | Migrates header cell to widget3 and updates context reads + Html usage. |
| lua/wikis/commons/Widget/Table2/Cell.lua | Migrates cell to widget3 and updates context reads + Html usage. |
| lua/wikis/commons/Widget/Table2/All.lua | Renames internal export table variable; continues exporting Table2 entrypoints. |
| lua/wikis/commons/Widget/Contexts/Table2.lua | Replaces Widget2 contexts with widget3 ComponentContext definitions. |
Comments suppressed due to low confidence (1)
lua/wikis/commons/Widget/Table2/Row.lua:86
- Cell/header detection uses
getmetatable(child)comparisons against component metatables. For widget3 components, all VNodes share the same metatable, so this will never match andcolumnIndex/colspaninference won’t run. Use a VNode identity check (e.g.,type(child)=='table' and child.renderFn == Table2Cell.renderFn/Table2CellHeader.renderFn) instead.
local indexedChildren = Array.map(children, function(child)
if getmetatable(child) == getmetatable(Table2Cell) or getmetatable(child) == Table2CellHeaderMT then
local cellChild = child
local explicitIndex = MathUtil.toInteger(cellChild.props.columnIndex)
if explicitIndex and explicitIndex >= 1 then
columnIndex = math.max(columnIndex, explicitIndex)
elseif cellChild.props.columnIndex == nil then
cellChild.props.columnIndex = columnIndex
end
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
hjpalpha
reviewed
May 7, 2026
|
|
||
| ---@class Table2CellProps | ||
| ---@field children? Renderable|Renderable[] | ||
| ---@field children Renderable[] |
Collaborator
There was a problem hiding this comment.
we use it with non arrays quite often currently
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate table2 to use widget3. This may temporarily break some Squad functionality. But Squad is stacked on this one, so a quick merge between the two.
How did you test this change?
dev with squad, but some independent table2 tests would be useful