Skip to content

Feature/sync class - #268

Open
TrevorBurgoyne wants to merge 7 commits into
mainfrom
feature/sync-class
Open

TrevorBurgoyne wants to merge 7 commits into
mainfrom
feature/sync-class

Conversation

@TrevorBurgoyne

@TrevorBurgoyne TrevorBurgoyne commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Sync Class across Subtasks

Description

Added

  • Set class in <subtask> context-menu item: sets an annotation's counterparts in another writable subtask to its class (matched by id, then name). Counterparts that can't take that class, or already have it, are left alone, and the item only shows when at least one would change. New get_counterpart_class_changes() and set_counterparts_class(), recorded as one undoable set_counterparts_class action on the target subtask.
  • counterpart_class_meta_key config option (default null): an annotation's string value under this annotation_meta key names the class it gives its counterparts (Set class in) and copies (Copy to / Move to, paste), replacing the id/name match. Set class in leaves a counterpart alone when no class has that name. Copies drop the entry, and copies/pastes back into the source subtask ignore it.
  • Details in the context menu lists every non-zero class confidence, highest first, when more than one class has one.
  • confidence_card_classes config option (default 1): the hover confidence card also lists up to N - 1 runner-up classes with non-zero confidence.
  • hover_card_text config callback (default null): returns up to 5 plain-text lines that the hover confidence card shows for an annotation. Called once per hovered annotation and again after it changes.
  • The class pie shows the hovered class's name in its centre. Long names break only between words, and the text shrinks to fit the circle, down to 8px, then ends in "…".

Fixed

  • delete_counterparts no longer stamps, reverts or drops history for an unrelated target annotation that happens to share the source annotation's id.

PR Checklist

  • Merged latest main
  • Version number in package.json has been bumped since last release
  • Version numbers match between package package.json and src/version.js
  • Updated documentation if necessary (currently just in api_spec.md)
  • Added changes to CHANGELOG.md

Breaking API Changes

no

@joshua-dean joshua-dean mentioned this pull request Oct 26, 2026
2 of 5 tasks

@joshua-dean joshua-dean left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A couple of things from a first pass (happy to help solve/contribute any of them):

  • No demo showcasing linked annos (in general consolidating or doing a landing page for the demos might be worthwhile)
  • Consider (this is from 0.29.0):
    1. 3x subtasks: A, B, C
    2. Anno in A linked to anno in B
    3. Copy anno A into subtask C
    4. B has no idea C exists
  • set_counterparts_class only checks read_only (context menu checks is_subtask_edit_locked and thus focus_deprecated) which is more lenient - this is fine but we might want to standardize these "subtask locks" in subtask.ts for consistency
  • In general it might be nice for "linked" annotations to highlight each other on hover, perhaps with different styling

Not necessarily blockers - with a hand-rolled demo, everything appears to work fine. We can open issues for add-ons to this as necessary.

This branch has not been deployed

No deployments
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