[fix](trx-frontend-http): refresh spectrum bookmark markers on edit and delete

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-21 21:17:20 +01:00
parent a814e7ec5b
commit cd80954767
2 changed files with 6 additions and 2 deletions
@@ -9070,7 +9070,8 @@ function createBookmarkChip(bm, colorMap, options = {}) {
function updateSideBookmarkStack(container, bookmarks, colorMap) {
if (!container) return;
const nextKey = Array.isArray(bookmarks) ? bookmarks.map((bm) => bm.id).join(",") : "";
const rev = typeof bmRevision !== "undefined" ? bmRevision : 0;
const nextKey = Array.isArray(bookmarks) ? `${rev}:${bookmarks.map((bm) => bm.id).join(",")}` : "";
if (!Array.isArray(bookmarks) || bookmarks.length === 0) {
if (container.dataset.bmKey) {
container.innerHTML = "";
@@ -9145,7 +9146,8 @@ function updateBookmarkAxis(range) {
// Only rebuild DOM when the set of visible bookmarks changes.
// Positions are always updated to handle pan/zoom smoothly.
const newKey = visBookmarks.map((b) => b.id).join(",");
const rev = typeof bmRevision !== "undefined" ? bmRevision : 0;
const newKey = `${rev}:${visBookmarks.map((b) => b.id).join(",")}`;
if (axisEl.dataset.bmKey !== newKey) {
axisEl.dataset.bmKey = newKey;
axisEl.innerHTML = "";
@@ -1,6 +1,7 @@
// --- Bookmarks Tab ---
var bmList = [];
var bmRevision = 0;
let bmFilteredList = [];
let bmEditId = null;
let bmCurrentPage = 1;
@@ -47,6 +48,7 @@ async function bmFetch(categoryFilter) {
console.error("Failed to fetch bookmarks:", e);
bmList = [];
}
bmRevision++;
if (typeof window.syncBookmarkMapLocators === "function") {
window.syncBookmarkMapLocators(bmList);
}