diff --git a/app/src/lib/components/Sidebar.svelte b/app/src/lib/components/Sidebar.svelte index eaa9a99..c61a5dc 100644 --- a/app/src/lib/components/Sidebar.svelte +++ b/app/src/lib/components/Sidebar.svelte @@ -24,10 +24,10 @@ $: sidebarItems = sessionItems .filter(([_, item]) => item.chats.length) .map(([sessionId, item]) => ({ + sessionId, title: item.title || 'Untitled', nonce: item.nonce, - href: `/chat/${sessionId}?category=${item.category}`, - sessionId + category: item.category })) .sort((a, b) => b.nonce - a.nonce); @@ -44,6 +44,10 @@ ) .filter(([_, v]) => Boolean(v)); } + + function dispatchClickItem() { + dispatch('clickItem'); + }
Today
{#each inLast24Hrs as item} - dispatch('clickItem')} /> + {/each}
Last 7 days
{#each inLast7Days as item} - dispatch('clickItem')} /> + {/each}
Last month
{#each inLast30Days as item} - dispatch('clickItem')} /> + {/each}
diff --git a/app/src/lib/components/SidebarItem.svelte b/app/src/lib/components/SidebarItem.svelte index 7925ef3..017fc0b 100644 --- a/app/src/lib/components/SidebarItem.svelte +++ b/app/src/lib/components/SidebarItem.svelte @@ -1,9 +1,10 @@ @@ -21,13 +22,14 @@ easing: cubicInOut }); + $: href = `/chat/${item.sessionId}?category=${item.category}`; $: isActive = $page.url.href.includes(item.sessionId); diff --git a/app/src/routes/audiocast/[sessionId=sessionId]/+page.svelte b/app/src/routes/audiocast/[sessionId=sessionId]/+page.svelte index 4730660..343577e 100644 --- a/app/src/routes/audiocast/[sessionId=sessionId]/+page.svelte +++ b/app/src/routes/audiocast/[sessionId=sessionId]/+page.svelte @@ -9,9 +9,10 @@ type GenerateAudiocastResponse = { script: string; source_content: string; - created_at?: string; chats: Array>; + category: ContentCategory; title: ChatMetadata['title']; + created_at?: string; }; function parseScript(script: string) { @@ -83,9 +84,15 @@ {:then data}
- {#if data.title} -

{data.title}

- {/if} +
+ + {data.category} + + + {#if data.title} +

{data.title}

+ {/if} +