feat: wire workspace custom emoji into the template#18
Merged
Conversation
Source workspace custom emoji live from Slack `emoji.list` and pass them
into <BlockKitchen> via the new `customEmojis` prop (block-kitchen 0.8.4),
so the picker offers a Custom category and the preview resolves custom
images. The template has no DB, so live emoji.list is the natural source.
- worker: add GET /api/slack/emojis — proxies emoji.list and normalizes
the { name: value } map into { name, url, alias }[] (alias: entries
split into the alias field), guarded by the bot emoji:read scope
- client: fetch the endpoint on mount and hand the array to the builder
in both message and modal modes; non-blocking on failure
- manifest + SLACK_BOT_SCOPES: add the emoji:read bot scope
- doctor: check for emoji:read in the manifest
- README: document the customEmojis prop + the emoji.list endpoint wiring
Backward-compatible: customEmojis is optional and the template builds
unchanged when the array is empty (e.g. before the app is installed).
Implements ENG-4794.
https://claude.ai/code/session_01KSTrh3sekyiozbhH8tAZeM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires workspace custom emoji into the template end-to-end, so it demonstrates the
customEmojispattern downstream adopters copy from. The template now sources custom emoji live from Slackemoji.list(it has no DB, so the live API is the natural source vs. a synced table) and passes them into<BlockKitchen>via the newcustomEmojisprop added in@tightknitai/block-kitchen@0.8.4(ENG-4792). With it set, the picker offers a Custom category and the preview resolves:custom:directives to workspace images.src/worker/index.ts): newGET /api/slack/emojisproxiesemoji.list(bot token) and normalizes the{ name: value }map into{ name, url, alias }[]—alias:<target>values split into thealiasfield, everything else is a hostedurl. Guarded byrequireBotInstalland the botemoji:readscope.src/client/App.tsx): fetches the endpoint once on mount and hands the array to the builder in both message and modal modes (custom emoji are workspace-level). Non-blocking — any failure (not installed, missing scope) falls back to an empty list and the library's defaults.manifest.json+SLACK_BOT_SCOPESinwrangler.jsonc): addemoji:read.scripts/doctor.shnow checks foremoji:readand the reinstall reminder calls it out.@tightknitai/block-kitchen0.8.3→0.8.4.Type of change
Area
src/)/api/slack/*)scripts/).github/workflows,wrangler.jsonc)Test plan
pnpm run typecheckpassespnpm run buildpasses (Vite client + worker)pnpm run dev:tunnelexercised end-to-end against a real workspace — needs a Slack install with the newemoji:readscope (reinstall viapnpm run install-appafter re-pushing the manifest)Manual checks to run against a live workspace:
Related issues
Implements ENG-4794. Depends on ENG-4792 (the
customEmojisprop), shipped in block-kitchen 0.8.4.Checklist
README.md/wrangler.jsoncfor the new scope + endpoint (no.dev.vars.examplechange —SLACK_BOT_SCOPESlives inwrangler.jsonc)customEmojisis optional; the template builds unchanged when the array is emptyNote
Existing installs must be reinstalled to grant the new
emoji:readbot scope: re-pushmanifest.jsonat api.slack.com, thenpnpm run install-app. Until then,/api/slack/emojisreturns an error and the builder degrades gracefully to standard emoji only.https://claude.ai/code/session_01KSTrh3sekyiozbhH8tAZeM
Generated by Claude Code