From 4f57798295c580e4d2080b8e337291602d925fe6 Mon Sep 17 00:00:00 2001 From: Andrew Beal Date: Mon, 6 Jul 2026 14:22:51 +0100 Subject: [PATCH] feat: add animated graph background to empty chat state Replace static greeting with animated node graph visualization behind the greeting text. Adds GraphAnimation component with procedural graph generation, smooth node motion, and gradient backdrop effect. --- Components/ChatArea.svelte | 48 +++++++- Components/GraphAnimation.svelte | 183 +++++++++++++++++++++++++++++++ 2 files changed, 227 insertions(+), 4 deletions(-) create mode 100644 Components/GraphAnimation.svelte diff --git a/Components/ChatArea.svelte b/Components/ChatArea.svelte index 6a10e86..303167b 100644 --- a/Components/ChatArea.svelte +++ b/Components/ChatArea.svelte @@ -11,6 +11,7 @@ import { getOuterHeight, setElementIcon } from "Helpers/ElementHelper"; import { setIcon } from "obsidian"; import { fade } from "svelte/transition"; + import GraphAnimation from "./GraphAnimation.svelte"; export let messages: ConversationContent[] = []; export let currentThought: string | null = null; @@ -199,7 +200,6 @@ {:else} - {@const messageId = message.timestamp.getTime().toString()}
@@ -219,8 +219,14 @@
{#if messages.length === 0} -
-
{getGreetingByTime()}
+
+
+ +
+
+
+
{getGreetingByTime()}
+
{/if} @@ -360,7 +366,34 @@ padding-bottom: var(--size-4-2); } - .conversation-empty-state { + .conversation-empty-container { + display: grid; + height: 100%; + width: 100%; + } + + .conversation-empty-animation { + grid-row: 1; + grid-column: 1; + height: 100%; + width: 100%; + } + + .conversation-empty-greeting-backdrop { + position: absolute; + inset: -48px; + background: radial-gradient( + ellipse closest-side, + var(--background-secondary) 0%, + color-mix(in srgb, var(--background-secondary) 80%, transparent) 65%, + transparent 100% + ); + } + + .conversation-empty-greeting { + grid-row: 1; + grid-column: 1; + position: relative; margin: auto; font-style: italic; font-size: var(--font-ui-medium); @@ -368,6 +401,13 @@ pointer-events: none; } + .conversation-empty-greeting-label { + position: relative; + overflow: hidden; + white-space: nowrap; + padding: var(--size-2-2); + } + .streaming-content { justify-content: left; min-height: 1em; /* Ensure the element exists for binding */ diff --git a/Components/GraphAnimation.svelte b/Components/GraphAnimation.svelte new file mode 100644 index 0000000..7272da8 --- /dev/null +++ b/Components/GraphAnimation.svelte @@ -0,0 +1,183 @@ + + + + {#each renderEdges as e} + + {/each} + {#each renderNodes as n} + + {/each} + + +