fix: only show port label prompt inside component editor

Double-click rename for INPUT/OUTPUT/CLOCK gates now only triggers
when inside the component editor, not in the main circuit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jose Luis
2026-03-20 04:24:39 +01:00
parent eb22a5ff62
commit 5bd157c059

View File

@@ -159,8 +159,8 @@ export function initEvents() {
return;
}
// Double-click on I/O gates → rename
if (gate.type === 'INPUT' || gate.type === 'OUTPUT' || gate.type === 'CLOCK') {
// Double-click on I/O gates → rename (only inside component editor)
if (state.componentEditorActive && (gate.type === 'INPUT' || gate.type === 'OUTPUT' || gate.type === 'CLOCK')) {
const current = gate.label || '';
const label = prompt(`Label for ${gate.type}#${gate.id}:`, current);
if (label !== null) {