--- sessionId: session-261005-172001-12ux --- # Requirements ### Overview & Goals The objective is to maximize user engagement and utility by introducing an inline "Add Comment" area within `ProposalDetail.vue`. By enabling direct inline commenting without modal disruptions, users can effortlessly discuss and provide feedback on governance proposals, reducing interaction friction and streamlining the feedback loop. ### Scope - **In Scope**: - Embedding an inline comment input area (textarea and action controls) directly inside the Comments section of `src/components/ProposalDetail.vue`. - Integrating `CommentService.addComment` from `src/generated/typescript/services/CommentService.ts` to submit comments. - Form validation (preventing empty/whitespace submissions) and loading/error states. - Refreshing or updating the comment stream upon successful submission. - Accessible styling consistent with Tailwind CSS guidelines and the existing proposal layout. - **Out of Scope**: - Modal-based comment workflows (explicitly avoided per task specification). - Editing, deleting, or nesting/threading multi-level comments in this phase. - Backend schema or API endpoint modifications. ### User Stories - **As a stakeholder**, I want to post feedback directly beneath a proposal so that I can contribute to the discussion with minimal friction and no context-switching modals. - **As a user**, I want visual feedback while my comment is being submitted (e.g., loading state, error alert on failure) so that I know the exact status of my action. - **As a keyboard user**, I want full keyboard accessibility (tab navigation, clear focus states) so that I can participate efficiently without relying solely on mouse input. ### Functional Requirements - **Inline Input Form**: - A clean, expandable textarea with placeholder text (e.g., "Add to the discussion...") rendered directly within the `
` block. - An "Add Comment" (or "Post Comment") submit button and optional "Cancel" / "Clear" button. - **Validation & Form State**: - Disable the submit button when the textarea is empty, whitespace-only, or while a submission is in flight. - Display clear error messaging if the network or API call fails. - **API Dispatch**: - Construct an `AddCommentRequest` with `proposalId`, `content`, and active/fallback `userId`. - Invoke `CommentService.addComment(requestBody)`. - On success, reset the input field and update the comment list so the new comment appears immediately. ### Non-Functional Requirements - **Usability & Utility**: Minimal layout shift; smooth transition between idle, submitting, and submitted states. - **Design Consistency**: Match the Tailwind CSS design language (slate borders, amber accents, clear typography) of `ProposalDetail.vue` and `NewAmendmentModal.vue`. - **Accessibility**: Semantic HTML `
`, `