mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-07-15 22:32:29 -05:00
fix: show subtasks in saved filter views regardless of parent presence
Add isFilteredView parameter to shouldShowTaskInListView() that skips the parent-hiding logic when viewing tasks through a saved filter. This ensures all filter-matching tasks are shown. Ref: #2494
This commit is contained in:
@@ -6,14 +6,24 @@ import type {ITask} from '@/modelTypes/ITask'
|
||||
* Subtasks are hidden only when their parent task is also in the current view
|
||||
* (same project). Cross-project subtasks remain visible.
|
||||
*
|
||||
* In filtered views (saved filters), all tasks are shown regardless of parent
|
||||
* presence, since the user explicitly filtered for them.
|
||||
*
|
||||
* @param task - The task to check
|
||||
* @param allTasksInView - All tasks currently visible in the view
|
||||
* @param isFilteredView - Whether the current view is a saved/custom filter
|
||||
* @returns true if the task should be shown, false if it should be hidden
|
||||
*/
|
||||
export function shouldShowTaskInListView(
|
||||
task: ITask,
|
||||
allTasksInView: ITask[],
|
||||
isFilteredView: boolean = false,
|
||||
): boolean {
|
||||
// In filtered views (saved filters), show all tasks that matched the filter
|
||||
if (isFilteredView) {
|
||||
return true
|
||||
}
|
||||
|
||||
// If task has no parent, always show it
|
||||
const parentTasksCount = task.relatedTasks?.parenttask?.length ?? 0
|
||||
if (parentTasksCount === 0) {
|
||||
|
||||
Reference in New Issue
Block a user