From 919a56c1d542380e12b28714d97deef0d766c12d Mon Sep 17 00:00:00 2001 From: Tyom Semonov Date: Fri, 20 Feb 2026 10:18:58 +0000 Subject: [PATCH 1/5] fix: resolve emoji shortcodes to Unicode in rich_text blocks Use resolveEmoji() from @botarium/mrkdwn to convert emoji names to Unicode characters, with fallback to Slack's hex unicode field, then to :name: text for custom emojis. --- .../components/blockkit/blocks/RichTextBlock.svelte | 10 +++++++++- bunfig.toml | 1 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/ui/src/components/blockkit/blocks/RichTextBlock.svelte b/apps/ui/src/components/blockkit/blocks/RichTextBlock.svelte index 04bfe71..6be0de8 100644 --- a/apps/ui/src/components/blockkit/blocks/RichTextBlock.svelte +++ b/apps/ui/src/components/blockkit/blocks/RichTextBlock.svelte @@ -1,5 +1,6 @@ -
+
{#each blocks as block, index (getBlockId(block, index))} - {#if block.type === 'section'} - - {:else if block.type === 'input'} - - {:else if block.type === 'actions'} - - {:else if block.type === 'divider'} - - {:else if block.type === 'context'} - - {:else if block.type === 'image'} - - {:else if block.type === 'header'} - - {:else if block.type === 'rich_text'} - - {:else if block.type === 'table'} - - {:else if block.type === 'context_actions'} - - {:else} - - {@const unknownBlock = block as { type: string }} -
- Unknown block type: {unknownBlock.type} -
- {/if} +
+ {#if block.type === 'section'} + + {:else if block.type === 'input'} + + {:else if block.type === 'actions'} + + {:else if block.type === 'divider'} + + {:else if block.type === 'context'} + + {:else if block.type === 'image'} + + {:else if block.type === 'header'} + + {:else if block.type === 'rich_text'} + + {:else if block.type === 'table'} + + {:else if block.type === 'context_actions'} + + {:else} + + {@const unknownBlock = block as { type: string }} +
+ Unknown block type: {unknownBlock.type} +
+ {/if} +
{/each}
+ + diff --git a/apps/ui/src/components/blockkit/blocks/ActionsBlock.svelte b/apps/ui/src/components/blockkit/blocks/ActionsBlock.svelte index 4cb7380..57889b2 100644 --- a/apps/ui/src/components/blockkit/blocks/ActionsBlock.svelte +++ b/apps/ui/src/components/blockkit/blocks/ActionsBlock.svelte @@ -29,74 +29,87 @@ let { block, onAction }: Props = $props() -
- {#each block.elements as element, i (i)} - {#if element.type === 'button'} -
- {:else if element.type === 'checkboxes'} - {@const cb = element as SlackCheckboxesElement} -
- - onAction?.( - cb.action_id, - JSON.stringify( - options.map((o) => ({ text: o.text, value: o.value })) - ) - )} - /> -
- {:else if element.type === 'datepicker'} - {@const dp = element as SlackDatePickerElement} - onAction?.(dp.action_id, val)} - /> - {:else if element.type === 'timepicker'} - {@const tp = element as SlackTimePickerElement} - onAction?.(tp.action_id, val)} - /> - {:else if element.type === 'datetimepicker'} - {@const dtp = element as SlackDateTimePickerElement} - onAction?.(dtp.action_id, val)} - /> - {/if} - {/each} + {/each} +
+ + diff --git a/apps/ui/src/components/blockkit/blocks/ContextActionsBlock.svelte b/apps/ui/src/components/blockkit/blocks/ContextActionsBlock.svelte index f3a3938..8d6ecec 100644 --- a/apps/ui/src/components/blockkit/blocks/ContextActionsBlock.svelte +++ b/apps/ui/src/components/blockkit/blocks/ContextActionsBlock.svelte @@ -18,7 +18,7 @@ } -
+
{#each block.elements as element, i (i)} {#if element.type === 'feedback_buttons'} {@const fb = element as SlackFeedbackButtonsElement} @@ -58,6 +58,13 @@
diff --git a/apps/ui/src/components/blockkit/elements/Button.svelte b/apps/ui/src/components/blockkit/elements/Button.svelte index eb8745f..7bdefd1 100644 --- a/apps/ui/src/components/blockkit/elements/Button.svelte +++ b/apps/ui/src/components/blockkit/elements/Button.svelte @@ -36,12 +36,11 @@