Repository navigation
fix(table) :: show striped rows in dark mode - #1579
Merged
Merged
Conversation
Collaborator
Author
|
repro from #957 $ cat tests/end-to-end/fixtures/repro_957/index.sql
SELECT 'shell' AS component, 'dark' AS theme;
SELECT 'table' AS component, TRUE AS striped_rows;
SELECT 'x' AS value; SELECT 'x' AS value; SELECT 'x' AS value;
$ cat tests/end-to-end/fixtures/repro_957/light.sql
SELECT 'shell' AS component, 'light' AS theme;
SELECT 'table' AS component, TRUE AS striped_rows;
SELECT 'x' AS value; SELECT 'x' AS value; SELECT 'x' AS value;
$ cat tests/end-to-end/fixtures/repro_957/test.ts
import { expect, type Page, test } from "../../fixture.ts";
async function pixelColor(page: Page, x: number, y: number) {
const png = await page.screenshot({ clip: { x, y, width: 1, height: 1 } });
return page.evaluate(async (data) => {
const image = new Image();
image.src = `data:image/png;base64,${data}`;
await image.decode();
const canvas = document.createElement("canvas");
canvas.width = 1;
canvas.height = 1;
const context = canvas.getContext("2d") as CanvasRenderingContext2D;
context.drawImage(image, 0, 0);
return [...context.getImageData(0, 0, 1, 1).data.slice(0, 3)];
}, png.toString("base64"));
}
async function stripeContrast(page: Page) {
const rows = page.locator("tbody tr");
const backgrounds = [];
for (const row of [rows.nth(0), rows.nth(1)]) {
const box = await row.boundingBox();
if (!box) throw new Error("row is not visible");
backgrounds.push(await pixelColor(page, box.x + box.width - 3, box.y + box.height / 2));
}
const [odd, even] = backgrounds;
return { odd, even, difference: Math.max(...odd.map((channel, i) => Math.abs(channel - even[i]))) };
}
test("striped rows are as visible in dark mode as in light mode", async ({ page }, testInfo) => {
const dark = await stripeContrast(page);
await testInfo.attach("dark", { body: await page.locator("table").screenshot(), contentType: "image/png" });
await page.goto("/repro_957/light.sql");
const light = await stripeContrast(page);
await testInfo.attach("light", { body: await page.locator("table").screenshot(), contentType: "image/png" });
console.log(`STRIPES dark ${JSON.stringify(dark)} light ${JSON.stringify(light)}`);
expect(dark.difference).toBeGreaterThanOrEqual(light.difference / 2);
});
On commit 1f3db30a: |
81reap
force-pushed
the
81reap/issue/957
branch
2 times, most recently
from
October 30, 2026 00:35
5d3acb6 to
c97f0af
Compare
81reap
marked this pull request as ready for review
October 30, 2026 00:35
lovasoa
enabled auto-merge
October 30, 2026 20:51
lovasoa
approved these changes
Oct 30, 2026
lovasoa
reviewed
Oct 30, 2026
Tabler 1.5.0 didn't show table stripes in dark mode. This was fixed in Tabler 1.7.3 (tabler/tabler#3279). So we upgraded and added tests. Fixes #957 Assisted-By :: Claude Opus 5.5
81reap
force-pushed
the
81reap/issue/957
branch
from
October 30, 2026 21:10
29d0bc9 to
7498072
Compare
81reap
enabled auto-merge
October 30, 2026 21:11
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.
Tabler 1.5.0 didn't show table stripes in dark mode. This was fixed in Tabler 1.7.3 (tabler/tabler#3279). So we upgraded and added tests.
Fixes #957
Assisted-By :: Claude Opus 5.5