Skip to content

Fix grouped shapes disappearing after image changes - #266

Merged
vietanhdev merged 1 commit into
mainfrom
fix/group-persistence-103
Aug 30, 2026
Merged

Fix grouped shapes disappearing after image changes#266
vietanhdev merged 1 commit into
mainfrom
fix/group-persistence-103

Conversation

@vietanhdev

Copy link
Copy Markdown
Owner

Fixes #103.

Root cause

Grouping and ungrouping changed group_id values only in memory. The canvas did not emit its modification signal, so the labeling widget stayed clean and did not save before changing images. The edits also had no undo snapshot.

Changes

  • record Group/Ungroup edits in the canvas undo history
  • emit the existing change signal only when group IDs actually change
  • add regression coverage for dirty notification, undo, whole-group ungrouping, and JSON save/load persistence

Validation

  • QT_QPA_PLATFORM=offscreen .venv/bin/python -m unittest discover -s tests -v: 140 passed, 13 optional-model tests skipped
  • ruff check anylabeling/views/labeling/widgets/canvas.py tests/test_canvas_grouping.py
  • manual offscreen workflow: group → dirty signal → save → reload; group IDs [1, 1] persisted and undo was available

@vietanhdev
vietanhdev merged commit 844b490 into main Aug 30, 2026
9 checks passed
@vietanhdev
vietanhdev deleted the fix/group-persistence-103 branch August 30, 2026 03:27
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.

Grouping selected shapes/objects

1 participant