diff --git a/apps/matrix/apps/web/src/lib/components/chat/MessageInput.svelte b/apps/matrix/apps/web/src/lib/components/chat/MessageInput.svelte index 8cd02e0cf..49f2fd117 100644 --- a/apps/matrix/apps/web/src/lib/components/chat/MessageInput.svelte +++ b/apps/matrix/apps/web/src/lib/components/chat/MessageInput.svelte @@ -45,6 +45,143 @@ let mentionResults = $state([]); let selectedMentionIndex = $state(0); + // Emoji picker state + let showEmojiPicker = $state(false); + const commonEmojis = [ + // Smileys + '๐Ÿ˜€', + '๐Ÿ˜ƒ', + '๐Ÿ˜„', + '๐Ÿ˜', + '๐Ÿ˜…', + '๐Ÿ˜‚', + '๐Ÿคฃ', + '๐Ÿ˜Š', + '๐Ÿ˜‡', + '๐Ÿ™‚', + '๐Ÿ˜‰', + '๐Ÿ˜Œ', + '๐Ÿ˜', + '๐Ÿฅฐ', + '๐Ÿ˜˜', + '๐Ÿ˜—', + '๐Ÿ˜™', + '๐Ÿ˜š', + '๐Ÿ˜‹', + '๐Ÿ˜›', + '๐Ÿ˜œ', + '๐Ÿคช', + '๐Ÿ˜', + '๐Ÿค—', + '๐Ÿคญ', + '๐Ÿคซ', + '๐Ÿค”', + '๐Ÿค', + '๐Ÿคจ', + '๐Ÿ˜', + '๐Ÿ˜‘', + '๐Ÿ˜ถ', + '๐Ÿ˜', + '๐Ÿ˜’', + '๐Ÿ™„', + '๐Ÿ˜ฌ', + '๐Ÿ˜ฎ', + '๐Ÿคฏ', + '๐Ÿ˜ณ', + '๐Ÿฅบ', + '๐Ÿ˜ข', + '๐Ÿ˜ญ', + '๐Ÿ˜ค', + '๐Ÿ˜ ', + '๐Ÿ˜ก', + '๐Ÿคฌ', + '๐Ÿ˜ˆ', + '๐Ÿ‘ฟ', + // Gestures + '๐Ÿ‘', + '๐Ÿ‘Ž', + '๐Ÿ‘Œ', + '๐ŸคŒ', + 'โœŒ๏ธ', + '๐Ÿคž', + '๐ŸคŸ', + '๐Ÿค˜', + '๐Ÿค™', + '๐Ÿ‘‹', + '๐Ÿ–๏ธ', + 'โœ‹', + '๐Ÿ‘', + '๐Ÿ™Œ', + '๐Ÿ‘', + '๐Ÿคฒ', + '๐Ÿ™', + '๐Ÿ’ช', + '๐Ÿฆพ', + 'โค๏ธ', + '๐Ÿงก', + '๐Ÿ’›', + '๐Ÿ’š', + '๐Ÿ’™', + // Objects & Symbols + '๐Ÿ”ฅ', + 'โœจ', + '๐Ÿ’ซ', + 'โญ', + '๐ŸŒŸ', + '๐Ÿ’ฏ', + '๐Ÿ’ข', + '๐Ÿ’ฅ', + '๐Ÿ’ฆ', + '๐Ÿ’จ', + '๐ŸŽ‰', + '๐ŸŽŠ', + '๐ŸŽ', + '๐Ÿ†', + '๐Ÿฅ‡', + '๐ŸŽฏ', + '๐Ÿ’ก', + '๐Ÿ“Œ', + '๐Ÿ“', + 'โœ…', + 'โŒ', + 'โš ๏ธ', + 'โ—', + 'โ“', + ]; + + function insertEmoji(emoji: string) { + const cursorPos = textarea?.selectionStart ?? message.length; + const before = message.slice(0, cursorPos); + const after = message.slice(cursorPos); + message = before + emoji + after; + + // Close picker and focus textarea + showEmojiPicker = false; + setTimeout(() => { + textarea?.focus(); + const newPos = cursorPos + emoji.length; + textarea?.setSelectionRange(newPos, newPos); + }, 0); + } + + function handleEmojiClick() { + // Try to open native emoji picker (works on some browsers/OS) + if ('showPicker' in HTMLInputElement.prototype) { + // This is for date/color inputs, won't work for emoji but we try + } + + // Check if we're on mobile - keyboard usually has emoji button + const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent); + if (isMobile) { + // On mobile, just focus the textarea - user can use keyboard emoji button + textarea?.focus(); + return; + } + + // Desktop fallback: show our emoji picker + showEmojiPicker = !showEmojiPicker; + } + // Set message content when editing $effect(() => { if (editMessage) { @@ -462,19 +599,17 @@ {/if} - -
- -
+ +
+ +
{#if showAttachMenu} @@ -521,8 +656,10 @@ onchange={handleFileSelect} /> - -
+ +
+ + + + + {#if showEmojiPicker} + + + +
+
+ {#each commonEmojis as emoji} + + {/each} +
+
+ {/if}
- + {#if isRecording} {:else if message.trim()} {:else} {/if}
diff --git a/apps/matrix/apps/web/src/lib/components/chat/RoomList.svelte b/apps/matrix/apps/web/src/lib/components/chat/RoomList.svelte index ae2273237..7ef15bc0c 100644 --- a/apps/matrix/apps/web/src/lib/components/chat/RoomList.svelte +++ b/apps/matrix/apps/web/src/lib/components/chat/RoomList.svelte @@ -56,7 +56,8 @@
- {#if filteredDirectRooms.length > 0 || !search} + {#if matrixStore.directRooms.length > 0}
Direktnachrichten - {#if matrixStore.directRooms.length > 0} - - {matrixStore.directRooms.length} - - {/if} + + {matrixStore.directRooms.length} +
{#each filteredDirectRooms as room (room.id)} handleSelectRoom(room.id)} /> - {:else} - {#if !search} -

Keine Direktnachrichten

- {/if} {/each}
{/if} - {#if filteredGroupRooms.length > 0 || !search} + {#if matrixStore.groupRooms.length > 0}
Rรคume - {#if matrixStore.groupRooms.length > 0} - - {matrixStore.groupRooms.length} - - {/if} + + {matrixStore.groupRooms.length} +
{#each filteredGroupRooms as room (room.id)} handleSelectRoom(room.id)} /> - {:else} - {#if !search} -

Keine Rรคume

- {/if} {/each}
{/if} - {#if search && filteredDirectRooms.length === 0 && filteredGroupRooms.length === 0} + {#if search && filteredDirectRooms.length === 0 && filteredGroupRooms.length === 0 && filteredInvites.length === 0 && (matrixStore.directRooms.length > 0 || matrixStore.groupRooms.length > 0 || matrixStore.invitedRooms.length > 0)}

Keine Ergebnisse fรผr "{search}"