Comment visibility
#364
Samengevoegd
Plume_migration_agent
heeft 6 commits samengevoegd van comment-visibility
naar master
5 jaren geleden
Reviewers
Beoordeling aanvragen
Geen beoordelaars
Labels
Verwijder labels
Related to the REST API
Code running on the server
Stuff related to Federation
Related to the front-end
Translations, and related code
More about project management or code than the project itself
The building, or installation process of Plume
Something isn't working
We need to talk
New feature or request
This is a new feature
Compatibility with different browsers, readers and OS
Related to an external package that Plume uses
UI/UX related issues and PRs
Good for newcomers
Extra attention is needed
Issues affecting only mobile UX
How elements're rendered out for the end user
Something else needs to be fixed first
This issue or pull request already exists
This PR is not complete yet
Issues concern a limited number of instances
This doesn't seem right
Need to be discussed by the community (on Loomio)
This PR is ready to be reviewed
Proposed ideas worth considering
This is issue has been created after a vote on Loomio
This will not be worked on
Labels toepassen
A: API
Related to the REST API
A: Backend
Code running on the server
A: Federation
Stuff related to Federation
A: Front-End
Related to the front-end
A: I18N
Translations, and related code
A: Meta
More about project management or code than the project itself
A: Security
Build
The building, or installation process of Plume
C: Bug
Something isn't working
C: Discussion
We need to talk
C: Enhancement
New feature or request
C: Feature
This is a new feature
Compatibility
Compatibility with different browsers, readers and OS
Dependency
Related to an external package that Plume uses
Design
UI/UX related issues and PRs
Documentation
Good first issue
Good for newcomers
Help welcome
Extra attention is needed
Mobile
Issues affecting only mobile UX
Rendering
How elements're rendered out for the end user
S: Blocked
Something else needs to be fixed first
S: Duplicate
This issue or pull request already exists
S: Incomplete
This PR is not complete yet
S: Instance specific
Issues concern a limited number of instances
S: Invalid
This doesn't seem right
S: Needs Voting/Discussion
Need to be discussed by the community (on Loomio)
S: Ready for review
This PR is ready to be reviewed
Suggestion
Proposed ideas worth considering
S: Voted on Loomio
This is issue has been created after a vote on Loomio
S: Wontfix
This will not be worked on
Geen label
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
Mijlpaal
Stel mijlpaal in
Verwijder mijlpaal
Geen items
Geen mijlpaal
Toegewezen aan
Gebruikers toewijzen
Verwijder toegewezen aan
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
Verwijs in nieuw issue
Er is nog geen inhoud.
Verwijder branch 'comment-visibility'
Het verwijderen van een branch is permanent. Het KAN NIET ongedaan gemaakt worden. Wil je toch doorgaan?
Nee
Ja
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!
Reviewers
fdfeeed6d9
.Stap 1:
Vanuit het project, check een branch uit en test de veranderingen.Stap 2:
Voeg de wijzigingen samen en update ze op Forgejo.