Skip to content

Migrate dark-mode-web to new ab test framework#15299

Merged
Jakeii merged 9 commits intomainfrom
jlk/migrate-dark-mode-test
Mar 3, 2026
Merged

Migrate dark-mode-web to new ab test framework#15299
Jakeii merged 9 commits intomainfrom
jlk/migrate-dark-mode-test

Conversation

@Jakeii
Copy link
Member

@Jakeii Jakeii commented Feb 4, 2026

What does this change?

Migrate Dark Mode on Web 0% test to the new framework. Update the accessibility page for the new opt in behaviour.

The tickbox has been replaced with opt-in links, the domain that the cookie is on didn't play nicely with setCookie, and there's no way to specify a domain so rather than mess around getting it working, links are fine, for this experimental feature.

Regardless, this means anyone opted in will need to re-opt in to retain dark mode.

Why?

We need all tests on the legacy framework removed or migrated so we can delete it!

Screenshots

Before After
before after

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

@Jakeii Jakeii added the maintenance Departmental tracking: maintenance work, not a fix or a feature label Mar 2, 2026
@Jakeii Jakeii added the run_chromatic Runs chromatic when label is applied label Mar 2, 2026
@Jakeii Jakeii marked this pull request as ready for review March 2, 2026 11:48
@Jakeii Jakeii requested review from a team as code owners March 2, 2026 11:48
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Mar 2, 2026
Copy link
Contributor

@dskamiotis dskamiotis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me 👍

description: "Dark mode accessibility feature test on web",
owners: ["dotcom.platform@theguardian.com"],
status: "ON",
expirationDate: "2027-04-05",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a Monday right? Feels like a slightly dangerous time for a test to expire as there's noone working at the weekend to see an upcoming expiry notification. Maybe we should aim for mid week?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's a good shout, would that be the case for any test? Should we add a check for tests ending them on a Monday?

Copy link
Contributor

@cemms1 cemms1 Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I did think about that! Would be nice to warn people about Monday/Friday/Saturday/Sunday expiries. I dunno if it's enough to actually fail a workflow though as there may be some tests which should intentionally expire on a weekend. This also doesn't account for UK bank holidays so didn't want to rely on that alone

renderingTarget,
darkModeAvailable:
frontendData.config.abTests.darkModeWebVariant === 'variant',
darkModeAvailable,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add this config to the other render.* files?

render.allEditorialNewslettersPage.web.tsx
render.article.apps.tsx
render.editionsCrossword.tsx
render.thrasher.apps.tsx

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For apps darkModeAvailable is always true :)
allEditorialNewslettersPage doesn't seem to have dark mode colours setup, so will consider that out of scope for this!
and editionsCrossword I'm not sure?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay we will add the config when we implement dark mode across all pages


const ABTests: ABTest[] = [
{
name: "webex-dark-mode-web",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a long debate about this but the spelling 'WebX' is preferred :]

@Jakeii Jakeii added the run_chromatic Runs chromatic when label is applied label Mar 3, 2026
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Mar 3, 2026
@Jakeii Jakeii merged commit 262f6ac into main Mar 3, 2026
31 checks passed
@Jakeii Jakeii deleted the jlk/migrate-dark-mode-test branch March 3, 2026 14:35
@gu-prout
Copy link

gu-prout bot commented Mar 3, 2026

Seen on PROD (merged by @Jakeii 7 minutes and 58 seconds ago) Please check your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature Seen-on-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants