Code Sessions

{#if error}
{error}
{/if}
e.key === "Enter" && search()} placeholder="Search conversations..." class="w-full px-4 py-2 text-sm border border-surface-200 dark:border-surface-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 dark:bg-surface-700 dark:text-white" />
{#if view !== "search" && view !== "stats"}
{#each dates as d} {/each} {#if !dates.length && !error}

No conversations yet.

{/if}
{/if} {#if loading}
{:else if view === "summary" && summary}
Conversations
{summary.conversation_count}
Messages
{summary.total_messages}
Tokens
{formatTokens(summary.total_tokens)}
Projects
{summary.projects?.split(',')[0] || 'N/A'}
{@html markdownToHtml(summary.content)}
Conversations ({conversations.length})
{#each conversations as conv} {/each}
{:else if view === "detail" && selectedConversation}

{selectedConversation.slug || 'Untitled'}

Project: {selectedConversation.project_path?.split('/').pop()}
Branch: {selectedConversation.git_branch || 'N/A'}
Messages: {selectedConversation.message_count}
Tokens: {formatTokens(selectedConversation.total_input_tokens + selectedConversation.total_output_tokens)}
{#each messages as msg}
{msg.role} {msg.timestamp?.slice(11, 19)}
{msg.content?.slice(0, 500)}{msg.content?.length > 500 ? '...' : ''}
{#if msg.tool_calls?.length}
Tools: {msg.tool_calls.map(t => t.name).join(', ')}
{/if} {#if msg.input_tokens || msg.output_tokens}
{msg.input_tokens ? `${msg.input_tokens} in` : ''} {msg.output_tokens ? `${msg.output_tokens} out` : ''}
{/if}
{/each}
{:else if view === "search"}
Search Results ({searchResults.length})
{#each searchResults as conv} {/each} {#if searchResults.length === 0}
No results found
{/if}
{:else if view === "stats" && stats}
Total Conversations
{stats.total_conversations}
Total Messages
{stats.total_messages}
Total Tokens
{formatTokens(stats.total_tokens)}

Top Projects

{#each stats.top_projects as proj}
{proj.path?.split('/').pop()} {proj.count}
{/each}

Top Tools

{#each stats.top_tools as tool}
{tool.name} {tool.count}
{/each}
{/if}