From f3dfd9294729fec5eb4ece01216b5591e52324cf Mon Sep 17 00:00:00 2001 From: Tanner Linsley Date: Wed, 14 Oct 2026 05:20:12 -0600 Subject: [PATCH] fix: make catalog previews independent of host timezone --- .../previews/132-shadcn-tooltip-advanced.svg | 2 +- .../previews/190-shadcn-tooltip-default.svg | 2 +- .../previews/191-shadcn-tooltip-formatter.svg | 2 +- .../previews/192-shadcn-tooltip-icons.svg | 2 +- .../193-shadcn-tooltip-indicator-line.svg | 2 +- .../194-shadcn-tooltip-indicator-none.svg | 2 +- .../195-shadcn-tooltip-label-custom.svg | 2 +- .../196-shadcn-tooltip-label-formatter.svg | 2 +- .../197-shadcn-tooltip-label-none.svg | 2 +- benchmarks/conformance/previews/manifest.json | 20 +++++++++---------- scripts/catalog-preview.mjs | 1 + scripts/catalog-preview.test.mjs | 3 ++- 12 files changed, 22 insertions(+), 20 deletions(-) diff --git a/benchmarks/conformance/previews/132-shadcn-tooltip-advanced.svg b/benchmarks/conformance/previews/132-shadcn-tooltip-advanced.svg index e45a795f..a74d4320 100644 --- a/benchmarks/conformance/previews/132-shadcn-tooltip-advanced.svg +++ b/benchmarks/conformance/previews/132-shadcn-tooltip-advanced.svg @@ -1 +1 @@ - + diff --git a/benchmarks/conformance/previews/190-shadcn-tooltip-default.svg b/benchmarks/conformance/previews/190-shadcn-tooltip-default.svg index a536d1d6..f3565020 100644 --- a/benchmarks/conformance/previews/190-shadcn-tooltip-default.svg +++ b/benchmarks/conformance/previews/190-shadcn-tooltip-default.svg @@ -1 +1 @@ - + diff --git a/benchmarks/conformance/previews/191-shadcn-tooltip-formatter.svg b/benchmarks/conformance/previews/191-shadcn-tooltip-formatter.svg index 3f91ac67..231b2330 100644 --- a/benchmarks/conformance/previews/191-shadcn-tooltip-formatter.svg +++ b/benchmarks/conformance/previews/191-shadcn-tooltip-formatter.svg @@ -1 +1 @@ - + diff --git a/benchmarks/conformance/previews/192-shadcn-tooltip-icons.svg b/benchmarks/conformance/previews/192-shadcn-tooltip-icons.svg index 92998466..a3f74064 100644 --- a/benchmarks/conformance/previews/192-shadcn-tooltip-icons.svg +++ b/benchmarks/conformance/previews/192-shadcn-tooltip-icons.svg @@ -1 +1 @@ - + diff --git a/benchmarks/conformance/previews/193-shadcn-tooltip-indicator-line.svg b/benchmarks/conformance/previews/193-shadcn-tooltip-indicator-line.svg index f3fa5dcf..ea3ce186 100644 --- a/benchmarks/conformance/previews/193-shadcn-tooltip-indicator-line.svg +++ b/benchmarks/conformance/previews/193-shadcn-tooltip-indicator-line.svg @@ -1 +1 @@ - + diff --git a/benchmarks/conformance/previews/194-shadcn-tooltip-indicator-none.svg b/benchmarks/conformance/previews/194-shadcn-tooltip-indicator-none.svg index 24bc2585..4f2e897e 100644 --- a/benchmarks/conformance/previews/194-shadcn-tooltip-indicator-none.svg +++ b/benchmarks/conformance/previews/194-shadcn-tooltip-indicator-none.svg @@ -1 +1 @@ - + diff --git a/benchmarks/conformance/previews/195-shadcn-tooltip-label-custom.svg b/benchmarks/conformance/previews/195-shadcn-tooltip-label-custom.svg index 7d9f4e08..ab1a5767 100644 --- a/benchmarks/conformance/previews/195-shadcn-tooltip-label-custom.svg +++ b/benchmarks/conformance/previews/195-shadcn-tooltip-label-custom.svg @@ -1 +1 @@ - + diff --git a/benchmarks/conformance/previews/196-shadcn-tooltip-label-formatter.svg b/benchmarks/conformance/previews/196-shadcn-tooltip-label-formatter.svg index 003322dd..64f12719 100644 --- a/benchmarks/conformance/previews/196-shadcn-tooltip-label-formatter.svg +++ b/benchmarks/conformance/previews/196-shadcn-tooltip-label-formatter.svg @@ -1 +1 @@ - + diff --git a/benchmarks/conformance/previews/197-shadcn-tooltip-label-none.svg b/benchmarks/conformance/previews/197-shadcn-tooltip-label-none.svg index 941b2616..b415f939 100644 --- a/benchmarks/conformance/previews/197-shadcn-tooltip-label-none.svg +++ b/benchmarks/conformance/previews/197-shadcn-tooltip-label-none.svg @@ -1 +1 @@ - + diff --git a/benchmarks/conformance/previews/manifest.json b/benchmarks/conformance/previews/manifest.json index 8e27d4b0..146154f1 100644 --- a/benchmarks/conformance/previews/manifest.json +++ b/benchmarks/conformance/previews/manifest.json @@ -2,7 +2,7 @@ "schemaVersion": 1, "width": 288, "height": 192, - "sourceHash": "2ce2590f5c943219b694d3c51bb4806ed785ff0a4058c108fc520b0e6087c183", + "sourceHash": "54ad8bcd52292af01eb73439aebd5ca4186c06ece050bb2d0118406cc36c88ec", "assets": [ { "id": "01-line-gaps", @@ -616,7 +616,7 @@ }, { "id": "132-shadcn-tooltip-advanced", - "sha256": "97738ec4dd4be6c3e40c7b3bae1fa519e809c5f71f451384d2be9b84ef4be79a", + "sha256": "8762da7358bcfa728e206a9c906cf596f298f483d39f8e01eeb086c1ffc991e4", "bytes": 5019 }, { @@ -906,42 +906,42 @@ }, { "id": "190-shadcn-tooltip-default", - "sha256": "fe48eaec0c292c1338d653953946483982ef1b23ec356478b24bbf11730fd3f9", + "sha256": "51bd9df24b4f9e1b9e1978c870d901dd7c7e861aba5530e786bddfba070247fc", "bytes": 5018 }, { "id": "191-shadcn-tooltip-formatter", - "sha256": "43eb6270aa388f3a3004cec62e53f0fbdb73ff5ddc5c4190649ff64d61730240", + "sha256": "b7e374ccd584b066a7501419d7f021a6397911f90dfc498ac2dc5f79e8b94beb", "bytes": 5020 }, { "id": "192-shadcn-tooltip-icons", - "sha256": "bda712a532d9455b3409e7dd4280e1e9262a1bc805fe6b7ffcc237de9693e39e", + "sha256": "2f61168ff6f8a22b04fdea877adfe9c4e2dfbd2c16fc4df734a0d508fac9b959", "bytes": 5016 }, { "id": "193-shadcn-tooltip-indicator-line", - "sha256": "a46a207d4db94529ad698128a0f348300212593c91517fbeb05a4a6e9de07888", + "sha256": "4be629683b7b8688e318e27e769e5da19732f1a7b58cbdfdab9a33b63f31fb3e", "bytes": 5025 }, { "id": "194-shadcn-tooltip-indicator-none", - "sha256": "ac6fe965bea2a6588cc0597a595fa8624c7f6cac3b38a20201ae8807f0ba4514", + "sha256": "b5606048801c5fc115081a953430c46228ebb6f43dfe79a18891d2fe3f8283fd", "bytes": 5023 }, { "id": "195-shadcn-tooltip-label-custom", - "sha256": "b09982f65a0481e1c2efdee73d3132058594acdc9786d8c1f9ad877816752536", + "sha256": "55ab8ea80d10636234d51d03172a5b32fff6541a51b02ff800f939b346131e6f", "bytes": 5023 }, { "id": "196-shadcn-tooltip-label-formatter", - "sha256": "b18e7ed66963b22aa33bc543ab08d119be452cf7e6f77d485f8756694dd16f2f", + "sha256": "26bcd0b7899a2545c8a3e0bc46f027836d3ef59a6f99e7fe4d36635897c9f951", "bytes": 5026 }, { "id": "197-shadcn-tooltip-label-none", - "sha256": "af6631dd0b4e88a936d9cff1ae28a90b549ef6c2d72513b90e9dadb80d4f437a", + "sha256": "4968486648c607560e8b47274b3fcd628134c2f9453a0d09d9362861e0d011bf", "bytes": 5019 } ] diff --git a/scripts/catalog-preview.mjs b/scripts/catalog-preview.mjs index 016f59ee..17906904 100644 --- a/scripts/catalog-preview.mjs +++ b/scripts/catalog-preview.mjs @@ -943,6 +943,7 @@ export function createCatalogPreviewContext(browser) { colorScheme: 'light', deviceScaleFactor: 1, locale: 'en-US', + timezoneId: 'UTC', reducedMotion: 'reduce', viewport: { width: catalogPreviewWidth, diff --git a/scripts/catalog-preview.test.mjs b/scripts/catalog-preview.test.mjs index f6f5b30b..127ce433 100644 --- a/scripts/catalog-preview.test.mjs +++ b/scripts/catalog-preview.test.mjs @@ -128,11 +128,12 @@ describe('catalog previews', () => { ).toThrow('did not render a TanStack chart SVG') }) - it('pins the browser locale used to render checked previews', () => { + it('pins the browser locale and timezone used to render checked previews', () => { const newContext = vi.fn((options) => options) expect(createCatalogPreviewContext({ newContext })).toMatchObject({ locale: 'en-US', + timezoneId: 'UTC', }) expect(newContext).toHaveBeenCalledOnce() })