Skip to content

Commit 8ad5d5c

Browse files
committed
🐛(frontend) fix callout emoji list
Removing explicit categories prop from EmojiPicker to let emoji-mart manage categories and avoid mismatch causing runtime error with locales.
1 parent 1d20a8b commit 8ad5d5c

File tree

5 files changed

+24
-26
lines changed

5 files changed

+24
-26
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ and this project adheres to
2121
- 🔒️(backend) configure throttle on every viewsets #1343
2222
- ⬆️ Bump eslint to V9 #1071
2323

24+
### Fixed
25+
26+
- 🐛(frontend) fix callout emoji list #1366
27+
2428
## [3.6.0] - 2025-09-04
2529

2630
### Added

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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,8 +699,23 @@ test.describe('Doc Editor', () => {
699699
const emojiButton = calloutBlock.getByRole('button');
700700
await expect(emojiButton).toHaveText('💡');
701701
await emojiButton.click();
702-
await page.locator('button[aria-label="⚠️"]').click();
703-
await expect(emojiButton).toHaveText('⚠️');
702+
// Group smiley
703+
await expect(page.getByRole('button', { name: '🤠' })).toBeVisible();
704+
// Group animals
705+
await page.getByText('Animals & Nature').scrollIntoViewIfNeeded();
706+
await expect(page.getByRole('button', { name: '🦆' })).toBeVisible();
707+
// Group travel
708+
await page.getByText('Travel & Places').scrollIntoViewIfNeeded();
709+
await expect(page.getByRole('button', { name: '🚝' })).toBeVisible();
710+
// Group objects
711+
await page.getByText('Objects').scrollIntoViewIfNeeded();
712+
await expect(page.getByRole('button', { name: '🪇' })).toBeVisible();
713+
// Group symbol
714+
await page.getByText('Symbols').scrollIntoViewIfNeeded();
715+
await expect(page.getByRole('button', { name: '🛃' })).toBeVisible();
716+
// Group flag
717+
await page.getByText('Flags').scrollIntoViewIfNeeded();
718+
await expect(page.getByRole('button', { name: '🏴‍☠️' })).toBeVisible();
704719

705720
await page.locator('.bn-side-menu > button').last().click();
706721
await page.locator('.mantine-Menu-dropdown > button').last().click();

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ import { Box } from '@/components';
77

88
interface EmojiPickerProps {
99
emojiData: EmojiMartData;
10-
categories: string[];
1110
onClickOutside: () => void;
1211
onEmojiSelect: ({ native }: { native: string }) => void;
1312
}
1413

1514
export const EmojiPicker = ({
1615
emojiData,
17-
categories,
1816
onClickOutside,
1917
onEmojiSelect,
2018
}: EmojiPickerProps) => {
@@ -24,7 +22,6 @@ export const EmojiPicker = ({
2422
<Box $position="absolute" $zIndex={1000} $margin="2rem 0 0 0">
2523
<Picker
2624
data={emojiData}
27-
categories={categories}
2825
locale={i18n.resolvedLanguage}
2926
navPosition="none"
3027
onClickOutside={onClickOutside}

src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-blocks/CalloutBlock.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Box, BoxButton, Icon } from '@/components';
1010
import { DocsBlockNoteEditor } from '../../types';
1111
import { EmojiPicker } from '../EmojiPicker';
1212

13-
import InitEmojiCallout from './initEmojiCallout';
13+
import emojidata from './initEmojiCallout';
1414

1515
export const CalloutBlock = createReactBlockSpec(
1616
{
@@ -79,8 +79,7 @@ export const CalloutBlock = createReactBlockSpec(
7979

8080
{openEmojiPicker && (
8181
<EmojiPicker
82-
emojiData={InitEmojiCallout.emojidata}
83-
categories={InitEmojiCallout.calloutCategories}
82+
emojiData={emojidata}
8483
onClickOutside={onClickOutside}
8584
onEmojiSelect={onEmojiSelect}
8685
/>

src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-blocks/initEmojiCallout.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,4 @@ if (!emojidata.categories.some((c) => c.id === CALLOUT_ID)) {
5656

5757
void init({ data: emojidata });
5858

59-
const calloutCategories = [
60-
'callout',
61-
'people',
62-
'nature',
63-
'foods',
64-
'activity',
65-
'places',
66-
'flags',
67-
'objects',
68-
'symbols',
69-
];
70-
71-
const calloutEmojiData = {
72-
emojidata,
73-
calloutCategories,
74-
};
75-
76-
export default calloutEmojiData;
59+
export default emojidata;

0 commit comments

Comments
 (0)