@widgetic/chat 0.1.5 → 0.1.6

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.
@@ -169,7 +169,7 @@
169
169
  class:completed={isCompleted}
170
170
  onclick={handleCompletionToggle}
171
171
  disabled={disabled || !conversationId}
172
- title={isCompleted ? 'Mark as Active' : 'Mark as Complete'}
172
+ title={isCompleted ? 'Mark as Active — you can keep iterating either way' : 'Mark this chat as done. You can still send messages and iterate on the widget.'}
173
173
  aria-label={isCompleted ? 'Mark conversation as active' : 'Mark conversation as complete'}
174
174
  >
175
175
  {#if isCompleted}
@@ -20,7 +20,7 @@
20
20
  isCompleted?: boolean;
21
21
  onStatsUpdate?: (messageCount: number, firstMessage: string | null) => void;
22
22
  onChatReady?: (chatMethods: ChatMethods) => void;
23
- onCompletionToggle?: () => void;
23
+ onCompletionToggle?: (detail?: { conversationId: string | null; completed: boolean }) => void;
24
24
  /** When provided, called instead of the built-in mock service for sending messages.
25
25
  * The parent handles the actual API call and can push assistant messages via addAssistantMessage. */
26
26
  onSendMessage?: (
@@ -707,26 +707,30 @@
707
707
  }
708
708
 
709
709
  async function handleComplete({ detail }: { detail: { completed: boolean } }) {
710
- chatLog('Conversation completion toggle requested');
711
-
710
+ chatLog('Conversation completion toggle requested', {
711
+ conversationId: currentConversationId,
712
+ completed: detail?.completed,
713
+ });
714
+
712
715
  if (!currentConversationId) {
713
716
  console.error('No active conversation to mark as complete');
714
717
  return;
715
718
  }
716
-
719
+
717
720
  try {
718
- // Call parent's completion toggle function
719
721
  if (onCompletionToggle) {
720
- onCompletionToggle();
722
+ onCompletionToggle({
723
+ conversationId: currentConversationId,
724
+ completed: detail?.completed,
725
+ });
721
726
  chatLog('Completion toggled via parent callback');
722
727
  } else {
723
728
  chatWarn('No onCompletionToggle callback provided');
724
729
  }
725
-
726
730
  } catch (error) {
727
731
  console.error('Failed to update conversation status:', error);
728
- chatStore.actions.updateUI({
729
- errorMessage: 'Failed to update conversation status'
732
+ chatStore.actions.updateUI({
733
+ errorMessage: 'Failed to update conversation status'
730
734
  });
731
735
  }
732
736
  }
@@ -1310,7 +1314,7 @@
1310
1314
  showScreenshot={config?.features?.screenshot !== false}
1311
1315
  showRecord={config?.features?.screenRecording !== false}
1312
1316
  showUpload={config?.features?.fileUpload !== false}
1313
- showComplete={config?.features?.markComplete === true}
1317
+ showComplete={config?.features?.markComplete !== false}
1314
1318
  on:screenshot={handleScreenshot}
1315
1319
  on:recordStart={handleRecordStart}
1316
1320
  on:recordStop={handleRecordStop}
@@ -52,7 +52,10 @@ interface Props {
52
52
  isCompleted?: boolean;
53
53
  onStatsUpdate?: (messageCount: number, firstMessage: string | null) => void;
54
54
  onChatReady?: (chatMethods: ChatMethods) => void;
55
- onCompletionToggle?: () => void;
55
+ onCompletionToggle?: (detail?: {
56
+ conversationId: string | null;
57
+ completed: boolean;
58
+ }) => void;
56
59
  /** When provided, called instead of the built-in mock service for sending messages.
57
60
  * The parent handles the actual API call and can push assistant messages via addAssistantMessage. */
58
61
  onSendMessage?: (content: string, attachments?: Array<{
@@ -40,8 +40,8 @@ export interface ChatConfig {
40
40
  screenRecording: boolean;
41
41
  restoreCheckpoint: boolean;
42
42
  /**
43
- * Mark conversation complete / active. Off by default — widget codegen
44
- * does not persist this status (parent must pass onCompletionToggle).
43
+ * Mark conversation complete / active. Default on (ActionBar Complete).
44
+ * Set false to hide. Parent should persist via onCompletionToggle.
45
45
  */
46
46
  markComplete?: boolean;
47
47
  /**
@@ -46,7 +46,7 @@ export const DEFAULT_CHAT_CONFIG = {
46
46
  aiSuggestions: true,
47
47
  screenRecording: false,
48
48
  restoreCheckpoint: false,
49
- markComplete: false,
49
+ markComplete: true,
50
50
  autoCodeDetection: false,
51
51
  showGenerationSummaries: false,
52
52
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widgetic/chat",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",