Skip to content

Addressing subtask indentation feature request - #294

Open
AsbestosLampshade wants to merge 6 commits into
go-vikunja:mainfrom
AsbestosLampshade:main
Open

AsbestosLampshade wants to merge 6 commits into
go-vikunja:mainfrom
AsbestosLampshade:main

Conversation

@AsbestosLampshade

Copy link
Copy Markdown

The subtask request #57 should be fixed with this change, tested on an android emulator, g_pixel_34.
Subtasks seem to generate fine.
image
image

Please do let me know if any changes are required.

AsbestosLampshade and others added 3 commits July 13, 2026 20:41
Subtask entries returned by the API as separate items are now properly
filtered from list/kanban/project views and nested under their parent tasks.
Uses flattenAndRemoveSubtasks to merge subtask data into parents and remove
top-level duplication across both TaskPageController and ProjectController.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Subtask entries returned by the API as separate items are now properly
filtered from list/kanban/project views and nested under their parent tasks.
Uses flattenAndRemoveSubtasks to merge subtask data into parents and remove
top-level duplication across both TaskPageController and ProjectController.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
@AsbestosLampshade

Copy link
Copy Markdown
Author

Hi @leschbenedikt, could you help push the review the code and push it for CI when available?

@leschbenedikt leschbenedikt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for you work.

Unfortunately this does not work correctly at the moment.

I've created a task with a sub task which has a sub task itself like this.

Parent Task -> Sub Task -> Sub sub Task

On the web page this will be displayed like this in overview and upcoming:

Image

In the project page, it will be displayed like this:

Image

In the home page of the android app the sub sub taks is missing.
Also they are indented which differs from the web page:

Image

In the project page the indentation would be correct but also sub sub task is missing:

Image

createdBy: b.createdBy != null ? UserDto.fromDomain(b.createdBy!) : null,
);

static int? _extractParentTaskId(Map<String, dynamic> json) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand that correctly 'related_tasks' is the new api and it was 'parent_task' before.

We don't want to support outdated api from the pre 1.0 release in the app. So please use only the newest one.
For future changes we will have api versioning.

…ith full flat entries

The API returns tasks both nested inside related_tasks.subtask (shallow, with
empty subtasks) and as top-level items in the flat response (with their own
subtasks populated). When a task already existed in its parent's subtasks
from the shallow nested copy, the old code skipped it — losing grandchild
subtasks entirely. Now the richer flat-list copy replaces the stale nested one.

Also remove all pre-1.0 API fallback field reads (json['parent_task_id'],
json['subtasks']) — only the related_tasks format is supported.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
@AsbestosLampshade

Copy link
Copy Markdown
Author

image -- Home
Multi-layer tasks are accommodated for, thanks for the pointer, never used >2, so I never noticed.
Let me know if the indentation matches expectation here
image -- Within Projects

image Dropped parent_task_id as source here.

Thanks a lot for your comments @leschbenedikt
Do let me know what changes you think I should add here.

@leschbenedikt

Copy link
Copy Markdown
Collaborator

Hey,
thanks for the changes. Unfortunately not everything seems to be fixed.

The sub sub tasks is still not visible at all for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants