Skip to content

Query DAO proposals through backend boundary#1432

Draft
dnlbui wants to merge 2 commits into
issue-1414-dao-modal-list-uifrom
issue-1415-dao-backend-integration
Draft

Query DAO proposals through backend boundary#1432
dnlbui wants to merge 2 commits into
issue-1414-dao-modal-list-uifrom
issue-1415-dao-backend-integration

Conversation

@dnlbui

@dnlbui dnlbui commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

What Changed

This PR removes the temporary DAO mock data runtime path and wires the DAO modal list to the current server proposal query path.

  • Deleted dao.mock-data.js and removed production references to generated mock proposals.
  • Added createDaoBackendFetcher(queryDaoApi) in dao.repo.js; it loads GET /dao/proposals/meta, then fetches GET /dao/proposals/:number in batches of 10.
  • Mapped server DaoProposalAccount payloads into the existing DAO modal store shape, including status, type, description/title fallback, committee data, reward fields, and totalVote -> votes compatibility for the current detail modal.
  • Kept backend querying and mapping behind dao.repo.js; app.js only registers setDaoBackendFetcher(createDaoBackendFetcher(queryNetwork)).
  • Kept local-only createProposal and castVote disabled with clear not-connected behavior; those transaction flows remain for later phase issues.
  • Preserved the existing empty-store behavior when no fetcher is configured and previous-store preservation when refresh fails.

Flow

  1. User opens the DAO modal.
  2. daoRepo.refresh({ force: true }) calls the configured backend fetcher.
  3. The fetcher reads proposal count from /dao/proposals/meta and loads numbered proposals from /dao/proposals/:number.
  4. dao.repo.js normalizes fetched proposals into Active/Archived lists and status counts for DaoModal.
  5. If the query fails after data was already loaded, the previous store remains available.

Why

Issue #1415 is the backend/query integration step for the Phase 1 DAO modal list. The server currently exposes DAO proposal metadata plus individual numbered proposal accounts, not a single list endpoint, so this follows the same count-then-fetch pattern used by the server CLI while keeping the UI renderer decoupled from endpoint details.

Create, vote, committee review, rewards, and ready actions are still placeholders for their later phase issues.

Validation

  • node --check app.js
  • node --check dao.repo.js
  • git diff --check
  • git diff --check issue-1414-dao-modal-list-ui...HEAD
  • node --input-type=module smoke check: no fetcher returns empty Active/Archived lists
  • node --input-type=module smoke check: injected backend fetcher queries meta/proposals, skips a missing proposal, maps totalVote into votes
  • node --input-type=module smoke check: failed refresh preserves the previously loaded store

Closes #1415
Parent: #1413
Depends on #1429

@dnlbui dnlbui changed the title Remove DAO mock data path Query DAO proposals through backend boundary Jul 1, 2026
@dnlbui dnlbui force-pushed the issue-1415-dao-backend-integration branch from cc68f7d to 995f985 Compare July 1, 2026 21:21
@dnlbui dnlbui linked an issue Jul 2, 2026 that may be closed by this pull request
7 tasks
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.

Phase 1.B: DAO Modal, List Shape, And Filter Dropdown Backend Integration

1 participant