Skip to content

Incorrect draft annotation color#1471

Open
yannik131 wants to merge 13 commits into
masterfrom
1468-incorrect-draft-annotation-color
Open

Incorrect draft annotation color#1471
yannik131 wants to merge 13 commits into
masterfrom
1468-incorrect-draft-annotation-color

Conversation

@yannik131
Copy link
Copy Markdown
Contributor

Closes #1468

@yannik131 yannik131 changed the title Incorrecrt draft annotation color Incorrect draft annotation color May 26, 2026
@yannik131 yannik131 force-pushed the 1468-incorrect-draft-annotation-color branch from 98628ba to 28ef5af Compare May 26, 2026 12:16
@yannik131 yannik131 requested a review from Copilot May 26, 2026 12:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses #1468 by ensuring draft annotations (especially for polygon/polygon-brush and magic wand tools) can correctly reflect the selected label color during drawing/editing.

Changes:

  • Adds a shared setOrUnsetProperty() helper to consistently apply or remove feature properties (e.g., color).
  • Introduces draftColor propagation into polygon brush/modify interactions and the magic wand interaction (plus Vue-side watchers to update it on label/setting changes).
  • Updates videoScreen and annotationCanvas draw flows to apply/unset draft feature color more consistently.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
resources/assets/js/videos/components/videoScreen/polygonBrushInteractions.vue Passes draft color into polygon brush/eraser/fill interactions and updates pending draft features when label/setting changes.
resources/assets/js/videos/components/videoScreen/drawInteractions.vue Adds draft color handling for draw interactions (including fallback when setDraftColor is unavailable).
resources/assets/js/utils.js Introduces setOrUnsetProperty() helper and exports it.
resources/assets/js/annotations/ol/MagicWandInteraction.js Adds draftColor support + setDraftColor() to update sketch/indicator feature properties.
resources/assets/js/annotations/ol/interaction/PolygonBrush.js Adds draftColor support + setDraftColor() to color sketch point/feature.
resources/assets/js/annotations/ol/interaction/ModifyPolygonBrush.js Adds draftColor support + setDraftColor() to color the sketch point.
resources/assets/js/annotations/components/annotationCanvas/polygonBrushInteraction.vue Passes draftColor into polygon brush/modify interactions and updates draft color on watchers.
resources/assets/js/annotations/components/annotationCanvas/magicWandInteraction.vue Passes draftColor into magic wand and updates it on label/setting changes.
resources/assets/js/annotations/components/annotationCanvas/drawInteractions.vue Applies/unsets draft color on overlay features during drawing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread resources/assets/js/videos/components/videoScreen/polygonBrushInteractions.vue Outdated
Comment thread resources/assets/js/videos/components/videoScreen/polygonBrushInteractions.vue Outdated
Comment thread resources/assets/js/videos/components/videoScreen/drawInteractions.vue Outdated
Comment thread resources/assets/js/videos/components/videoScreen/polygonBrushInteractions.vue Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Comment thread resources/assets/js/videos/components/videoScreen/drawInteractions.vue Outdated
Comment thread resources/assets/js/annotations/ol/MagicWandInteraction.js
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

@yannik131
Copy link
Copy Markdown
Contributor Author

@mzur Changing the colors of all draw interactions and all pending and current features proved to be quite tedious and repetitive. And it's hard to test the UI in all possible scenarios, but I'm relatively sure I didn't miss anything. Maybe there is a cleaner way to centralize coloring map features?

@yannik131 yannik131 marked this pull request as ready for review May 26, 2026 14:59
@yannik131 yannik131 requested a review from mzur May 26, 2026 14:59
@yannik131
Copy link
Copy Markdown
Contributor Author

@mzur A possible improvement of the current architecture would be introducing separate js classes for draw interaction creation (polygon brush, magic wand, etc.) and pending annotation management. Then most of the changes would be limited to these classes instead of being scattered throughout the code base.

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.

Incorrect draft annotation color

2 participants