-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(discoverability): add image cursor experience #1270
feat(discoverability): add image cursor experience #1270
Conversation
@@ -17,12 +18,29 @@ class ImageViewer extends ImageBaseViewer { | |||
this.updatePannability = this.updatePannability.bind(this); | |||
this.handleImageDownloadError = this.handleImageDownloadError.bind(this); | |||
this.handleAssetAndRepLoad = this.handleAssetAndRepLoad.bind(this); | |||
this.handleZoomEvent = this.handleZoomEvent.bind(this); | |||
this.annotationControlsFSM = new AnnotationControlsFSM( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AnnotationControlsFSM
has already been created in BaseViewer
constructor, right? Should we move the logic to BaseViewer
? Or call something like this.annotationControlsFSM.setState
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @ConradJChan and I discussed that we wanted ImageViewer to instantiate its own instance of AnnotationControlsFSM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need to re-instantiate when enableAnnotationsImageDiscoverability === false
? How about:
if (this.options.enableAnnotationsImageDiscoverability) {
this.annotationControlsFSM = new AnnotationControlsFSM(AnnotationState.REGION_TEMP);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also make sure that if enableAnnotationsImageDiscoverability === false
, that we get the old ImageViewer
experience, i.e. not the enableAnnotationsDiscoverability
experience
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate a little on this? Do you mean that we should have a check like this:
if (enableAnnotationsImageDiscoverability) {
this.annotationControlsFSM = new AnnotationControlsFSM(AnnotationState.REGION_TEMP);
}
jest.spyOn(image, 'processAnnotationModeChange'); | ||
}); | ||
|
||
test.each` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this test may be combining too many things. Maybe split it out to a test based on type
to make sure it doesn't get processed and the another test for the combinations of currentState
and whether the image overflows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The should
param is probably unnecessary. Maybe just update the test description to include the height
and width
, otherwise consider breaking out a separate test to test the currentState
vs overflow
conditions
@@ -17,12 +18,29 @@ class ImageViewer extends ImageBaseViewer { | |||
this.updatePannability = this.updatePannability.bind(this); | |||
this.handleImageDownloadError = this.handleImageDownloadError.bind(this); | |||
this.handleAssetAndRepLoad = this.handleAssetAndRepLoad.bind(this); | |||
this.handleZoomEvent = this.handleZoomEvent.bind(this); | |||
this.annotationControlsFSM = new AnnotationControlsFSM( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need to re-instantiate when enableAnnotationsImageDiscoverability === false
? How about:
if (this.options.enableAnnotationsImageDiscoverability) {
this.annotationControlsFSM = new AnnotationControlsFSM(AnnotationState.REGION_TEMP);
}
5af3073
to
3353da4
Compare
jest.spyOn(image, 'processAnnotationModeChange'); | ||
}); | ||
|
||
test.each` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The should
param is probably unnecessary. Maybe just update the test description to include the height
and width
, otherwise consider breaking out a separate test to test the currentState
vs overflow
conditions
Changes in this PR:
Demo:
