Currently, when taskfile.tree.sort is set to "default", tasks in the sidebar are displayed in the order returned by the task CLI, which does not necessarily match the order in which they are defined in the Taskfile.
This can be confusing for users who carefully organize their Taskfile, expecting the sidebar to reflect the same structure.
Proposed behavior:
When the sort mode is "default", tasks and namespaces should be sorted by their location.line property, preserving the original definition order from the Taskfile.
Example:
Given this Taskfile:
tasks:
build:
desc: Build the project
test:
desc: Run tests
lint:
desc: Lint the code
The sidebar should display: build, test, lint — not alphabetically or in an arbitrary order.
For namespaces (included Taskfiles), the namespace position is determined by the smallest location.line of its contained tasks, scoped to the parent Taskfile to prevent included files from pulling a namespace out of order.
Currently, when
taskfile.tree.sortis set to"default", tasks in the sidebar are displayed in the order returned by thetaskCLI, which does not necessarily match the order in which they are defined in the Taskfile.This can be confusing for users who carefully organize their Taskfile, expecting the sidebar to reflect the same structure.
Proposed behavior:
When the sort mode is
"default", tasks and namespaces should be sorted by theirlocation.lineproperty, preserving the original definition order from the Taskfile.Example:
Given this Taskfile:
The sidebar should display:
build,test,lint— not alphabetically or in an arbitrary order.For namespaces (included Taskfiles), the namespace position is determined by the smallest
location.lineof its contained tasks, scoped to the parent Taskfile to prevent included files from pulling a namespace out of order.