[PR #1649] [MERGED] fix: show cross-project subtasks in List view #1645

Closed
opened 2025-11-01 21:24:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/1649
Author: @kolaente
Created: 10/13/2025
Status: Merged
Merged: 10/13/2025
Merged by: @kolaente

Base: mainHead: fix-subtask-visibility


📝 Commits (10+)

  • 3245c50 test: add tests for cross-project subtask visibility in List view
  • 445ecd9 feat: add composable for cross-project-aware task filtering
  • cbbaca0 fix: show cross-project subtasks in List view
  • c1c4f4a test: add e2e tests for cross-project subtask visibility
  • a4fc953 chore: cleanup test
  • 19a9cff fix: test truncate fixtures
  • 22b0ec9 cleanup
  • 8627aa1 trigger ci
  • f03c4bd fix: task id
  • d92075b refactor(tests): extend createProjects to support multiple projects with views

📊 Changes

6 files changed (+334 additions, -15 deletions)

View changed files

📝 frontend/cypress/e2e/project/prepareProjects.ts (+19 -10)
📝 frontend/cypress/e2e/project/project-view-list.spec.ts (+83 -1)
📝 frontend/cypress/support/factory.ts (+20 -1)
📝 frontend/src/components/project/views/ProjectList.vue (+2 -3)
frontend/src/composables/useTaskListFiltering.test.ts (+180 -0)
frontend/src/composables/useTaskListFiltering.ts (+30 -0)

📄 Description

Summary

Fixes #782 - Cross-project subtasks now remain visible in their own project's List view.

Previously, subtasks were hidden in List view if they had ANY parent task, regardless of which project the parent belonged to. This caused cross-project subtasks to disappear from their own project's List view, while they remained visible in Table and Kanban views.

Changes

  • Root Cause: The List view component filtered out all tasks with parent tasks, without checking if the parent was in the same project
  • Solution: Updated filter logic to only hide subtasks when their parent task is also visible in the current view (same project)
  • Implementation:
    • Created shouldShowTaskInListView() composable with project-aware filtering logic
    • Updated ProjectList.vue to use the new filtering function
    • Added comprehensive unit tests (8 tests covering all scenarios)
    • Added E2E tests for cross-project and same-project subtask visibility

Test Coverage

Unit Tests (8 new tests)

  • Hide subtasks when parent is in the same project
  • Show subtasks when parent is in a different project
  • Show tasks with no parents
  • Handle undefined/empty relatedTasks
  • Handle multiple levels of nesting within same project
  • Show tasks with multiple parents when none are in view
  • Hide tasks with multiple parents when at least one is in view

E2E Tests

  • Cross-project subtasks visible in their own project's List view
  • Same-project subtasks hidden at top level (nested under parent)

Verification

  • All 706 unit tests pass
  • Linting passes (ESLint + Stylelint)
  • Frontend builds successfully
  • No type errors in modified files

Example Scenario

Before:

  1. Create Task A in Project 1
  2. Create Task B in Project 2
  3. Make Task B a subtask of Task A
  4. Task B disappears from Project 2's List view

After:

  1. Create Task A in Project 1
  2. Create Task B in Project 2
  3. Make Task B a subtask of Task A
  4. Task B remains visible in Project 2's List view
  5. Task A shows Task B as nested subtask in Project 1's List view

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/1649 **Author:** [@kolaente](https://github.com/kolaente) **Created:** 10/13/2025 **Status:** ✅ Merged **Merged:** 10/13/2025 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `fix-subtask-visibility` --- ### 📝 Commits (10+) - [`3245c50`](https://github.com/go-vikunja/vikunja/commit/3245c503afab20153f9bfcdf93280de8d0f5316b) test: add tests for cross-project subtask visibility in List view - [`445ecd9`](https://github.com/go-vikunja/vikunja/commit/445ecd920fe9e4ab6224d5c0e8f6b6493cc06750) feat: add composable for cross-project-aware task filtering - [`cbbaca0`](https://github.com/go-vikunja/vikunja/commit/cbbaca019d5b1dd8f3d8244696cbd36ae704685d) fix: show cross-project subtasks in List view - [`c1c4f4a`](https://github.com/go-vikunja/vikunja/commit/c1c4f4a8f73895abad97700d4b20e0bf29eb56f9) test: add e2e tests for cross-project subtask visibility - [`a4fc953`](https://github.com/go-vikunja/vikunja/commit/a4fc95309a4394c2444c9729833be22ff02654b8) chore: cleanup test - [`19a9cff`](https://github.com/go-vikunja/vikunja/commit/19a9cff5d91b9345d78ff4151a3360aafbb9dcf2) fix: test truncate fixtures - [`22b0ec9`](https://github.com/go-vikunja/vikunja/commit/22b0ec95603a3cac12a6c2828f9b22986e6e3bcf) cleanup - [`8627aa1`](https://github.com/go-vikunja/vikunja/commit/8627aa13fc3cff2dff2a4a3b7e4686ebccc4c96f) trigger ci - [`f03c4bd`](https://github.com/go-vikunja/vikunja/commit/f03c4bdf4db9cd922f3796fa085a078276d87c35) fix: task id - [`d92075b`](https://github.com/go-vikunja/vikunja/commit/d92075b558df9eca67b304c8fe637b8800f7640c) refactor(tests): extend createProjects to support multiple projects with views ### 📊 Changes **6 files changed** (+334 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `frontend/cypress/e2e/project/prepareProjects.ts` (+19 -10) 📝 `frontend/cypress/e2e/project/project-view-list.spec.ts` (+83 -1) 📝 `frontend/cypress/support/factory.ts` (+20 -1) 📝 `frontend/src/components/project/views/ProjectList.vue` (+2 -3) ➕ `frontend/src/composables/useTaskListFiltering.test.ts` (+180 -0) ➕ `frontend/src/composables/useTaskListFiltering.ts` (+30 -0) </details> ### 📄 Description ## Summary Fixes #782 - Cross-project subtasks now remain visible in their own project's List view. Previously, subtasks were hidden in List view if they had ANY parent task, regardless of which project the parent belonged to. This caused cross-project subtasks to disappear from their own project's List view, while they remained visible in Table and Kanban views. ## Changes - **Root Cause:** The List view component filtered out all tasks with parent tasks, without checking if the parent was in the same project - **Solution:** Updated filter logic to only hide subtasks when their parent task is also visible in the current view (same project) - **Implementation:** - Created `shouldShowTaskInListView()` composable with project-aware filtering logic - Updated `ProjectList.vue` to use the new filtering function - Added comprehensive unit tests (8 tests covering all scenarios) - Added E2E tests for cross-project and same-project subtask visibility ## Test Coverage ### Unit Tests (8 new tests) - ✅ Hide subtasks when parent is in the same project - ✅ Show subtasks when parent is in a different project - ✅ Show tasks with no parents - ✅ Handle undefined/empty relatedTasks - ✅ Handle multiple levels of nesting within same project - ✅ Show tasks with multiple parents when none are in view - ✅ Hide tasks with multiple parents when at least one is in view ### E2E Tests - ✅ Cross-project subtasks visible in their own project's List view - ✅ Same-project subtasks hidden at top level (nested under parent) ## Verification - ✅ All 706 unit tests pass - ✅ Linting passes (ESLint + Stylelint) - ✅ Frontend builds successfully - ✅ No type errors in modified files ## Example Scenario **Before:** 1. Create Task A in Project 1 2. Create Task B in Project 2 3. Make Task B a subtask of Task A 4. ❌ Task B disappears from Project 2's List view **After:** 1. Create Task A in Project 1 2. Create Task B in Project 2 3. Make Task B a subtask of Task A 4. ✅ Task B remains visible in Project 2's List view 5. ✅ Task A shows Task B as nested subtask in Project 1's List view --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-01 21:24:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#1645