Skip to content

Add Governance module: proposals, weighted voting, feature-gated UI - #357

Merged
Lakes41 merged 2 commits into
Adamantine-guild:mainfrom
Six2world:governance-module-frontend
Jul 29, 2026
Merged

Add Governance module: proposals, weighted voting, feature-gated UI#357
Lakes41 merged 2 commits into
Adamantine-guild:mainfrom
Six2world:governance-module-frontend

Conversation

@Six2world

@Six2world Six2world commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

closes #337

Summary

Adds a complete, feature-flagged Governance module enabling communities to propose, discuss, and vote on decisions.

Changes

  • Types & API contract: Proposal/Vote types with full lifecycle (draft/active/closed/resolved), plus a 15-endpoint API specification (docs/governance-contract.md)
  • Mock backend: In-memory governance engine with weighted voting (tier x role, up to 9x for pro admin), vote aggregation, community-scoped storage, and localStorage persistence for demos
  • Live backend client: 10 methods implementing the governance API contract, with graceful degradation on 503 (returns safe empty defaults instead of crashing)
  • Frontend routes: proposal list (with status filters), proposal detail (voting UI + results), and admin-only create proposal form
  • Query keys: added for list/detail/memberVote/votes

Key characteristics

  • Feature-gated behind NEXT_PUBLIC_FEATURE_GOVERNANCE, hidden by default
  • Role-based access: members vote, admins create/manage proposals
  • Uses existing SIWE wallet auth for all governance actions
  • Fully functional in mock mode without a backend; ready for guildpass-core backend implementation

Testing

Fully mock-complete and manually verified across proposal lifecycle (draft → active → closed → resolved). Type-safe with zero TypeScript errors.

- Add Proposal/Vote types and 15-endpoint API contract (docs/governance-contract.md)
- Implement mock governance engine with weighted voting (tier x role) and localStorage persistence
- Add live backend client with graceful 503 degradation
- Add proposal list, detail, and create routes, feature-gated via NEXT_PUBLIC_FEATURE_GOVERNANCE
- Add governance query keys for list/detail/memberVote/votes
@Lakes41

Lakes41 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This PR cannot be merged automatically because it has merge conflicts.

Please update the branch with the latest base branch and resolve the conflicts.

After the conflicts are resolved and checks pass, the automation can review it again.

@Lakes41
Lakes41 merged commit 5684fe9 into Adamantine-guild:main Jul 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Design and implement the Governance module (deferred) behind its existing feature flag

2 participants