Skip to content

Commit 1296bc8

Browse files
mahanticodex
andcommitted
Preserve standalone renderer surfaces during message hover
Co-authored-by: Codex <[email protected]> Signed-off-by: Arjun Mahanti <[email protected]>
1 parent 344c9d0 commit 1296bc8

3 files changed

Lines changed: 30 additions & 6 deletions

File tree

‎src/features/messages/Messages.module.css‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2925,13 +2925,17 @@ html[data-keyboard-navigation] .rawDiff:focus-visible {
29252925
.message[data-actions-revealed]
29262926
> .messageBody
29272927
> .messageContent
2928-
.messageBubble:not([data-emoji-only]) {
2928+
.messageBubble:not([data-emoji-only], [data-diff-only]):not(
2929+
:has(> .text > table:only-child)
2930+
) {
29292931
background: var(--surface-message-hover);
29302932
}
29312933
.message[data-own][data-actions-revealed]
29322934
> .messageBody
29332935
> .messageContent
2934-
.messageBubble:not([data-emoji-only]) {
2936+
.messageBubble:not([data-emoji-only], [data-diff-only]):not(
2937+
:has(> .text > table:only-child)
2938+
) {
29352939
background: var(--surface-message-own-hover);
29362940
}
29372941
}
@@ -3510,10 +3514,6 @@ html[data-keyboard-navigation]
35103514
--reaction-surface: initial;
35113515
--reaction-ink: initial;
35123516
}
3513-
.messageBubble[data-diff-only]::after,
3514-
.messageBubble:has(> .text > table:only-child)::after {
3515-
display: none;
3516-
}
35173517
.workflowAttribution {
35183518
display: inline-flex;
35193519
align-items: baseline;

‎tests/browser/message-content-polish.spec.mjs‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,23 @@ test("reaction counts under an unboxed own table stay readable", async ({
7474
}
7575
});
7676

77+
for (const theme of ["light", "dark"]) {
78+
test(`standalone table and diff hover stays transparent in ${theme}`, async ({
79+
page,
80+
}) => {
81+
await page.goto(
82+
`/tests/fixtures/message-gallery.html?group=references&theme=${theme}`,
83+
);
84+
for (const id of ["table-received", "table-links", "code-diff"]) {
85+
const example = specimen(page, id);
86+
const bubble = example.locator("[data-message-action-anchor]");
87+
await bubble.hover();
88+
await expect(example.locator("[data-actions-revealed]")).toBeVisible();
89+
await expect(bubble).toHaveCSS("background-color", "rgba(0, 0, 0, 0)");
90+
}
91+
});
92+
}
93+
7794
for (const theme of ["light", "dark"]) {
7895
test(`message references and inset surfaces remain legible in ${theme}`, async ({
7996
page,

‎tests/fixtures/message-gallery/examples.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@ export const groups: Group[] = [
195195
"Join https://feedback.communities.buzz.xyz/invite/workshop-testing to help test, and review https://github.com/block/buzz-app/pull/1423 too.",
196196
{ authorId: teammate },
197197
),
198+
single(
199+
"table-received",
200+
"Received standalone table",
201+
"A received table owns its surface even while message actions show.",
202+
"| Item | State |\n| --- | --- |\n| Review | Ready |",
203+
{ authorId: teammate },
204+
),
198205
single(
199206
"table-links",
200207
"Linked table content",

0 commit comments

Comments
 (0)