3dstreet icon indicating copy to clipboard operation
3dstreet copied to clipboard

feature: categories for models

Open kfarr opened this issue 1 year ago β€’ 8 comments

Design WIP paste from Figma: image

Figma: https://www.figma.com/file/W9jid3A0jgssnIKBFEvG38/3DStreet-2022?type=design&node-id=3478-62879&mode=design&t=zwUhIrR6g3dBB2tt-4

v1 - grouping? https://react-select.com/home - see grouped example

questions:

  • where is grouping data stored?
  • should use same flow as https://github.com/3DStreet/citybuilderjr#gltf-auditjs ?
  • should we add new field for category or group?

v2, later: related to categories, when you modify a prop it should keep within the same category (a bus shouldn't be able to become a tree, or a sidewalk) (epic: planner)

kfarr avatar Oct 12 '23 18:10 kfarr

previous research https://github.com/3DStreet/3dstreet-editor/issues/179

kfarr avatar Oct 28 '23 03:10 kfarr

I think this issue should be in 3dstreet-editor repo?

Algorush avatar Nov 23 '23 14:11 Algorush

About where to store information about groups. I came up with this option - use group names from assets.js.. And after that we can create groups data on the fly, so not necessary a separate file with information. Or better yet, inside assets.js create JSON with information about the mixin, divided into groups, with a format appropriate for the Select component and store this JSON as an attribute in some tag. For example <a-assets groupedOptionsJSON='...'>. And use this attribute when creating a list with a mixin in the Select component on the right panel of the editor.

Algorush avatar Nov 23 '23 16:11 Algorush

v1 with collapsible categories is ready with this approach: inside assets.js create JSON with information about the mixin, divided into groups, and store this JSON as an attribute in street-assets tag. In the mixin component (in Editor) I added a function to generate a groupedOptions object with information about the mixins and what group they are in, in a format that the Select component accepts to form groups. Also added functions for collapsing groups through the interface. But I can't make the desired styles like in Figma because I have limited access to the Figma template - View only

Algorush avatar Nov 24 '23 21:11 Algorush

@Algorush sounds like a good start

Are there branches for 3dstreet (assets.js) + 3dstreet-editor (grouped select widget) ?

What else do you need to see in Figma? I think actually the react-select widget in grouped mode would be simplest option for a v1 and that is not going to align with the figma design which is ok for a first version. https://react-select.com/home#getting-started

kfarr avatar Nov 24 '23 22:11 kfarr

What else do you need to see in Figma? I think actually the react-select widget in grouped mode would be simplest option for a v1 and that is not going to align with the figma design which is ok for a first version. https://react-select.com/home#getting-started

Ok. Now it looks like in react-select web-site. I could make a design with arrows and all paddings, etc, like in Figma. This is what I mean. But I can also make approximate dimensions from the Figma picture. I haven't created PR's yet because I found one issue when an element has several mixins

Algorush avatar Nov 24 '23 22:11 Algorush

I noticed that this issue was also there before, so I created a separate topic for it in the issue list: https://github.com/3DStreet/3dstreet-editor/issues/352

Algorush avatar Nov 26 '23 15:11 Algorush

https://github.com/3DStreet/3dstreet-editor/pull/354

Algorush avatar Dec 11 '23 15:12 Algorush

closed by https://github.com/3DStreet/3dstreet-editor/pull/354

kfarr avatar Mar 13 '24 04:03 kfarr