regardscitoyens / the-law-factory

Track the french law-making process
https://www.lafabriquedelaloi.fr
GNU Affero General Public License v3.0
75 stars 15 forks source link

Restore snake-order on amendements #131

Closed njoyard closed 8 years ago

njoyard commented 8 years ago

Lost when merging #129

njoyard commented 8 years ago

FYI I pushed 3 working solutions on my fork. They all have the same visual result but different performance. To help testing I removed the 2-column mode and some container sizing is not quite right but that's not what matters right now, all this will be fixed.

From worst to best performance:

Feel free to tell me what you think about those. In all 3 cases performance is a bit hurt by the fact that we have a huge number of angular watchers (ng-repeat on subjects > ng-repeat on amendments > many dynamic properties). So I was wondering, given that we tell angular to identify amendments by their id_api, can we assume that a bunch of properties will never change on a given amendment (amdt number, group, title, authors for example) ? That would allow using one-time binding (ie. {{ ::value }}) and only use dynamic binding for things that do change (such as amendment status).

What do you think @fmassot @RouxRC ?

njoyard commented 8 years ago

Fixed by https://github.com/regardscitoyens/the-law-factory/commit/3f568a7d584beeaf6d6b10310efbed7588ed244b, uses "snake-swap" implementation. Feel free to keep commenting on other implementations, too.

njoyard commented 8 years ago

Oops, not using the right array when rendering ; thus it's not really snake ordering. Should be an easy fix.

fmassot commented 8 years ago

I also wanted to put one time binding everywhere we can, so this is excellent news !

RouxRC commented 8 years ago

same same for the ::value, didn't even know about it, excellent!