Streamline the connections workspace

Rename and remove now live on each sidebar row instead of a header
above the workspace. The pen swaps the row to an inline input (Enter or
blur saves, Escape cancels and returns focus to the pen) and the remove
control targets its own row without switching the open connection. The
row shows a status dot with text; on mobile a bar beside Show
connections shows the open connection and its status.

The per-connection activity timeline and its saved transfer history are
removed. Records from pre-release 0.0.5 builds lose their history field
on first load. A removal dialog closes when another tab removes its
connection, and focus moves to the next row after removing another one.

The README is reorganized without repetition and corrects the TypeScript
version; the 0.0.5 changelog now describes the net change since 0.0.4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SchluffeandClaude Opus 5.5 committed 2026-10-19 23:46:12 +02:00
1 parent 4323a8b774
commit f320bfb541
11 files changed
+552 -650

No files matched your search

+107 -45
View File
@@ -239,68 +239,76 @@ try {
if (connections) {
const sender = await page(), receiver = await page(origin.replace('127.0.0.1', 'localhost'));
const selectConnection = (session: string, name: string) => evaluate(session, (name: string) => {
const button = [...document.querySelectorAll<HTMLButtonElement>('.connection-link')].find(item => item.querySelector('.connection-name')?.textContent === name);
if (!button) throw new Error('Missing connection: ' + name);
button.click();
const label = [...document.querySelectorAll<HTMLElement>('.connection-name')].find(item => item.textContent === name);
if (!label) throw new Error('Missing connection: ' + name);
label.click();
}, name);
await call('Emulation.setDeviceMetricsOverride', { width: 1440, height: 1000, deviceScaleFactor: 1, mobile: false }, sender);
assert.equal(await evaluate(sender, () => document.querySelector('.title-line h1')?.textContent), 'Con 1');
assert.equal(await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent), 'Con 1');
assert.deepEqual(await evaluate(sender, () => [...document.querySelectorAll<HTMLDetailsElement>('.config-details')].map(details => [details.querySelector('summary')?.textContent?.trim(), details.open])), [
['Remembered device', false], ['Network settings', false],
], 'Configuration panels start closed');
await checkAccessibility(sender, 'Connections desktop');
await screenshot(sender, 'connections-desktop');
await evaluate(sender, () => window.__hellcon.element<HTMLInputElement>('#connection-name').focus());
await input(sender, '#connection-name', 'Work laptop');
await evaluate(sender, () => window.__hellcon.element<HTMLInputElement>('#connection-name').blur());
assert.equal(await evaluate(sender, () => !!document.querySelector('.connection-rename-input')), false, 'Names start locked');
await click(sender, 'Rename Con 1');
assert.equal(await evaluate(sender, () => document.activeElement?.classList.contains('connection-rename-input')), true, 'The pen focuses the name editor');
await input(sender, '.connection-rename-input', 'Work laptop');
await evaluate(sender, () => window.__hellcon.element<HTMLInputElement>('.connection-rename-input').blur());
await wait(sender, () => document.querySelector('.connection-name')?.textContent === 'Work laptop');
await evaluate(sender, () => window.__hellcon.element<HTMLInputElement>('#connection-name').focus());
await input(sender, '#connection-name', ' ');
await evaluate(sender, () => window.__hellcon.element<HTMLInputElement>('#connection-name').blur());
assert.equal(await evaluate(sender, () => window.__hellcon.element<HTMLInputElement>('#connection-name').value), 'Work laptop');
await evaluate(sender, () => window.__hellcon.element<HTMLInputElement>('#connection-name').focus());
await input(sender, '#connection-name', 'Work laptop ');
await click(sender, 'Rename Work laptop');
await input(sender, '.connection-rename-input', ' ');
await evaluate(sender, () => window.__hellcon.element<HTMLInputElement>('.connection-rename-input').blur());
assert.equal(await evaluate(sender, () => document.querySelector('.connection-name')?.textContent), 'Work laptop');
await click(sender, 'Rename Work laptop');
await input(sender, '.connection-rename-input', 'Work laptop ');
await call('Input.dispatchKeyEvent', { type: 'keyDown', key: 'Enter', code: 'Enter', windowsVirtualKeyCode: 13 }, sender);
await call('Input.dispatchKeyEvent', { type: 'keyUp', key: 'Enter', code: 'Enter', windowsVirtualKeyCode: 13 }, sender);
assert.equal(await evaluate(sender, () => window.__hellcon.element<HTMLInputElement>('#connection-name').value), 'Work laptop');
assert.equal(await evaluate(sender, () => document.activeElement?.id === 'connection-name'), false);
assert.equal(await evaluate(sender, () => document.querySelector('.connection-name')?.textContent), 'Work laptop');
assert.equal(await evaluate(sender, () => !!document.querySelector('.connection-rename-input')), false, 'Enter relocks the name');
await click(sender, 'Rename Work laptop');
await input(sender, '.connection-rename-input', 'Cancelled name');
await call('Input.dispatchKeyEvent', { type: 'keyDown', key: 'Escape', code: 'Escape', windowsVirtualKeyCode: 27 }, sender);
await call('Input.dispatchKeyEvent', { type: 'keyUp', key: 'Escape', code: 'Escape', windowsVirtualKeyCode: 27 }, sender);
assert.equal(await evaluate(sender, () => document.querySelector('.connection-name')?.textContent), 'Work laptop', 'Escape discards the draft');
assert.equal(await evaluate(sender, () => document.activeElement?.classList.contains('edit-action')), true, 'Escape returns focus to the pen');
await click(receiver, 'Receive');
await connect(sender, receiver, 4097);
const fingerprints = await evaluate(sender, () => [...document.querySelectorAll('.fp-row code')].map(item => item.textContent));
await click(sender, 'Add connection');
await wait(sender, () => document.querySelector('.title-line h1')?.textContent === 'Con 2');
await wait(sender, () => document.querySelector('.main-pane h1')?.textContent === 'Con 2');
assert.equal(await evaluate(sender, () => !!document.querySelector('.fingerprint')), false);
await click(receiver, 'Accept file');
await wait(sender, () => document.querySelector('.connection-link .connection-preview')?.textContent === 'browser-test.bin');
assert.equal(await evaluate(sender, () => document.querySelectorAll('.activity-item').length), 0, 'Hidden session activity must stay in its own slot');
await wait(sender, () => document.querySelector('.connection-item .connection-status')?.textContent === 'Connected');
assert.equal(await evaluate(sender, () => document.querySelector('.connection-nav')?.textContent?.includes('browser-test.bin')), false, 'The sidebar shows connection status instead of filenames');
assert.equal(await evaluate(sender, () => !!document.querySelector('.activity-panel')), false, 'The workspace has no activity timeline');
await selectConnection(sender, 'Work laptop');
await wait(sender, () => document.querySelector('.session-badge')?.textContent?.includes('Connected'));
await wait(sender, () => document.querySelector('.connection-item.selected .connection-status')?.textContent === 'Connected');
assert.deepEqual(await evaluate(sender, () => [...document.querySelectorAll('.fp-row code')].map(item => item.textContent)), fingerprints);
await evaluate(sender, () => window.__hellcon.chooseFile(1234, 'after-switch.bin'));
await wait(receiver, () => document.querySelector('.incoming')?.textContent?.includes('after-switch.bin'));
await click(receiver, 'Accept file');
await wait(sender, () => document.querySelectorAll('.activity-item').length === 2);
await wait(sender, () => document.querySelector('.progress[aria-label="Sending progress"]')?.getAttribute('aria-valuenow') === '100');
const received = await evaluate(receiver, async () => {
const bytes = new Uint8Array(await (await fetch(window.__hellcon.element<HTMLAnchorElement>('a.download').href)).arrayBuffer());
return { size: bytes.length, valid: bytes.every(byte => byte === 123) };
});
assert.deepEqual(received, { size: 1234, valid: true });
await click(sender, 'Disconnect'); await click(sender, 'Reset');
assert.equal(await evaluate(sender, () => document.querySelectorAll('.activity-item').length), 2, 'Reset must preserve slot history');
await checkAccessibility(sender, 'Connections with history');
await screenshot(sender, 'connections-history');
assert.equal(await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent), 'Work laptop', 'Reset keeps the connection slot');
await checkAccessibility(sender, 'Connections after transfer');
await screenshot(sender, 'connections-after-transfer');
await selectConnection(sender, 'Con 2');
await evaluate(sender, () => window.__hellcon.chooseFile(10, 'draft.bin'));
await selectConnection(sender, 'Work laptop'); await selectConnection(sender, 'Con 2');
assert.equal(await evaluate(sender, () => [...document.querySelectorAll('.panel li')].some(item => item.textContent?.includes('draft.bin'))), true, 'Selected file state survives slot switching');
await call('Page.navigate', { url: origin }, sender);
await wait(sender, () => document.querySelectorAll('.activity-item').length === 2);
assert.equal(await evaluate(sender, () => document.querySelector('.title-line h1')?.textContent), 'Work laptop');
assert.equal(await evaluate(sender, () => document.querySelector('.session-badge')?.textContent), 'Ready to connect');
await wait(sender, () => !!document.querySelector('#stun-provider'));
assert.equal(await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent), 'Work laptop');
assert.equal(await evaluate(sender, () => document.querySelector('.connection-item.selected .connection-status')?.textContent), 'Ready to connect');
await selectConnection(sender, 'Con 2');
assert.equal(await evaluate(sender, () => document.querySelectorAll('.activity-item').length), 0);
assert.equal(await evaluate(sender, () => document.querySelector<HTMLInputElement>('#file-input')?.files?.length), 0, 'File contents must not persist after reload');
console.log('PASS: connections retain names and separate histories across reload; switching preserves live transfers and drafts; Reset preserves history.');
console.log('PASS: connections retain names across reload; switching preserves live transfers and drafts; Reset keeps the slot without activity history.');
const other = await page();
await Promise.all([click(sender, 'Add connection'), click(other, 'Add connection')]);
@@ -311,16 +319,18 @@ try {
await call('Emulation.setDeviceMetricsOverride', { width: 390, height: 844, deviceScaleFactor: 1, mobile: false }, sender);
await selectConnection(sender, 'Work laptop');
assert.deepEqual(await evaluate(sender, () => [document.querySelector('.mobile-current-name')?.textContent, document.querySelector('.mobile-current-status')?.textContent]),
['Work laptop', 'Ready to connect'], 'Mobile shows the open connection and its status');
await checkAccessibility(sender, 'Connections mobile');
assert.equal(await evaluate(sender, () => document.documentElement.scrollWidth <= innerWidth), true, 'Mobile workspace must not overflow horizontally');
await screenshot(sender, 'connections-mobile');
await click(sender, 'Remove');
await click(sender, 'Show connections');
await click(sender, 'Remove Work laptop');
await wait(sender, () => !!document.querySelector('dialog[open]'));
await checkAccessibility(sender, 'Removal dialog mobile');
await screenshot(sender, 'connections-mobile-dialog');
await click(sender, 'Close dialog');
await wait(sender, () => !document.querySelector('dialog[open]'));
await click(sender, 'Show connections');
await checkAccessibility(sender, 'Connections mobile sidebar');
assert.equal(await evaluate(sender, () => getComputedStyle(window.__hellcon.element('.sidebar')).display), 'flex');
await screenshot(sender, 'connections-mobile-sidebar');
@@ -333,8 +343,8 @@ try {
await connect(sender, receiver, 1024);
await selectConnection(sender, 'Con 2');
await selectConnection(other, 'Work laptop');
await evaluate(other, () => window.__hellcon.element<HTMLButtonElement>('.header-action').focus());
await click(other, 'Remove');
await evaluate(other, () => window.__hellcon.element<HTMLButtonElement>('.connection-item.selected .remove-action').focus());
await click(other, 'Remove Work laptop');
await wait(other, () => !!document.querySelector('dialog[open]'));
assert.equal(await evaluate(other, () => document.activeElement?.textContent?.trim()), 'Keep connection', 'Dialog starts on its non-destructive action');
await checkAccessibility(other, 'Remove connection confirmation');
@@ -347,30 +357,82 @@ try {
await call('Input.dispatchKeyEvent', { type: 'keyDown', key: 'Escape', code: 'Escape', windowsVirtualKeyCode: 27 }, other);
await call('Input.dispatchKeyEvent', { type: 'keyUp', key: 'Escape', code: 'Escape', windowsVirtualKeyCode: 27 }, other);
await wait(other, () => !document.querySelector('dialog[open]'));
assert.equal(await evaluate(other, () => document.activeElement?.classList.contains('header-action')), true, 'Dialog restores focus to the opener');
await click(other, 'Remove');
assert.equal(await evaluate(other, () => document.activeElement?.classList.contains('remove-action')), true, 'Dialog restores focus to the opener');
await click(other, 'Remove Work laptop');
await click(other, 'Keep connection');
assert.equal(await evaluate(other, () => document.querySelectorAll('.connection-link').length), 4);
await click(other, 'Remove'); await click(other, 'Remove connection');
await click(sender, 'Remove Work laptop');
await wait(sender, () => !!document.querySelector('dialog[open]'));
await click(other, 'Remove Work laptop'); await click(other, 'Remove connection');
await wait(other, () => document.querySelectorAll('.connection-link').length === 3);
await wait(sender, () => document.querySelectorAll('.connection-link').length === 3);
await wait(sender, () => !document.querySelector('dialog[open]'));
await wait(receiver, () => !document.querySelector('.incoming'));
await call('Page.navigate', { url: origin }, sender);
await wait(sender, () => !!document.querySelector('#stun-provider'));
assert.equal(await evaluate(sender, () => [...document.querySelectorAll('.connection-name')].some(item => item.textContent === 'Work laptop')), false);
for (let count = 3; count > 0; count--) {
const oldName = await evaluate(sender, () => document.querySelector('.title-line h1')?.textContent);
await click(sender, 'Remove'); await click(sender, 'Remove connection');
const oldName = await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent);
await click(sender, `Remove ${oldName}`); await click(sender, 'Remove connection');
await wait(sender, () => !document.querySelector('dialog[open]'));
assert.equal(await evaluate(sender, () => document.querySelectorAll('.connection-link').length), Math.max(1, count - 1));
assert.notEqual(await evaluate(sender, () => document.querySelector('.title-line h1')?.textContent), oldName);
assert.notEqual(await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent), oldName);
}
assert.equal(await evaluate(sender, () => document.querySelector('.title-line h1')?.textContent), 'Con 1');
assert.equal(await evaluate(sender, () => document.querySelectorAll('.activity-item').length), 0);
assert.equal(await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent), 'Con 1');
await call('Page.navigate', { url: origin }, sender);
await wait(sender, () => !!document.querySelector('#stun-provider'));
assert.deepEqual(await evaluate(sender, () => [...document.querySelectorAll('.connection-name')].map(item => item.textContent)), ['Con 1']);
console.log('PASS: removal can be cancelled, persists across reload, closes cached sessions in other tabs, and replaces the last slot with a fresh Con 1.');
await click(sender, 'Add connection');
await wait(sender, () => document.querySelectorAll('.connection-link').length === 2);
await selectConnection(sender, 'Con 1');
const spareName = await evaluate(sender, () => document.querySelectorAll('.connection-name')[1]?.textContent);
await click(sender, `Rename ${spareName}`);
await input(sender, '.connection-rename-input', 'Spare device');
await evaluate(sender, () => window.__hellcon.element<HTMLInputElement>('.connection-rename-input').blur());
await wait(sender, () => [...document.querySelectorAll('.connection-name')].some(item => item.textContent === 'Spare device'));
assert.equal(await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent), 'Con 1', 'Renaming another row keeps the current connection');
await click(sender, 'Remove Spare device');
assert.match(await dialogText(sender), /Remove Spare device\?/);
await click(sender, 'Remove connection');
await wait(sender, () => document.querySelectorAll('.connection-link').length === 1);
assert.equal(await evaluate(sender, () => document.querySelector('.main-pane h1')?.textContent), 'Con 1', 'Removing another row keeps the current connection');
assert.equal(await evaluate(sender, () => document.activeElement?.classList.contains('connection-link')), true, 'Focus returns to the remaining connection after removal');
console.log('PASS: sidebar actions target their own connection without changing the active workspace.');
await evaluate(sender, async () => {
const db = await new Promise<IDBDatabase>((resolve, reject) => {
const request = indexedDB.open('hellcon-connections', 1);
request.onsuccess = () => resolve(request.result);
request.onerror = () => reject(request.error);
});
await new Promise<void>((resolve, reject) => {
const tx = db.transaction('connections', 'readwrite');
const store = tx.objectStore('connections');
const request = store.getAll();
request.onsuccess = () => store.put({ ...request.result[0], history: [{ name: 'old-file.bin' }] });
tx.oncomplete = () => resolve();
tx.onerror = tx.onabort = () => reject(tx.error);
});
db.close();
});
await call('Page.navigate', { url: origin }, sender);
await wait(sender, () => !!document.querySelector('#stun-provider'));
const oldHistoryRemoved = await evaluate(sender, async () => {
const db = await new Promise<IDBDatabase>((resolve, reject) => {
const request = indexedDB.open('hellcon-connections', 1);
request.onsuccess = () => resolve(request.result);
request.onerror = () => reject(request.error);
});
const record = await new Promise<Record<string, unknown>>((resolve, reject) => {
const request = db.transaction('connections', 'readonly').objectStore('connections').getAll();
request.onsuccess = () => resolve(request.result[0]);
request.onerror = () => reject(request.error);
});
db.close();
return { name: record.name, hasHistory: Object.hasOwn(record, 'history') };
});
assert.deepEqual(oldHistoryRemoved, { name: 'Con 1', hasHistory: false }, 'Loading an old slot removes saved transfer history');
console.log('PASS: legacy transfer history is removed from saved connections on load.');
assert.deepEqual(browserErrors, []);
} else if (streaming) {
const sender = await page(), receiver = await page();
@@ -607,17 +669,17 @@ try {
// suggests the slot paired with the sender's device, and Open hands it there.
const invitedPaired = await page(receiverOrigin);
await click(invitedPaired, 'Add connection');
await wait(invitedPaired, () => document.querySelector('.title-line h1')?.textContent === 'Con 2');
await wait(invitedPaired, () => document.querySelector('.main-pane h1')?.textContent === 'Con 2');
await evaluate(invitedPaired, (code: string) => { location.hash = code; }, offer);
await wait(invitedPaired, () => document.querySelector('dialog[open]')?.textContent?.includes('Invitation to receive files'));
assert.match(await dialogText(invitedPaired), /matches the paired device of Con 1/);
assert.equal(await evaluate(invitedPaired, () => window.__hellcon.element<HTMLSelectElement>('#invitation-target').selectedOptions[0]?.textContent?.trim()), 'Con 1 · paired device');
await click(invitedPaired, 'Open'); await wait(invitedPaired, () => !document.querySelector('dialog[open]'));
assert.equal(await evaluate(invitedPaired, () => document.querySelector('.title-line h1')?.textContent), 'Con 1');
assert.equal(await evaluate(invitedPaired, () => document.querySelector('.main-pane h1')?.textContent), 'Con 1');
assert.equal(await evaluate(invitedPaired, () => window.__hellcon.element<HTMLTextAreaElement>('#offer-input').value), offer);
await evaluate(invitedPaired, () => [...document.querySelectorAll<HTMLButtonElement>('.connection-link')].find(item => item.querySelector('.connection-name')?.textContent === 'Con 2')?.click());
await wait(invitedPaired, () => document.querySelector('.title-line h1')?.textContent === 'Con 2');
await click(invitedPaired, 'Remove'); await click(invitedPaired, 'Remove connection');
await evaluate(invitedPaired, () => [...document.querySelectorAll<HTMLElement>('.connection-name')].find(item => item.textContent === 'Con 2')?.click());
await wait(invitedPaired, () => document.querySelector('.main-pane h1')?.textContent === 'Con 2');
await click(invitedPaired, 'Remove Con 2'); await click(invitedPaired, 'Remove connection');
await wait(invitedPaired, () => document.querySelectorAll('.connection-link').length === 1);
await closePage(invitedPaired);
console.log('PASS: an invitation from a paired device suggests its slot over the current one and hands the code to it.');