Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix: swimlane view filters (MUL-3072) (#3645)

Anderson Shindy Okif8fb3fdcd121
diff --git a/packages/views/issues/components/issues-page.tsx b/packages/views/issues/components/issues-page.tsx
index e6cc2f4fff..d6425dfbfd 100644
--- a/packages/views/issues/components/issues-page.tsx
+++ b/packages/views/issues/components/issues-page.tsx
@@ -137,6 +137,26 @@ export function IssuesPage() {
[scopedIssues, priorityFilters, assigneeFilters, includeNoAssignee, creatorFilters, projectFilters, includeNoProject, labelFilters, agentRunningFilter, runningIssueIds],
);
+ const activeFilters = useMemo(() => ({
+ priorityFilters,
+ assigneeFilters,
+ includeNoAssignee,
+ creatorFilters,
+ projectFilters,
+ includeNoProject,
+ labelFilters,
+ agentRunningFilter,
+ }), [
+ priorityFilters,
+ assigneeFilters,
+ includeNoAssignee,
+ creatorFilters,
+ projectFilters,
+ includeNoProject,
+ labelFilters,
+ agentRunningFilter,
+ ]);
+
// Fetch sub-issue progress from the backend so counts are accurate
// regardless of client-side pagination or filtering of done issues.
const { data: childProgressMap = EMPTY_CHILD_PROGRESS } = useQuery(childIssueProgressOptions(wsId));
@@ -222,6 +242,7 @@ export function IssuesPage() {
<SwimLaneView
issues={issues}
unfilteredIssues={swimlaneIssues}
+ activeFilters={activeFilters}
visibleStatuses={visibleStatuses}
hiddenStatuses={hiddenStatuses}
onMoveIssue={handleMoveIssue}
diff --git a/packages/views/issues/components/swimlane-view.test.tsx b/packages/views/issues/components/swimlane-view.test.tsx
index 31d7793f3d..1bbc5cc8ea 100644
--- a/packages/views/issues/components/swimlane-view.test.tsx
+++ b/packages/views/issues/components/swimlane-view.test.tsx
@@ -19,9 +19,18 @@ vi.mock("@multica/core/hooks", () => ({
const mockListChildrenByParents = vi.hoisted(() =>
vi.fn().mockResolvedValue({ issues: [] }),
);
+const mockGetAgentTaskSnapshot = vi.hoisted(() =>
+ vi.fn().mockResolvedValue([]),
+);
vi.mock("@multica/core/api", () => ({
- api: { listChildrenByParents: mockListChildrenByParents },
- getApi: () => ({ listChildrenByParents: mockListChildrenByParents }),
+ api: {
+ listChildrenByParents: mockListChildrenByParents,
+ getAgentTaskSnapshot: mockGetAgentTaskSnapshot,
+ },
+ getApi: () => ({
+ listChildrenByParents: mockListChildrenByParents,
+ getAgentTaskSnapshot: mockGetAgentTaskSnapshot,
+ }),
setApiInstance: vi.fn(),
}));
@@ -154,6 +163,14 @@ const mockViewState: {
toggleSwimlaneCollapsed: (key: string) => void;
hideStatus: (s: string) => void;
showStatus: (s: string) => void;
+ priorityFilters?: string[];
+ assigneeFilters?: any[];
+ includeNoAssignee?: boolean;
+ creatorFilters?: any[];
+ projectFilters?: string[];
+ includeNoProject?: boolean;
+ labelFilters?: string[];
+ agentRunningFilter?: boolean;
} = {
sortBy: "position",
sortDirection: "asc",
@@ -166,6 +183,14 @@ const mockViewState: {
toggleSwimlaneCollapsed: vi.fn(),
hideStatus: vi.fn(),
showStatus: vi.fn(),
+ priorityFilters: [],
+ assigneeFilters: [],
+ includeNoAssignee: false,
+ creatorFilters: [],
+ projectFilters: [],
+ includeNoProject: false,
+ labelFilters: [],
+ agentRunningFilter: false,
};
const mockSetSwimlaneOrder = mockViewState.setSwimlaneOrder as ReturnType<typeof vi.fn>;
const mockToggleSwimlaneCollapsed = mockViewState.toggleSwimlaneCollapsed as ReturnType<typeof vi.fn>;
@@ -318,7 +343,16 @@ describe("SwimLaneView", () => {
mockViewState.swimlaneGrouping = "parent";
mockViewState.swimlaneOrders = { parent: [], project: [], assignee: [] };
mockViewState.collapsedSwimlanes = { parent: [], project: [], assignee: [] };
+ mockViewState.priorityFilters = [];
+ mockViewState.assigneeFilters = [];
+ mockViewState.includeNoAssignee = false;
+ mockViewState.creatorFilters = [];
+ mockViewState.projectFilters = [];
+ mockViewState.includeNoProject = false;
+ mockViewState.labelFilters = [];
+ mockViewState.agentRunningFilter = false;
mockListChildrenByParents.mockResolvedValue({ issues: [] });
+ mockGetAgentTaskSnapshot.mockResolvedValue([]);
useLoadMoreByStatusMock.mockImplementation(() => ({
total: 0,
loaded: 0,
@@ -1345,4 +1379,192 @@ describe("SwimLaneView", () => {
expect(mockOnMoveIssue).not.toHaveBeenCalled();
});
+
+ it("filters batch-fetched children using active filters", async () => {
+ mockViewState.swimlaneGrouping = "parent";
+
+ const grandparent: Issue = {
+ id: "gp-2",
+ workspace_id: "ws-1",
+ number: 20,
+ identifier: "PROJ-20",
+ title: "Grandparent 2",
+ description: null,
+ status: "todo",
+ priority: "high",
+ assignee_type: null,
+ assignee_id: null,
+ creator_type: "member",
+ creator_id: "user-1",
+ parent_issue_id: null,
+ project_id: null,
+ position: 10,
+ start_date: null,
+ due_date: null,
+ metadata: {},
+ created_at: "2026-01-01T00:00:00Z",
+ updated_at: "2026-01-01T00:00:00Z",
+ };
+ const parent: Issue = {
+ ...grandparent,
+ id: "p-2",
+ number: 21,
+ identifier: "PROJ-21",
+ title: "Parent 2",
+ parent_issue_id: "gp-2",
+ position: 11,
+ };
+ const matchingGrandchild: Issue = {
+ ...grandparent,
+ id: "gc-matching",
+ number: 22,
+ identifier: "PROJ-22",
+ title: "Matching Child (High Priority)",
+ status: "in_progress",
+ priority: "high",
+ parent_issue_id: "p-2",
+ position: 12,
+ };
+ const nonMatchingGrandchild: Issue = {
+ ...grandparent,
+ id: "gc-non-matching",
+ number: 23,
+ identifier: "PROJ-23",
+ title: "Non-matching Child (Low Priority)",
+ status: "in_progress",
+ priority: "low",
+ parent_issue_id: "p-2",
+ position: 13,
+ };
+
+ mockListChildrenByParents.mockResolvedValueOnce({
+ issues: [matchingGrandchild, nonMatchingGrandchild],
+ });
+
+ const childProgressMap = new Map<string, { done: number; total: number }>([
+ ["p-2", { done: 0, total: 2 }],
+ ]);
+
+ renderWithI18n(
+ <SwimLaneView
+ issues={[grandparent, parent]}
+ activeFilters={{
+ priorityFilters: ["high"],
+ assigneeFilters: [],
+ includeNoAssignee: false,
+ creatorFilters: [],
+ projectFilters: [],
+ includeNoProject: false,
+ labelFilters: [],
+ agentRunningFilter: false,
+ }}
+ childProgressMap={childProgressMap}
+ onMoveIssue={vi.fn()}
+ />,
+ );
+
+ await waitFor(() => {
+ expect(mockListChildrenByParents).toHaveBeenCalled();
+ });
+
+ await waitFor(() => {
+ expect(screen.getByText("Matching Child (High Priority)")).toBeInTheDocument();
+ expect(screen.queryByText("Non-matching Child (Low Priority)")).toBeNull();
+ });
+ });
+
+ it("filters batch-fetched children using working filter", async () => {
+ mockViewState.swimlaneGrouping = "parent";
+
+ const grandparent: Issue = {
+ id: "gp-3",
+ workspace_id: "ws-1",
+ number: 30,
+ identifier: "PROJ-30",
+ title: "Grandparent 3",
+ description: null,
+ status: "todo",
+ priority: "medium",
+ assignee_type: null,
+ assignee_id: null,
+ creator_type: "member",
+ creator_id: "user-1",
+ parent_issue_id: null,
+ project_id: null,
+ position: 10,
+ start_date: null,
+ due_date: null,
+ metadata: {},
+ created_at: "2026-01-01T00:00:00Z",
+ updated_at: "2026-01-01T00:00:00Z",
+ };
+ const parent: Issue = {
+ ...grandparent,
+ id: "p-3",
+ number: 31,
+ identifier: "PROJ-31",
+ title: "Parent 3",
+ parent_issue_id: "gp-3",
+ position: 11,
+ };
+ const runningGrandchild: Issue = {
+ ...grandparent,
+ id: "gc-running",
+ number: 32,
+ identifier: "PROJ-32",
+ title: "Running Child",
+ status: "in_progress",
+ parent_issue_id: "p-3",
+ position: 12,
+ };
+ const nonRunningGrandchild: Issue = {
+ ...grandparent,
+ id: "gc-non-running",
+ number: 33,
+ identifier: "PROJ-33",
+ title: "Non-running Child",
+ status: "in_progress",
+ parent_issue_id: "p-3",
+ position: 13,
+ };
+
+ mockGetAgentTaskSnapshot.mockResolvedValueOnce([
+ { id: "task-1", status: "running", issue_id: "gc-running" },
+ ]);
+
+ mockListChildrenByParents.mockResolvedValueOnce({
+ issues: [runningGrandchild, nonRunningGrandchild],
+ });
+
+ const childProgressMap = new Map<string, { done: number; total: number }>([
+ ["p-3", { done: 0, total: 2 }],
+ ]);
+
+ renderWithI18n(
+ <SwimLaneView
+ issues={[grandparent, parent]}
+ activeFilters={{
+ priorityFilters: [],
+ assigneeFilters: [],
+ includeNoAssignee: false,
+ creatorFilters: [],
+ projectFilters: [],
+ includeNoProject: false,
+ labelFilters: [],
+ agentRunningFilter: true,
+ }}
+ childProgressMap={childProgressMap}
+ onMoveIssue={vi.fn()}
+ />,
+ );
+
+ await waitFor(() => {
+ expect(mockListChildrenByParents).toHaveBeenCalled();
+ });
+
+ await waitFor(() => {
+ expect(screen.getByText("Running Child")).toBeInTheDocument();
+ expect(screen.queryByText("Non-running Child")).toBeNull();
+ });
+ });
});
diff --git a/packages/views/issues/components/swimlane-view.tsx b/packages/views/issues/components/swimlane-view.tsx
index c460d8fc1b..ddcf512116 100644
--- a/packages/views/issues/components/swimlane-view.tsx
+++ b/packages/views/issues/components/swimlane-view.tsx
@@ -27,6 +27,8 @@ import type {
UpdateIssueRequest,
} from "@multica/core/types";
import { useViewStore, useViewStoreApi } from "@multica/core/issues/stores/view-store-context";
+import { agentTaskSnapshotOptions } from "@multica/core/agents";
+import { filterIssues, type IssueFilters } from "../utils/filter";
import type { SwimlaneGrouping } from "@multica/core/issues/stores/view-store";
import { useWorkspacePaths } from "@multica/core/paths";
import { useWorkspaceId } from "@multica/core/hooks";
@@ -442,6 +444,7 @@ function buildAssigneeLanes(
export function SwimLaneView({
issues,
unfilteredIssues,
+ activeFilters: activeFiltersProp,
visibleStatuses = BOARD_STATUSES,
hiddenStatuses = [],
onMoveIssue,
@@ -461,6 +464,7 @@ export function SwimLaneView({
* a parent in a hidden status still surfaces its label correctly.
*/
unfilteredIssues?: Issue[];
+ activeFilters?: Omit<IssueFilters, "statusFilters" | "runningIssueIds">;
visibleStatuses?: IssueStatus[];
hiddenStatuses?: IssueStatus[];
onMoveIssue: (issueId: string, updates: SwimLaneMoveUpdates) => void;
@@ -482,6 +486,29 @@ export function SwimLaneView({
const swimlaneOrder = swimlaneOrders[swimlaneGrouping];
const wsId = useWorkspaceId();
+
+ const { data: snapshot = [] } = useQuery(agentTaskSnapshotOptions(wsId));
+ const runningIssueIds = useMemo(() => {
+ const ids = new Set<string>();
+ for (const t of snapshot) {
+ if (t.status === "running" && t.issue_id) ids.add(t.issue_id);
+ }
+ return ids;
+ }, [snapshot]);
+
+ const activeFilters = useMemo(() => ({
+ // Status is enforced by visible-column rendering, not by filterIssues
+ statusFilters: [],
+ priorityFilters: activeFiltersProp?.priorityFilters ?? [],
+ assigneeFilters: activeFiltersProp?.assigneeFilters ?? [],
+ includeNoAssignee: activeFiltersProp?.includeNoAssignee ?? false,
+ creatorFilters: activeFiltersProp?.creatorFilters ?? [],
+ projectFilters: activeFiltersProp?.projectFilters ?? [],
+ includeNoProject: activeFiltersProp?.includeNoProject ?? false,
+ labelFilters: activeFiltersProp?.labelFilters ?? [],
+ agentRunningFilter: activeFiltersProp?.agentRunningFilter ?? false,
+ runningIssueIds,
+ }), [activeFiltersProp, runningIssueIds]);
const { data: projects = EMPTY_PROJECTS } = useQuery({
...projectListOptions(wsId),
enabled: swimlaneGrouping === "project",
@@ -606,8 +633,9 @@ export function SwimLaneView({
}
}
}
- return extra.length === 0 ? issues : [...issues, ...extra];
- }, [swimlaneGrouping, issues, perParentChildrenLists, subscribedParentIds, batchChildrenMap]);
+ const filteredExtra = filterIssues(extra, activeFilters);
+ return filteredExtra.length === 0 ? issues : [...issues, ...filteredExtra];
+ }, [swimlaneGrouping, issues, perParentChildrenLists, subscribedParentIds, batchChildrenMap, activeFilters]);
const laneGroups = useMemo<LaneGroup[]>(() => {
if (swimlaneGrouping === "project") {
diff --git a/packages/views/my-issues/components/my-issues-page.tsx b/packages/views/my-issues/components/my-issues-page.tsx
index d2acbcaeb3..10b42bd1e5 100644
--- a/packages/views/my-issues/components/my-issues-page.tsx
+++ b/packages/views/my-issues/components/my-issues-page.tsx
@@ -162,6 +162,17 @@ export function MyIssuesPage() {
[myIssues, priorityFilters, agentRunningFilter, runningIssueIds],
);
+ const activeFilters = useMemo(() => ({
+ priorityFilters,
+ assigneeFilters: [],
+ includeNoAssignee: false,
+ creatorFilters: [],
+ projectFilters: [],
+ includeNoProject: false,
+ labelFilters: [],
+ agentRunningFilter,
+ }), [priorityFilters, agentRunningFilter]);
+
const { data: childProgressMap = new Map() } = useQuery(childIssueProgressOptions(wsId));
const visibleStatuses = useMemo(() => {
@@ -269,6 +280,7 @@ export function MyIssuesPage() {
<SwimLaneView
issues={issues}
unfilteredIssues={swimlaneIssues}
+ activeFilters={activeFilters}
visibleStatuses={visibleStatuses}
hiddenStatuses={hiddenStatuses}
onMoveIssue={handleMoveIssue}
diff --git a/packages/views/projects/components/project-detail.tsx b/packages/views/projects/components/project-detail.tsx
index 31cdd03b1d..0b8ee1195c 100644
--- a/packages/views/projects/components/project-detail.tsx
+++ b/packages/views/projects/components/project-detail.tsx
@@ -165,6 +165,24 @@ function ProjectIssuesContent({
[projectIssues, priorityFilters, assigneeFilters, includeNoAssignee, creatorFilters, labelFilters, agentRunningFilter, runningIssueIds],
);
+ const activeFilters = useMemo(() => ({
+ priorityFilters,
+ assigneeFilters,
+ includeNoAssignee,
+ creatorFilters,
+ projectFilters: [],
+ includeNoProject: false,
+ labelFilters,
+ agentRunningFilter,
+ }), [
+ priorityFilters,
+ assigneeFilters,
+ includeNoAssignee,
+ creatorFilters,
+ labelFilters,
+ agentRunningFilter,
+ ]);
+
// Gantt rides its own dedicated query (scheduled-only) so it doesn't have
// to wait for every status bucket to paginate in. View-store filters still
// apply so toggling priority / assignee / label hides the same bars.
@@ -271,6 +289,7 @@ function ProjectIssuesContent({
<SwimLaneView
issues={issues}
unfilteredIssues={swimlaneIssues}
+ activeFilters={activeFilters}
visibleStatuses={visibleStatuses}
hiddenStatuses={hiddenStatuses}
onMoveIssue={handleMoveIssue}