Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

frontend layer refactoring #1152

Open
9 tasks
markus2330 opened this issue Jan 8, 2024 · 4 comments
Open
9 tasks

frontend layer refactoring #1152

markus2330 opened this issue Jan 8, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request frontend changes in Typescript code

Comments

@markus2330
Copy link
Contributor

markus2330 commented Jan 8, 2024

Tasks

Common operations of elements:

  • selection
  • transformation
  • undo
  • ???

Use case

shade and drawing layer

Related Pull request

No response

@markus2330 markus2330 added the enhancement New feature or request label Jan 8, 2024
@markus2330
Copy link
Contributor Author

As first step, please collect which operations might be sharable between layers.

@markus2330 markus2330 added the frontend changes in Typescript code label Jan 8, 2024
@Bushuo
Copy link
Contributor

Bushuo commented Jan 8, 2024

I would strongly agree to a refactor of the MapStore into a more narrow layer specific store.
Also maybe a Stage and Transformer store.
This way more logic can be pulled from components into the respective stores and makes it easier to track where what happens.

A design pattern I would strongly encourage then is grouping actions under a actions namespace inside the store.

@Bushuo
Copy link
Contributor

Bushuo commented Jan 8, 2024

@badnames Can you please also explain, why a stage listeners functionality was needed?


Currently it seems a bit convoluted this way.
If you look at the plant layer
useMapStore.getState().stageRef.current?.on('click.placePlant', handleCreatePlanting);
there is a backed-in functionality to listen to native Stage events.
Maybe I am missing something?

@markus2330
Copy link
Contributor Author

@Bushuo thx for your great input!

A design pattern I would strongly encourage then is grouping actions under a actions namespace inside the store.

Can you maybe describe what you have in mind in our architecture documentation as a separate PR?

Can you please also explain

I created a separate issue #1155 as @badnames sometimes does not get all the notification. The extra issue will pop up in the sprint and I can ask him in the meeting.

I suggest that we should have a dedicated meeting together to discuss the frontend layer refactoring. But first we should have a PR that proposes an architecture. I think they (@badnames and @danielsteinkogler) will be very happy if you (@Bushuo) make specific suggestions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request frontend changes in Typescript code
Projects
Status: Current Sprint
Development

No branches or pull requests

5 participants