Frontend — History & Filtering
Summary
Users who manage payroll or grants need a paper trail they can import into a spreadsheet. This issue adds a single "Export CSV" button to HistoryPage that triggers a browser download of all executed proposals in a standard comma-separated format.
Background
HistoryPage.tsx already receives a historyProposals array containing executed, expired, and revoked proposals. The Proposal type in frontend/src/types/accord.ts includes id, amount, token, to (recipient), status, and deadline. There is currently no dedicated execution timestamp — the contributor should either use the deadline field as a proxy date or add an executedAt field to the Proposal type and populate it in mapProposal in frontend/src/lib/contract.ts. No external CSV library should be added; the file can be built from a plain string and downloaded via a temporary anchor element.
What Needs to Be Done
- In
frontend/src/pages/HistoryPage.tsx, add an "Export CSV" button in the header row next to the "Proposal History" heading. The button should only be enabled when at least one executed proposal exists.
- When clicked, filter
historyProposals to only those with status === "executed", build a CSV string with a header row (ID,Amount,Token,Recipient,Date) and one data row per proposal, then trigger a file download named accord-history.csv using a temporary anchor element with a blob URL.
- If no
executedAt field exists on the Proposal type, add one (nullable string) to frontend/src/types/accord.ts and populate it with the formatted deadline value in mapProposal inside frontend/src/lib/contract.ts until a true execution timestamp is available from the contract.
Acceptance Criteria
Files to Look At
frontend/src/pages/HistoryPage.tsx — add the button and CSV download logic here
frontend/src/types/accord.ts — check the Proposal type; add executedAt if needed
frontend/src/lib/contract.ts — mapProposal is where new fields on Proposal get populated
Difficulty: Easy
Frontend — History & Filtering
Summary
Users who manage payroll or grants need a paper trail they can import into a spreadsheet. This issue adds a single "Export CSV" button to HistoryPage that triggers a browser download of all executed proposals in a standard comma-separated format.
Background
HistoryPage.tsxalready receives ahistoryProposalsarray containing executed, expired, and revoked proposals. TheProposaltype infrontend/src/types/accord.tsincludesid,amount,token,to(recipient),status, anddeadline. There is currently no dedicated execution timestamp — the contributor should either use thedeadlinefield as a proxy date or add anexecutedAtfield to theProposaltype and populate it inmapProposalinfrontend/src/lib/contract.ts. No external CSV library should be added; the file can be built from a plain string and downloaded via a temporary anchor element.What Needs to Be Done
frontend/src/pages/HistoryPage.tsx, add an "Export CSV" button in the header row next to the "Proposal History" heading. The button should only be enabled when at least one executed proposal exists.historyProposalsto only those withstatus === "executed", build a CSV string with a header row (ID,Amount,Token,Recipient,Date) and one data row per proposal, then trigger a file download namedaccord-history.csvusing a temporary anchor element with a blob URL.executedAtfield exists on theProposaltype, add one (nullable string) tofrontend/src/types/accord.tsand populate it with the formatted deadline value inmapProposalinsidefrontend/src/lib/contract.tsuntil a true execution timestamp is available from the contract.Acceptance Criteria
accord-history.csv.Files to Look At
frontend/src/pages/HistoryPage.tsx— add the button and CSV download logic herefrontend/src/types/accord.ts— check theProposaltype; addexecutedAtif neededfrontend/src/lib/contract.ts—mapProposalis where new fields onProposalget populatedDifficulty: Easy