UC-Davis-molecular-computing / scadnano

Web application for designing DNA structures such as DNA origami.
https://scadnano.org
MIT License
21 stars 13 forks source link

use React drag library #345

Open dave-doty opened 4 years ago

dave-doty commented 4 years ago

Current, we use the Dart dnd package for drag operations (e.g., drawing a selection box, or moving a Strand). There's lot of ugly code in lib/src/view/design.dart for handling this.

If we use a React drag-and-drop library, for example https://github.com/atlassian/react-beautiful-dnd or https://github.com/react-dnd/react-dnd, then this code won't need to be done outside of the React/Redux cycle. I'm not sure exactly how it would work. Possibly it would be a lot of code in middleware?

Together with #43, this would mean that we could hopefully have a single React tree for the view (#334).

dave-doty commented 4 years ago

It may not be necessary to use a React library for this. It may be that we simply have to move the drag-sensing code from lib/src/view/design.dart up to lib/src/view/view.dart.

But I think it would be good at least for the Boolean "is the Dart draggable component activated?" to be a part of AppUIState. This might help with fixing this bug: #163.