feat(app): register native Settings on the shared live session

This commit is contained in:
2026-10-21 18:55:50 +01:00
parent 7b327f012b
commit d05aa0cfbc
15 changed files with 278 additions and 54 deletions
+18
View File
@@ -119,6 +119,8 @@ try {
if (!el.children.length && el.innerText) chunks.push(el.innerText);
}
for (const el of document.querySelectorAll('input, textarea')) {
const label = el.getAttribute('aria-label');
if (label) chunks.push(label);
if (el.value) chunks.push(String(el.value));
}
if (document.body?.innerText) chunks.push(document.body.innerText);
@@ -369,6 +371,12 @@ try {
await assertBody('Fixture live run');
captures.push(await capture('i1-gate-recovered-list-phone'));
await clickText('Settings');
await assertBody('Server URL');
await assertBody('Fixture settings build');
if ((await path()) !== '/settings') throw new Error('Settings did not update route');
captures.push(await capture('settings-cupertino-registered-phone'));
// Material host: the same deep link and route must render standard Material
// controls (the Cupertino host was selected by the macOS browser above).
await send(
@@ -390,6 +398,16 @@ try {
}
captures.push(await capture('i1-material-deeplink-run-1-phone'));
const beforeSettings = await (await fetch(`${fixture.url}/fixture/state`)).json();
await clickText('Settings');
await assertBody('Server URL');
await assertBody('Fixture settings build');
const afterSettings = await (await fetch(`${fixture.url}/fixture/state`)).json();
if (beforeSettings.subscribed !== afterSettings.subscribed || afterSettings.connections !== 1) {
throw new Error('Settings opened another connection instead of sharing the app socket');
}
captures.push(await capture('settings-material-registered-phone'));
const fixtureState = await (await fetch(`${fixture.url}/fixture/state`)).json();
if (fixtureState.subscribed < 2) throw new Error(`App never resubscribed: ${JSON.stringify(fixtureState)}`);
if (fixtureState.listRuns < 2) throw new Error(`App never reloaded: ${JSON.stringify(fixtureState)}`);
+8
View File
@@ -345,6 +345,14 @@ export async function startFixture({ root }) {
return;
}
if (request.type === 'unsubscribe') return;
if (request.type === 'ping') {
client.send({
id: request.id, type: 'pong',
build: { version: 'Fixture settings build' },
time: '2026-10-21T12:00:00Z',
});
return;
}
if (request.type === 'list_runs') {
listRuns++;
client.send({ id: request.id, type: 'runs', runs: RUNS, usage: null });