Skip to content

Commit 1059a99

Browse files
Merge pull request #48 from AIDC-AI/parameter_debug_dev
feat: param debug添加track
2 parents 814ff6c + 0f21220 commit 1059a99

7 files changed

+82
-38
lines changed

dist/copilot_web/App-Ba7xn0aw.js renamed to dist/copilot_web/App-Ir1_Ye5s.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/copilot_web/ParameterDebugInterfaceNew-BCHpIXMw.js

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/copilot_web/ParameterDebugInterfaceNew-w-WTp5UJ.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

dist/copilot_web/input.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/copilot_web/workflowChat-C02WyW-V.js renamed to dist/copilot_web/workflowChat-BgtFRcV-.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "ComfyUI-Copilot"
33
description = "Your Intelligent Assistant for Comfy-UI."
4-
version = "1.1.3"
4+
version = "1.1.4"
55
license = {file = "LICENSE"}
66

77
[project.urls]

ui/src/components/debug/ParameterDebugInterfaceNew.tsx

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export const ParameterDebugInterface: React.FC<ParameterDebugInterfaceProps> = (
7171
threshold: false,
7272
prompt: false
7373
});
74+
const [task_id, setTask_id] = useState(generateUUID());
7475
const [isProcessing, setIsProcessing] = useState(false);
7576
const [isCompleted, setIsCompleted] = useState(false);
7677
const [completedCount, setCompletedCount] = useState(0);
@@ -145,6 +146,16 @@ export const ParameterDebugInterface: React.FC<ParameterDebugInterfaceProps> = (
145146
try {
146147
const generatedTexts = await WorkflowChatAPI.generateSDPrompts(aiWritingModalText);
147148
setAiGeneratedTexts(generatedTexts);
149+
// 发送埋点事件
150+
WorkflowChatAPI.trackEvent({
151+
event_type: 'prompt_generate',
152+
message_type: 'parameter_debug',
153+
message_id: task_id,
154+
data: {
155+
input_text: aiWritingModalText,
156+
generated_texts: generatedTexts
157+
}
158+
});
148159

149160
// Pre-select all generated texts
150161
const newSelectedTexts: {[key: string]: boolean} = {};
@@ -246,6 +257,18 @@ export const ParameterDebugInterface: React.FC<ParameterDebugInterfaceProps> = (
246257
[textKey]: [...currentTexts, ...selectedTexts]
247258
};
248259
});
260+
261+
// 发送埋点事件
262+
WorkflowChatAPI.trackEvent({
263+
event_type: 'prompt_apply',
264+
message_type: 'parameter_debug',
265+
message_id: task_id,
266+
data: {
267+
input_text: aiWritingModalText,
268+
generated_texts: aiGeneratedTexts,
269+
selected_texts: selectedTexts
270+
}
271+
});
249272

250273
// Also update paramTestValues
251274
const updatedTexts = [...(textInputs[textKey] || []), ...selectedTexts];
@@ -351,6 +374,13 @@ export const ParameterDebugInterface: React.FC<ParameterDebugInterfaceProps> = (
351374
};
352375
}, [openDropdowns]);
353376

377+
// Add useEffect to reset task_id when visible changes from false to true
378+
useEffect(() => {
379+
if (visible) {
380+
setTask_id(generateUUID());
381+
}
382+
}, [visible]);
383+
354384
// Navigate to next screen
355385
const handleNext = (event?: React.MouseEvent) => {
356386
if (event) {
@@ -690,6 +720,18 @@ export const ParameterDebugInterface: React.FC<ParameterDebugInterfaceProps> = (
690720
setCompletedCount(0);
691721

692722
console.log("Generated parameter combinations:", paramCombinations);
723+
724+
// 发送埋点事件
725+
WorkflowChatAPI.trackEvent({
726+
event_type: 'start_generation',
727+
message_type: 'parameter_debug',
728+
message_id: task_id,
729+
data: {
730+
workflow: (await app.graphToPrompt()).output,
731+
all_params: paramTestValues,
732+
count: totalCombinations
733+
}
734+
});
693735

694736
// If we have no combinations, show error and return
695737
if (paramCombinations.length === 0) {
@@ -879,7 +921,7 @@ export const ParameterDebugInterface: React.FC<ParameterDebugInterfaceProps> = (
879921
WorkflowChatAPI.trackEvent({
880922
event_type: 'parameter_debug_apply',
881923
message_type: 'parameter_debug',
882-
message_id: generateUUID(),
924+
message_id: task_id,
883925
data: {
884926
workflow: (await app.graphToPrompt()).output,
885927
selected_params: generatedImages[selectedImageIndex].params,
@@ -992,6 +1034,8 @@ export const ParameterDebugInterface: React.FC<ParameterDebugInterfaceProps> = (
9921034
threshold: false,
9931035
prompt: false
9941036
});
1037+
// Reset task_id
1038+
setTask_id(generateUUID());
9951039
cleanupPolling(); // Add cleanup call
9961040
setIsProcessing(false);
9971041
setIsCompleted(false);

0 commit comments

Comments
 (0)