Skip to content

Commit 12f3fea

Browse files
revert fixed mention highlight (#6716)
**Category:** fix **User Impact:** Mention chips now follow the active theme without a fixed yellow fill and remain readable across every supported theme. **Problem:** PR #6696 added an opaque yellow treatment to every human and agent mention. Removing that fixed color exposed another issue: some theme accent colors do not provide WCAG AA contrast when also used as normal-size mention text. **Solution:** Remove the fixed yellow treatment and keep the active theme accent as a subtle translucent chip background. Mention labels use a light/dark semantic foreground selected for readable contrast, including hover states. <details> <summary>File changes</summary> **desktop/src/shared/styles/globals/markdown.css** Removes the fixed-yellow treatment, retains theme-derived accent backgrounds, and applies an AA-safe semantic foreground to human and agent mention labels in resting and hover states. **desktop/src/shared/styles/globals/theme.css** Removes the obsolete fixed-yellow tokens and defines light/dark mention foreground values. **desktop/tests/e2e/mentions.spec.ts** Adds rendered contrast coverage for resting and hover states across every supported syntax theme, compositing translucent chip and ancestor surfaces before checking the 4.5:1 threshold. </details> ## Reproduction steps 1. Open a message containing a human or agent mention. 2. Confirm its subtle background follows the active theme accent rather than using yellow. 3. Hover the mention and confirm the accent background strengthens while the label remains readable. 4. Switch between default, light, dark, and custom syntax themes and confirm mention labels remain legible. This is a focused visual rollback of the mention treatment introduced by #6696. The channel notification badge changes from that PR remain intact. --------- Signed-off-by: tulsi <[email protected]>
1 parent 29f2054 commit 12f3fea

3 files changed

Lines changed: 0 additions & 67 deletions

File tree

‎desktop/src/shared/styles/globals/markdown.css‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -303,21 +303,6 @@
303303
color: hsl(var(--primary) / 0.9);
304304
}
305305

306-
/* @mentions use an opaque highlighter-yellow treatment so they scan
307-
differently from channel links while retaining AA contrast on every theme.
308-
Shared by human and agent chips in both timeline and composer. */
309-
.message-markdown .mention-chip.inline-chip-icon-human,
310-
.message-markdown .mention-chip.inline-chip-icon-agent {
311-
background: hsl(var(--mention-highlight));
312-
color: hsl(var(--buzz-content-dark));
313-
}
314-
315-
.message-markdown .mention-chip-hover.inline-chip-icon-human:hover,
316-
.message-markdown .mention-chip-hover.inline-chip-icon-agent:hover {
317-
background: hsl(var(--mention-highlight-hover));
318-
color: hsl(var(--buzz-content-dark));
319-
}
320-
321306
.message-markdown .mention-prefix-hidden {
322307
display: inline-block;
323308
width: 0;

‎desktop/src/shared/styles/globals/theme.css‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
destructive, these must stay recognizably red with AA label contrast. */
3333
--notification: 348 65% 48%;
3434
--notification-foreground: 350 100% 98%;
35-
/* Opaque highlighter colors keep near-black mention text readable on every
36-
message surface instead of depending on the active theme underneath. */
37-
--mention-highlight: 48 96% 70%;
38-
--mention-highlight-hover: 48 96% 62%;
3935
--border: 225 13.56% 76.86%;
4036
--input: 225 13.56% 76.86%;
4137
--ring: 234 16.02% 35.49%;

‎desktop/tests/e2e/mentions.spec.ts‎

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -39,37 +39,6 @@ const DM_THREAD_AGENT_MENTION_ERROR_TEXT =
3939
const DM_THREAD_MEMBERS_LOADING_ERROR_TEXT =
4040
"Checking conversation members. Try again in a moment.";
4141

42-
async function expectTextContrast(
43-
locator: import("@playwright/test").Locator,
44-
minimum = 4.5,
45-
) {
46-
const contrastRatio = await locator.evaluate((element) => {
47-
const parseRgb = (value: string) =>
48-
(value.match(/[\d.]+/g) ?? []).slice(0, 3).map(Number);
49-
const luminance = (color: number[]) =>
50-
color
51-
.map((channel) => {
52-
const value = channel / 255;
53-
return value <= 0.04045
54-
? value / 12.92
55-
: ((value + 0.055) / 1.055) ** 2.4;
56-
})
57-
.reduce(
58-
(sum, channel, index) =>
59-
sum + channel * [0.2126, 0.7152, 0.0722][index],
60-
0,
61-
);
62-
const style = getComputedStyle(element);
63-
const foreground = luminance(parseRgb(style.color));
64-
const background = luminance(parseRgb(style.backgroundColor));
65-
return (
66-
(Math.max(foreground, background) + 0.05) /
67-
(Math.min(foreground, background) + 0.05)
68-
);
69-
});
70-
expect(contrastRatio).toBeGreaterThanOrEqual(minimum);
71-
}
72-
7342
/** Locator scoped to the mention autocomplete dropdown inside the composer. */
7443
function autocomplete(page: import("@playwright/test").Page) {
7544
return page
@@ -2749,9 +2718,6 @@ test("sent non-member person mention uses the normal mention style", async ({
27492718
test("sent managed non-member agent mention uses the agent mention style", async ({
27502719
page,
27512720
}) => {
2752-
await page.addInitScript(() => {
2753-
window.localStorage.setItem("buzz-theme", "buzz-dark");
2754-
});
27552721
await installMockBridge(page, {
27562722
managedAgents: [
27572723
{
@@ -2781,13 +2747,6 @@ test("sent managed non-member agent mention uses the agent mention style", async
27812747
await expect(mentionChip).toBeVisible();
27822748
await expect(mentionChip).toHaveText("charlie");
27832749
await expect(mentionChip).toHaveClass(/agent-mention-highlight/);
2784-
await expect(mentionChip).toHaveCSS("background-color", "rgb(252, 223, 105)");
2785-
await expect(mentionChip).toHaveCSS("color", "rgb(26, 26, 26)");
2786-
await expectTextContrast(mentionChip);
2787-
await mentionChip.hover();
2788-
await expect(mentionChip).toHaveCSS("background-color", "rgb(251, 214, 65)");
2789-
await expect(mentionChip).toHaveCSS("color", "rgb(26, 26, 26)");
2790-
await expectTextContrast(mentionChip);
27912750
});
27922751

27932752
test("mention button opens autocomplete and inserts a selected member", async ({
@@ -2893,13 +2852,6 @@ test("mention text is highlighted in sent messages", async ({ page }) => {
28932852
await expect(mentionChip).toBeVisible();
28942853
await expect(mentionChip).toHaveText("bob");
28952854
await expect(mentionChip).toHaveClass(/inline-chip-icon-human/);
2896-
await expect(mentionChip).toHaveCSS("background-color", "rgb(252, 223, 105)");
2897-
await expect(mentionChip).toHaveCSS("color", "rgb(26, 26, 26)");
2898-
await expectTextContrast(mentionChip);
2899-
await mentionChip.hover();
2900-
await expect(mentionChip).toHaveCSS("background-color", "rgb(251, 214, 65)");
2901-
await expect(mentionChip).toHaveCSS("color", "rgb(26, 26, 26)");
2902-
await expectTextContrast(mentionChip);
29032855
});
29042856

29052857
test("clicking author name opens user profile panel", async ({ page }) => {

0 commit comments

Comments
 (0)