perf: optimize app startup and background lifecycles

This commit is contained in:
inman
2026-08-19 00:56:15 +08:00
parent 31332f6d76
commit 927e13349b
121 changed files with 4359 additions and 1400 deletions

View File

@@ -295,7 +295,16 @@ export async function openModelsPage(page: Page): Promise<void> {
await settingsPage.waitFor({ state: 'visible', timeout: 5_000 }).catch(() => undefined);
}
await expect(settingsPage).toBeVisible();
await page.getByTestId('settings-reveal-additional').click();
const modelsSection = page.getByTestId('settings-opencode-models');
if (!(await modelsSection.isVisible().catch(() => false))) {
await page.getByTestId('settings-reveal-additional').click();
const adminDialog = page.getByTestId('settings-admin-password-dialog');
if (await adminDialog.isVisible().catch(() => false)) {
await page.getByTestId('settings-admin-password-input').fill('zhiniankeji666');
await page.getByTestId('settings-admin-unlock-button').click();
}
}
await expect(modelsSection).toBeVisible();
await page
.getByTestId('settings-opencode-models')
.getByRole('button', { name: 'Configure models' })