diff --git a/index.html b/index.html
index d002e20..96229d2 100644
--- a/index.html
+++ b/index.html
@@ -212,16 +212,16 @@
-
-
-
-
Stackable Metronome v0.0.1-dev
Space play · T tap · ←→ tempo · ↑↓ cue · ⏎ commit · N/P step · A add · ? help
@@ -915,8 +915,12 @@ function removeItem(i) {
}
function moveItem(i, d) { const sl = getSL(); const j = i + d; if (j < 0 || j >= sl.items.length) return; [sl.items[i], sl.items[j]] = [sl.items[j], sl.items[i]]; saveSetlists(); }
function moveCuedItem(d) { // keyboard reorder of the cued item (Alt+↑/↓), within the viewed list
- if (cuedSL !== activeSL || cuedItem < 0) return;
- const sl = getSL(); const j = cuedItem + d; if (j < 0 || j >= sl.items.length) return;
+ const sl = getSL(); if (!sl || !sl.items.length) return;
+ if (cuedSL !== activeSL || cuedItem < 0 || cuedItem >= sl.items.length) { // no cue here yet → seed it
+ cuedSL = activeSL;
+ cuedItem = (loadedSL === activeSL && activeItem >= 0) ? activeItem : 0;
+ }
+ const j = cuedItem + d; if (j < 0 || j >= sl.items.length) { renderItems(); return; } // at an edge: just show the cue
moveItem(cuedItem, d);
if (loadedSL === activeSL) { if (activeItem === cuedItem) activeItem = j; else if (activeItem === j) activeItem = cuedItem; }
cuedItem = j; renderItems();
@@ -1386,7 +1390,7 @@ function themePref() { try { const p = localStorage.getItem("metronome.theme");
function applyTheme(pref) {
try { localStorage.setItem("metronome.theme", pref); } catch (e) {}
document.documentElement.dataset.theme = effectiveTheme(pref);
- $("themeBtn").textContent = pref === "system" ? "🖥" : pref === "light" ? "☀" : "🌙";
+ $("themeBtn").textContent = pref === "system" ? "◐" : pref === "light" ? "☀" : "☾"; // plain glyphs (emoji ones failed to render in some browsers)
$("themeBtn").title = "Theme: " + pref + " (click to cycle: system → light → dark)";
}
$("themeBtn").addEventListener("click", () => applyTheme(THEMES[(THEMES.indexOf(themePref()) + 1) % THEMES.length]));