Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vérifications par sujet #191

Open
40 tasks
Betree opened this issue Apr 1, 2021 · 1 comment
Open
40 tasks

Vérifications par sujet #191

Betree opened this issue Apr 1, 2021 · 1 comment
Labels
backend Everything for https://github.com/CaptainFact/captain-fact-api complexity > complex Complex tasks, that require more than tree days to complete feature New features frontend Everything for https://github.com/CaptainFact/captain-fact-frontend

Comments

@Betree
Copy link
Member

Betree commented Apr 1, 2021

CaptainFact envisage de créer un nouvel outil reprenant les mécanismes du fact-checking collaboratif existants dans l'outil vidéo, mais en centrant les vérifications autour d'un sujet. Un sujet dans le cadre qui nous intéresse peut être définit comme un énoncé simple présentant une idée dans sa forme la plus indivisible à même d'être vérifiée. Exemples de sujets : "Il y a des puces 5G dans les vaccins pour la Covid", "En France, l'insécurité est en hausse".

Chaque sujet pourra être relié à un ou plusieurs liens qui y font référence. On pourra par exemple indiquer qu'un sujet est mentionné sur tel article d'un site d'actualité, ou dans telle vidéo YouTube (en précisant le timecode).

De la même manière que pour les « statements » (affirmations), chaque sujet pourra avoir plusieurs commentaires qui, en fonction de la valeur de comment.approve, pourront être des confirmations (true), des réfutations (false), ou des simples commentaires (nil). L'interface utilisera des websockets pour assurer une discussion en temps réel. À la différence de l'outils vidéo, ces websockets seront à implémenter sur l'API GraphQL (et non sur l'API REST).

Design

Specifications techniques

Pour simplifier l'implémentation, on cherchera autant que possible a ré-utiliser (et mettre en commun) les composants existants. L'utilisation de Redux est à proscrire en faveur du cache Apollo ou de contextes React. Si des composants devant être mis en communs utilisent Redux, il faudra séparer la partie vue de la partie état en créant deux composants.

Les spécifications ci-dessous sont en Anglais pour correspondre à la langue utilisée dans le code.

API

  • Create a new Topic schema
    • text string
    • slug string
    • speaker_id
  • Create a new TopicReference schema
    • topic_id
    • url
    • text (the exact quote, if available)
    • type - enum(WEB, PDF, AUDIO, VIDEO)
  • In apps/cf/lib/topics/topics.ex, create a new lib to handle topics
    • create_topic (must create the associated user_action & check permissions)
    • update_topic (must create the associated user_action & check permissions)
  • Create a new TopicsIndexer to synchronize topics with Algolia
  • Tweak Comments to make it possible to add them on a Topic. This implies looking for and preventing regressions in related code (flagger, notifications, subscriptions, etc.)
  • Expose all the necessary helpers on the GraphQL API (the legacy REST endpoints and websockets are not meant to be used for new developments).
    • topic query (get one topic)
    • topics query (list all topics)
    • create_topic mutation
    • update_topic mutations (to submit new links)
    • create_comment(topic, text, source, direction) mutation (direction = CONFIRM|REFUTE)
    • comment_added(topic) subscription field
    • comment_removed(topic) subscription field
  • Add unit tests
    • Validations on Topic schema
    • All methods from apps/cf/lib/topics/topics.ex
    • Add comments to topics
    • GraphQL subscriptions

Frontend

  • Add a tab for topics in search results
  • Add a new Topics link in the sidebar (links to /topics)
  • Implement the page to list latests topics and add new on /topics
  • Implement the topic page on /topics/:topic_slug
    • Comment updates/removal/addition should be reflected in real time (with GraphQL subscriptions)
    • Must be able to add comments
    • Must be able to add links
    • Page should work when logged out
    • Votes should be updated every ~30s
  • Add Cypress tests for the full flow
    • Search topic
    • Create topic
    • Add comment on topic

Parts of the design that are not required for the initial implementation

  • History
  • Similar topics

Tips for implementing

  • Permissions are checked with UserPermissions.check!(user, :action, :entity)
  • In the frontend, you can block an UI element based on permissions/reputation using ReputationGuardTooltip

Context

@Betree Betree added feature New features backend Everything for https://github.com/CaptainFact/captain-fact-api frontend Everything for https://github.com/CaptainFact/captain-fact-frontend complexity > complex Complex tasks, that require more than tree days to complete labels Apr 1, 2021
@Miragide Miragide added this to Backlog & Ideas in Development roadmap via automation Apr 21, 2021
@Miragide Miragide moved this from Backlog & Ideas to High priority in Development roadmap Apr 21, 2021
@Miragide
Copy link
Contributor

@Miragide Miragide moved this from High priority to Backlog & Ideas in Development roadmap Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Everything for https://github.com/CaptainFact/captain-fact-api complexity > complex Complex tasks, that require more than tree days to complete feature New features frontend Everything for https://github.com/CaptainFact/captain-fact-frontend
Projects
Development roadmap
  
Backlog & Ideas
Development

No branches or pull requests

2 participants