Skip to content

Conversation

@parfeniukink
Copy link
Owner

@parfeniukink parfeniukink commented Jul 12, 2025

  • recalculate positions on shortcut insert

    • solution
      • get last shortcut (with the greater index_position)
      • +1 to that value and save
  • recalculate positions on shortcut delete

    • get all shortcuts that stand after this one
    • delete shortcut
    • update selected shortcuts, set index_position -1
  • set position

    • user_input with position (int)
    • select from shortcuts where index_position=user_input
    • select from shortcuts where index_position>=juser_input
    • update all shortcuts after this one (including) +1 to index_position
    • update selected shortcut, set index_position to user_input
  • make UI available to update the position

    • settings?

FLOW for changing position

INPUT: E.position = 2

A (1)
B (2)
C (3)
D (4)
E (5) -> (2)
F (6)
G (7)
H (8)

select where `E.position > position >= B.position

A (1)
B (2)
C (3)
D (4)
E (5)
F (6)
G (7)
H (8)

  • +1 to B,C,D position

A (1)
B (3) updated
C (4) updated
D (5) updated
E (5)
F (6)
G (7)
H (8)

  • set position to the selected shortcut

A (1)
E (2) updated
B (3)
C (4)
D (5)
F (6)
G (7)
H (8)

@parfeniukink parfeniukink self-assigned this Jul 12, 2025
@parfeniukink parfeniukink changed the title Analytics and database transactions Analytics, database transactions, shortcuts indexes Jul 12, 2025
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.

1 participant