feat(shortcuts): bind tracklist.delete to the confirmation
CI / check (push) Canceled after 0s
CI / e2e (push) Canceled after 0s
Search index maintenance / maintain-index (push) Canceled after 0s
Build & publish Arch package / arch-package (push) Successful in 2m5s

The binding has been in the defaults and in Settings since it was
written, with nothing on the other end of it, because "remove from
library" did not exist. It does now — and Delete only *opens* the
dialog, never performs the removal, which is the only version
defensible one keystroke from a focused row.

The e2e case asserts the two things that matter and neither is the row
count: the file is still on disk, and a real scan of the real directory
does not bring the row back. It watches a control path survive the same
scan, because a guard that excluded everything would pass the negative
assertion for free — and it restores the database it spends.
This commit is contained in:
2026-08-13 13:28:38 -04:00
parent 6d97e3c872
commit 41a4dd7148
6 changed files with 223 additions and 12 deletions
@@ -383,6 +383,35 @@ describe('shortcut dispatch: scope', () => {
expect(fired).toBe(1);
});
/**
* `tracklist.delete` was advertised in Settings for six phases with
* nothing dispatching for it. What it dispatches now only *opens* a
* confirmation, which is what makes a destructive action defensible
* on an unmodified key one row from the user's music.
*/
it('dispatches for tracklist.delete, which had nothing on the other end', () => {
bindings({ 'tracklist.delete': 'Delete' });
const panel = mount(document.createElement('div'));
const row = document.createElement('div');
row.tabIndex = 0;
panel.dataset['shortcutScope'] = 'tracklist';
panel.append(row);
row.focus();
let fired = 0;
const listener = (): void => {
fired += 1;
};
document.addEventListener('shortcut:tracklist-delete', listener);
press('Delete');
document.removeEventListener('shortcut:tracklist-delete', listener);
expect(fired).toBe(1);
});
});
// ===================================================================