Skip to content

Feat/frontend redesign - #4316

Draft
kusssal wants to merge 90 commits into
IntersectMBO:developfrom
cardanoapi:feat/frontend-redesign
Draft

kusssal wants to merge 90 commits into
IntersectMBO:developfrom
cardanoapi:feat/frontend-redesign

Conversation

@kusssal

@kusssal kusssal commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

List of changes

  • Change: redesign the whole frontend to the new design: design tokens, self-hosted Geist fonts, lucide icons, new top navigation, footer, mobile drawer and page frame
  • Change: redesign Home, the DRep directory and profile, Live Voting, Outcomes (list and details), the proposal discussion list and page, the connected dashboard, the wallet flows, modals and creating a governance action
  • Add: Governance Activity page, global search (Ctrl/⌘K), notifications, a tabbed DRep dashboard, the DRep share dialog, retired DRep dashboard and re-register flow, and profile and wallet popups
  • Add: DRep directory cards show participation and delegators, with an actions menu
  • Fix: text contrast, landmarks and keyboard access across the redesigned pages
  • Change: Playwright page objects follow the new markup; test ids the CI suites read are kept

Checklist

@kusssal
kusssal force-pushed the feat/frontend-redesign branch from ff0582e to 277cbd4 Compare November 24, 2026 04:46

@mesudip mesudip left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. The DRep dashboard never sees live actions.

    • services/requests/drepDashboard.ts:31 calls /governance-actions with filters: "". 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=live and merge. Keep the unfiltered read, since it is the only one that returns dropped actions.
  2. Participation counts from the DRep's last profile update, not its registration.

    • hooks/queries/useDRepDashboard.ts:172-179 and DRepDashboard.tsx:115 use latestRegistrationDate. 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, and dRepRegisterTxHash, which is also the newest certificate (drep.service.ts:364).
  3. Home's "N votes" adds up ada and committee members.

    • Home/HomePulse.tsx:39-52 sums 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-82 and :185 use count-like fixtures, so the test passes.
  4. /activity's "all live actions" list hides actions the connected DRep has already voted on.

    • ActiveActionsList.tsx:137 uses useGetProposalsPageQuery. That hook always sends the wallet's DRep id (useGetProposalsPageQuery.ts:21,26 → getProposals.ts:42), and /proposal/list then drops voted actions (proposal.controller.ts:45-50).
    • A DRep who voted on 3 of 12 sees 9 rows under "All 12".
  5. Text from documents that failed their hash check is shown.

    • /governance-actions/metadata parses 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.
  6. 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).
  7. "Latest decision" is in submission order.

    • hooks/queries/useGetDecidedActionsQuery.ts:16 asks for newestFirst, which the backend sorts by submission epoch.
    • Home/GovernanceSnapshot.tsx:119 takes decidedActions[0] as the latest decision, and HomeOutcomes.tsx:206 slices 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

  1. 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, and activityCounts counts 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).
  2. 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/list through API (getDRepList.ts:34).
    • govtool/AGENTS.md warns that this throws users out of a vote or a form.
  3. 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).

  4. Navigation inside flows.

    • CenteredBoxPageWrapper.tsx:46 passes the back-to-dashboard handler as TopNav's onNavigateAway, 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).
  5. Direct voters and registration.

    • A direct voter always gets an "Active" badge (ProfileMenu.tsx:219), and ProfileMenu.test.tsx:124 asserts 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).
  6. 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.time is typed string (models/drepDashboard.ts:5), but #4320 sends null.
  7. 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).
  8. DRep page breadcrumb. It shows givenName with isDataMissing={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

  1. The nightly Playwright suite no longer matches the markup. CI's two suites are unaffected.

    • DRep card copy id: it is now a MenuItem in a closed Menu that renders outside the card (organisms/DRepCard.tsx:373). Yet lib/pages/dRepDirectoryPage.ts:183-197 looks for it inside the card, and tests/2-delegation/delegation.spec.ts:205 clicks 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:241 splits the type text on ":". The type pill now holds only the label (molecules/GovernanceActionCard.tsx:162). Line :225 expects the tx hash as card text, and it never appears.
    • Spec 2R: tests/2-delegation/delegationFunctionality.delegation.spec.ts:236-243 clicks a delegate button that is disabled while a delegation is pending (pages/DRepDirectoryContent.tsx:488).
  2. A CI-gated check got weaker. governance-actions.aggregates.ui.spec.ts:248 and :254 replaced the positive toContainText("-") with not.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

  1. govtool/frontend/AGENTS.md:

    • :237 says "Switch wallet disconnects without the reload". The code reloads on purpose (hooks/useConnectedWallet.ts:59, :86).
    • :257-258 says "nothing loads Google Fonts", but maintenance-page/index.html:8-11 still loads Poppins from Google.
    • :146 calls wallet-only pages "top-level routes", while :195-196 puts the notification pages inside the Dashboard route.
    • :231 says the E2E login "waits for /stake_keys"; it waits for /my/stake-key (tests/govtool-frontend/playwright/lib/pages/loginPage.ts:29).
  2. 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-button and proposal-details-header-comment-button.
    • D164 (:5653) says gates fail open "as for every feature", but the new useIsFeatureServed fails closed (hooks/queries/useDRepDashboard.ts:28-35).
    • Neither change has an amending entry, and neither does the notifications contract.
  3. docs/api: notifications.md:44 says emailSetupUrl is "https:// only", but safeHref accepts http too (Notifications/notificationContent.ts:49-50). drep-dashboard.md:1-3 calls every read "planned", including #4320's route.

  4. 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:20 now encodes it.
    • The appendix (:1276) pins pagination[pageSize]=10, but countProposalsByType (proposalList.js:59-75) sends pageSize=1, once for all and once per type, and the corpus doesn't cover that.
  5. User guide. docs/docs/cardano-govtool/using-govtool/governance-actions/view-governance-actions.md now describes the redesigned page, but keeps the old numbered screenshot (a.webp).

Older bugs in code this PR touches (separate issues are fine)

  1. Governance action submission. hooks/forms/useCreateGovernanceActionForm.ts:378-381 never checks that buildTransaction returned a builder. Without one, buildSignSubmitConwayCertTx signs 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.

  2. Script DReps get a key-hash certificate. Delegation passes the bare hash, and context/wallet.tsx:968-969 builds DRep.new_key_hash for 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.

  3. Search by CIP-129 id loses the index. services/requests/getProposals.ts:26-28 rewrites any gov_action1… id to txHash#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

  1. This PR conflicts with three of them:
    • #4322: VotesSubmitted.tsx, models/api.ts and en.json. Carry its sharesUnavailable and the nullable stake types into the redesigned panel.
    • #4318: index.html, App.tsx, the share link in GovernanceActionDetailsCardData.tsx, getGovActionId.ts and the frontend AGENTS.md. Once #4318 is in, add /activity to govtool-backend/src/seo/routes.ts, or the page is served noindex.
    • #4319: the same lines of delegate-to-a-drep.md and view-governance-actions.md.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants