Comment visibility #364

已合併
Plume_migration_agent 將 6 次提交從 comment-visibility 合併至 master 5 年前
擁有者

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 已審核 5 年前
發布者
擁有者

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 已審核 5 年前
發布者
擁有者

things after here were added

things after here were added
trinity-1686a 已審核 5 年前
@ -235,0 +256,4 @@
.ok();
}
}
comm
發布者
擁有者

things between here and next message were added

things between here and next message were added
trinity-1686a 已審核 5 年前
@ -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

things between here and previous message were added
codecov[bot] 已留言 5 年前 (已從 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 (已從 github.com 遷移) 已審核 5 年前
igalic (已從 github.com 遷移) 留下了回應

just 👀

just 👀
igalic (已從 github.com 遷移) 已留言 5 年前

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 年前 (已從 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).
發布者
擁有者

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 年前 (已從 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 已審核 5 年前
發布者
擁有者

I should be more coherent on argument ordering 🤔

I should be more coherent on argument ordering :thinking:
elegaanz (已從 github.com 遷移) 核可了這些變更 5 年前
elegaanz (已從 github.com 遷移) 留下了回應

Great job, thank you!

Great job, thank you!

審核者

此合併請求已被合併為 fdfeeed6d9
您也可以查看命令列指南

第一步:

在您的儲存庫中切換到新分支並測試變更。
git checkout -b comment-visibility master
git pull origin comment-visibility

第二步:

合併變更並更新到 Forgejo。
git checkout master
git merge --no-ff comment-visibility
git push origin master
登入 才能加入這對話。
沒有審核者
未選擇里程碑
沒有負責人
2 參與者
通知
截止日期
截止日期無效或超出範圍,請使用「yyyy-mm-dd」的格式。

未設定截止日期。

先決條件

未設定先決條件。

參考: Plume/Plume#364
載入中…
尚未有任何內容