aelve / guide

A workspace for research teams
https://guide.aelve.com
106 stars 10 forks source link

Instead of “changed X” say “added X” if X was added #96

Closed neongreen closed 8 years ago

neongreen commented 8 years ago

Currently we have this, it's silly:

image

How to fix it:

babhishek21 commented 8 years ago

I believe the file View.hs resides in /liband not /src.

neongreen commented 8 years ago

Yeah, it was moved together with the rest of /src.

babhishek21 commented 8 years ago

So are we supposed to check for all the Edit'Set* cases to see if the old value is empty? What about when new values are empty?

neongreen commented 8 years ago

So are we supposed to check for all the Edit'Set* cases to see if the old value is empty?

Yeah. I wish I had a less boilerplatey definition of Edit (with some kind of first-class record fields), but currently it is what it is, and I don't know how to make it better without losing type safety. If you have any ideas, please tell!

What about when new values are empty?

They can't be, because code that generates Edits won't create an edit when the old value is equal to the new value. Furthermore, even if an empty value slips through, nothing bad will happen (the admin interface isn't even visible for ordinary users), so you can ignore this possibility.

Here's the function which adds an edit: https://github.com/aelve/guide/blob/master/lib/Guide.hs#L180-L190. Here's the function which checks that an edit actually changes something: https://github.com/aelve/guide/blob/master/lib/Types.hs#L672-L711.

babhishek21 commented 8 years ago

Great! I think I'll take a look today evening. Does anyone mind?

neongreen commented 8 years ago

I definitely don't!

neongreen commented 8 years ago

Fixed by @babhishek21 in #131 and deployed.