WIP V improve UX [snapshot task 2]

Add the connections workspace (sidebar, editable slots, per-slot activity,
removal dialog with focus wrapping), remove the downloadable local HTML and
unreleased identity backup/restore, and start the 0.0.5 draft changelog.
Restore the released 0.0.3/0.0.4 changelog entries. Enable focus emulation
in browser checks so background tabs receive focus/blur events.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SchluffeandClaude Opus 5.5 committed 2026-10-17 13:44:08 +02:00
1 parent 58c3e2af86
commit 5f8c6a1916
21 files changed
+879 -306

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { emptyConnection, updateConnection, HISTORY_LIMIT, type ConnectionActivity } from '../src/lib/connections.ts';
test('renaming and pairing preserve a slot identity and its activity', () => {
const initial = emptyConnection(2);
const activity: ConnectionActivity = { id: 'transfer', time: 1, direction: 'send', name: 'example.txt', size: 123, result: 'complete' };
const withHistory = updateConnection(initial, { activity });
const renamed = updateConnection(withHistory, { name: ' Work laptop ' });
const paired = updateConnection(renamed, { peerKey: '04' + 'a'.repeat(128) });
assert.equal(initial.name, 'Con 2');
assert.equal(paired.id, initial.id);
assert.equal(paired.name, 'Work laptop');
assert.deepEqual(paired.history, [activity]);
assert.equal(initial.history.length, 0);
assert.throws(() => updateConnection(paired, { name: ' ' }));
assert.throws(() => updateConnection(paired, { name: 'a'.repeat(81) }));
assert.throws(() => updateConnection(paired, { peerKey: 'invalid' }));
});
test('history is bounded, ordered, and does not duplicate an event', () => {
let connection = emptyConnection();
for (let i = 0; i < HISTORY_LIMIT + 10; i++) {
connection = updateConnection(connection, { activity: { id: String(i), time: i, direction: 'receive', name: 'file', size: 0, result: 'declined' } });
}
const last = connection.history.at(-1)!;
connection = updateConnection(connection, { activity: last });
assert.equal(connection.history.length, HISTORY_LIMIT);
assert.equal(connection.history[0]!.time, 10);
assert.throws(() => updateConnection(connection, { activity: { ...last, size: -1 } }));
assert.throws(() => updateConnection(connection, { activity: { ...last, direction: 'invalid' as 'send' } }));
});