Backend: - Fixed auth issue where get_optional_user wasn't properly extracting tokens - Added user_id to conversational agent for proper auth context - Fixed DCA buy logic to support multiple buys on dips - Fixed sell logic to use amount_percent - Added comprehensive backtest engine tests - Fixed kline data validation for bad price data - Fixed chained tool calls handling Frontend: - BotCard now links to chat page instead of bot page - Chat page handles direct bot loading from dashboard - Various UI improvements and fixes Tests: - Added test_agent.py with mock client tests - Added test_backtest_engine.py with 7 comprehensive tests
62 lines
1.2 KiB
Svelte
62 lines
1.2 KiB
Svelte
<script lang="ts">
|
|
import { onMount } from 'svelte';
|
|
import { initAuth, isLoading } from '$lib/stores';
|
|
import favicon from '$lib/assets/favicon.svg';
|
|
|
|
let { children } = $props();
|
|
|
|
onMount(() => {
|
|
initAuth();
|
|
|
|
// Reset anonymous counts on layout load (for debugging)
|
|
const count = localStorage.getItem('anonymous_chat_count');
|
|
if (count && parseInt(count) >= 50) {
|
|
console.log('Resetting anonymous_chat_count from', count, 'to 0');
|
|
localStorage.setItem('anonymous_chat_count', '0');
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<svelte:head>
|
|
<link rel="icon" href={favicon} />
|
|
</svelte:head>
|
|
|
|
{#if $isLoading}
|
|
<div class="loading">
|
|
<div class="spinner"></div>
|
|
</div>
|
|
{:else}
|
|
{@render children()}
|
|
{/if}
|
|
|
|
<style>
|
|
:global(body) {
|
|
margin: 0;
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
background: #0f0f0f;
|
|
color: #fff;
|
|
}
|
|
|
|
.loading {
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.spinner {
|
|
width: 40px;
|
|
height: 40px;
|
|
border: 3px solid rgba(255, 255, 255, 0.1);
|
|
border-top-color: #667eea;
|
|
border-radius: 50%;
|
|
animation: spin 1s linear infinite;
|
|
}
|
|
|
|
@keyframes spin {
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
</style>
|