-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(boards2): change flagging threshold to be configurable per board #3724
feat(boards2): change flagging threshold to be configurable per board #3724
Conversation
@x1unix this PR is ready for review 🙏 |
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):No automated checks match this pull request. ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
// DefaultFlaggingThreshold defines the default number of flags that hides flaggable items. | ||
const DefaultFlaggingThreshold = 1 | ||
|
||
var gFlaggingThresholds avl.Tree // string(board ID) -> int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boards may be removed in a future, thus it's necessary to clean this table as well.
Moving threshold into a Board
will solve this, but you'll need to get board first and then the counter in every call.
Is this a reason why you made this a separate tree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take another look 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving threshold into a
Board
will solve this, but you'll need to get board first and then the counter in every call.Is this a reason why you made this a separate tree?
I didn't want to make flagging part of a board, I though that it could be an optional separate feature but with the current code might make sense to integrate that into the Board type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After checking, we currently don't support removing Boards, that feature is something to be discussed if we want to implement it.
We could add the threshold in the Boards but for now we can have it separate, as now. This approach is based on the idea of having "custom" features like flagging implemented independently of the Board or Post types to make it optional, in case these types are moved into a package. If we agree on having a package then we can have a small refactor for Post to separate flagging logic, otherwise if we agree on not having a package we can integrate flagging threshold into the Board type. If it makes sense :)
This enables each board to use a flagging threshold different than the default of 1.
Threshold specifies how many flags are required for a thread or comment to be hidden.