| sessionId |
|---|
| session-261002-164508-dfif |
The objective of this task is to convert the placeholder Add element in AmendmentCarousel.vue into a fully styled, accessible “dummy” amendment card. Clicking this card launches a new amendment creation modal, allowing users to propose an amendment to the currently viewed proposal using their connected Stellar Freighter wallet.
<article> in src/components/AmendmentCarousel.vue into an attractive, interactive dummy amendment card.src/components/modals/NewAmendmentModal.vue to capture amendment details (name/title and markdown content).AmendmentService.addAmendment with wallet authorization via @stellar/freighter-api.AmendmentCarousel.vue upon successful submission.AmendmentService).w-36 md:w-72 lg:w-80 shrink-0) with styling indicating an actionable create card (e.g. dashed border, centered plus icon, clear typography, and subtle hover animations).NewAmendmentModal via useModal().show().name) and Amendment Description/Content (content).@stellar/freighter-api and invoke AmendmentService.addAmendment({ proposalId, creator, name, content }).ProposalDetail.vue and ProposalModal.vue.role="button", tabindex="0", aria-label, and keyboard event handlers.src/components/AmendmentCarousel.vue: Renders existing amendments using horizontal scroll. Currently ends with a raw placeholder <article class="...">Add</article>.src/components/modals/Modal.vue: Base dialog component with backdrop, keyboard listeners (Esc), headers, and action buttons.src/components/modals/ProposalModal.vue: Example creation modal utilizing Modal.vue, PostBuilder.vue, freighter-api, and useModal.src/composables/useModal.ts: Controls active modal visibility and dynamic content via show(component) and hide().src/generated/typescript/services/AmendmentService.ts: Provides addAmendment(requestBody: AddAmendmentRequest) and listAmendments(proposalId).NewAmendmentModal.vue Component:
AmendmentModal.vue.AmendmentModal focuses on inspecting existing amendments while NewAmendmentModal handles form inputs, validation, and wallet signing.eventBus or direct callback) upon submission to trigger getAmendments() in AmendmentCarousel.vue.border-2 border-dashed border-slate-300 hover:border-amber-400), a plus icon from src/components/icons/Plus.vue, and descriptive text.src/components/modals/NewAmendmentModal.vue (New File):
name input and PostBuilder (or markdown content area).name.trim().length > 0 and content presence.AmendmentService.addAmendment(...) with Freighter address.created event or publishes to eventBus.src/components/AmendmentCarousel.vue (Modified):
Add article with styled card component.openNewAmendmentModal handler invoking show(NewAmendmentModal).getAmendments().graph LR
User[User] -->|Click / Keyboard| DummyCard[Dummy Card in Carousel]
DummyCard -->|useModal.show| NewModal[NewAmendmentModal]
NewModal -->|Sign & Submit| Freighter[Stellar Freighter Wallet]
NewModal -->|addAmendment| Backend[AmendmentService API]
Backend -->|Success| Refresh[Refresh Carousel]
src/components/modals/NewAmendmentModal.vue: New creation modal component.src/components/AmendmentCarousel.vue: Updated dummy card markup, styling, and modal invocation.src/composables/useModal.ts (if needed): Context helpers for active proposal ID.Verify the feature through interactive testing and automated checks:
NewAmendmentModal.NewAmendmentModal.AmendmentService.addAmendment.updateEdges() executes after adding an amendment to update left/right navigation arrows.A dedicated NewAmendmentModal.vue component is created and integrated with the modal system.
src/components/modals/NewAmendmentModal.vue utilizing <Modal> for the dialog container.name), content editor (using PostBuilder or markdown input), and submit action.@stellar/freighter-api to retrieve the signer address and AmendmentService.addAmendment to dispatch the proposal amendment.The carousel placeholder is replaced with a styled, accessible “Add Amendment” dummy card that opens the modal.
<article> in src/components/AmendmentCarousel.vue to match carousel card dimensions (w-36 md:w-72 lg:w-80) with dashed border and hover effects (border-2 border-dashed border-slate-300 hover:border-amber-400 bg-slate-50/50 hover:bg-amber-50/60).Plus icon (src/components/icons/Plus.vue), title (“Add Amendment”), and descriptive helper text.role="button", tabindex="0", Enter/Space handlers) and click handler calling useModal().show(NewAmendmentModal).proposalId context to the modal so new amendments are attached to the active proposal.Amendment creation triggers carousel list reload and seamlessly updates the UI.
getAmendments() in AmendmentCarousel.vue upon successful amendment submission.updateEdges()) update after new amendment addition.