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

Code Quality Modularization Decoupling Testing #123

Open
3 tasks
ChromaticPanic opened this issue Apr 9, 2024 · 2 comments
Open
3 tasks

Code Quality Modularization Decoupling Testing #123

ChromaticPanic opened this issue Apr 9, 2024 · 2 comments
Labels
enhancement New feature or request user-visible User visible enhancement or features - must QA

Comments

@ChromaticPanic
Copy link
Contributor

ChromaticPanic commented Apr 9, 2024

Some components are too highly coupled and violate the single responsibility principle making some components hard to test and debug

I would like to propose the following solution:

  • Break down components into smaller parts
  • Separate Component Logic from View
  • e.g. ClassifierContainer.tsx , ClassifierView.tsx
  • then export as one Module
  • This allows the React state logic to be tested separately from the UI structure
  • Make functions pure
  • Move functions that don't depend on React hooks into their own modules
  • In some cases, e.g. deep component nesting, React Context can be used to share information without having to rely on passing props repeatedly into a deep component tree

Tasks

  • Factor out species list autocomplete component
  • Break down Microscope Feed Component
  • uuid and backendurl useContext
@ChromaticPanic ChromaticPanic added user-visible User visible enhancement or features - must QA enhancement New feature or request labels Apr 9, 2024
@ChromaticPanic
Copy link
Contributor Author

For the Body specifically, I think we can move all the popup JSX code down into the component tree close to the code that triggers them if we show them as Modals.

@rngadam
Copy link

rngadam commented Apr 9, 2024

Ensure that @CFIALeronB understands the plan for change so he can adequately comment on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request user-visible User visible enhancement or features - must QA
Projects
None yet
Development

No branches or pull requests

2 participants