Comment visibility #364
Nessun revisore
Etichette
Nessuna etichetta
A: API
A: Backend
A: Federation
A: Front-End
A: I18N
A: Meta
A: Security
Build
C: Bug
C: Discussion
C: Enhancement
C: Feature
Compatibility
Dependency
Design
Documentation
Good first issue
Help welcome
Mobile
Rendering
S: Blocked
S: Duplicate
S: Incomplete
S: Instance specific
S: Invalid
S: Needs Voting/Discussion
S: Ready for review
Suggestion
S: Voted on Loomio
S: Wontfix
Nessuna pietra miliare
Nessun progetto
Nessun assegnatario
2 partecipanti
Notifiche
Scadenza
Nessuna scadenza impostata.
Dipendenze
Nessuna dipendenza impostata.
Riferimento: Plume/Plume#364
Caricamento…
Add table
Crea riferimento in una nuova segnalazione
Descrizione non fornita.
Elimina ramo "comment-visibility"
L'eliminazione di un ramo è definitiva. Nonostante il ramo eliminato potrebbe continuare ad esistere per un breve periodo di tempo prima di essere realmente eliminato, l'eliminazione NON PUÒ essere annullata in molti casi. Continuare?
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?
before someone ask why : ructe don't allow for
let var = value;
, and Rust try to catch irrefutable patterns in if (likeif let var = value {...
), so I tried to be creative. This is actually just a nasty trick to not query the database 2 timesthings after here were added
@ -235,0 +256,4 @@
.ok();
}
}
comm
things between here and next message were added
@ -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)
things between here and previous message were added
Codecov Report
just 👀
if you put these one into each line, my short attention span will be able to follow it 😵
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).
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

If that's not too complex, yes, it could be a good idea.
I should be more coherent on argument ordering 🤔
Great job, thank you!