Snilld

ux-best-practices

ux-best-practices

Ensures excellent user experience and usability in Snilld-CRM interfaces. Use when designing or modifying admin pages, customer portal views, forms, modals, navigation, or any user-facing interface. Focuses on clarity, efficiency, feedback, and intuitive interactions.

# UX Best Practices for Snilld-CRM

Ensures all user interfaces follow modern UX principles for maximum usability and user satisfaction.

## Core UX Principles

### 1. Clear Visual Hierarchy
- Most important information at the top
- Use typography scale (headings, subheadings, body)
- Visual weight guides attention
- Group related information together

### 2. Immediate Feedback
- Loading states for all async operations
- Success/error messages visible and clear
- Button states (hover, active, disabled)
- Progress indicators for long operations
- Real-time validation feedback

### 3. Error Prevention & Recovery
- Confirm destructive actions
- Clear error messages with solutions
- Undo functionality where possible
- Validation before submission
- Helpful placeholder text and hints

### 4. Efficiency & Speed
- Keyboard shortcuts for power users
- Bulk actions where applicable
- Quick filters and search
- Auto-save where appropriate
- Minimize clicks to complete tasks

## Loading States

**Always show loading feedback:**

```javascript
// ✅ GOOD - Clear loading state
this.isLoading = true;
this.showViewLoading(true);
// ... perform operation
this.isLoading = false;
this.hideViewLoading();

// ❌ BAD - No feedback
// ... perform operation silently
```

**Loading indicators:**
- Spinner for short operations (< 2s) - Progress bar for longer operations - Skeleton screens for content loading - Disable buttons during operations ## User Feedback Messages **Success messages:** - Clear, specific, and positive - Auto-dismiss after 3-5 seconds - Position: top-right or inline near action - Include icon (✓) and brief description **Error messages:** - Explain what went wrong - Suggest how to fix it - Use friendly, non-technical language - Position: near the problematic field or top of form **Example:** ```javascript // ✅ GOOD showSuccess('Task created successfully and added to KANBAN board'); // ❌ BAD showSuccess('OK'); ``` ## Form Design ### Input Fields - Clear labels (never rely on placeholders alone) - Helpful placeholder text with examples - Inline validation feedback - Required fields clearly marked (*) - Group related fields together - Logical tab order ### Buttons - Primary action: prominent, clear label - Secondary actions: less prominent - Destructive actions: red/warning color - Disabled state: clearly indicate why - Loading state: show spinner + disable ### Modals - Clear title explaining purpose - Focus trap (keyboard navigation) - Close button (X) always visible - Escape key closes modal - Backdrop click closes (if appropriate) - Size appropriate to content ## Navigation & Information Architecture ### Menu Structure - Logical grouping of related items - Clear labels (avoid jargon) - Icons for visual recognition - Active state clearly indicated - Breadcrumbs for deep navigation ### Search & Filters - Always visible search bar (if applicable) - Filters clearly labeled - Show active filters - "Clear all" option - Results update in real-time (if possible) ### Data Tables - Sortable columns - Pagination for large datasets - Row actions (edit, delete, etc.) - Bulk selection and actions - Responsive (horizontal scroll on mobile) ## Responsive Design **Mobile-first approach:** - Touch-friendly targets (min 44x44px) - Adequate spacing between interactive elements - Stack columns on small screens - Hide non-essential columns on mobile - Expandable/collapsible sections **Breakpoints:** - Mobile: 1024px

## Accessibility (WCAG 2.1 AA)

- **Keyboard navigation**: All interactive elements accessible via keyboard
- **Focus indicators**: Visible focus states
- **ARIA labels**: For screen readers
- **Color contrast**: Minimum 4.5:1 for text
- **Alt text**: For all images
- **Semantic HTML**: Proper heading hierarchy

## Performance Perception

**Make interfaces feel fast:**
- Optimistic UI updates (update UI before server confirms)
- Show content progressively (skeleton screens)
- Lazy load images and heavy content
- Debounce search/filter inputs
- Cache frequently accessed data

## Snilld-CRM Specific Patterns

### KANBAN Board
- Smooth drag & drop animations
- Visual feedback on hover
- Clear column headers with counts
- Task cards show key information at a glance
- Quick filters always visible

### Customer Portal
- Clear call-to-action buttons
- Step-by-step wizards for complex tasks
- Progress indicators for multi-step processes
- AI assistant clearly labeled and accessible
- Approval workflow clearly explained

### Admin Dashboard
- Widget-based layout for flexibility
- Quick stats visible at top
- Recent activity feeds
- Quick action buttons
- Customizable (if possible)

## Testing Checklist

Before releasing any UI change:

- [ ] Loading states work correctly
- [ ] Error messages are helpful
- [ ] Forms validate properly
- [ ] Keyboard navigation works
- [ ] Mobile responsive
- [ ] Touch targets adequate size
- [ ] Colors have sufficient contrast
- [ ] Focus indicators visible
- [ ] No console errors
- [ ] Performance acceptable (< 3s load time)

    Gør brugeroplevelsen bedre.
    Hvilket firma arbejder du for?