Comment visibility #364

Unito
Plume_migration_agent ha unito 6 commit da comment-visibility a master 2018-12-24 10:23:04 +00:00
Proprietario

Add some support for comment visibility, fix #217

This add a new column to comment, denoting if they are public or not, and a new table linking private comments to those allowed to read them. There is currently no way to write a private comment from Plume.
Git is having a hard time what happened in Comment::from_activity, but most of it is just re-indentation because a new block was needed to please the borrow checker. I've marked with comments where things actually changed.
At this point only mentioned users can see private comments, even when posted as "follower only" or equivalent.

What should we do when someone isn't allowed to see a comment? Hide the whole thread, or just the comment? If hiding just the comment, should we mark there is a comment one can't see, but answers they can, or put other comments like if they answered to the same comment the hidden one do?

Add some support for comment visibility, fix #217 This add a new column to comment, denoting if they are public or not, and a new table linking private comments to those allowed to read them. There is currently no way to write a private comment from Plume. Git is having a hard time what happened in Comment::from_activity, but most of it is just re-indentation because a new block was needed to please the borrow checker. I've marked with comments where things actually changed. At this point only mentioned users can see private comments, even when posted as "follower only" or equivalent. What should we do when someone isn't allowed to see a comment? Hide the whole thread, or just the comment? If hiding just the comment, should we mark there is a comment one can't see, but answers they can, or put other comments like if they answered to the same comment the hidden one do?
trinity-1686a revisionato 2018-12-18 18:26:45 +00:00
Autore
Proprietario

before someone ask why : ructe don't allow for let var = value;, and Rust try to catch irrefutable patterns in if (like if let var = value {...), so I tried to be creative. This is actually just a nasty trick to not query the database 2 times

before someone ask why : ructe don't allow for `let var = value;`, and Rust try to catch irrefutable patterns in if (like `if let var = value {...`), so I tried to be creative. This is actually just a nasty trick to not query the database 2 times
trinity-1686a revisionato 2018-12-18 18:27:32 +00:00
Autore
Proprietario

things after here were added

things after here were added
trinity-1686a revisionato 2018-12-18 18:28:11 +00:00
@ -235,0 +256,4 @@
.ok();
}
}
comm
Autore
Proprietario

things between here and next message were added

things between here and next message were added
trinity-1686a revisionato 2018-12-18 18:28:30 +00:00
@ -235,0 +266,4 @@
match v.unwrap_or(serde_json::Value::Null) {
serde_json::Value::Array(v) => v,
v => vec![v],
}.into_iter().filter_map(filter)
Autore
Proprietario

things between here and previous message were added

things between here and previous message were added
codecov[bot] 2018-12-18 18:52:14 +00:00 ha commentato (Migrato da github.com)

Codecov Report

Merging #364 into master will decrease coverage by 0.37%.
The diff coverage is 0%.

@@            Coverage Diff            @@
##           master    #364      +/-   ##
=========================================
- Coverage   28.47%   28.1%   -0.38%     
=========================================
  Files          62      63       +1     
  Lines        5706    5782      +76     
=========================================
  Hits         1625    1625              
- Misses       4081    4157      +76
# [Codecov](https://codecov.io/gh/Plume-org/Plume/pull/364?src=pr&el=h1) Report > Merging [#364](https://codecov.io/gh/Plume-org/Plume/pull/364?src=pr&el=desc) into [master](https://codecov.io/gh/Plume-org/Plume/commit/5c5cf36b0d6609127793e22ed315edf5a5c689d2?src=pr&el=desc) will **decrease** coverage by `0.37%`. > The diff coverage is `0%`. ```diff @@ Coverage Diff @@ ## master #364 +/- ## ========================================= - Coverage 28.47% 28.1% -0.38% ========================================= Files 62 63 +1 Lines 5706 5782 +76 ========================================= Hits 1625 1625 - Misses 4081 4157 +76 ```
igalic (Migrato da github.com) revisionato 2018-12-18 21:49:07 +00:00
igalic (Migrato da github.com) lascia un commento

just 👀

just 👀
igalic (Migrato da github.com) 2018-12-18 21:34:33 +00:00 ha commentato

if you put these one into each line, my short attention span will be able to follow it 😵

if you put these one into each line, my short attention span will be able to follow it 😵
elegaanz 2018-12-22 18:06:58 +00:00 ha commentato (Migrato da github.com)

What you have done seems to work great. 👌 The only little bug that I noticed is that when you are not connected but that there are private comments, the comment area is displayed normally but is empty.

I think that when a comment can not be displayed in a thread, there should a message saying it I think (it would fix the little issue I described too).

What you have done seems to work great. :ok_hand: The only little bug that I noticed is that when you are not connected but that there are private comments, the comment area is displayed normally but is empty. I think that when a comment can not be displayed in a thread, there should a message saying it I think (it would fix the little issue I described too).
Autore
Proprietario

I've added a message, I'm not too fan of how it looks. I wonder if we shouldn't build the comment "tree" and trim it according to users rights before rendering, entirely hiding private threads
screenshot_comment_section

I've added a message, I'm not too fan of how it looks. I wonder if we shouldn't build the comment "tree" and trim it according to users rights before rendering, entirely hiding private threads ![screenshot_comment_section](https://user-images.githubusercontent.com/35889323/50377570-fa069900-061f-11e9-9c44-0b290a2cd0a9.png)
elegaanz 2018-12-22 19:36:06 +00:00 ha commentato (Migrato da github.com)

If that's not too complex, yes, it could be a good idea.

If that's not too complex, yes, it could be a good idea.
trinity-1686a revisionato 2018-12-23 08:27:21 +00:00
Autore
Proprietario

I should be more coherent on argument ordering 🤔

I should be more coherent on argument ordering :thinking:
elegaanz (Migrato da github.com) hanno approvato queste modifiche 2018-12-24 10:22:52 +00:00
elegaanz (Migrato da github.com) lascia un commento

Great job, thank you!

Great job, thank you!
Effettua l'accesso per partecipare alla conversazione.
Nessun revisore
Nessuna pietra miliare
Nessun progetto
Nessun assegnatario
2 partecipanti
Notifiche
Scadenza
La scadenza non è valida o fuori intervallo. Si prega di utilizzare il formato "aaaa-mm-dd".

Nessuna scadenza impostata.

Dipendenze

Nessuna dipendenza impostata.

Riferimento: Plume/Plume#364
Descrizione non fornita.