A verification “Swiss army knife” helping journalists, fact-checkers, and human rights defenders to save time and be more efficient in their fact-checking and debunking tasks on social networks especially when verifying videos and images
This pull request introduces (a lot of) refactoring changes regarding the navigation.
The rationale is to have less error-prone code: less hardcoded strings, less arrays all around relying on ids that could break and shift things easily. The new code should be:
Easy to maintain: a single unified file to manage all the different tools
Easy to contribute to: adding a new tool should not be a hassle like it was before with code to write in many files
So... The first and main change is the ⚠️ suppression of the (infamous) NavBar.jsx ⚠️ file
The UI is now divided as follow:
An ApplicationLayout component that groups all the rest of the layout
The TopMenu component has the different quick-access tools available at the top (Tools, Assistant, etc. at the time of writing)
The SideMenu component lists all the tools available to fact-checkers
The MainContent component is where the content for the selected tool is displayed
A tools file is introduced where all the tools are listed, where new tools can be added.
A constants folder is introduced to manage the plugin's constants that should not be modified often.
The current design choice is to get rid of ids and positions in array but use the tools' titles to identify them in redux instead. This allow to get rid of errors where the position in array or id could be wrong, which could introduce odd navigation behaviors, or even make the plugin crash totally.
We also introduce a Tool class that represents the tools and the properties they can have, and we added JSDoc to many functions to provide autocompletion as well as documentation.
A lot of constants names are also refactored with much more meaningful names: "index" or "lists" are renamed with what they truly correspond to, like "tool".
All the icons are wrapped as MUI svgIcon components, which allow us to override the styling as needed.
This pull request introduces (a lot of) refactoring changes regarding the navigation.
The rationale is to have less error-prone code: less hardcoded strings, less arrays all around relying on ids that could break and shift things easily. The new code should be:
So... The first and main change is the ⚠️ suppression of the (infamous) NavBar.jsx ⚠️ file
The UI is now divided as follow:
ApplicationLayout
component that groups all the rest of the layoutTopMenu
component has the different quick-access tools available at the top (Tools, Assistant, etc. at the time of writing)SideMenu
component lists all the tools available to fact-checkersMainContent
component is where the content for the selected tool is displayedtools
file is introduced where all the tools are listed, where new tools can be added.constants
folder is introduced to manage the plugin's constants that should not be modified often.The current design choice is to get rid of ids and positions in array but use the tools' titles to identify them in redux instead. This allow to get rid of errors where the position in array or id could be wrong, which could introduce odd navigation behaviors, or even make the plugin crash totally.