Skip to content

feat: wire workspace custom emoji into the template#18

Merged
StephenTangCook merged 1 commit into
mainfrom
claude/dreamy-goodall-ulShd
Jun 4, 2026
Merged

feat: wire workspace custom emoji into the template#18
StephenTangCook merged 1 commit into
mainfrom
claude/dreamy-goodall-ulShd

Conversation

@StephenTangCook

Copy link
Copy Markdown
Contributor

Summary

Wires workspace custom emoji into the template end-to-end, so it demonstrates the customEmojis pattern downstream adopters copy from. The template now sources custom emoji live from Slack emoji.list (it has no DB, so the live API is the natural source vs. a synced table) and passes them into <BlockKitchen> via the new customEmojis prop 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.

  • Backend (src/worker/index.ts): new GET /api/slack/emojis proxies emoji.list (bot token) and normalizes the { name: value } map into { name, url, alias }[]alias:<target> values split into the alias field, everything else is a hosted url. Guarded by requireBotInstall and the bot emoji:read scope.
  • Frontend (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.
  • Scope (manifest.json + SLACK_BOT_SCOPES in wrangler.jsonc): add emoji:read.
  • Docs / tooling: README documents the prop + endpoint wiring; scripts/doctor.sh now checks for emoji:read and the reinstall reminder calls it out.
  • Dep: bump @tightknitai/block-kitchen 0.8.30.8.4.

Type of change

  • New feature
  • Docs
  • Build / CI / deps

Area

  • Builder UI / React SPA (src/)
  • Worker API routes (/api/slack/*)
  • Setup scripts (scripts/)
  • Deploy / CI (.github/workflows, wrangler.jsonc)
  • Docs

Test plan

  • pnpm run typecheck passes
  • pnpm run build passes (Vite client + worker)
  • pnpm run dev:tunnel exercised end-to-end against a real workspace — needs a Slack install with the new emoji:read scope (reinstall via pnpm run install-app after re-pushing the manifest)

Manual checks to run against a live workspace:

  • Picker shows the workspace's custom emoji under the Custom category
  • Preview renders a custom emoji as its workspace image; an alias resolves to its target
  • Sending a message containing a custom emoji posts successfully

Related issues

Implements ENG-4794. Depends on ENG-4792 (the customEmojis prop), shipped in block-kitchen 0.8.4.

Checklist

  • No secrets, tokens, or signing keys committed
  • Updated README.md / wrangler.jsonc for the new scope + endpoint (no .dev.vars.example change — SLACK_BOT_SCOPES lives in wrangler.jsonc)
  • Considered backwards compatibility — customEmojis is optional; the template builds unchanged when the array is empty

Note

Existing installs must be reinstalled to grant the new emoji:read bot scope: re-push manifest.json at api.slack.com, then pnpm run install-app. Until then, /api/slack/emojis returns an error and the builder degrades gracefully to standard emoji only.

https://claude.ai/code/session_01KSTrh3sekyiozbhH8tAZeM


Generated by Claude Code

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
@StephenTangCook StephenTangCook merged commit 710a108 into main Jun 4, 2026
1 check passed
@StephenTangCook StephenTangCook deleted the claude/dreamy-goodall-ulShd branch June 4, 2026 19:22
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