From 052e946cd3dde748813ead16772cd576ff9a6126 Mon Sep 17 00:00:00 2001 From: franmagn Date: Mon, 13 Oct 2025 12:54:47 +0200 Subject: [PATCH] refactor(#4): changed texts from "annotations" to "saved locations" --- src/AnnotationControl/annotationPanel.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/AnnotationControl/annotationPanel.js b/src/AnnotationControl/annotationPanel.js index 1217bde..1136252 100644 --- a/src/AnnotationControl/annotationPanel.js +++ b/src/AnnotationControl/annotationPanel.js @@ -13,7 +13,7 @@ export function initAnnotationsPanel(viewer) { const header = document.createElement('h3') header.id = 'menu_camera_annotations' const headerSpan = document.createElement('span') - headerSpan.textContent = 'Annotations' + headerSpan.textContent = 'Saved Locations' header.appendChild(headerSpan) const panel = document.createElement('div') @@ -82,7 +82,7 @@ export function initAnnotationsPanel(viewer) { ) { const empty = document.createElement('div') empty.className = 'annotation-empty' - empty.textContent = 'No annotations yet' + empty.textContent = 'No saved positions yet' targetContainer.appendChild(empty) return } @@ -128,14 +128,14 @@ export function initAnnotationsPanel(viewer) { // Delete button const delBtn = document.createElement('button') delBtn.textContent = 'x' - delBtn.title = 'Delete annotation' - // Delete an annotation: remove live scene annotation (handles/DOM) then remove the tree node + delBtn.title = 'Delete saved position' + // Delete an annotation: remove annotation from the renderer scene (live annotation), then remove the tree node delBtn.onclick = () => { const annData = node.data || {} const uuid = annData.uuid if (uuid && viewer && viewer.scene && viewer.scene.annotations) { - // Find the live annotation instance by UUID + // Find the live annotation instance by UUID (Universally Unique Identifier) let candidates = [] try { candidates = @@ -205,7 +205,7 @@ export function initAnnotationsPanel(viewer) { info.style.marginLeft = '8px' const fmt = (v) => v ? v.map((c) => Number(c).toFixed(3)).join(', ') : '—' - info.innerHTML = `Cam: ${fmt(cam)}
Pivot saved: ${fmt(camTarget)}` + info.innerHTML = `Camera coordinates: ${fmt(cam)}
Pivot coordinates: ${fmt(camTarget)}` row.appendChild(info) } } catch (e) { @@ -218,7 +218,7 @@ export function initAnnotationsPanel(viewer) { // Add Annotation UI (mimics Potree toolbar/pinpoint-button logic) function createAddButton() { const btn = document.createElement('button') - btn.textContent = '+ Add Annotation' + btn.textContent = '+ Add a new location' btn.style.margin = '8px 0' btn.onclick = () => { // Show this panel, if collapsed @@ -295,7 +295,7 @@ export function initAnnotationsPanel(viewer) { createAddButton() updateAnnotationsList() - // Listen to Potree's annotation events to auto-refresh our list + // Listen to Potree's annotation events to auto-refresh the list if (viewer.scene && viewer.scene.annotations) { viewer.scene.annotations.addEventListener( 'annotation_added',