caido icon indicating copy to clipboard operation
caido copied to clipboard

Allow sorting or reordering of Convert workflows

Open rew1nter opened this issue 2 years ago • 1 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help us know what to work on
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request

Description

When prioritizing and more frequently using some workflows than others, you want them to be on the top. But if you already have 10 workflows defined, the 11th workflow will be at the very last of the list. There's no way to get it up on the list without deleting the previous workflows. A sorting or reordering feature will allow proper organization and grouping of the workflows.

Use cases

Save mouse drag when frequently using a workflow

rew1nter avatar Nov 12 '23 11:11 rew1nter

Internal notes for ranking across global and local objects

Problem: We want relative global ordering but also ordering with local objects, this is very hard to do since we cannot use a simple lexorank system like we currently do for local objects.

Solution: We need to use two lexorank, one for the global relative ordering and one for the local ordering.

Database changes:

  • For the global object, add a rank column to the table
  • For the local object, create a new table objects_rank like (id, rank). Another table is needed since we will have both global ID (g:1) and local ID (p:1)

Algorithm:

  • The API will remain rankObject(after: ID, before: ID), for now we continue to assume that those IDs are consecutive (that won't we true if concurrent ranking happens, but the change is low enough for now)
  • Local ranking
    • If after or before is not ranked locally, rank them first
      • Use they global rank if it doesn't already exist
      • If it exists, then rank it before or after depending on the name of the object
      • To do that, find the previous or next item and rank in between
    • Rank the current item in between
  • (If global) Global ranking
    • Verify if there are global objects in between the old global rank and the new local rank
    • If yes, take the object closest to the new rank and the previous/next item
    • Rank between them globally

Sytten avatar Apr 30 '24 19:04 Sytten