{#if message.redacted}
Nachricht wurde gelöscht
@@ -574,9 +606,9 @@ {#if showActions && !message.redacted}
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 be2d83780..d89c281c9 100644
--- a/apps/matrix/apps/web/src/lib/components/chat/RoomList.svelte
+++ b/apps/matrix/apps/web/src/lib/components/chat/RoomList.svelte
@@ -1,22 +1,15 @@
-
-
-
-
-
-
-
-
+
+
diff --git a/apps/matrix/apps/web/src/lib/components/chat/Timeline.svelte b/apps/matrix/apps/web/src/lib/components/chat/Timeline.svelte
index 6a4397777..fd89690cf 100644
--- a/apps/matrix/apps/web/src/lib/components/chat/Timeline.svelte
+++ b/apps/matrix/apps/web/src/lib/components/chat/Timeline.svelte
@@ -137,7 +137,7 @@
{/if}
-
+
+
+ Räume
+
+ {matrixStore.directRooms.length + matrixStore.groupRooms.length}
+
+
+
+
+
{#if filteredInvites.length > 0}
@@ -163,7 +159,7 @@
class="flex items-center gap-2 px-2 py-2 text-xs font-semibold uppercase text-muted-foreground"
>
- Räume
+ Gruppen
{matrixStore.groupRooms.length}
@@ -181,22 +177,8 @@
{#if search && filteredDirectRooms.length === 0 && filteredGroupRooms.length === 0 && filteredInvites.length === 0 && (matrixStore.directRooms.length > 0 || matrixStore.groupRooms.length > 0 || matrixStore.invitedRooms.length > 0)}
-
-
-
-
{/if}
Keine Ergebnisse für "{search}"
-
-
+
{#each matrixStore.messages as message, index (message.id)}
{@const prevMessage = matrixStore.messages[index - 1]}
{@const nextMessage = matrixStore.messages[index + 1]}
diff --git a/apps/matrix/apps/web/src/routes/(app)/+layout.svelte b/apps/matrix/apps/web/src/routes/(app)/+layout.svelte
index 3593a4f7f..e75da7df6 100644
--- a/apps/matrix/apps/web/src/routes/(app)/+layout.svelte
+++ b/apps/matrix/apps/web/src/routes/(app)/+layout.svelte
@@ -20,8 +20,9 @@
} from '@manacore/shared-theme';
import type { ThemeVariant } from '@manacore/shared-theme';
import { isNavCollapsed as collapsedStore } from '$lib/stores/navigation.svelte';
- import { PillNavigation, QuickInputBar } from '@manacore/shared-ui';
+ import { PillNavigation } from '@manacore/shared-ui';
import type { PillNavItem, PillDropdownItem, QuickInputItem } from '@manacore/shared-ui';
+ import { MagnifyingGlass, X } from '@manacore/shared-icons';
import { getPillAppItems } from '@manacore/shared-branding';
import { getLanguageDropdownItems, getCurrentLanguageLabel } from '@manacore/shared-i18n';
import { setLocale, supportedLocales } from '$lib/i18n';
@@ -126,6 +127,17 @@
const navRoutes = navItems.map((item) => item.href);
function handleKeydown(event: KeyboardEvent) {
+ // Cmd/Ctrl+K opens command palette from anywhere
+ if ((event.ctrlKey || event.metaKey) && event.key === 'k') {
+ event.preventDefault();
+ if (showCommandPalette) {
+ closeCommandPalette();
+ } else {
+ openCommandPalette();
+ }
+ return;
+ }
+
const target = event.target as HTMLElement;
if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {
return;
@@ -164,20 +176,71 @@
goto('/login');
}
- // QuickInputBar handlers
- async function handleInputSearch(query: string): Promise {
- const q = query.toLowerCase();
- const rooms = matrixStore.rooms.filter((r) => r.name?.toLowerCase().includes(q));
- return rooms.slice(0, 10).map((room) => ({
- id: room.roomId,
- title: room.name || room.roomId,
- subtitle: room.isDirect ? 'Direktnachricht' : 'Gruppe',
- }));
+ // Command Palette state
+ let showCommandPalette = $state(false);
+ let commandQuery = $state('');
+ let commandResults = $state([]);
+ let commandSelectedIndex = $state(0);
+ let commandInputEl = $state(null);
+
+ function openCommandPalette() {
+ showCommandPalette = true;
+ commandQuery = '';
+ commandResults = [];
+ commandSelectedIndex = 0;
+ // Focus after render
+ setTimeout(() => commandInputEl?.focus(), 50);
}
- function handleInputSelect(item: QuickInputItem) {
+ function closeCommandPalette() {
+ showCommandPalette = false;
+ commandQuery = '';
+ commandResults = [];
+ }
+
+ function handleCommandSearch() {
+ const q = commandQuery.toLowerCase().trim();
+ if (!q) {
+ commandResults = [];
+ return;
+ }
+ commandResults = matrixStore.rooms
+ .filter((r) => r.name?.toLowerCase().includes(q))
+ .slice(0, 10)
+ .map((room) => ({
+ id: room.roomId,
+ title: room.name || room.roomId,
+ subtitle: room.isDirect ? 'Direktnachricht' : 'Gruppe',
+ }));
+ commandSelectedIndex = 0;
+ }
+
+ function handleCommandSelect(item: QuickInputItem) {
matrixStore.selectRoom(item.id);
goto('/chat');
+ closeCommandPalette();
+ }
+
+ function handleCommandKeydown(event: KeyboardEvent) {
+ if (event.key === 'Escape') {
+ event.preventDefault();
+ closeCommandPalette();
+ return;
+ }
+ if (event.key === 'ArrowDown') {
+ event.preventDefault();
+ commandSelectedIndex = Math.min(commandSelectedIndex + 1, commandResults.length - 1);
+ return;
+ }
+ if (event.key === 'ArrowUp') {
+ event.preventDefault();
+ commandSelectedIndex = Math.max(commandSelectedIndex - 1, 0);
+ return;
+ }
+ if (event.key === 'Enter' && commandResults.length > 0) {
+ event.preventDefault();
+ handleCommandSelect(commandResults[commandSelectedIndex]);
+ }
}
onMount(async () => {
@@ -348,23 +411,88 @@
allAppsHref="https://mana.how"
/>
-
-
-
{@render children()}
+
+ {#if showCommandPalette}
+
+
+
+
diff --git a/apps/matrix/apps/web/src/routes/(app)/chat/+page.svelte b/apps/matrix/apps/web/src/routes/(app)/chat/+page.svelte
index bf0c875e3..9ba8855d6 100644
--- a/apps/matrix/apps/web/src/routes/(app)/chat/+page.svelte
+++ b/apps/matrix/apps/web/src/routes/(app)/chat/+page.svelte
@@ -46,11 +46,6 @@
// Keyboard shortcuts
window.addEventListener('keydown', (e) => {
- // Cmd/Ctrl + K = Search
- if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
- e.preventDefault();
- showSearch = true;
- }
// Cmd/Ctrl + N = New chat
if ((e.metaKey || e.ctrlKey) && e.key === 'n' && !e.shiftKey) {
e.preventDefault();
+
+ {/if}
+
+
+
+
+
+
+
+ ESC
+
+
+
+ {#if commandQuery.trim()}
+
+ {#if commandResults.length === 0}
+
+ {:else}
+ + Keine Räume gefunden +
+ {:else} + {#each commandResults as item, index (item.id)} + + {/each} + {/if} +
+ Tippe um Räume und Kontakte zu finden
+
+ {/if}
+