Skip to content

fix(vault): preserve node position in tree when editing existing connection or folder - #36

Open
AlissonAraldi wants to merge 1 commit into
privum-cloud:mainfrom
AlissonAraldi:pr/vault-preserve-position
Open

AlissonAraldi wants to merge 1 commit into
privum-cloud:mainfrom
AlissonAraldi:pr/vault-preserve-position

Conversation

@AlissonAraldi

Copy link
Copy Markdown

Summary

Currently, VaultManager::upsert removes any existing node with the matching id and inserts it at the end of the parent's children (u.doc.remove(id) followed by insert_into(...)). This scrambles the user's manual ordering of connections whenever an existing connection or folder is updated.

Changes

  • Implemented find_parent_id and replace_in in src-tauri/src/vault/manager.rs.
  • When an existing node is updated and its parent has not changed, it is updated in-place at the exact same index.
  • Added unit test upsert_existing_preserves_position verifying order is preserved across edits.

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