Skip to content

Commit abc7193

Browse files
committed
Move instruction validation for completed tasks from frontend to backend
- when clicking on the checkpox to mark as complete and instructions are empty, should show appropriate notification ├── apps │ └── editor │ └── src │ ├── i18n │ │ └── translations │ │ └── views │ │ └── common │ │ └── handlers │ │ └── common.ts │ └── views │ └── prompt │ ├── backend │ │ ├── message-handlers │ │ │ └── handle-save-completed-tasks.ts │ │ └── prompt-view-provider.ts │ ├── frontend │ │ └── Main │ │ └── Main.tsx │ └── types │ └── messages.ts └── packages └── ui └── src └── components └── editor └── common └── prompts └── PromptField └── PromptField.tsx
1 parent 7d86aba commit abc7193

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎apps/editor/src/views/prompt/backend/message-handlers/handle-save-completed-tasks.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,9 @@ export const handle_save_completed_tasks = async (
8686
command: 'FOCUS_PROMPT_FIELD'
8787
})
8888
}
89+
} else {
90+
vscode.window.showInformationMessage(
91+
t('views.common.handlers.common.instructions-cannot-be-empty')
92+
)
8993
}
9094
}

‎apps/editor/src/views/prompt/frontend/Main/Main.tsx‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -564,11 +564,9 @@ export const Main: React.FC<Props> = (props) => {
564564
}
565565

566566
const handle_task_completed = () => {
567-
if (props.edit_instructions.trim()) {
568-
post_message(props.vscode, {
569-
command: 'SAVE_COMPLETED_TASKS'
570-
})
571-
}
567+
post_message(props.vscode, {
568+
command: 'SAVE_COMPLETED_TASKS'
569+
})
572570
}
573571

574572
const handle_clear_completed_tasks = () => {

0 commit comments

Comments
 (0)