Comment visibility #364

Samengevoegd
Plume_migration_agent heeft 6 commits samengevoegd van comment-visibility naar master 5 jaren geleden
Eigenaar

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 beoordeeld 5 jaren geleden
Poster
Eigenaar

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 beoordeeld 5 jaren geleden
Poster
Eigenaar

things after here were added

things after here were added
trinity-1686a beoordeeld 5 jaren geleden
@ -235,0 +256,4 @@
.ok();
}
}
comm
Poster
Eigenaar

things between here and next message were added

things between here and next message were added
trinity-1686a beoordeeld 5 jaren geleden
@ -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)
Poster
Eigenaar

things between here and previous message were added

things between here and previous message were added
codecov[bot] reageerde 5 jaren geleden (Gemigreerd van 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 (Gemigreerd van github.com) beoordeeld 5 jaren geleden
igalic (Gemigreerd van github.com) heeft een reactie achtergelaten

just 👀

just 👀
igalic (Gemigreerd van github.com) reageerde 5 jaren geleden

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 reageerde 5 jaren geleden (Gemigreerd van 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).
Poster
Eigenaar

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 reageerde 5 jaren geleden (Gemigreerd van 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 beoordeeld 5 jaren geleden
Poster
Eigenaar

I should be more coherent on argument ordering 🤔

I should be more coherent on argument ordering :thinking:
elegaanz (Gemigreerd van github.com) heeft deze veranderingen 5 jaren geleden goedgekeurd
elegaanz (Gemigreerd van github.com) heeft een reactie achtergelaten

Great job, thank you!

Great job, thank you!

Reviewers

De pull request is samengevoegd als fdfeeed6d9.
Je kunt ook command line instructies bekijken.

Stap 1:

Vanuit het project, check een branch uit en test de veranderingen.
git checkout -b comment-visibility master
git pull origin comment-visibility

Stap 2:

Voeg de wijzigingen samen en update ze op Forgejo.
git checkout master
git merge --no-ff comment-visibility
git push origin master
Log in om deel te nemen aan deze discussie.
Geen beoordelaars
Geen mijlpaal
Niet toegewezen
2 deelnemers
Notificaties
Vervaldatum
De deadline is ongeldig of buiten bereik. Gebruik het formaat 'jjjj-mm-dd'.

Geen vervaldatum ingesteld.

Afhankelijkheden

Geen afhankelijkheden ingesteld.

Referentie: Plume/Plume#364
Laden…
Er is nog geen inhoud.