Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

Refactor the web tasks to present a server selected task type

Open fozziethebeat opened this issue 2 years ago • 16 comments

Right now users can select the task type they want but for data collection goals it's better for the server to decide what task is most important.

We should refactor the tasks such that they're all components and a single task page (random) will fetch a task type and content from the server and then present whatever that task content is.

This requires moving some react code around and consolidating things then simplifying the landing page.

fozziethebeat avatar Jan 06 '23 06:01 fozziethebeat

This is very high priority

fozziethebeat avatar Jan 06 '23 06:01 fozziethebeat

Could maybe add task "points" concepts or something and have a way to see which are high value vs low value tasks etc. Eg maybe lean into the gamification stuff by putting a "price" or "value" on each task and then being able to use that to control or weight tasks and maybe even let users incentive to more higher value tasks.

Might be a bit too fancy for right now, but on the other hand if each task had a "points" associated with it that could be a useful building block to add now. Is kinda a product sort of question maybe.

Unsure myself but just throwing idea out there.

andrewm4894 avatar Jan 06 '23 10:01 andrewm4894

That's a good idea in the future. For the MVP we want to avoid creating any new feature requests for the backend. The backend right now doesn't have a way to check if a task type has actual tasks that need answers so the best option would be to just have a "Random" option on the dashboard and let the server pick the task which needs an answer.

Later on, your idea is the right direction to go towards but needs help in the backend.

fozziethebeat avatar Jan 06 '23 11:01 fozziethebeat

Is there already an endpoint that will return a task_type?

EDIT: found where the task information is stored (TaskOption.tsx)

kostiak avatar Jan 06 '23 14:01 kostiak

@fozziethebeat I created a draft PR to suggest how we can refactor the pages into components. It's already quite a big change, so I didn't add the "random" page yet. Want to double check I'm going in the right direction.

What I did was extract the task definitions from /Dashboard/TaskOption.tsx into /Tasks/TaskTypes.tsx and modify it to be more extendable. Then I based the components on it.

I created a Task.tsx which has the general task logic. CreateTask.tsx and EvaluateTask.tsx have the specific things those types need.

I also moved all the task pages into /tasks/ route.

kostiak avatar Jan 06 '23 19:01 kostiak

I think this sounds right but i'd have to look at a PR to be sure

fozziethebeat avatar Jan 06 '23 22:01 fozziethebeat

@fozziethebeat uploaded a new draft PR, let me know if that's more in the right direction, thanks!

kostiak avatar Jan 07 '23 03:01 kostiak

@fozziethebeat Now that the refactor is merged (a big thanks to @AbdBarho for the help) we need to discuss the design of the page. The easiest way is to add a new category: image

I don't think that looks good, plus it pushes the leaderboard out of view. Some suggestions:

  1. We can add a specific design for the random task, taking up less space
  2. We can reduce the gaps between categories
  3. We can cosider moving the leaderboard to the top

Let me know what you think.

kostiak avatar Jan 07 '23 16:01 kostiak

Perhaps to add a point from the last meeting, assuming I understood everything correctly:

the random task should in theory be the only task kind available. the backend decides what the 'random' task should be based off what data is needed.

This is more or less the current behaviour of the discord bot.

AbdBarho avatar Jan 07 '23 16:01 AbdBarho

@AbdBarho does the discord currently implement the labeling tasks?

Are we talking about a design like this: image

If so, I think this still needs some thinking design wise.

kostiak avatar Jan 07 '23 16:01 kostiak

I think this still needs a bit discussion with the team, I will add label it accordingly.

@kostiak regarding your question, I think the bot currently only shows random tasks. @AlexanderHOtt ?

AbdBarho avatar Jan 07 '23 17:01 AbdBarho

With PR #470 now merged, should we also remove redundant TaskSelection folder & components?

Klotske avatar Jan 07 '23 17:01 Klotske

@Klotske I did in #477, or at least what was obvious.

AbdBarho avatar Jan 07 '23 17:01 AbdBarho

@AbdBarho Oh okay. Then great! I looked through the PR but missed that...

Klotske avatar Jan 07 '23 17:01 Klotske

For right now (this will likely change later once there's more backend features) we should show just one task type on the dashboard. So yeah, we can clean up a lot of stuff that was for presenting all the task types.

fozziethebeat avatar Jan 08 '23 01:01 fozziethebeat

I think this still needs a bit discussion with the team, I will add label it accordingly.

@kostiak regarding your question, I think the bot currently only shows random tasks. @AlexanderHOtt ?

The bot defaults to random, but the user can still select the type of task.

AlexanderHott avatar Jan 09 '23 01:01 AlexanderHott

With everyone's help, this is now done!

fozziethebeat avatar Jan 12 '23 04:01 fozziethebeat