Repository navigation
Conversation
ff0582e to
277cbd4
Compare
277cbd4 to
76aeb9d
Compare
mesudip
left a comment
There was a problem hiding this comment.
I checked this out and ran the frontend's checks, since CI runs none of them on a fork pull request: npm run tsc and npm run lint are clean, and npx vitest run passes (188 files, 1,146 tests). Several screens show wrong figures, though, and the nightly Playwright suite no longer matches the markup. Paths are under govtool/frontend/src/ unless noted; line numbers are at 7b7853e.
Must fix: wrong data or misplaced trust
-
The DRep dashboard never sees live actions.
services/requests/drepDashboard.ts:31calls/governance-actionswithfilters: "". With no filter the backend returns concluded actions only (govtool-backend/src/governance-actions/governance-actions.mapping.ts:245,if (filters.length === 0) return !isLive).- As a result, participation leaves out every open action, and "Total Actions" (
utils/governanceActionStats.ts:26) undercounts by the live ones. - In My Votes every vote on a live action reads "Unknown" (
GovernanceTab.tsx:279-281), and the Active filter stays empty. - Fix: also read
filters=liveand merge. Keep the unfiltered read, since it is the only one that returns dropped actions.
-
Participation counts from the DRep's last profile update, not its registration.
hooks/queries/useDRepDashboard.ts:172-179andDRepDashboard.tsx:115uselatestRegistrationDate. The backend fills that from the newest registration or update certificate (govtool-backend/src/drep/drep.service.ts:108-109,:731).- So editing a profile restarts the count, and "N of M actions since registration" goes up.
- The History Log's fallback "Registered" row (
HistoryLogTab.tsx:42-53) takes that date, anddRepRegisterTxHash, which is also the newest certificate (drep.service.ts:364).
-
Home's "N votes" adds up ada and committee members.
Home/HomePulse.tsx:39-52sums all nine tally fields and prints them as votes (:125). The DRep and SPO fields are lovelace and the committee fields are member counts.- So an action with ₳3.6B of DRep yes shows about 3.6 quadrillion "votes".
pages/Home.test.tsx:81-82and:185use count-like fixtures, so the test passes.
-
/activity's "all live actions" list hides actions the connected DRep has already voted on.
ActiveActionsList.tsx:137usesuseGetProposalsPageQuery. That hook always sends the wallet's DRep id (useGetProposalsPageQuery.ts:21,26→getProposals.ts:42), and/proposal/listthen drops voted actions (proposal.controller.ts:45-50).- A DRep who voted on 3 of 12 sees 9 rows under "All 12".
-
Text from documents that failed their hash check is shown.
/governance-actions/metadataparses the body before checking the hash, so it returns the body even with INVALID_HASH (govtool-backend/src/metadata/metadata.service.ts:221-236).- The redesigned Outcomes card shows that title and only colours it red (
molecules/GovernanceActionHistoryCard.tsx:60,:106,:118-123). Develop's card header showed the failure message instead. - The same fallback, with no status check, is in:
Home/GovernanceSnapshot.tsx:122;Home/HomeOutcomes.tsx:112-114(title and abstract);GovernanceActivity/RecentlyRatified.tsx:63;GovernanceActivity/ActivityFeed.tsx:78;GlobalSearch/searchResults.tsx:55.
-
The retirement acknowledgement states something false.
- The required checkbox
retirement.ackVoting(i18n/locales/en.json:1863) says "Voting Power delegated to my DRep ID will remain associated with it until redelegated".retirement.points.id.body(:1860) promises the same. - The db-sync provider documents that from protocol 10 the ledger clears a retiring DRep's delegations (
govtool-provider-dbsync/src/accounts.ts:90-95).
- The required checkbox
-
"Latest decision" is in submission order.
hooks/queries/useGetDecidedActionsQuery.ts:16asks fornewestFirst, which the backend sorts by submission epoch.Home/GovernanceSnapshot.tsx:119takesdecidedActions[0]as the latest decision, andHomeOutcomes.tsx:206slices the same list.- The 30-day completeness test (
utils/governanceActivity.ts:46-50) assumes decision order, so it can call the count complete while missing an action decided recently but submitted earlier.
Should fix
-
Unknown values shown as 0 or as invented data:
- The Activity tab shows "0%" and a streak of 0 (
DRepDashboard/ActivityReportTab.tsx:88-96) where the directory card shows "—" for the same DRep. - The representation card shows "₳ 0" for unknown voting power (
OverviewTab.tsx:98). - The voting-power chart draws a fixed rising shape when there is no history (
OverviewTab.tsx:61-65). - The Home snapshot has no loading or error state, so it shows zeros.
/activity's overview ignores the live list's error flag (ActivityOverview.tsx:83-90). The decided-actions query has no error flag at all, andactivityCountscounts an empty list as complete.- "All 0" shows while loading or after a failure (
ActiveActionsList.tsx:153), and "decided · 30 days: 0" likewise (HomeOutcomes.tsx:254). - The notification bell has an error state only in remote mode (
useNotifications.ts:421). - Global search prints the backend's failure-fallback 0 as "₳ 0" (
GlobalSearch/searchResults.tsx:163-164).
- The Activity tab shows "0%" and a streak of 0 (
-
New background and landing-page reads go through
API, which sends the user to the error page on any 500.- The live-proposals read (
getProposals.ts:33) is mounted in the notification bell (useNotifications.ts:191) and the profile menu (ProfileMenu.tsx:199). - Home's DRep leaderboard reads
/drep/listthroughAPI(getDRepList.ts:34). govtool/AGENTS.mdwarns that this throws users out of a vote or a form.
- The live-proposals read (
-
Deadline reminders stay after the user votes. The bell's votes key (
useGetDRepVotesByIdQuery.ts:9) has no pending-vote hash, and a vote only invalidates the current-delegation key (context/pendingTransaction/utils.tsx:55-59). -
Navigation inside flows.
CenteredBoxPageWrapper.tsx:46passes the back-to-dashboard handler as TopNav'sonNavigateAway, which cancels every nav click (TopNav.tsx:52-56). Confirming then lands on /dashboard, not on the link clicked.- In a flow, "View Profile" in the wallet menu (
WalletMenu.tsx:112-115) goes to /dashboard without the leave prompt, because the profile menu isn't mounted there (TopNav.tsx:91).
-
Direct voters and registration.
- A direct voter always gets an "Active" badge (
ProfileMenu.tsx:219), andProfileMenu.test.tsx:124asserts it. - Closing the direct-voter dialog forgets a pending registration (
pages/RegisterAsDirectVoter.tsx:152). - The registration pages swap to a spinner after signing (
pages/RegisterAsdRep.tsx:80-85), because the voter query has no placeholder data (useGetVoterInfoQuery.ts:30-37).
- A direct voter always gets an "Active" badge (
-
My Delegations, with #4320.
- Row 0 is marked "Current", with today's voting power (
GovernanceTab.tsx:592-594). Meanwhile the real current delegation is fetched (:583) and ignored. - "Yourself" compares the row's CIP-129 id with the wallet's hex id (
:577), so only the current row can match. EpochStamp.timeis typedstring(models/drepDashboard.ts:5), but #4320 sendsnull.
- Row 0 is marked "Current", with today's voting power (
-
Wording that contradicts D158. D158 says a group that votes on the action but has no tally is "not supported".
- Home's tally row says "Not eligible" whenever a loaded record lacks a group's tally (
molecules/VoteTallyRow.tsx:74). - The outcome header pill reads "Not counted" (
OutcomeDetails/parts.tsx:168). - The Votes tab chip says "Voting Complete" with no tally (
OutcomeDetails/OtherTabs.tsx:166-170). - Elsewhere: dropped actions are labelled "Expired" (
utils/governanceActionFormat.ts:74-79,utils/governanceActivity.ts:105), and the snapshot always says "Updated just now" (en.json:1413).
- Home's tally row says "Not eligible" whenever a loaded record lacks a group's tally (
-
DRep page breadcrumb. It shows
givenNamewithisDataMissing={null}(pages/DRepDetails.tsx:64-69). That is a name the card hides when the document fails validation, e.g. D176's over-long name.
Tests
-
The nightly Playwright suite no longer matches the markup. CI's two suites are unaffected.
- DRep card copy id: it is now a
MenuItemin a closedMenuthat renders outside the card (organisms/DRepCard.tsx:373). Yetlib/pages/dRepDirectoryPage.ts:183-197looks for it inside the card, andtests/2-delegation/delegation.spec.ts:205clicks it directly. - Outcomes page object: it reads
-CIP-105-id(lib/pages/governanceActionHistoryPage.ts:65,:228,:517,:562) and-Expired-date(:361), and nothing renders either id now. - Live Voting page object:
lib/pages/governanceActionsPage.ts:241splits the type text on ":". The type pill now holds only the label (molecules/GovernanceActionCard.tsx:162). Line:225expects the tx hash as card text, and it never appears. - Spec 2R:
tests/2-delegation/delegationFunctionality.delegation.spec.ts:236-243clicks a delegate button that is disabled while a delegation is pending (pages/DRepDirectoryContent.tsx:488).
- DRep card copy id: it is now a
-
A CI-gated check got weaker.
governance-actions.aggregates.ui.spec.ts:248and:254replaced the positivetoContainText("-")withnot.toContainText(/Pass|Fail/), which also passes on wrong text such as "Not counted". Assert "No threshold" exactly.
Docs and decision log out of step with the code
-
govtool/frontend/AGENTS.md::237says "Switch wallet disconnects without the reload". The code reloads on purpose (hooks/useConnectedWallet.ts:59,:86).:257-258says "nothing loads Google Fonts", butmaintenance-page/index.html:8-11still loads Poppins from Google.:146calls wallet-only pages "top-level routes", while:195-196puts the notification pages inside the Dashboard route.:231says the E2E login "waits for /stake_keys"; it waits for /my/stake-key (tests/govtool-frontend/playwright/lib/pages/loginPage.ts:29).
-
docs/api/decisions.md:- D144 (
:5203) says "Kept: every testid". The forum list and details pages drop about ten:filter-button,reset-filters, the type radio wrappers, the sort options,submitted-for-vote-radio,active-proposal-radio, the list cards'copy-link,review-and-vote-buttonandproposal-details-header-comment-button. - D164 (
:5653) says gates fail open "as for every feature", but the newuseIsFeatureServedfails closed (hooks/queries/useDRepDashboard.ts:28-35). - Neither change has an amending entry, and neither does the notifications contract.
- D144 (
-
docs/api:notifications.md:44saysemailSetupUrlis "https:// only", butsafeHrefaccepts http too (Notifications/notificationContent.ts:49-50).drep-dashboard.md:1-3calls every read "planned", including #4320's route. -
govtool-pdf-backend/SPEC.md:- §4.1 (
:226-230) says pdf-ui never URL-encodes and that a search containing&or#is cut short.pdf-ui/lib/proposalList.js:20now encodes it. - The appendix (
:1276) pinspagination[pageSize]=10, butcountProposalsByType(proposalList.js:59-75) sendspageSize=1, once for all and once per type, and the corpus doesn't cover that.
- §4.1 (
-
User guide.
docs/docs/cardano-govtool/using-govtool/governance-actions/view-governance-actions.mdnow describes the redesigned page, but keeps the old numbered screenshot (a.webp).
Older bugs in code this PR touches (separate issues are fine)
-
Governance action submission.
hooks/forms/useCreateGovernanceActionForm.ts:378-381never checks thatbuildTransactionreturned a builder. Without one,buildSignSubmitConwayCertTxsigns a transaction with no proposal, adding a stake-key registration and its deposit when the key isn't registered (context/wallet.tsx:714-726). The success modal still shows. -
Script DReps get a key-hash certificate. Delegation passes the bare hash, and
context/wallet.tsx:968-969buildsDRep.new_key_hashfor any hex target. The new review dialog shows the script's 0x23 CIP-129 id (DelegationReviewDialog.tsx:175-176), so the user reviews one DRep and signs for another. -
Search by CIP-129 id loses the index.
services/requests/getProposals.ts:26-28rewrites anygov_action1…id totxHash#0, so actions with index ≥ 1 can't be found by their id. The new /activity search inherits this.
Coordination with the other open PRs
- This PR conflicts with three of them:
- #4322:
VotesSubmitted.tsx,models/api.tsand en.json. Carry itssharesUnavailableand the nullable stake types into the redesigned panel. - #4318:
index.html,App.tsx, the share link inGovernanceActionDetailsCardData.tsx,getGovActionId.tsand the frontend AGENTS.md. Once #4318 is in, add/activitytogovtool-backend/src/seo/routes.ts, or the page is served noindex. - #4319: the same lines of
delegate-to-a-drep.mdandview-governance-actions.md.
- #4322:
List of changes
Checklist
Closes Global search #4112
Closes Show wallet icon and stake address on connected panel #4209
Closes Mobile wallet warning #2040
Closes 🐛 Drep card on dashboard should show DRep name, and not label #1958
Closes 💡 Open DRep Details in new Tab #3141
Closes Update "View Details and Vote" Button Text Based on User Permissions #3109
Closes [USERSNAP] DTW: Preview DReps - DRep Explorer #1763
Closes 💡 Better search and filters #759
Closes Poor use of space, UI design on PDF main card #1387
Closes Sentry reports on wallet related user actions #1964
Closes 💡 Add a "Expiring Soon" warning on governance actions #2133
Closes Updated Dashboard with all-inclusive features #3622
My changes generate no new warnings
My code follows the style guidelines of this project
I have commented my code, particularly in hard-to-understand areas
I have made corresponding changes to the changelog
I have added tests that prove my fix is effective or that my feature works