Fix navbar children assigned to multiple parents due to missing unique column IDs #96
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue where creating a submenu item would make it appear in multiple parents at once.
There were two causes:
Frontend
New parent items were created with
id: '', meaning several parents ended up sharing the same ID.I replaced this with id: crypto.randomUUID() so each parent gets a proper unique ID.
Backend
Submenu items were being linked to parents using
label:sub_items = [sub_item for sub_item in sub_navbar_items if sub_item.get('columnId') == item.get('label')]It’s now updated to use the actual parent ID:
sub_items = [sub_item for sub_item in sub_navbar_items if sub_item.get('columnId') == item.get('id')]Before (Adding 'Child 1' to 'Parent 1' => Duplicated Child 1 and insertion to 'Parent 2' (Bug))

After :