Kanban Board
Relevant source files
The following files were used as context for generating this wiki page:
The Kanban Board is a core feature of the Ever Teams platform, providing a visual and interactive way to manage projects, tasks, and issues. It organizes tasks into columns based on their status, allowing teams to track progress and manage workflows efficiently. The board is designed to be highly responsive and performant, utilizing lazy loading for components, optimistic updates for UI interactions, and a comprehensive set of filters to manage complex task lists.
This feature is a central part of the platform's "Projects / Tasks & Issues Management" capabilities.
Sources: README.md, apps/web/app/[locale]/(main)/kanban/page.tsx
Architecture Overview
The Kanban Board's architecture is centered around a main page component that orchestrates several specialized hooks, state management atoms, and UI components. This separation of concerns ensures that the logic is decoupled from the presentation, making the system more maintainable and scalable.
The following diagram illustrates the high-level component architecture:
This diagram shows how kanban/page.tsx acts as the central coordinator, using the useKanban hook for its logic, which in turn relies on other hooks and state atoms. The page then renders the appropriate UI components, including a skeleton during the initial load.
Sources: apps/web/app/[locale]/(main)/kanban/page.tsx, apps/web/core/hooks/tasks/use-kanban.ts, apps/web/core/components/layouts/skeletons/kanban-page-skeleton.tsx
Core Components
Page Component: kanban/page.tsx
This is the main entry point for the Kanban Board feature. It is a client-side component responsible for:
- Orchestrating UI: Renders the main layout, including the header with breadcrumbs, page title, team member avatars, and action buttons.
- State and Logic Integration: Utilizes the
useKanbanhook to fetch and manage task data, and to handle filter state changes. - Filter Management: Renders a suite of filter components for epics, issue types, labels, priorities, and sizes. It also manages the date-based tabs ("Today", "Yesterday", "Tomorrow").
- Lazy Loading: Implements lazy loading for performance-critical components like
LazyKanbanViewand various filter dropdowns to ensure a fast initial page load. - Loading State: Displays the
KanbanPageSkeletoncomponent while initial data is being fetched, providing a smooth user experience and preventing layout shifts.
Sources: apps/web/app/[locale]/(main)/kanban/page.tsx:5-299
Logic Hook: use-kanban.ts
This hook encapsulates the majority of the business logic for the Kanban Board. It is the "brain" of the feature.
- Data Fetching: It uses the
useTeamTaskshook to get the raw list of tasks for the active team. - State Management: It interacts with the
kanbanBoardStateJotai atom to store the structured board data. - Filtering Logic: It contains a set of memoized callback functions to filter tasks based on various criteria such as search terms, priority, issue type, size, labels, epics, and assigned employee.
- Data Structuring: It processes the filtered list of tasks and groups them by their status (
taskStatusId) to create the column-based structure required by the Kanban view. - Optimistic Updates: It leverages React's
useOptimistichook to provide instantaneous UI feedback for column operations like collapsing/expanding (toggleColumn) and reordering (reorderStatus). The actual API call is made in the background.
Sources: apps/web/core/hooks/tasks/use-kanban.ts:10-292
State Atom: kanbanBoardState
This Jotai atom serves as the global state container for the Kanban board data.
- Path:
apps/web/core/stores/integrations/kanban.ts - Type:
IKanbanwhich is defined as{[key: string]: TTask[]}. - Function: It holds an object where each key is a task status name (e.g., "Open", "In Progress") and the value is an array of tasks (
TTask[]) belonging to that status. This structure directly maps to the columns and cards on the board.
Sources: apps/web/core/hooks/tasks/use-kanban.ts:1, 8, 26
Loading Skeleton: kanban-page-skeleton.tsx
To improve user experience during data loading, a dedicated skeleton component is used.
- Purpose: It renders a placeholder UI that mimics the exact layout of the Kanban page, including the header, filter bar, and columns.
- Behavior: This prevents content from jumping around (layout shift) when the real data arrives and gives the user a sense of progress. It is displayed whenever the
isLoadingflag from theuseKanbanhook is true.
Sources: apps/web/core/components/layouts/skeletons/kanban-page-skeleton.tsx, apps/web/app/[locale]/(main)/kanban/page.tsx:210-212
Data Flow
The data flow for populating the Kanban board is a one-way process from data fetching to UI rendering, with filtering logic applied in the middle.
The diagram below shows the flow of task data from the source to the rendered view.
- The
useTeamTaskshook fetches all tasks for the current team. - The
useKanbanhook receives this raw list of tasks. - It applies all active filters (search, priority, labels, etc.) to the task list.
- The resulting filtered tasks are then grouped into an object where keys are task statuses.
- This object is set in the
kanbanBoardStateJotai atom. - The
Kanbanpage component subscribes to this atom and passes the final structured data to theLazyKanbanViewcomponent for rendering.
Sources: apps/web/core/hooks/tasks/use-kanban.ts:121-163
Key Features
Task Filtering
The Kanban board provides a rich set of filters to allow users to narrow down the tasks they see.
| Filter Control | Purpose | Controlled by | Source File |
|---|---|---|---|
| Search Bar | Filters tasks by title. | setSearchTasks | use-kanban.ts:100-103 |
| Date Tabs | Filters tasks by creation date (Today, Yesterday, Tomorrow). | activeTab state | kanban/page.tsx:143-181 |
| Epic Dropdown | Filters tasks belonging to selected epics. | setEpics | use-kanban.ts:133-138 |
| Issue Type Dropdown | Filters tasks by their issue type (e.g., Task, Bug, Story). | setIssues | use-kanban.ts:111-116 |
| Labels Dropdown | Filters tasks that have specific labels. | setLabels | use-kanban.ts:127-132 |
| Priority Dropdown | Filters tasks by their priority level. | setPriority | use-kanban.ts:105-110 |
| Size Dropdown | Filters tasks by their estimated size. | setSizes | use-kanban.ts:118-122 |
| Employee Filter | Filters tasks assigned to a specific employee (via URL param). | employee search param | use-kanban.ts:140-146 |
All filter logic is implemented through memoized functions in use-kanban.ts for optimal performance.
Sources: apps/web/core/hooks/tasks/use-kanban.ts:100-146, apps/web/app/[locale]/(main)/kanban/page.tsx:280-388
Optimistic Updates
To provide a fluid and responsive user experience, column manipulations use optimistic updates. When a user collapses, expands, or reorders a column, the UI updates instantly without waiting for the server response.
The sequence diagram below details the process for collapsing a column:
This approach is implemented in the toggleColumn and reorderStatus functions within the use-kanban.ts hook, using React's useOptimistic and startTransition.
Sources: apps/web/core/hooks/tasks/use-kanban.ts:169-224, 238-284
Lazy Loading of Components
The Kanban page is optimized for fast initial load times by deferring the loading of non-critical components. The main page dynamically imports heavy components only when they are needed.
The following components are lazy-loaded:
LazyKanbanView: The main board view with columns and cards.LazyEpicPropertiesDropdownLazyStatusDropdownLazyTaskLabelsDropdownLazyTaskPropertiesDropdownLazyTaskSizesDropdownLazyKanbanSearchLazyInviteFormModal
This is achieved using dynamic imports, and the components are rendered within a Suspense boundary, which can show a fallback UI (like a skeleton) while the component is loading.
Sources: apps/web/app/[locale]/(main)/kanban/page.tsx:32-51, 290-400
Conclusion
The Kanban Board is a sophisticated and well-architected feature within the Ever Teams application. It effectively separates concerns between presentation, logic, and state. By leveraging modern React features like optimistic updates and server components with lazy loading, it delivers a highly interactive and performant user experience for complex project management workflows. The extensive filtering capabilities and clear visual organization make it a powerful tool for teams to manage their tasks.