bettersg / checkMate

GNU General Public License v3.0
5 stars 0 forks source link

Move message to voted tab once I have voted not once message is assessed. Probably need to handle this frontend since voted status only changes asynchronously backend. #225

Closed madanalogy closed 3 months ago

madanalogy commented 5 months ago

Move message to voted tab once I have voted not once message is assessed.

I vaguely recall we had a discussion about this. Just to confirm, is the intention to only have two tabs (voted / not voted)? So then differentiating between assessed / not assessed is done in a different manner / not at all? Since there are 2 state variables each message can be in 1 of 4 states, so making explicit which tab / colour /font it should be in for each state would be good.

Probably need to handle this frontend since voted status only changes asynchronously backend.

We can set a react hook to fetch messages after voting. Alternatively we can include the updated message state in the api response. The latter might be more data efficient but might require more changes to existing interfaces.

sarge1989 commented 5 months ago

@madanalogy Yeah that's the intention i think! Can double confirm with amanda @scrumpdiddlyum .

We can set a react hook to fetch messages after voting. Alternatively we can include the updated message state in the api response. The latter might be more data efficient but might require more changes to existing interfaces.

I think the latter is better actually, come to think of it I was probably mistaken. The "voted" state is updated synchronously in the API, it's assessed which is not. Changes to existing interfaces not a problem cos the API interface is brand new anyway and only used by the checkers webapp, haha.

sarge1989 commented 5 months ago

@madanalogy Also, to be pedantic, theres still one more set of variables, "correct" and "wrong", assuming the checker has voted on the message and it is also assessed. This also relates to #224