Comment visibility #364

Unito
Plume_migration_agent ha unito 6 commit da comment-visibility a master 5 anni fa
trinity-1686a 5 anni fa ha commentato
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 5 anni fa
trinity-1686a 5 anni fa ha commentato
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 5 anni fa
trinity-1686a 5 anni fa ha commentato
Autore
Proprietario

things after here were added

things after here were added
trinity-1686a revisionato 5 anni fa
@ -235,0 +256,4 @@
.ok();
}
}
comm
trinity-1686a 5 anni fa ha commentato
Autore
Proprietario

things between here and next message were added

things between here and next message were added
trinity-1686a revisionato 5 anni fa
@ -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)
trinity-1686a 5 anni fa ha commentato
Autore
Proprietario

things between here and previous message were added

things between here and previous message were added
codecov[bot] 5 anni fa 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 5 anni fa
igalic (Migrato da github.com) lascia un commento

just 👀

just 👀
igalic (Migrato da github.com) 5 anni fa 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 5 anni fa 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).
trinity-1686a 5 anni fa ha commentato
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 5 anni fa 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 5 anni fa
trinity-1686a 5 anni fa ha commentato
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 5 anni fa
elegaanz (Migrato da github.com) lascia un commento

Great job, thank you!

Great job, thank you!

Revisori

La pull request è stata unita come fdfeeed6d9.
Puoi anche visualizzare le istruzioni da riga di comando.

Passo 1:

Dal repository del tuo progetto, fai il check out di un nuovo branch e verifica le modifiche.
git checkout -b comment-visibility master
git pull origin comment-visibility

Passo 2:

Fai il merge delle modifiche e aggiorna su Forgejo.
git checkout master
git merge --no-ff comment-visibility
git push origin master
Effettua l'accesso per partecipare alla conversazione.
Nessun revisore
Nessuna milestone
Nessuna assegnatario
2 Partecipanti
Notifiche
Data di scadenza
La data di scadenza non è valida o fuori intervallo. Si prega di utilizzare il formato 'aaaa-mm-dd'.

Nessuna data di scadenza impostata.

Dipendenze

Nessuna dipendenza impostata.

Riferimento: Plume/Plume#364
Caricamento…
Non ci sono ancora contenuti.