The Ontology.tsx super component is really difficult to follow (and thus will be hard to maintain/debug). It would be really useful for us to refactor this into a better component rich structure with things like useEffect only being used where absolutely needed at a per-component level.
My read is that we can separate out the following features as separate functions / components:
Ontology Tree and DAG View
Search Functionality
Inheritance Updates
Firestore Data Management
Authentication and Routing
possibly other UI elements as well...
a lot of these are sort of "components" already, but with a lot of logic still here in the Ontology component. If anything we should abstract out state to being a shared reference that passes from parent (Ontology) to all children (the components). Passing state update functions instead of managing everything in one place should be easier in the long run as state is centralized without needing all the logic to live here too.
it would also help to use a more structured Grid for layout rather than lots of Box and Container and Section elements which do not convey a clean sense of structure or order. a grid layout lets us be more precise with where things are expected to be around the screen.
The Ontology.tsx super component is really difficult to follow (and thus will be hard to maintain/debug). It would be really useful for us to refactor this into a better component rich structure with things like useEffect only being used where absolutely needed at a per-component level.
My read is that we can separate out the following features as separate functions / components:
a lot of these are sort of "components" already, but with a lot of logic still here in the Ontology component. If anything we should abstract out state to being a shared reference that passes from parent (Ontology) to all children (the components). Passing state update functions instead of managing everything in one place should be easier in the long run as state is centralized without needing all the logic to live here too.
it would also help to use a more structured
Grid
for layout rather than lots ofBox
andContainer
andSection
elements which do not convey a clean sense of structure or order. a grid layout lets us be more precise with where things are expected to be around the screen.