Skip to content

Commit

Permalink
refactor(#4): changed texts from "annotations" to "saved locations"
Browse files Browse the repository at this point in the history
  • Loading branch information
franmagn committed Oct 13, 2025
1 parent f92fb4c commit 052e946
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/AnnotationControl/annotationPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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)}<br/>Pivot saved: ${fmt(camTarget)}`
info.innerHTML = `Camera coordinates: ${fmt(cam)}<br/>Pivot coordinates: ${fmt(camTarget)}`
row.appendChild(info)
}
} catch (e) {
Expand All @@ -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
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 052e946

Please sign in to comment.