#13381: UI: add Slack-style emoji shortcode autocomplete to chat (Emre #1 PR)
app: web-ui
size: XL
Cluster:
Web UI Enhancements and Fixes
## Summary
Adds Slack-style `:emoji:` shortcode autocomplete to the Control UI chat textarea.
## What it does
- Type `:` followed by 2+ characters to trigger an emoji autocomplete popup
- Navigate with ↑/↓ arrow keys, select with Enter or Tab, dismiss with Escape
- Replaces the `:shortcode:` text with the actual emoji character
- Supports 200+ common emoji shortcodes (smile, heart, thumbsup, fire, etc.)
## Implementation
- **`ui/src/ui/emoji-data.ts`** — Lightweight shortcode→emoji map (~200 entries, no external deps)
- **`ui/src/ui/components/emoji-autocomplete.ts`** — Lit component with keyboard navigation, filtering, and text replacement
- **`ui/src/styles/components/emoji-autocomplete.css`** — Styled using existing CSS variables for theme consistency
- **`ui/src/ui/components/emoji-autocomplete.test.ts`** — Unit tests for filtering, selection, and edge cases
- **`ui/src/ui/views/chat.ts`** — Integration into the chat textarea (input handler + keydown interception)
- **`ui/src/styles.css`** — CSS import added
## Design decisions
- No external emoji libraries — keeps bundle small
- Minimum 2 chars after `:` before showing suggestions (reduces noise)
- Max 8 suggestions shown at a time
- Uses existing CSS variables (`--card`, `--border`, `--ring`, etc.) for consistent theming
- Follows existing Lit patterns (legacy decorators, `experimentalDecorators`)
## Testing
- All existing tests pass (914 files, 5908 tests, 0 failures)
- New unit tests for the autocomplete component
- `pnpm build && pnpm check && pnpm test` all green
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds a Slack-style `:emoji:` shortcode autocomplete to the chat compose textarea by introducing a small in-repo shortcode→emoji dataset (`ui/src/ui/emoji-data.ts`), a pure Lit render/logic module for filtering + keyboard handling (`ui/src/ui/components/emoji-autocomplete.ts`), styling for the popup (`ui/src/styles/chat/emoji-autocomplete.css` imported from `ui/src/styles/chat.css`), and integrates it into the chat view (`ui/src/ui/views/chat.ts`) via `@input` updates and `@keydown` interception.
The overall integration approach fits the existing UI architecture (Lit render functions + state stored in the app render state), but there are a couple of correctness issues to address before merge: the hover behavior in the popup is currently a no-op despite being wired up, the documented “2+ chars after `:`” trigger doesn’t match the implementation, and the autocomplete state is stored at module scope in `chat.ts` which can leak/stale across session/tab changes.
<h3>Confidence Score: 3/5</h3>
- This PR has user-visible correctness issues that should be fixed before merging.
- Core functionality and tests look reasonable, but there are confirmed behavior mismatches (hover selection handler is effectively dead code, and the documented minimum trigger length doesn’t match the implementation) plus module-scoped state in the chat view that can persist across session/tab changes and leave stale UI state.
- ui/src/ui/components/emoji-autocomplete.ts, ui/src/ui/views/chat.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#18668: feat(ui/chat): chat UX overhaul
by jasonkneen · 2026-02-16
79.4%
#13548: feat(control-ui): Add quote reply and send message to session features
by Annaxiebot · 2026-02-10
77.8%
#20405: feat(ui): KaTeX math rendering, collapsible tool cards, image attac...
by ayaanngandhi · 2026-02-18
75.1%
#20473: feat(ui): add auto-send with configurable triggers
by pborgen · 2026-02-19
74.6%
#7528: feat: Adds slash command suggestions to chat
by JohnnyD1776 · 2026-02-02
74.1%
#6521: fix: addressed style issue for chat compose and thread on mobile
by spencer-rafada · 2026-02-01
72.8%
#3721: fix(ui): webchat not displaying chat responses
by maxmaxrouge-rgb · 2026-01-29
72.7%
#16733: fix(ui): avoid injected newlines when tool output is hidden
by jp117 · 2026-02-15
72.3%
#17448: ui: make tool cards collapsible with inline expansion
by karimStekelenburg · 2026-02-15
72.2%
#19816: feat(slack): add typingReaction config for DM typing indicator fall...
by dalefrieswthat · 2026-02-18
72.1%