Cutsheet: show the next free cable ID as a hint, not a placeholder
Lint / JS (eslint) (push) Successful in 7s
Lint / Python (flake8) (push) Successful in 48s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Lint / Python (flake8) (pull_request) Successful in 55s
Lint / JS (eslint) (pull_request) Successful in 14s
Lint / Notify on failure (pull_request) Skipped
Lint / Deploy (pull_request) Skipped
Security / Python Security (bandit) (pull_request) Successful in 1m45s
Security / Python Security (bandit) (push) Successful in 1m22s
Test / Python Tests (pytest) (pull_request) Successful in 1m6s
Test / Python Tests (pytest) (push) Successful in 1m0s

A placeholder of C01 in the empty ID field looked like a real value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 16:10:51 -05:00
co-authored by Claude Opus 5.5
parent b9412ff6ba
commit 52cfea5439
2 changed files with 5 additions and 2 deletions
+2
View File
@@ -370,6 +370,7 @@ function openCable(cable, prefill) {
form.b_side.value = data.b_side || 'front'; form.b_side.value = data.b_side || 'front';
form.label_applied.checked = !!data.label_applied; form.label_applied.checked = !!data.label_applied;
form.querySelector('.cs-delete').hidden = !cable; form.querySelector('.cs-delete').hidden = !cable;
document.getElementById('cs-next-label').textContent = _cs.next_label;
document.getElementById('cs-cable-title').textContent = cable ? `Edit ${cable.label || 'cable'}` : 'New cable'; document.getElementById('cs-cable-title').textContent = cable ? `Edit ${cable.label || 'cable'}` : 'New cable';
fillPorts('a'); fillPorts('a');
fillPorts('b'); fillPorts('b');
@@ -510,6 +511,7 @@ document.addEventListener('click', e => {
else if (action === 'edit-item') openItem(_cs.items.find(i => String(i.id) === btn.dataset.id)); else if (action === 'edit-item') openItem(_cs.items.find(i => String(i.id) === btn.dataset.id));
else if (action === 'edit-port-label') openPortLabel(btn.dataset.item, btn.dataset.port); else if (action === 'edit-port-label') openPortLabel(btn.dataset.item, btn.dataset.port);
else if (action === 'print-labels') printLabels(); else if (action === 'print-labels') printLabels();
else if (action === 'use-next-label') document.getElementById('cs-label').value = _cs.next_label;
else if (action === 'toggle-suggestions') { _showAllSuggestions = !_showAllSuggestions; renderSuggestions(); } else if (action === 'toggle-suggestions') { _showAllSuggestions = !_showAllSuggestions; renderSuggestions(); }
else if (action === 'import-check') importCsv(null, true); else if (action === 'import-check') importCsv(null, true);
else if (action === 'add-suggestion') { else if (action === 'add-suggestion') {
+3 -2
View File
@@ -105,8 +105,9 @@
<div class="form-row"> <div class="form-row">
<div class="lt-form-group"> <div class="lt-form-group">
<label class="lt-label" for="cs-label">Cable ID</label> <label class="lt-label" for="cs-label">Cable ID</label>
<input class="lt-input" id="cs-label" name="label" maxlength="32" placeholder="C01"> <input class="lt-input" id="cs-label" name="label" maxlength="32">
<div class="lt-field-hint">Leave blank for a cable you haven't labeled.</div> <div class="lt-field-hint">Blank if the cable has no ID yet. Next free:
<span id="cs-next-label"></span> <button type="button" class="cs-link-btn" data-action="use-next-label">use</button></div>
</div> </div>
<div class="lt-form-group"> <div class="lt-form-group">
<label class="lt-label" for="cs-status">Status</label> <label class="lt-label" for="cs-status">Status</label>