[feat](trx-frontend-http): overlay bookmarks on spectrum; enforce one per freq
Draw bookmark frequency markers on the spectrum canvas: amber vertical line + ribbon shape (rectangle with V-notch) at each bookmark in view. Below the freq axis, show a #spectrum-bookmark-axis row of clickable amber ribbon labels (clip-path bookmark shape); clicking tunes the rig. Labels auto-appear / collapse as bookmarks scroll in and out of view. Server: reject POST/PUT with 409 Conflict when another bookmark already exists at the requested freq_hz (BookmarkStore::freq_taken helper). Client: bmFetch() triggers a spectrum redraw so markers appear immediately on load without requiring a tab visit first. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -46,6 +46,7 @@ async function bmFetch(categoryFilter) {
|
||||
bmSyncAccess();
|
||||
bmRender(bmList);
|
||||
bmRefreshCategoryFilter(categoryFilter);
|
||||
if (typeof scheduleSpectrumDraw === "function") scheduleSpectrumDraw();
|
||||
}
|
||||
|
||||
async function bmRefreshCategoryFilter(keepValue) {
|
||||
@@ -197,6 +198,9 @@ async function bmSave(e) {
|
||||
}
|
||||
if (!resp.ok) {
|
||||
const text = await resp.text();
|
||||
if (resp.status === 409) {
|
||||
throw new Error("A bookmark for that frequency already exists.");
|
||||
}
|
||||
throw new Error(text || "HTTP " + resp.status);
|
||||
}
|
||||
bmCloseForm();
|
||||
@@ -294,4 +298,7 @@ async function bmApply(bm) {
|
||||
await bmDelete(delBtn.dataset.bmId);
|
||||
}
|
||||
});
|
||||
|
||||
// Pre-load bookmarks so spectrum markers are visible immediately.
|
||||
bmFetch("");
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user