feat(emoji): Miro-style emoji picker tool #44
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_whiteboard!44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_emoji_picker_tool"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a Miro-style emoji picker tool: a new toolbar button opens a popover with search + 9 category tabs + ~300 curated emojis. Picking an emoji and clicking the canvas drops it as a first-class
emojiobject — draggable, resizable, rotatable, deletable, erasable, rubber-band selectable, undo/redo, multi-user syncable, and persistent across reload. Zero server changes; reuses the existingobjectstable withtype='emoji'anddata={char, fontSize}.Related Issue
Closes #43
Changes
crates/hero_whiteboard_ui/static/web/js/whiteboard/emoji_picker.js— IIFE with 9 categories x ~33 emojis (~300 total), a small keyword map for search, tabs, an 8-column grid, outside-click-to-close, re-positioning to sit next to the toolbar button.templates/web/board.html— new toolbar button, picker container div, script include.toolbar.js— when the emoji tool is activated, open the picker; when switched away, close it.app.js—WhiteboardEmojiPicker.init()andcase 'emoji':increateObjectFromData(restoreschar,fontSize, width/height on load).objects.js—createEmoji(x, y, opts)builds aKonva.Group name='object emoji'containing aKonva.Text(font-family stack: Apple/Segoe/Noto Color Emoji) + an invisible.bghit rect; newapplyTransformbranch enforces uniform scale viamin(scaleX, scaleY)on the fontSize, keeps.bgin sync; exported in the return object.tools.js—emojiCharstate; new'emoji'branch inonMouseDown: drops the armed emoji at the click position, closes the picker, switches back to select;setEmojiChar/getEmojiCharexports.shortcuts.js—':'opens the picker (subject to the existing INPUT/TEXTAREA/contentEditable guard);Escapecloses the picker first before falling through to deselect.sync.js— serialize reads_emojiChar/_emojiFontSizeoff the group; applySyncUpdate applies incoming char/fontSize changes to the Konva text and resizes the.bgrect.whiteboard.css—.wb-emoji-picker(popover + search + tabs + grid + cell) styles using theme vars.Test Results
cargo check --workspace: passcargo clippy --workspace -- -D warnings: passcargo fmt --check: passEntirely vanilla JS / CSS / HTML; UI behavior needs manual verification in the browser.
Manual verification
:on the canvas opens the picker; typing:inside a sticky/text/document editor does NOT.New emoji-smile toolbar button opens a picker popover with search, 9 category tabs (~300 curated emojis), and click-to-place. After picking an emoji the next canvas click drops it at that point as a first-class 'emoji' object (Konva.Text inside a Group with an invisible .bg hit rect so the generic transformer / rubber-band / eraser / applyTransform paths all work without special cases). - New module: emoji_picker.js (IIFE, no external deps). - Uniform resize: applyTransform takes min(scaleX, scaleY) to keep the glyph square. - Persistence: reuses the existing objects table — type='emoji', data={char, fontSize}. No server changes. - Keyboard: ':' opens the picker (when no input is focused); Escape closes it without falling through to deselect. - Styling: new .wb-emoji-picker CSS; theme vars re-used. #43