mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-09-09 11:15:08 +08:00
Prompt for reason for skipping.
Note: skipping is only half implemented for labelling and summarisation tasks as those probably need to be changed to use the new Task component.
This commit is contained in:
@@ -11,7 +11,8 @@ export interface TaskControlsProps {
|
||||
tasks: any[];
|
||||
className?: string;
|
||||
onSubmitResponse: (task: { id: string }) => void;
|
||||
onSkip: () => void;
|
||||
onSkipTask: (task: { id: string }, reason: string) => void;
|
||||
onNextTask: () => void;
|
||||
}
|
||||
|
||||
export const TaskControls = (props: TaskControlsProps) => {
|
||||
@@ -31,13 +32,17 @@ export const TaskControls = (props: TaskControlsProps) => {
|
||||
>
|
||||
<TaskInfo id={props.tasks[0].id} output="Submit your answer" />
|
||||
<Flex justify="center" ml="auto" gap={2}>
|
||||
<SkipButton>Skip</SkipButton>
|
||||
<SkipButton
|
||||
onSkip={(reason: string) => {
|
||||
props.onSkipTask(props.tasks[0], reason);
|
||||
}}
|
||||
/>
|
||||
{endTask.task.type !== "task_done" ? (
|
||||
<SubmitButton colorScheme="blue" data-cy="submit" onClick={() => props.onSubmitResponse(props.tasks[0])}>
|
||||
Submit
|
||||
</SubmitButton>
|
||||
) : (
|
||||
<SubmitButton colorScheme="green" data-cy="next-task" onClick={props.onSkip}>
|
||||
<SubmitButton colorScheme="green" data-cy="next-task" onClick={props.onNextTask}>
|
||||
Next Task
|
||||
</SubmitButton>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user