Skip to content

Conversation

@FuzzkingCool
Copy link
Contributor

This pull request introduces configurable sorting for task display order in the TasksWidget, allowing users to choose between "anatomy" and "alphabetical" sorting based on project settings. It also adds a new settings section for this configuration in the server-side tools settings model.

TLDR: Sort Tasks in tools by alphanumerically OR by the order they are in the Anatomy, preserving a project's pipeline step order.

Task Display Order Configuration

  • Added logic in TasksWidget to read the task_display_order setting from project settings.
  • Introduced the TASK_SORT_ROLE data role and updated task item population to set sorting values based on the selected display order. [1] [2]
  • Implemented a custom lessThan method in the proxy model to sort tasks according to the configured order, handling both string and numeric values.

Server-side Settings Model Updates

  • Added a new ToolsDisplayModel with a task_display_order field to the server-side tools settings (tools.py), allowing global configuration of task sorting.
  • Integrated the new display settings section into the global tools settings and provided a default value for task_display_order. [1] [2]

@ynbot ynbot added the size/XS label Oct 30, 2025
@iLLiCiTiT
Copy link
Member

iLLiCiTiT commented Oct 30, 2025

What does "anatomy" mean? Anatomy does not have order of tasks... Task types are stored as dictionary (unordered map) as far as I know.

self._last_project_name = project_name
self._last_folder_id = folder_id
# Load tools configuration for task display order
try:
Copy link
Member

@iLLiCiTiT iLLiCiTiT Oct 30, 2025

Choose a reason for hiding this comment

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

This logic does not belong to UI. This is backend logic which should be received using controller, or the widget should have setter for it. I'm also not convinced if this has to be in settings.

Copy link
Member

Choose a reason for hiding this comment

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

If anatomy actually is using order for task types then the TaskItem should already have order stored on it, which would be filled in model.

Copy link
Member

Choose a reason for hiding this comment

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

Confirmed, that project anatomy is using the order. So, now I believe we should get rid of the settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I can make these changes if you feel this could get merged:

  • Respect MVC and move the logic to the model
  • As @BigRoy pointed out, this becomes less useful when there are multiple Tasks of these types, and ordering them by their Type will not necessarily reflect the intended pipeline step order. However in the simple paradigm of Kitsu where Tasks and Task Types are one and the same, this is VERY useful.

Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

AYON frontend already does sort it based on anatomy task types order. I believe we should follow that in pipeline tools too, without settings.

Without settings nothing has to be moved from the UI because it does what has to be done already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understood. I wonder if however studios who are used to it being alphabetical, as it is by default right now, might want to keep it the default approach? Without the ayon-core addon setting, they would be forced to order the Task Types in the Anatomy, creating a state which is not as complimentary to the production if they have different Tasks that are of the same type, but not consecutive etc.

Copy link
Member

Choose a reason for hiding this comment

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

I think we already had requests to change it this way. It is easier to add settings if someone complains than give the option and then try to remove the settings.

@BigRoy
Copy link
Collaborator

BigRoy commented Oct 30, 2025

What does "anatomy" mean? Anatomy does not have order of tasks... Task types are stored as dictionary (unordered map) as far as I know.

The order would be "Task Type", as such it would e.g. be this order in Anatomy:
image

As such, order would then be Task Type Order 1st and Task Name 2nd because you may have multiples of same task type.

@MustafaJafar MustafaJafar added community Issues and PRs coming from the community members type: enhancement Improvement of existing functionality or minor addition labels Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Issues and PRs coming from the community members size/XS type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants