@widgetic/chat 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1521,6 +1521,7 @@
1521
1521
  class="prompt-chat-messages h-full"
1522
1522
  messages={currentMessages || []}
1523
1523
  isLoading={isLoading}
1524
+ isInitialized={isInitialized}
1524
1525
  {context}
1525
1526
  isCompleted={isCompleted}
1526
1527
  enableAutoCodeDetection={config?.features?.autoCodeDetection === true}
@@ -12,6 +12,8 @@
12
12
  class?: string;
13
13
  messages: ChatMessage[];
14
14
  isLoading?: boolean;
15
+ /** True after the conversation list/messages finished initializing — gates the empty state so suggestions never flash at mount. */
16
+ isInitialized?: boolean;
15
17
  context: ChatContext;
16
18
  isCompleted?: boolean;
17
19
  /**
@@ -43,6 +45,7 @@
43
45
  class: className = '',
44
46
  messages,
45
47
  isLoading = false,
48
+ isInitialized = true,
46
49
  context,
47
50
  isCompleted = false,
48
51
  enableAutoCodeDetection = false,
@@ -766,8 +769,9 @@
766
769
  use:detectMessagesScrollbar
767
770
  onscroll={handleScroll}
768
771
  >
769
- <!-- Empty state with suggestions -->
770
- {#if messages.length === 0 && !isLoading}
772
+ <!-- Empty state with suggestions — hidden until initialization completes so
773
+ suggestions never flash before the loaded messages arrive. -->
774
+ {#if isInitialized && messages.length === 0 && !isLoading}
771
775
  <div class="empty-state-ct flex flex-col items-center justify-center text-center max-w-sm w-full" style="align-self: center;">
772
776
  <h3 class="text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2">💬 Start a conversation</h3>
773
777
  <p class="text-gray-600 dark:text-gray-400 text-sm mb-6">
@@ -3,6 +3,8 @@ interface Props {
3
3
  class?: string;
4
4
  messages: ChatMessage[];
5
5
  isLoading?: boolean;
6
+ /** True after the conversation list/messages finished initializing — gates the empty state so suggestions never flash at mount. */
7
+ isInitialized?: boolean;
6
8
  context: ChatContext;
7
9
  isCompleted?: boolean;
8
10
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/chat",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",