Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/web-shell/client/e2e/web-shell.smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ test('loads replayed transcript and connects to fake daemon @smoke', async ({
await expect(page.locator('[data-web-shell-message-list]')).toContainText(
'Hello from fake daemon',
);

// #8214: pin the explicit ::selection rule on message content. This
// asserts the rule is present and matches the [data-user-selectable]
// wrapper; it does not verify the Firefox paint effect itself (this
// repo's Playwright projects are chromium-only).
const selectionBackground = await page.evaluate(() => {
const content = document.querySelector(
'[data-user-selectable] *',
) as Element | null;
if (!content) return null;
return getComputedStyle(content, '::selection').backgroundColor;
});
expect(selectionBackground).toBe('rgba(0, 128, 255, 0.3)');
});

test('submits a prompt and renders a streamed assistant response @smoke', async ({
Expand Down
17 changes: 17 additions & 0 deletions packages/web-shell/client/styles/standalone.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,23 @@ textarea,
user-select: text;
}

/*
* Defensive selection-highlight rule for message content. #8214.
*
* Firefox is suspected of not painting the default selection highlight for
* text whose element chain passes through a `display: contents` element (the
* `data-user-selectable` wrapper on MessageItem). The logical selection
* (copy, selectionchange popup) works fine - only the visual highlight is
* missing. An explicit `::selection` background makes Firefox paint the
* highlight where the default painting may fail. This is a low-risk
* workaround, not a confirmed root-cause fix: the wrapper is shared by user
* and assistant rows alike, and the reporter's environment appears to be an
* embedding page, so its own CSS may also need adjustment.
*/
[data-user-selectable] ::selection {
background: hsl(210 100% 50% / 30%);
}

/*
* iOS Safari auto-zooms any <input> / <textarea> / contenteditable whose
* computed font-size is < 16px when focused. The composer editor sits at
Expand Down
Loading