Skip to content

Commit 0d09f76

Browse files
ZouicheOmarAntoLC
authored andcommitted
💄(frontend) improve comments highlights
Updated comments styles to respect design proposal, adding distinguishable highlighting, click and hover style interactions.
1 parent ce5f9a1 commit 0d09f76

3 files changed

Lines changed: 44 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to
66

77
## [Unreleased]
88

9+
### Changed
10+
11+
- 💄(frontend) improve comments highlights #1961
12+
913
## [v4.8.3] - 2026-03-23
1014

1115
### Changed

src/frontend/apps/e2e/__tests__/app-impress/doc-comments.spec.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,13 @@ test.describe('Doc Comments', () => {
131131
await thread.getByRole('paragraph').first().fill('This is a comment');
132132
await thread.locator('[data-test="save"]').click();
133133
await expect(thread.getByText('This is a comment').first()).toBeHidden();
134+
await expect(editor.getByText('Hello')).toHaveClass('bn-thread-mark');
134135

135-
// Check background color changed
136136
await expect(editor.getByText('Hello')).toHaveCSS(
137137
'background-color',
138-
'rgba(237, 180, 0, 0.4)',
138+
'color(srgb 0.882353 0.831373 0.717647 / 0.4)',
139139
);
140+
140141
await editor.first().click();
141142
await editor.getByText('Hello').click();
142143

@@ -185,6 +186,7 @@ test.describe('Doc Comments', () => {
185186
await thread.getByText('This is an edited comment').first().hover();
186187
await thread.locator('[data-test="resolve"]').click();
187188
await expect(thread).toBeHidden();
189+
188190
await expect(editor.getByText('Hello')).toHaveCSS(
189191
'background-color',
190192
'rgba(0, 0, 0, 0)',
@@ -196,18 +198,21 @@ test.describe('Doc Comments', () => {
196198

197199
await thread.getByRole('paragraph').first().fill('This is a new comment');
198200
await thread.locator('[data-test="save"]').click();
201+
await expect(editor.getByText('Hello')).toHaveClass('bn-thread-mark');
199202

200203
await expect(editor.getByText('Hello')).toHaveCSS(
201204
'background-color',
202-
'rgba(237, 180, 0, 0.4)',
205+
'color(srgb 0.882353 0.831373 0.717647 / 0.4)',
203206
);
207+
204208
await editor.first().click();
205209
await editor.getByText('Hello').click();
206210

207211
await thread.getByText('This is a new comment').first().hover();
208212
await thread.locator('[data-test="moreactions"]').first().click();
209213
await getMenuItem(thread, 'Delete comment').click();
210214

215+
await expect(editor.getByText('Hello')).not.toHaveClass('bn-thread-mark');
211216
await expect(editor.getByText('Hello')).toHaveCSS(
212217
'background-color',
213218
'rgba(0, 0, 0, 0)',
@@ -263,7 +268,7 @@ test.describe('Doc Comments', () => {
263268

264269
await expect(otherEditor.getByText('Hello')).toHaveCSS(
265270
'background-color',
266-
'rgba(237, 180, 0, 0.4)',
271+
'color(srgb 0.882353 0.831373 0.717647 / 0.4)',
267272
);
268273

269274
// We change the role of the second user to reader
@@ -298,7 +303,7 @@ test.describe('Doc Comments', () => {
298303

299304
await expect(otherEditor.getByText('Hello')).toHaveCSS(
300305
'background-color',
301-
'rgba(237, 180, 0, 0.4)',
306+
'color(srgb 0.882353 0.831373 0.717647 / 0.4)',
302307
);
303308
await otherEditor.getByText('Hello').click();
304309
await expect(
@@ -344,7 +349,7 @@ test.describe('Doc Comments', () => {
344349

345350
await expect(editor1.getByText('Document One')).toHaveCSS(
346351
'background-color',
347-
'rgba(237, 180, 0, 0.4)',
352+
'color(srgb 0.882353 0.831373 0.717647 / 0.4)',
348353
);
349354

350355
await editor1.getByText('Document One').click();

src/frontend/apps/impress/src/features/docs/doc-editor/components/comments/styles.tsx

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,37 @@ export const cssComments = (
88
& .--docs--main-editor .ProseMirror {
99
// Comments marks in the editor
1010
.bn-editor {
11-
.bn-thread-mark:not([data-orphan='true']),
12-
.bn-thread-mark-selected:not([data-orphan='true']) {
13-
background: ${canSeeComment ? '#EDB40066' : 'transparent'};
14-
color: var(--c--globals--colors--gray-700);
11+
// Resets blocknote comments styles
12+
.bn-thread-mark,
13+
.bn-thread-mark-selected {
14+
background-color: transparent;
1515
}
1616
17+
${canSeeComment &&
18+
css`
19+
.bn-thread-mark:not([data-orphan='true']) {
20+
background-color: color-mix(
21+
in srgb,
22+
var(--c--contextuals--background--palette--yellow--tertiary) 40%,
23+
transparent
24+
);
25+
border-bottom: 2px solid
26+
var(--c--contextuals--background--palette--yellow--secondary);
27+
28+
mix-blend-mode: multiply;
29+
30+
transition:
31+
background-color var(--c--globals--transitions--duration),
32+
border-bottom-color var(--c--globals--transitions--duration);
33+
34+
&:has(.bn-thread-mark-selected) {
35+
background-color: var(
36+
--c--contextuals--background--palette--yellow--tertiary
37+
);
38+
}
39+
}
40+
`}
41+
1742
[data-show-selection] {
1843
color: HighlightText;
1944
}

0 commit comments

Comments
 (0)