cozy / cozy-client-js

Javascript library to write Cozy applications
https://docs.cozy.io/en/cozy-client-js/README/
MIT License
11 stars 12 forks source link

Add intent transition handling #194

Closed CPatchane closed 7 years ago

CPatchane commented 7 years ago

Useful to 'animate' intent resizing using css transitions.

y-lohse commented 7 years ago

@CPatchane code looks good 👍

Help me jog my memory though, when does this happen? When the service tells the client it wants to be displayed at a certain size, is that correct?

CPatchane commented 7 years ago

Exactly this point @y-lohse

CPatchane commented 7 years ago

(5) [NUA-7] ETU je peux contacter le support directement depuis le nuage

gregorylegarec commented 7 years ago

I really don't get why an intent service should provide a presentation information to the client ? Isn't only client's purpose ?

CPatchane commented 7 years ago

@gregorylegarec We should be able to choose how the css is animated using CSS transition according to the client, shouldn't we? Sometimes we could want to delay this transition still using css (which is the case for the bar) and provide this information is necessary here.

gregorylegarec commented 7 years ago

@CPatchane Ok thanks, let's go with it, thanks ! 👍

y-lohse commented 7 years ago

To be fair, this also bothers me a little. I think Claudy is an extreme use case of intents. Theoretically speaking, would it be better if Claudy was distributed as a standalone js code, instead of an iframe? It could still use intents to do it's things, but only to manipulate data, while the resizing / animating / etc would be done on the client side and wouldn't event be in the intents?

(ping @CPatchane and @gregorylegarec so you get a notification just in case)

gregorylegarec commented 7 years ago

@y-lohse @CPatchane The more it grows, the more Claudy become extreme in many way. Maybe the need to pass this kind of data from the intente service means that our whole design is bad. But also, having a standalone Claudy would not solve those issues. However, externalizing Claudy from Cozy-Bar looks like a good idea. Again, we are falling back to our modularization and code mutualization problems.

CPatchane commented 7 years ago

Agree with @gregorylegarec about separate Claudy would not solve issues about our current workflow. However, I think we should see Claudy as a good example of extreme user of intents and a way to make it the most robust and reusable.