Skip to content

feat(editor): replace emoji picker with browse + search#2171

Merged
Philipinho merged 7 commits into
docmost:mainfrom
daysus:feat/emoji-suggestion-list-view
May 8, 2026
Merged

feat(editor): replace emoji picker with browse + search#2171
Philipinho merged 7 commits into
docmost:mainfrom
daysus:feat/emoji-suggestion-list-view

Conversation

@daysus
Copy link
Copy Markdown
Contributor

@daysus daysus commented May 8, 2026

Summary

Replaces the emoji-mart picker with a two-mode popup:

  • Typing bare : opens a browse view with category tabs and an 8-column grid.
  • Typing after : switches to a compact search list.
  • Search uses a simple name.includes() / id.includes() match against a lazy-built index from @emoji-mart/data.

daysus and others added 7 commits May 5, 2026 10:47
Replace the fixed-column emoji grid with a vertical list that displays
each emoji alongside its :shortcode: name. This makes the picker more
discoverable—users can see and learn shortcodes without prior knowledge.

Changes:
- EmojiList: switch from SimpleGrid/ActionIcon to UnstyledButton list
  rows showing emoji glyph + monospace 🆔 label
- Navigation simplified to ArrowUp/ArrowDown (list has no columns)
- Results capped at 8 items for a focused, scannable dropdown
- CSS module: rename menuBtn -> menuItem, tighten padding
Port the exact search algorithm from the original extension:
- Build a flat index from @emoji-mart/data: { id, name (lowercase), native }
- Filter with name.includes(q) || id.includes(q) — predictable, no
  keyword indirection
- Results capped at 5 (same as extension)
- Frequently-used emojis (sorted by usage) shown when query is empty
- Remove emoji-mart init() / SearchIndex / getEmojiDataFromNative
  dependencies; index is built lazily and cached in memory
- Remove unused GRID_COLUMNS constant
When the query is empty the picker shows a category bar with 8 tabs
(people, nature, food…) and a scrollable emoji grid. Typing after ':'
switches to a compact list that shows the glyph and :shortcode: side by
side, making it easy to discover emoji names while you type.

- Category data is loaded lazily from @emoji-mart/data and cached, so
  opening the picker more than once has no overhead
- Grid keyboard nav: arrow keys move by cell/row, Enter picks
- List keyboard nav: up/down through results, Enter picks
- Mouse hover syncs the keyboard selection index in both modes
- incrementEmojiUsage tracks picks so frequently used ones bubble up
  in future sessions
@Philipinho Philipinho merged commit 6046d04 into docmost:main May 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants