Add epic filter to kanban board

- Add epicId filter to KanbanFilterOptions
- Filter issues by parent epic when epicId is set
- Add epic dropdown to kanban controls with title-first format
- Pass epics list from kanban page to controls
This commit is contained in:
zenchantlive 2026-02-13 12:35:17 -08:00
parent 2cfaa9b406
commit 74871545c7
3 changed files with 28 additions and 0 deletions

View file

@ -11,6 +11,7 @@ export interface KanbanFilterOptions {
type?: string;
priority?: string;
showClosed?: boolean;
epicId?: string;
}
export interface KanbanStats {
@ -123,6 +124,7 @@ export function filterKanbanIssues(issues: BeadIssue[], filters: KanbanFilterOpt
const type = (filters.type ?? '').trim().toLowerCase();
const priority = (filters.priority ?? '').trim();
const showClosed = filters.showClosed ?? false;
const epicId = filters.epicId?.trim();
return issues.filter((issue) => {
if (!showClosed && issue.status === 'closed') {
@ -144,6 +146,15 @@ export function filterKanbanIssues(issues: BeadIssue[], filters: KanbanFilterOpt
return false;
}
if (epicId) {
// Filter to show only tasks belonging to this epic
const parentDep = issue.dependencies.find((dep) => dep.type === 'parent');
const issueEpicId = parentDep?.target ?? (issue.id.includes('.') ? issue.id.split('.')[0] : null);
if (issueEpicId !== epicId) {
return false;
}
}
return true;
});
}