From b9a63257adaaea2f880847a16ec60f533e771ce6 Mon Sep 17 00:00:00 2001 From: Lingjie Feng Date: Tue, 23 Apr 2024 16:32:35 -0400 Subject: [PATCH 1/3] feat: displaying status --- src/common/TaskStatus.tsx | 17 +++++++++-------- src/common/TaskUI.tsx | 2 +- src/state/currentTask.ts | 11 ++++++++--- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/common/TaskStatus.tsx b/src/common/TaskStatus.tsx index c27f6ea..c7e4739 100644 --- a/src/common/TaskStatus.tsx +++ b/src/common/TaskStatus.tsx @@ -14,17 +14,18 @@ export default function TaskStatus() { } const displayedStatus: Record = { - idle: "Idle", - "attaching-debugger": "Attaching Debugger", - "pulling-dom": "Reading Page", - "transforming-dom": "Reading Page", - "performing-query": "Running GPT", - "performing-action": "Performing Action", - waiting: "Waiting", + idle: "💤 Idle", + "attaching-debugger": "🔗 Attaching Debugger", + "pulling-dom": "🌐 Understanding Website", + "annotating-dom": "🌐 Understanding Website", + "fetching-knoweldge": "🧠 Getting Instructions", + "generating-action": "🤔 Thinking and planning", + "performing-action": "🚀 Performing Action", + waiting: "⏳ Waiting", }; return ( - + {displayedStatus[actionStatus]} ); diff --git a/src/common/TaskUI.tsx b/src/common/TaskUI.tsx index 5ec7523..3109978 100644 --- a/src/common/TaskUI.tsx +++ b/src/common/TaskUI.tsx @@ -123,7 +123,6 @@ const TaskUI = () => { /> )} - {debugMode && } {state.voiceMode && ( @@ -140,6 +139,7 @@ const TaskUI = () => { )} {debugMode && } + ); diff --git a/src/state/currentTask.ts b/src/state/currentTask.ts index a26c5ee..71e9584 100644 --- a/src/state/currentTask.ts +++ b/src/state/currentTask.ts @@ -46,8 +46,9 @@ export type CurrentTaskSlice = { | "idle" | "attaching-debugger" | "pulling-dom" - | "transforming-dom" - | "performing-query" + | "annotating-dom" + | "fetching-knoweldge" + | "generating-action" | "performing-action" | "waiting"; actions: { @@ -168,11 +169,11 @@ export const createCurrentTaskSlice: MyStateCreator = ( return true; }; - setActionStatus("performing-query"); let query: QueryResult | null = null; // check if the tab does not allow attaching debugger, e.g. chrome:// pages if (activeTab.url?.startsWith("chrome")) { + setActionStatus("generating-action"); query = await determineNavigateAction(instructions); if (wasStopped()) break; @@ -198,6 +199,7 @@ export const createCurrentTaskSlice: MyStateCreator = ( .filter(truthyFilter); if (isVisionModel) { + setActionStatus("fetching-knoweldge"); const url = new URL(activeTab.url ?? ""); const customKnowledgeBase = get().settings.customKnowledgeBase; const knowledge = await fetchKnowledge(url, customKnowledgeBase); @@ -205,6 +207,7 @@ export const createCurrentTaskSlice: MyStateCreator = ( state.currentTask.knowledgeInUse = knowledge; }); + setActionStatus("annotating-dom"); const [imgData, labelData] = await buildAnnotatedScreenshots( tabId, knowledge, @@ -215,6 +218,7 @@ export const createCurrentTaskSlice: MyStateCreator = ( [], ); if (wasStopped()) break; + setActionStatus("generating-action"); query = await determineNextActionWithVision( instructions, url, @@ -237,6 +241,7 @@ export const createCurrentTaskSlice: MyStateCreator = ( } if (wasStopped()) break; + setActionStatus("generating-action"); query = await determineNextAction( instructions, previousActions, From 3123337970c329b05b4d56207de6c036cbd5a11a Mon Sep 17 00:00:00 2001 From: Lingjie Feng Date: Tue, 23 Apr 2024 16:35:12 -0400 Subject: [PATCH 2/3] fix: update name --- src/common/TaskStatus.tsx | 2 +- src/state/currentTask.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/TaskStatus.tsx b/src/common/TaskStatus.tsx index c7e4739..ae0d107 100644 --- a/src/common/TaskStatus.tsx +++ b/src/common/TaskStatus.tsx @@ -17,7 +17,7 @@ export default function TaskStatus() { idle: "💤 Idle", "attaching-debugger": "🔗 Attaching Debugger", "pulling-dom": "🌐 Understanding Website", - "annotating-dom": "🌐 Understanding Website", + "annotating-web": "🌐 Understanding Website", "fetching-knoweldge": "🧠 Getting Instructions", "generating-action": "🤔 Thinking and planning", "performing-action": "🚀 Performing Action", diff --git a/src/state/currentTask.ts b/src/state/currentTask.ts index 71e9584..5d2cecc 100644 --- a/src/state/currentTask.ts +++ b/src/state/currentTask.ts @@ -46,7 +46,7 @@ export type CurrentTaskSlice = { | "idle" | "attaching-debugger" | "pulling-dom" - | "annotating-dom" + | "annotating-web" | "fetching-knoweldge" | "generating-action" | "performing-action" @@ -207,7 +207,7 @@ export const createCurrentTaskSlice: MyStateCreator = ( state.currentTask.knowledgeInUse = knowledge; }); - setActionStatus("annotating-dom"); + setActionStatus("annotating-web"); const [imgData, labelData] = await buildAnnotatedScreenshots( tabId, knowledge, From 7fe994333c7e58c634ff16017df35a23bb631d5b Mon Sep 17 00:00:00 2001 From: Lingjie Feng Date: Tue, 23 Apr 2024 17:56:09 -0400 Subject: [PATCH 3/3] fix: updated name --- src/common/TaskStatus.tsx | 2 +- src/state/currentTask.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/TaskStatus.tsx b/src/common/TaskStatus.tsx index ae0d107..a1bdd87 100644 --- a/src/common/TaskStatus.tsx +++ b/src/common/TaskStatus.tsx @@ -17,7 +17,7 @@ export default function TaskStatus() { idle: "💤 Idle", "attaching-debugger": "🔗 Attaching Debugger", "pulling-dom": "🌐 Understanding Website", - "annotating-web": "🌐 Understanding Website", + "annotating-page": "🌐 Understanding Website", "fetching-knoweldge": "🧠 Getting Instructions", "generating-action": "🤔 Thinking and planning", "performing-action": "🚀 Performing Action", diff --git a/src/state/currentTask.ts b/src/state/currentTask.ts index 5d2cecc..93e3979 100644 --- a/src/state/currentTask.ts +++ b/src/state/currentTask.ts @@ -46,7 +46,7 @@ export type CurrentTaskSlice = { | "idle" | "attaching-debugger" | "pulling-dom" - | "annotating-web" + | "annotating-page" | "fetching-knoweldge" | "generating-action" | "performing-action" @@ -207,7 +207,7 @@ export const createCurrentTaskSlice: MyStateCreator = ( state.currentTask.knowledgeInUse = knowledge; }); - setActionStatus("annotating-web"); + setActionStatus("annotating-page"); const [imgData, labelData] = await buildAnnotatedScreenshots( tabId, knowledge,