char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Aleksander Grygierui: Chat Conversation Tabbed navigation (#27263)8144f3192

char/aliceai-t5-moe
924 B34 linesraw
1<script lang="ts">
2	import { page } from '$app/state';
3	import { ChatScreen, ChatTabs } from '$lib/components/app';
4	import { NEW_CHAT_TAB_ID } from '$lib/constants';
5	import { settingsStore, tabsStore } from '$lib/stores';
6
7	let { children } = $props();
8
9	// the new-chat screen is the bare `#/` route (no conversation id)
10	let showCenteredEmpty = $derived(!page.params.id);
11
12	let showTabs = $derived(
13		Boolean(settingsStore.config.conversationTabs) &&
14			(page.params.id || tabsStore.openTabs.some((id) => id !== NEW_CHAT_TAB_ID))
15	);
16
17	$effect(() => {
18		const id = page.params.id ?? (page.route.id === '/(chat)' ? NEW_CHAT_TAB_ID : undefined);
19
20		if (id && settingsStore.config.conversationTabs) {
21			tabsStore.syncWithRoute(id);
22		}
23	});
24</script>
25
26<div class={showTabs ? 'md:[--chat-tabs-offset:1.25rem]' : ''}>
27	{#if showTabs}
28		<ChatTabs />
29	{/if}
30
31	<ChatScreen {showCenteredEmpty} />
32</div>
33
34{@render children?.()}