Keep Contact folded until both Cockpit left panels close, and keep focus in a renamed row

Opening Utilities while Data Layers is open no longer forgets that Contact
was folded for the first, and closing one of them leaves Contact folded
while the other is still open. Enter and Esc in a drawn shape's name keep
focus in the field instead of dropping it to the page. The draw tool's
destroy test now checks it stops following the board, and the Draw gate's
amber-count comment sits on its function again.
This commit is contained in:
Said Turksever committed 2026-11-02 17:01:31 +00:00
1 parent 345d5db593
commit 672a145254
7 files changed
+68 -15

No files matched your search

@@ -101,6 +101,9 @@ test('a name is saved on Enter or leaving the field; an unchanged one costs noth
name.value = ' Ridge walk ';
key(name, 'Enter');
assert.deepEqual(calls, [['renameDrawMark', 'a1', 'Ridge walk']]);
assert.equal(document.activeElement, name, 'Enter keeps focus in the field');
name.blur();
assert.equal(calls.length, 1, 'the blur after Enter saves nothing more');
const pinName = control('a2', 'name');
pinName.focus();
pinName.blur();
@@ -122,6 +125,7 @@ test('Escape drops the draft and stays in the list, even with the row\'s colours
const event = key(name, 'Escape');
assert.equal(event.defaultPrevented, true);
assert.equal(name.value, 'Camp', 'the saved name comes back');
assert.equal(document.activeElement, name, 'focus stays in the field');
await nextTick();
assert.deepEqual(calls, [], 'the draft is not saved');
// Escape in the open colours closes them and gives focus to the swatch.