Skip to content

Fix transparent verification checkmark in dark mode #30235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 7, 2025

Conversation

Banbuii
Copy link
Contributor

@Banbuii Banbuii commented Jul 1, 2025

fixes #28285

What did I change?
I added a white version of the verification shield as a background to the verification symbol (checkmark) when authenticating a new web-device with another device.

Before:
Checkmark_before

After:
Checkmark_after

Why did I change it?
The checkmark in the verification icon was transparent, which lead to a black checkmark in darkmode, while the corresponding checkmark in the other device was white. (See issue description.)
Now it is also shown as a white checkmark.

Testing:

  • Log into account
  • Turn on dark mode
  • Verify session with external device

@Banbuii Banbuii requested a review from a team as a code owner July 1, 2025 10:01
@Banbuii Banbuii requested review from dbkr and florianduros July 1, 2025 10:01
@github-actions github-actions bot added the Z-Community-PR Issue is solved by a community member's PR label Jul 1, 2025
@dbkr dbkr added the T-Defect label Jul 1, 2025
@@ -59,3 +59,8 @@ Please see LICENSE files in the repository root for full details.
mask-image: url("$(res)/img/e2e/verified.svg");
background-color: $e2e-verified-color;
}

.mx_E2EIcon_verified .mx_E2EIcon_normal::after {
Copy link
Member

Choose a reason for hiding this comment

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

Why is one of these the normal selector and one an after?

Copy link
Contributor Author

@Banbuii Banbuii Jul 2, 2025

Choose a reason for hiding this comment

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

The <div> of the normal icon is a child of the <div> of the verified icon - not its ::after pseudo class. Yet the icons get rendered by the ::after so we need this selector to corretly apply color and resizing.

Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

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

You also have some test failures and I think you need to run prettier.

content = <div className={classes} style={style}><div className="mx_E2EIcon_normal" /></div>;
} else {
content = <div className={classes} style={style} />;
}
Copy link
Member

Choose a reason for hiding this comment

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

Not sure I understand this change: aren't the classes supposed to correspond to the state of the icon, so normal and verified are separate states? Why is this adding normal when it's verified? Also, why the nested div?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just used the "normal" Icon, to put it behind the verified icon, to use it as a white background. I didn't really know how else to do it, except to use a white rectangle or something. But in any case I needed some kind of additional div to use a a background, because otherwise, the whole box around the verified shield would be white, and that looked bad (in my opinion).
And the "normal" icon already had the right form factor.

But I can change the Icon to a new div with a smaller rectangle. I just thought it would be better to reuse existing icons, but as said, I can easily change that.

Copy link
Member

Choose a reason for hiding this comment

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

Aha! I hadn't realised that's what this was doing. I think this could definitely do with a comment! I think it will also need the same with the warning state of the icon, as that has a '!' cutout in the shield.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Then I will add it to that as well

<div
class="mx_E2EIcon_normal"
/>
</div>
Copy link
Member

Choose a reason for hiding this comment

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

Again, why another nested div?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The nested div is for the background, to not have the white background being bigger than the verified icon.

@Banbuii
Copy link
Contributor Author

Banbuii commented Jul 7, 2025

You also have some test failures and I think you need to run prettier.

Hi again,
I have now formatted the code with prettier and added the requested comments, as well as a white background to the warning icon. The BG for the warning icon as well as the verified icon only applies to the e2e icons.

What I am still unsure about are the failing testcases for the playwright tests. I have looked into them, and I am genuinely confused why they are failing, because it seems like it's testcases that have nothing to do with what I changed?
If you could give me a pointer, what I might have done wrong, that would be greatly appreciated!

@dbkr
Copy link
Member

dbkr commented Jul 7, 2025

We have flaky tests at the moment so the failures probably aren't related: I've retried and it seems fine now.

Also, please don't force-push PRs, it means we can't see what code we've already reviewed.

@dbkr dbkr added this pull request to the merge queue Jul 7, 2025
Merged via the queue into element-hq:develop with commit aa2dc8e Jul 7, 2025
31 of 33 checks passed
@Banbuii
Copy link
Contributor Author

Banbuii commented Jul 7, 2025

Thanks for accepting the PR
And sorry for the force push^^"
I will keep it in mind!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verification Shield has a black Check-Mark in Dark-Mode
2 participants