From 2c388f8dc0588fd8ce994d850fc91275e0d8b89c Mon Sep 17 00:00:00 2001 From: Stan Grams Date: Wed, 1 Apr 2026 22:02:48 +0200 Subject: [PATCH] [fix](trx-frontend-http): make extra channels editable in scheduler inline edit The inline row editor rendered extra channels as read-only text and never saved changes to bookmark_ids. Add a dropdown + chip UI matching the form modal pattern so users can add/remove extra channels inline. Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Stan Grams --- .../assets/web/plugins/scheduler.js | 49 ++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/scheduler.js b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/scheduler.js index f0895f6..44af2e6 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/scheduler.js +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/scheduler.js @@ -802,13 +802,23 @@ return ''; }).join(''); + var extraBmOptions = '' + bookmarkList.map(function (bm) { + return ''; + }).join(''); + + var inlineExtraIds = Array.isArray(entry.bookmark_ids) ? entry.bookmark_ids.slice() : []; + tr.innerHTML = '\u2807' + '' + '' + '' + (entry.center_hz ? formatFreq(entry.center_hz) : '\u2014') + '' + '' + - '' + (Array.isArray(entry.bookmark_ids) && entry.bookmark_ids.length ? entry.bookmark_ids.map(function(id) { return escHtml(bmName(id)); }).join(', ') : '\u2014') + '' + + '
' + + '
' + + '' + + '' + + '
' + '' + '' + '' + @@ -816,6 +826,42 @@ tr.classList.add('sch-inline-editing'); + var chipsContainer = tr.querySelector('.sch-inline-extra-chips'); + var extraPick = tr.querySelector('.sch-inline-extra-pick'); + var extraAddBtn = tr.querySelector('.sch-inline-extra-add'); + + function renderInlineExtraChips() { + chipsContainer.innerHTML = ''; + inlineExtraIds.forEach(function (id, i) { + var chip = document.createElement('span'); + chip.className = 'sch-extra-bm-chip'; + var rmBtn = document.createElement('span'); + rmBtn.className = 'sch-extra-bm-chip-rm'; + rmBtn.textContent = '\u00D7'; + rmBtn.title = 'Remove'; + rmBtn.addEventListener('click', function () { + inlineExtraIds.splice(i, 1); + renderInlineExtraChips(); + }); + chip.appendChild(rmBtn); + chip.appendChild(document.createTextNode(' ' + bmName(id))); + chipsContainer.appendChild(chip); + }); + Array.from(extraPick.options).forEach(function (opt) { + if (opt.value) opt.disabled = inlineExtraIds.includes(opt.value); + }); + } + renderInlineExtraChips(); + + extraAddBtn.addEventListener('click', function () { + if (!extraPick.value) return; + if (!inlineExtraIds.includes(extraPick.value)) { + inlineExtraIds.push(extraPick.value); + renderInlineExtraChips(); + } + extraPick.value = ''; + }); + tr.querySelector('.sch-inline-save').addEventListener('click', function () { var startEl = tr.querySelector('[data-field="start"]'); var endEl = tr.querySelector('[data-field="end"]'); @@ -832,6 +878,7 @@ entry.label = labelEl.value.trim() || null; var ilVal = parseInt(ilEl.value, 10); entry.interleave_min = (!isNaN(ilVal) && ilVal > 0) ? ilVal : null; + entry.bookmark_ids = inlineExtraIds.slice(); entry.record = recEl.checked; currentConfig.entries[idx] = entry;