Conversation
yhabib
commented
Feb 24, 2026
yhabib
commented
Feb 24, 2026
Contributor
Author
|
Blocked by dfinity/snsdemo#582 as we need a new version of the replica with an updated governance canister. |
yhabib
added a commit
to dfinity/dfx-extensions
that referenced
this pull request
Feb 25, 2026
# Motivation https://github.com/dfinity/snsdemo uses dfx-extensions to set up a local replica. This is utilized by the [nns-dapp](https://github.com/dfinity/nns-dapp/). The pull request at dfinity/nns-dapp#7742 is blocked by end-to-end tests that depend on snsdemo, as the version of the Governance canister does not include the new API. # Changes - Updated `NNS_SNS_REPLICA_REV` to the latest version to support `return_self_describing_action` in the Governance canister. - Updated dependencies. - Updated ledger init to fulfill dfinity/ic@88516cb
1ad46c0 to
881861d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the frontend proposals flow to rely on the governance canister’s selfDescribingAction (requested via returnSelfDescribingAction: true) instead of fetching/decoding proposal payloads via the nns-dapp canister, removing the now-redundant payload API/store/components and associated i18n labels.
Changes:
- Request
selfDescribingActioninqueryProposalsandqueryProposal, and remove the proposal payload fetch path (API/service/canister method/errors/store). - Render proposer “payload/action” details from
selfDescribingAction.valuevia the newselfDescribingValueToJsonutility. - Remove action / NNS-function i18n label tables and update unit/e2e tests accordingly.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/lib/api/proposals.api.ts | Adds returnSelfDescribingAction: true; removes queryProposalPayload API. |
| frontend/src/lib/services/public/proposals.services.ts | Removes loadProposalPayload service logic and related error handling/toasts. |
| frontend/src/lib/stores/proposals.store.ts | Removes proposalPayloadsStore and related payload types. |
| frontend/src/lib/utils/proposals.utils.ts | Derives proposal type from selfDescribingAction; adds selfDescribingValueToJson conversion utility. |
| frontend/src/lib/components/proposal-detail/NnsProposalProposerActionsEntry.svelte | Switches proposer action/payload rendering to selfDescribingAction.value and labels section as “Payload”. |
| frontend/src/lib/components/proposal-detail/NnsProposal.svelte | Removes proposer payload entry component from the proposal detail page. |
| frontend/src/lib/components/proposal-detail/ProposalProposerPayloadEntry.svelte | Deleted (payload entry no longer needed). |
| frontend/src/lib/components/proposal-detail/NnsProposalProposerPayloadEntry.svelte | Deleted (nns-dapp payload fetch UI no longer needed). |
| frontend/src/lib/canisters/nns-dapp/nns-dapp.canister.ts | Removes getProposalPayload method and related imports. |
| frontend/src/lib/canisters/nns-dapp/nns-dapp.errors.ts | Removes proposal-payload-specific error classes. |
| frontend/src/lib/i18n/en.json | Removes proposal-payload-related error strings. |
| frontend/src/lib/i18n/en.governance.json | Removes actions* and nns_functions* label/description tables. |
| frontend/src/lib/types/i18n.d.ts | Removes corresponding i18n type definitions for deleted keys. |
| frontend/src/tests/lib/api/proposals.api.spec.ts | Updates API expectations; removes payload API tests. |
| frontend/src/tests/lib/services/public/proposals.services.spec.ts | Removes payload service tests and store assertions. |
| frontend/src/tests/lib/stores/proposals.store.spec.ts | Removes proposalPayloadsStore tests. |
| frontend/src/tests/lib/canisters/nns-dapp.canister.spec.ts | Removes getProposalPayload method tests and payload error expectations. |
| frontend/src/tests/lib/utils/proposals.utils.spec.ts | Updates type mapping tests; adds selfDescribingValueToJson unit tests. |
| frontend/src/tests/lib/components/proposals/NnsProposalCard.spec.ts | Updates card heading expectations to use selfDescribingAction-derived type. |
| frontend/src/tests/lib/components/proposal-detail/ProjectSystemInfoSection.spec.ts | Updates system info type rendering expectations to use selfDescribingAction. |
| frontend/src/tests/lib/components/proposal-detail/NnsProposalProposerActionsEntry.spec.ts | Updates proposer actions/payload rendering tests to use selfDescribingAction.value. |
| frontend/src/tests/lib/components/proposal-detail/NnsProposal.spec.ts | Removes proposer payload entry assertion and payload API mocking. |
| frontend/src/tests/lib/components/proposal-detail/ProposalProposerPayloadEntry.spec.ts | Deleted (component removed). |
| frontend/src/tests/lib/components/proposal-detail/NnsProposalProposerPayloadEntry.spec.ts | Deleted (component removed). |
| frontend/src/tests/lib/services/vote-registration.services.spec.ts | Updates proposal type label expectation (no longer i18n-driven). |
| frontend/src/tests/mocks/proposal.mock.ts | Adds selfDescribingAction to proposal mock data. |
| frontend/src/tests/mocks/proposals.store.mock.ts | Adds selfDescribingAction to proposals store mock data. |
| frontend/src/tests/e2e/proposals.spec.ts | Updates E2E expectation for proposer actions section title (“Payload”). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
881861d to
9ecc1b5
Compare
0xFFrancesco
approved these changes
Feb 27, 2026
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Feb 27, 2026
# Motivation The frontend no longer calls `get_proposal_payload` after switching to `selfDescribingAction` in #7742. This is the first step toward removing the `proposals` crate entirely. # Changes - Removed the `get_proposal_payload` update endpoint from the backend canister. - Removed the `proposals` crate dependency from the backend `Cargo.toml`. - Removed `GetProposalPayloadResponse` type and `get_proposal_payload` method from the Candid interface (backend and frontend copies). - Removed the `get_proposal_payload` entry from canister export lists (production and test). - Removed the `test-proposal-payload` script and its CI step in the build workflow.
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.
Motivation
The governance canister now exposes a
selfDescribingActionfield on proposals via areturnSelfDescribingActionflag inlistProposals. This field contains the decoded proposal action data (type name, description, and value) directly in the response. Before, we had to fetch and decode the proposal payload separately through the nns-dapp canister'sget_proposal_payloadendpoint, which internally used thers/proposalscrate to parse raw Candid binary into JSON viaidl2json. Since the governance canister now does this translation itself, the nns-dapp canister endpoint and all the frontend code around it become redundant.Note that this PR only addresses
/frontend; a follow-up will clean up/rs.Changes
returnSelfDescribingAction: trueto bothqueryProposalsandqueryProposalAPI calls.queryProposalPayloadfrom the API layer andloadProposalPayloadfromthe service layer.
proposalPayloadsStoreand related types.getProposalPayloadmethod fromNNSDappCanisterand its error classes (ProposalPayloadNotFoundError,ProposalPayloadTooLargeError,UnknownProposalPayloadError).NnsProposalProposerPayloadEntry.svelteandProposalProposerPayloadEntry.sveltecomponents.NnsProposalProposerActionsEntry.svelteto render action data fromselfDescribingAction.valueusing a newselfDescribingValueToJsonutility.mapProposalTypeto derive the proposal type label and description directly fromselfDescribingAction.typeNameandtypeDescription.selfDescribingValueToJsonutility that converts theSelfDescribingValueCandid tagged union to a plain JS object, with alphabetical key sorting to match the previous behavior.actions,actions_description,nns_functions,nns_functions_description).Tests
Todos