Skip to content

Create component for reverting annotations#486

Merged
naglepuff merged 21 commits intomasterfrom
050-annotation-edit-history
Jun 25, 2025
Merged

Create component for reverting annotations#486
naglepuff merged 21 commits intomasterfrom
050-annotation-edit-history

Conversation

@naglepuff
Copy link
Contributor

@naglepuff naglepuff commented Jun 23, 2025

Fix #459

This adds a new component to the edit annotation dialog which allows users to view the edit history for an annotation and revert back to any previous annotation version.

Annotation are grouped based on updated time. If more than one hour elapsed between edits, a new annotation group is created. Each group is represented by a collapsible list in the edit annotation dialog. Each entry contains the name of the user who made the edit, the edit time, the revision number, and the groups found in the annotation, as well as a button that can be used to revert to any that version.

On reverting an annotation, the dialog is closed and the annotations are refreshed.

@naglepuff naglepuff force-pushed the 050-annotation-edit-history branch 2 times, most recently from e17ff94 to 04dfcd1 Compare June 23, 2025 22:07
@naglepuff naglepuff force-pushed the 050-annotation-edit-history branch from 04dfcd1 to 5263052 Compare June 23, 2025 22:14
Since we can't actually get the setting value without admin privileges,
we guess based on the number of history entries and updated/created
fields of the most recent entry.
@manthey
Copy link
Contributor

manthey commented Jun 24, 2025

I think the divisions between edit times needs to be tweaked:
image
I think that rather than a duration from the last annotation, it should be a gap of at least our value between two sets of annotations.

@naglepuff naglepuff force-pushed the 050-annotation-edit-history branch from 7addecf to 8e8e3d8 Compare June 25, 2025 12:59
@naglepuff naglepuff requested a review from manthey June 25, 2025 14:07
@naglepuff naglepuff marked this pull request as ready for review June 25, 2025 14:07
@naglepuff
Copy link
Contributor Author

I think the divisions between edit times needs to be tweaked:

I think dfa387e addresses your concern here. Let me know if it needs to be tweaked further.

delete this.annotation._meta;
delete this.annotation._styleFuncs;
}
this.annotation.trigger('revert:annotation', this.annotation, {});
Copy link
Contributor

Choose a reason for hiding this comment

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

In girder we prefix our own events with g: to give them some modest namespace. In some spots in HistomicsUI we prefix them with h:. I think I'd prefer to change this to h:revert:annotation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 6d8341e

@naglepuff naglepuff merged commit b168787 into master Jun 25, 2025
11 checks passed
@naglepuff naglepuff deleted the 050-annotation-edit-history branch June 25, 2025 18:33
@manthey
Copy link
Contributor

manthey commented Jul 8, 2025

undo_annotation.mp4

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.

Annotation history and undo

2 participants