homotopy-io / homotopy-webclient

https://homotopy.io
26 stars 5 forks source link

Reorder cells in the signature #7

Open jamievicary opened 5 years ago

jamievicary commented 5 years ago

Suggest a material design paradigm would work well, with cells being like playing cards that can be moved up and down.

jamievicary commented 5 years ago

Could even encourage attachment by drag-and-drop

NickHu commented 5 years ago

To clarify, each cell currently has an id which also determines the order they appear in the signature. Would you suggest that reordering would change this id, or perhaps introduce a UI-specific draw-order numeric tag for each cell instead? I believe the former might require some nontrivial changes because cells are frequently referenced by this id

zrho commented 5 years ago

Indeed the id is used for far more than the ordering. I would recommend additionally storing an array of ids to encode the order, like in the answer at

https://stackoverflow.com/questions/51126582/how-to-keep-order-in-redux-state

This does not require replacing ids on reordering, and can't get into an inconsistent state like a draw order tag could.

On Wed, 27 Mar 2019, 18:22 Nick Hu notifications@github.com wrote:

To clarify, each cell currently has an id which also determines the order they appear in the signature. Would you suggest that reordering would change this id, or perhaps introduce a UI-specific draw-order numeric tag for each cell instead? I believe the former might require some nontrivial changes because cells are frequently referenced by this id

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/homotopy-io/webclient/issues/7#issuecomment-477265019, or mute the thread https://github.com/notifications/unsubscribe-auth/AAV1JYNiybEKpIof1j9kqPEzuSgfXbZ0ks5va6jDgaJpZM4WTUhN .

jamievicary commented 5 years ago

Yes, IDs are used everywhere, and I agree we shouldn't change these.

I agree that the best solution would be an array of IDs stored in the workspace.

NickHu commented 5 years ago

While we're at it, could we also store the "Single image" flag like Globular does in here? Or does core need to know about this for some reason?

jamievicary commented 5 years ago

No, the core doesn't need to know about this.

There are likely to be a large number of further parameters that could control the display of the generator. I think we could store all these happily in the existing generator object, alongside the colour.

On Thu, Mar 28, 2019 at 12:15 PM Nick Hu notifications@github.com wrote:

While we're at it, could we also store the "Single image" flag like Globular does in here? Or does core need to know about this for some reason?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/homotopy-io/webclient/issues/7#issuecomment-477570339, or mute the thread https://github.com/notifications/unsubscribe-auth/AKHHHsdtWugskXLbDzz7xupKNxw-o18eks5vbLJYgaJpZM4WTUhN .