refactor(table2): move striping logic to client-side JavaScript#7209
Open
refactor(table2): move striping logic to client-side JavaScript#7209
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Moves Table2 row striping from Lua-render-time logic to a client-side JS module, enabling rowspan-aware “group” striping, re-striping after sort operations, and hover highlighting across rowspan groups.
Changes:
- Removed Lua BodyStripe context and server-side striping computation; Table2 rows now emit
data-rowspan-countfor client use. - Updated Table2 widget to expose
data-striped="false"when striping is disabled, and removed standalone CSSnth-childstriping. - Added
javascript/commons/Table2.jsto apply striping + group hover behavior and hooked it intojavascript/Main.js.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| stylesheets/commons/Table2.scss | Adds table2__row--group-hover styling; removes standalone nth-child striping rule. |
| lua/wikis/commons/Widget/Table2/TableBody.lua | Removes server-side striping logic and BodyStripe context usage. |
| lua/wikis/commons/Widget/Table2/Table.lua | Adds data-striped="false" when striped is disabled; no longer wraps body in stripe context. |
| lua/wikis/commons/Widget/Table2/Row.lua | Emits data-rowspan-count for body rows to support JS grouping. |
| lua/wikis/commons/Widget/Contexts/Table2.lua | Removes BodyStripe context. |
| javascript/commons/Table2.js | New module implementing rowspan-aware striping, sortEnd re-striping, and group hover highlighting. |
| javascript/Main.js | Includes Table2 module in the test loader list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Move table2 row striping from Lua server-side rendering to client-side JavaScript to better handle rowspan grouping. Striping now treats rows with rowspan > 1 as a single visual group, automatically re-stripes when tables are sorted, and adds group hover highlighting for rowspan groups.
How did you test this change?
dev + devtools