gno icon indicating copy to clipboard operation
gno copied to clipboard

feat(boards2): implement next boards version

Open ilgooz opened this issue 1 year ago • 10 comments

This PR is an iteration based on the original boards implementation that adds more features and introduces an abstraction to support permissions and underlying DAOs.

Some of the added features are support for realm and boards members with owner, admin or moderator roles, thread and comment flagging, freezing (read-only) support for boards, threads and comments, realm locking, realm notices support (global messages), new UI, etc.

The main new feature introduced in the PR is the permissioned execution of different boards related actions. The key here is the usage of the WithPermission(std.Address, Permission, Args, callback) method which is part of the new Permissions interface. This interface is intended to allow changing the behaviour or rules used by the realm or individual boards, by allowing assigning a different Permissions implementation that under the hood could use a specific DAO implementation, or could integrate with a third party dApp.

This should be possible to make each board an independent community which could be integrated with any DAO, where each implementation of the Permissions interface could apply different assertions and rules to the permissioned boards realm actions.

Custom Permissions could be implemented to use a DAO under the hood but that's optional. The idea is that it should be possible using a DAO and proposals to execute board related actions asynchronically. Thats where the WithPermission(), its arguments parameter and the callback come into play, being the callback what's executed when a proposal passes, for example to create a new board, and being the arguments the parameters used within the proposal.

Current implementation uses CommonDAO to manage invited realm and board members but at this point doesn't create proposals for board actions.

It should be mentioned that at this point each board has members with different roles, where members are invite only. Open boards will be implemented but in another PR because it's mechanics are not well defined yet and at this point moderation can only be done by flagging.

The PR doesn't address some changes that have to be addressed in a different PR which are required to be able to use a package based approach instead of having all defined within a single realm. The important ones are a separation of the render logic from the base Board and Post types, and also their improvement.

ilgooz avatar Oct 04 '24 11:10 ilgooz

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:loudspeaker: Thoughts on this report? Let us know!

codecov[bot] avatar Oct 04 '24 11:10 codecov[bot]

🛠 PR Checks Summary

All Automated Checks passed. ✅

Manual Checks (for Reviewers):
  • [x] 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

Gno2D2 avatar Nov 29 '24 14:11 Gno2D2

Once #3882 is merged we should remove the commondao package from this PR and integrate with the merged one.

For context, the commondao package within this PR was conceived as an admindao specifically for the boards2 dApp, over time it evolved into commondao which was used as the starting point for #3882, which right now is a blocker to be able to merge this PR.

jeronimoalbi avatar Mar 17 '25 17:03 jeronimoalbi

PR is ready for review at this point.

Tests are failing because we have to integrate with gno.land/p/gnoland/commondao package which at this point is part of a different PR #3882 which should be merged before this one.

jeronimoalbi avatar Mar 19 '25 16:03 jeronimoalbi

Moving to Draft until we have an approval on the UI

jeronimoalbi avatar Apr 03 '25 10:04 jeronimoalbi

Merging interrealm spec changes

jeronimoalbi avatar Apr 22 '25 10:04 jeronimoalbi

Do we agree that the current implementation is not intended to be a reusable library and focuses on the rendering aspect of the realm? If not, is there an example demonstrating how to use this package externally?

At this point what's true is that is not intended to be a reusable library, having a package would be a next step that could be done in a different PR.

jeronimoalbi avatar May 21 '25 16:05 jeronimoalbi

The current implementation seems incompatible with a p/ package spirit. It is primarily designed around top-level functions and Render(), and it lacks safe objects. I am okay with this; I just want to emphasize that the best way to develop it into a library is potentially to incorporate the valuable aspects from this PR while transitioning to boards3. This could potentially make boards2 a version that won't be maintained and used for long.

I will continue my review without considering feedback on making it more library/future-proof, then. 👍

moul avatar May 22 '25 08:05 moul

Soon I'm going to update the issue description with the explanation of the important changes and ideas implemented since the original boards version which is needed to make any reviews easier.

jeronimoalbi avatar May 23 '25 15:05 jeronimoalbi

@jeronimoalbi i've made a round of replies to our discussions in this PR.

moul avatar Jun 13 '25 19:06 moul

Closing in favor of https://github.com/gnolang/gno/pull/4467.

ilgooz avatar Aug 18 '25 15:08 ilgooz