Skip to content

Fix embedded group selection when multiple groups share the same name#5

Open
Geojim wants to merge 3 commits into
masterfrom
claude/fix-qgis-embed-groups-HaRJ5
Open

Fix embedded group selection when multiple groups share the same name#5
Geojim wants to merge 3 commits into
masterfrom
claude/fix-qgis-embed-groups-HaRJ5

Conversation

@Geojim

@Geojim Geojim commented Mar 9, 2026

Copy link
Copy Markdown
Owner

When embedding a group from another project, the dialog returned only
group names which were then resolved via findGroup() - a depth-first
search returning the first match. When multiple groups shared the same
name, the wrong group could be embedded.

Fix by introducing path-based group identification: selectedGroupPaths()
returns the full tree path (chain of ancestor names with occurrence
indices) for each selected group. A new findGroupByPath() navigates
the tree using this path, skipping embedded groups, to find the exact
group the user selected. A corresponding createEmbeddedGroup() overload
accepts this path for unambiguous group resolution.

https://claude.ai/code/session_01JUB2eYmtWFLUyCHis7dgpz

When embedding a group from another project, the dialog returned only
group names which were then resolved via findGroup() - a depth-first
search returning the first match. When multiple groups shared the same
name, the wrong group could be embedded.

Fix by introducing path-based group identification: selectedGroupPaths()
returns the full tree path (chain of ancestor names with occurrence
indices) for each selected group. A new findGroupByPath() navigates
the tree using this path, skipping embedded groups, to find the exact
group the user selected. A corresponding createEmbeddedGroup() overload
accepts this path for unambiguous group resolution.

https://claude.ai/code/session_01JUB2eYmtWFLUyCHis7dgpz
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.

2 participants