The frontend component of PuffPastry, meant to interface with the backend, which in turn interfaces with the smart contract.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

style-amendment-carousel-cards.md 8.6 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. ---
  2. sessionId: session-261005-163409-12mw
  3. ---
  4. # Requirements
  5. ### Overview & Goals
  6. Enhance the visual design, contrast hierarchy, and layout ergonomics of the amendment cards inside `AmendmentCarousel.vue`. The carousel cards will feature a distinct yet gentle contrast against the surrounding background surface, cleaner typography, well-proportioned padding, refined interactive states, and consistent styling with the rest of the application's design system.
  7. ### Scope
  8. - **In Scope**:
  9. - Updating the background color, borders, shadows, and hover transitions of amendment cards in `AmendmentCarousel.vue`.
  10. - Harmonizing the visual contrast between the carousel track and card surfaces.
  11. - Improving card internal typography (header font, summary line height, status chip positioning).
  12. - Enhancing action buttons (confirm/reject) and bottom fade gradients.
  13. - Modernizing the "Add Amendment" placeholder card to match dimensions and visual hierarchy.
  14. - Refining carousel navigation arrow buttons and keyboard focus states.
  15. - **Out of Scope**:
  16. - Changes to underlying backend API schemas or data models.
  17. - Functional logic changes to amendment creation or voting workflows.
  18. ### User Stories
  19. - **As a user reading proposals**, I want amendment cards to stand out clearly from the page background with balanced contrast and legible text so that I can quickly review proposed changes without visual fatigue.
  20. - **As a voter/reviewer**, I want interactive elements (confirm, reject, card click, add amendment) to have intuitive hover and focus feedback so that navigating and acting upon amendments is efficient and error-free.
  21. ### Functional & Visual Requirements
  22. - **Card Contrast & Surface**: Amendment cards must have a defined surface (`bg-white` / `bg-slate-50`) paired with subtle bordering (`border border-slate-200`) and soft shadow elevation (`shadow-xs` / `shadow-sm`) to ensure clear separation from neutral carousel containers.
  23. - **Spacing & Proportions**: Inner card padding must expand from the current tight `px-2 py-1` to a balanced `p-3.5` or `p-4`, ensuring adequate breathing room for content.
  24. - **Typography & Details**:
  25. - Card title formatted cleanly using header font styles with proper wrapping/truncation.
  26. - Status chips positioned with uniform margin and alignment.
  27. - Multi-line summary truncated with a fading gradient that dynamically matches the card surface during hover transitions.
  28. - **Action Buttons**: Quick-action confirm and reject icons sized appropriately with accessible hover backgrounds and contrast colors.
  29. - **"Add Amendment" Card**: Styled with dashed borders, matching border radii and heights, and harmonious amber highlight accents upon hover.
  30. - **Navigation Controls**: Left/right carousel scroll buttons updated with modern rounded borders, backdrop blur, and distinct focus rings.
  31. # Technical Design
  32. ### Current Implementation
  33. In `src/components/AmendmentCarousel.vue`, the amendment card currently uses:
  34. - `class="w-36 md:w-72 lg:w-80 shrink-0 rounded-md shadow-lg px-2 py-1 cursor-pointer hover:bg-amber-50 transition-colors"`
  35. - Missing an explicit base background color, causing inconsistent contrast against different page container backgrounds (`bg-gray-200` in `App.vue`, `ProposalDetail.vue` sections).
  36. - Cramped internal padding (`px-2 py-1`) and a static gradient mask (`from-white`) that can clash during transitions.
  37. - Action buttons (`Confirm`, `Cancel`) lacking dedicated interactive hit targets.
  38. ### Key Decisions
  39. 1. **Subtle Surface Contrast vs Harsh Borders**:
  40. - *Decision*: Use `bg-white` (or `bg-slate-50/90`) paired with a lightweight border (`border-slate-200/80` to `border-slate-300`) and gentle elevation (`shadow-sm` on rest, `shadow-md` on hover).
  41. - *Rationale*: Maximizes readability and visual clarity while maintaining a calm, modern aesthetic that fits the application's slate/amber palette.
  42. 2. **Dynamic Gradient Masking**:
  43. - *Decision*: Tie the summary fade gradient to the card's background state (`bg-gradient-to-t from-white group-hover:from-amber-50/70`).
  44. - *Rationale*: Eliminates visual artifacting when hovering over cards with long text summaries.
  45. 3. **Ergonomic Sizing & Targets**:
  46. - *Decision*: Expand default minimum card widths (`w-48 sm:w-72 lg:w-80`) and provide `p-4` internal padding, giving action buttons `p-1 rounded-full hover:bg-slate-100` hitboxes.
  47. - *Rationale*: Improves tap target usability and visual pacing across responsive viewports.
  48. ### Proposed Changes
  49. 1. **`src/components/AmendmentCarousel.vue`**:
  50. - Refactor amendment `<article>` card markup and classes:
  51. - Apply `group relative flex flex-col justify-between rounded-xl border border-slate-200/90 bg-white p-4 shadow-sm transition-all duration-200 hover:-translate-y-0.5 hover:border-amber-300 hover:bg-amber-50/40 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-900`.
  52. - Update header section inside card:
  53. - Title styled with `font-header font-bold text-slate-900 text-sm sm:text-base leading-snug`.
  54. - Confirm/Reject actions styled with subtle circular icon button wrappers.
  55. - Update summary text block and gradient overlay:
  56. - `text-xs leading-relaxed text-slate-600` with smoothly fading overlay.
  57. - Refactor "Add Amendment" `<article>`:
  58. - Apply matching rounded corners (`rounded-xl`), dashed border styling (`border-2 border-dashed border-slate-300 hover:border-amber-500`), and balanced icon/label grouping.
  59. - Modernize `.carousel-btn`:
  60. - Update class styling to `border border-slate-300 bg-white/95 text-slate-700 shadow-md hover:bg-slate-50 hover:text-slate-950 hover:border-slate-400 backdrop-blur-sm transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-900`.
  61. ### File Structure
  62. - `src/components/AmendmentCarousel.vue` *(Modified)*: Main carousel component containing card templates, scroller, action triggers, and scoped styles.
  63. # Testing
  64. ### Validation Approach
  65. Verify visual appeal, responsive layout behavior, contrast ratios, and interactive states directly in the Vue component.
  66. ### Key Scenarios
  67. 1. **Resting & Hover States**:
  68. - Verify amendment cards render with clean background separation from the carousel track.
  69. - Verify hover transition smoothly shifts background tint (`amber-50/40`), border accent, and elevation without layout shift.
  70. 2. **Text Hierarchy & Gradient Mask**:
  71. - Verify amendment title, status chip, and multi-line summary render with clear typographic hierarchy.
  72. - Verify summary text fade seamlessly matches the card surface on both resting and hover states.
  73. 3. **Interactive Actions & Buttons**:
  74. - Confirm and reject buttons trigger appropriate handlers with clear visual feedback upon hover and click.
  75. - Verify "Add Amendment" card matches carousel dimensions and triggers creation modal on click / keyboard navigation.
  76. 4. **Carousel Navigation & Responsiveness**:
  77. - Verify scroll left and right buttons appear when content overflows and operate smoothly with visible focus indicators.
  78. - Test layout across mobile (`w-48` / `w-64`) and desktop breakpoints (`w-72` / `w-80`).
  79. # Delivery Steps
  80. ### ✓ Step 1: Refine amendment card surface styling and contrast hierarchy
  81. Amendment cards feature subtle surface contrast against the background, refined spacing, and polished borders.
  82. - Update the card container background to `bg-white` (or `bg-slate-50/90`) with a fine border (`border border-slate-200/80` or `border-slate-300`) and soft elevation (`shadow-xs` / `shadow-sm` transitioning to `shadow-md` on hover).
  83. - Increase inner padding to `p-4` (or `p-3.5`) for improved breathing room and ergonomic proportions.
  84. - Update hover state to cleanly transition surface background (`hover:bg-amber-50/70` or `hover:border-amber-300`).
  85. - Ensure cards maintain consistent height and flex alignment across different screen sizes (`w-48 sm:w-72 lg:w-80`).
  86. ### ✓ Step 2: Harmonize card content typography, action controls, and carousel styling
  87. Amendment content, action buttons, gradient masks, the 'Add Amendment' card, and navigation buttons look cohesive and accessible.
  88. - Apply header typography styling (`font-header` or `font-semibold text-slate-900`) to amendment titles with proper text truncation.
  89. - Enhance confirm/reject action buttons with dedicated hover/focus states, touch target padding, and tooltips or aria attributes.
  90. - Align the summary text line-height and update the bottom gradient fade (`bg-gradient-to-t from-white group-hover:from-amber-50/70`) to match the card background.
  91. - Redesign the 'Add Amendment' dashed card with matching dimensions, rounded corners, subtle slate background tint, and smooth amber hover transitions.
  92. - Polish carousel navigation buttons with clean border, backdrop blur, and accessible focus rings.