Documentation Index
Fetch the complete documentation index at: https://mintlify.com/EdgarJr30/proyecto-de-grado-cms/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Kanban board provides a visual, column-based interface for managing work orders and requests. It enables intuitive drag-and-drop operations to move tickets through their lifecycle stages.Both Work Requests and Work Orders use Kanban-style boards, but with different column configurations and behaviors.
Board Types
Work Orders Board
Manages accepted work orders through three main status columns:Pendiente
Orders waiting to be started. Newly accepted work requests appear here.
En Ejecución
Orders currently being worked on by assigned technicians.
Finalizadas
Completed orders ready for review or archiving.
- Archivadas - Archived orders (toggled on/off)
Work Requests Board
Displays unaccepted maintenance requests in a single-column layout:- All work requests shown together
- No drag-and-drop (requests must be formally accepted)
- Focus on review and assignment workflow
Drag-and-Drop Mechanics
How It Works
Move to target
Drag the card over the target column. The column highlights to show it’s ready to receive.
Visual Feedback
During Drag:- Source card becomes semi-transparent
- Target column highlights
- Drop zones become visible
- Cursor changes to indicate drag state
- Smooth animation to final position
- Status badge updates
- Timestamp refreshes
- Toast notification confirms save
Drag Constraints
Not all tickets can be dragged:Ordering Modes
The Work Orders board supports three ordering strategies:Manual Ordering
Behavior:- Drag tickets vertically within columns to reorder
- Custom order persists across sessions
- Stored in browser localStorage
- Independent order per status column
work_orders_manual_order_v1
Data Structure:
~/workspace/source/src/components/dashboard/workOrder/WorkOrdersBoard.tsx:34
Date Ascending
Behavior:- Sorts by
incident_date(oldest first) - Tickets without dates appear last
- Tie-breaker: ticket ID descending
Date Descending
Behavior:- Sorts by
incident_date(newest first) - Tickets without dates appear last
- Tie-breaker: ticket ID descending
Column Components
Column Header
Displays:- Column title (status name)
- Ticket count in column
- Optional loading indicator
- Collapse/expand control (future)
Column Body
Contains:- Scrollable list of ticket cards
- Drop zone for drag operations
- Empty state message
- Pagination controls
Ticket Cards
Information Displayed:- Ticket ID (e.g., #1234)
- Title (truncated if long)
- Description preview
- Priority badge (color-coded)
- Assignee name
- Location name
- Incident date
- Thumbnail of first attached image
- Special incident indicator (if applicable)
Real-time Synchronization
The board stays synchronized across all users:Update Triggers
- Ticket Created - New work requests appear instantly
- Status Changed - Cards move between columns
- Fields Updated - Card content refreshes
- Assignments Changed - Assignee name updates
- Comments Added - Notification badge appears
- Archived/Unarchived - Cards appear/disappear
Sync Implementation
~/workspace/source/src/lib/dataInvalidation.ts for event system details.
Performance Optimization
Pagination Strategy
Work Orders Board:- Loads 200 tickets per page
- Maximum 8 pages (1600 tickets total)
- Server-side pagination via Supabase
- Uses
.range(from, to)for efficient loading
Virtual Scrolling
Not yet implemented, but recommended for columns with 100+ tickets:- Render only visible cards
- Recycle DOM elements
- Smooth scroll performance
- Libraries: react-window, react-virtual
Reduced Motion Support
Respects user’s motion preferences:Accessibility
Keyboard Navigation
Board supports keyboard-only operation:- Tab - Navigate between cards and columns
- Enter - Open selected card
- Space - Start drag operation (with keyboard)
- Arrow Keys - Move card between columns (when dragging)
- Escape - Cancel drag operation
Screen Reader Support
- Column headers announce count: “Pendiente, 5 tickets”
- Card content read in logical order
- Status changes announced: “Ticket moved to En Ejecución”
- Drop zones labeled: “Drop here to move to Finalizadas”
ARIA Attributes
Mobile Responsiveness
Layout Adaptations
Desktop (≥1024px):- Horizontal columns side-by-side
- Drag horizontally between columns
- All columns visible simultaneously
- Horizontal scroll for columns
- Narrow columns with wrapped content
- Sticky column headers
- Vertical stacking of columns
- Accordion-style expansion
- Tap to expand/collapse columns
- Simplified card layout
Touch Gestures
Long Press: Initiate drag on touch devices Swipe: Scroll within column Tap: Open ticket detail Pinch: Not used (reserved for zoom)Error Handling
Common Errors
- Permission Denied
- Invalid Status
- Network Error
Error: “No se pudo mover la orden (no existe, está archivada o no tienes permiso).”Causes:
- User lacks
tickets:managepermission - Ticket is archived
- RLS policy blocks access
- Check user permissions
- Verify ticket is not archived
- Review RLS policies
Error Recovery
Optimistic Updates:- UI updates immediately
- Reverts on server error
- Toast notification shows error
- User can retry
Customization
Column Configuration
Define custom columns:Card Templates
Customize card appearance:Styling
Override default styles:Best Practices
Board Management
- Keep Columns Balanced - Distribute work evenly
- Limit WIP - Don’t overload “En Ejecución”
- Clear Finalizadas - Archive completed work regularly
- Use Manual Order - Prioritize important tickets at top
- Monitor Flow - Track tickets moving through stages
Performance
- Filter Aggressively - Reduce loaded tickets
- Archive Old Tickets - Keep active board small
- Limit Date Range - Use specific date filters
- Enable Virtual Scrolling - For large columns (future)
- Clear Local Storage - If manual order gets too large
User Experience
- Provide Feedback - Show loading states
- Confirm Actions - Toast for successful moves
- Handle Errors - Clear error messages
- Support Keyboard - Don’t rely only on mouse
- Test Touch - Verify mobile drag works
Troubleshooting
Cards not draggable
- Verify browser supports drag API
- Check ticket is accepted
- Ensure ticket is not archived
- Confirm user has permissions
Manual order not persisting
- Check localStorage enabled
- Verify storage quota
- Clear old order:
localStorage.removeItem('work_orders_manual_order_v1') - Check for JSON serialization errors
Columns not loading
- Check network tab for API errors
- Verify Supabase connection
- Check RLS policies
- Review filter values
Real-time updates not working
- Verify Supabase Realtime enabled
- Check subscription channel
- Confirm data invalidation events fire
- Review browser console for errors
Related Documentation
- Work Orders - Managing work orders
- Work Requests - Converting requests
- My Tickets - Personal view
- Notifications - Status change alerts