Skip to content
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

Conversation

jeronimoalbi
Copy link
Member

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.

@jeronimoalbi jeronimoalbi self-assigned this Feb 11, 2025
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Feb 11, 2025
@jeronimoalbi
Copy link
Member Author

@x1unix this PR is ready for review 🙏

@Gno2D2
Copy link
Collaborator

Gno2D2 commented Feb 11, 2025

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • IGNORE the bot requirements for this PR (force green CI check) (checked by @jeronimoalbi)
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:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission

// DefaultFlaggingThreshold defines the default number of flags that hides flaggable items.
const DefaultFlaggingThreshold = 1

var gFlaggingThresholds avl.Tree // string(board ID) -> int
Copy link
Contributor

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?

Copy link
Member Author

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 👍

Copy link
Member Author

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.

Copy link
Member Author

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 :)

@jeronimoalbi jeronimoalbi requested a review from x1unix February 13, 2025 09:33
@jeronimoalbi jeronimoalbi merged commit c948518 into gnolang:devx/feature/boardsv2 Feb 13, 2025
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧾 package/realm Tag used for new Realms or Packages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants