diff --git a/e2e/tests/functional/plugins/imagery/exampleImagery.e2e.spec.js b/e2e/tests/functional/plugins/imagery/exampleImagery.e2e.spec.js index 2756c714c59..bc852b8e3c2 100644 --- a/e2e/tests/functional/plugins/imagery/exampleImagery.e2e.spec.js +++ b/e2e/tests/functional/plugins/imagery/exampleImagery.e2e.spec.js @@ -57,6 +57,10 @@ test.describe('Example Imagery Object', () => { await mouseZoomOnImageAndAssert(page, -2); }); + test('Compass HUD should be hidden by default', async ({ page }) => { + await expect(page.locator('.c-hud')).toBeHidden(); + }); + test('Can adjust image brightness/contrast by dragging the sliders', async ({ page, browserName @@ -198,7 +202,7 @@ test.describe('Example Imagery Object', () => { expect(afterDownPanBoundingBox.y).toBeLessThan(afterUpPanBoundingBox.y); }); - test('Can use alt+shift+drag to create a tag', async ({ page }) => { + test('Can use alt+shift+drag to create a tag and ensure toolbars disappear', async ({ page }) => { const canvas = page.locator('canvas'); await canvas.hover({ trial: true }); @@ -211,7 +215,11 @@ test.describe('Example Imagery Object', () => { // steps not working for me here await page.mouse.move(canvasCenterX - 20, canvasCenterY - 20); await page.mouse.move(canvasCenterX - 100, canvasCenterY - 100); + // toolbar should hide when we're creating annotations with a drag + await expect(page.locator('[role="toolbar"][aria-label="Image controls"]')).toBeHidden(); await page.mouse.up(); + // toolbar should reappear when we're done creating annotations + await expect(page.locator('[role="toolbar"][aria-label="Image controls"]')).toBeVisible(); await Promise.all(tagHotkey.map((x) => page.keyboard.up(x))); //Wait for canvas to stabilize. diff --git a/src/plugins/imagery/ImageryView.js b/src/plugins/imagery/ImageryView.js index 7cd3003e7f1..96d8b42f6a6 100644 --- a/src/plugins/imagery/ImageryView.js +++ b/src/plugins/imagery/ImageryView.js @@ -35,6 +35,7 @@ export default class ImageryView { domainObject: this.domainObject, objectPath: alternateObjectPath || this.objectPath, imageFreshnessOptions: this.options?.imageFreshness || DEFAULT_IMAGE_FRESHNESS_OPTIONS, + showCompassHUD: this.options?.showCompassHUD, currentView: this }, data() { diff --git a/src/plugins/imagery/components/AnnotationsCanvas.vue b/src/plugins/imagery/components/AnnotationsCanvas.vue index 7d9d160eaaf..5f38bfd0c57 100644 --- a/src/plugins/imagery/components/AnnotationsCanvas.vue +++ b/src/plugins/imagery/components/AnnotationsCanvas.vue @@ -54,6 +54,7 @@ export default { } } }, + emits: ['annotation-marquee-started', 'annotations-changed', 'annotation-marquee-finished'], data() { return { dragging: false, @@ -121,7 +122,7 @@ export default { methods: { onAnnotationChange(annotations) { this.selectedAnnotations = annotations; - this.$emit('annotationsChanged', annotations); + this.$emit('annotations-changed', annotations); }, updateSelection(selection) { const selectionContext = selection?.[0]?.[0]?.context?.item; @@ -292,6 +293,8 @@ export default { createNewAnnotation() { this.dragging = false; this.selectedAnnotations = []; + this.selectedAnnotations = []; + this.$emit('annotation-marquee-finished'); const rectangleFromCanvas = { x: this.newAnnotationRectangle.x, @@ -315,6 +318,7 @@ export default { }, attemptToSelectExistingAnnotation(event) { this.dragging = false; + this.$emit('annotation-marquee-finished'); // use flatbush to find annotations that are close to the click const boundingRect = this.canvas.getBoundingClientRect(); const scaleX = this.canvas.width / boundingRect.width; @@ -377,7 +381,7 @@ export default { return selection; }, startAnnotationDrag(event) { - this.$emit('annotationMarqueed'); + this.$emit('annotation-marquee-started'); this.newAnnotationRectangle = {}; const boundingRect = this.canvas.getBoundingClientRect(); const scaleX = this.canvas.width / boundingRect.width; diff --git a/src/plugins/imagery/components/Compass/Compass.vue b/src/plugins/imagery/components/Compass/Compass.vue index a588e7b7eaf..d65477333d8 100644 --- a/src/plugins/imagery/components/Compass/Compass.vue +++ b/src/plugins/imagery/components/Compass/Compass.vue @@ -23,6 +23,7 @@