Add governance signal hooks and priority-sort utilities - #30
Open
Stanys-dev wants to merge 2 commits into
Open
Stanys-dev wants to merge 2 commits into
Stanys-dev wants to merge 2 commits into
Conversation
Introduce batch hasVoted reads, governance signal fetching, client-side priority sort, and GraphQL priority-desc pre-sort. Add Vitest with unit tests for sort and time-formatting helpers. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Someone is attempting to deploy a commit to the Lightchain AI Team on Vercel. A member of the Team first needs to authorize it. |
Map data/mock/proposals.json to API-shaped Proposal fixtures for deterministic priority-sort coverage. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 18, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
Foundation layer for upcoming governance UX improvements: batch on-chain vote-status reads, active/pending proposal signals, client-side priority sorting, and GraphQL pre-sort for
priority-desc. No visible UI change in this PR.Why
Follow-up PRs will show vote badges, priority-sorted proposal lists, and sidebar urgency signals. Those features need shared hooks and pure sort/time helpers first, kept separate from UI so reviewers can validate data logic independently.
Changes
hooks/useGovernorHasVotedBatch.tsβ batchhasVotedreads via wagmiuseReadContractshooks/useActiveProposalNotVotedForWallet.tsβ derives not-voted count from the batch maphooks/useProposalGovernanceSignals.tsβ TanStack Query hook for active/pending counts, next end time, and active proposal IDslib/sortProposalsByPriorityDesc.tsβ client priority sort (active + not voted first, soonest end within tier 0)lib/utils.tsβformatCompactTimeLeft()for compact urgency labelstypes/index.tsβ addpriority-desctoProposalSortOptiongraphqlApi/index.tsβ mappriority-descto serverend_time ascpre-sortvitest.config.ts+ unit tests for sort and time helpers;npm testscriptScope
12 files. Hooks and lib only β no component or page changes. No contract changes.
Verification
npm run testβ 7 tests passnpm run buildβ compiles cleanlynpm run lintfails with a pre-existing ESLint config error on this repo (circular structure in flat config); not introduced by this PRTest plan (for reviewer)
npm run testpassesnpm run build/ Vercel preview succeedsMade with Cursor