[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:
@@ -9070,7 +9070,8 @@ function createBookmarkChip(bm, colorMap, options = {}) {
|
|||||||
|
|
||||||
function updateSideBookmarkStack(container, bookmarks, colorMap) {
|
function updateSideBookmarkStack(container, bookmarks, colorMap) {
|
||||||
if (!container) return;
|
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 (!Array.isArray(bookmarks) || bookmarks.length === 0) {
|
||||||
if (container.dataset.bmKey) {
|
if (container.dataset.bmKey) {
|
||||||
container.innerHTML = "";
|
container.innerHTML = "";
|
||||||
@@ -9145,7 +9146,8 @@ function updateBookmarkAxis(range) {
|
|||||||
|
|
||||||
// Only rebuild DOM when the set of visible bookmarks changes.
|
// Only rebuild DOM when the set of visible bookmarks changes.
|
||||||
// Positions are always updated to handle pan/zoom smoothly.
|
// 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) {
|
if (axisEl.dataset.bmKey !== newKey) {
|
||||||
axisEl.dataset.bmKey = newKey;
|
axisEl.dataset.bmKey = newKey;
|
||||||
axisEl.innerHTML = "";
|
axisEl.innerHTML = "";
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// --- Bookmarks Tab ---
|
// --- Bookmarks Tab ---
|
||||||
|
|
||||||
var bmList = [];
|
var bmList = [];
|
||||||
|
var bmRevision = 0;
|
||||||
let bmFilteredList = [];
|
let bmFilteredList = [];
|
||||||
let bmEditId = null;
|
let bmEditId = null;
|
||||||
let bmCurrentPage = 1;
|
let bmCurrentPage = 1;
|
||||||
@@ -47,6 +48,7 @@ async function bmFetch(categoryFilter) {
|
|||||||
console.error("Failed to fetch bookmarks:", e);
|
console.error("Failed to fetch bookmarks:", e);
|
||||||
bmList = [];
|
bmList = [];
|
||||||
}
|
}
|
||||||
|
bmRevision++;
|
||||||
if (typeof window.syncBookmarkMapLocators === "function") {
|
if (typeof window.syncBookmarkMapLocators === "function") {
|
||||||
window.syncBookmarkMapLocators(bmList);
|
window.syncBookmarkMapLocators(bmList);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user