tournesol-app / tournesol

Free and open source code of the https://tournesol.app platform. Meet the community on Discord https://discord.gg/WvcSG55Bf3
https://tournesol.app
Other
321 stars 46 forks source link

[front] feat: add buttons to compare criteria #1968

Open GresilleSiffle opened 1 month ago

GresilleSiffle commented 1 month ago

related issues #1940

do not merge: the back end doesn't support comparisons with different score_max yet


Description

This PR adds a new comparison method for mobile devices: buttons.

capture

Features

How the front end chooses to display buttons or sliders?

If the displayed comparison has been previously made with buttons, the buttons are displayed. If it has been rated by sliders, sliders are displayed.

If the displayed comparison is new, the button are displayed for devices not matching the media query (pointer:fine), and the sliders are displayed for all other devices (See the pointer media feature).

No conversion from buttons to sliders and from sliders to buttons is allowed for now.

Future improvements

to-do

front end - tutorial

front end - buttons

front end - comparison input

front end - comparison scores review

front end - comparison

front end - coherence

Preview

capture

A "mobile" comparison displayed on desktop:

screencapture-localhost-3000-comparison-2024-06-10-11_29_03

Checklist

GresilleSiffle commented 1 month ago

Recent feedback from the rest of the team:

GresilleSiffle commented 1 month ago

Some alternatives to replace the current buttons (I implemented the option 4):

cap1 cap2 cap3 cap4
GresilleSiffle commented 1 month ago

What do you think about the following capture? Instead of displaying the name of the criterion, a full question is asked to increase the UI clarity.

capture

GresilleSiffle commented 1 month ago

The branch is now ready for review. I keep the PR in draft for now, because the back end is not yet ready to process comparisons with different score_max value.