feat(settings): search settings from the header and the command palette (#1714)

* feat(settings): search settings from the header and the command palette

The header search on the Settings page was shown but disabled. It now
searches a shared index of all 56 settings rows by translated title,
description and English synonyms, replaces the section page with ranked
results, and opens a result by scrolling to, focusing and briefly
highlighting its row. Enter opens the best match, and the section
navigation shows per-section match counts.

The command palette gains a "Settings" group that lists the best six
matches for a non-empty query, so any setting is one Ctrl/Cmd+K away.
Rows hidden by the current form state fall back to the control that
reveals them; rows the runtime cannot render are never returned.

The index ships through a new @iptvnator/workspace/shell/util/settings-search
sub-entrypoint so it stays out of the eager bundle, and a registry spec
keeps it in step with the section templates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(settings): let search reveals win over pending input and gate embedded MPV rows

- A reveal (result click, command palette, Enter) now cancels a search
  keystroke still waiting for its debounce, so its q navigation can no
  longer supersede the reveal and leave the results open.
- Embedded MPV extra options and auto-reconnect require a lazily probed
  embedded MPV capability; frame copy also needs frameCopyAvailable, so
  search never offers a row the settings page cannot render.
- Keyboard users keep a focus-visible ring on the revealed row after the
  highlight fades.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(workspace): wait for palette probes without Promise.allSettled

The web tsconfig lib predates Promise.allSettled; use Promise.all over
rejection-safe probes instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: 4gray <fourgray@proton.me>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-09-27 07:42:53 +02:00
1 parent b87291e388
commit ea51cae3db
77 files changed
+3304 -316

No files matched your search

+78
View File
@@ -254,6 +254,84 @@ test.describe('Settings', () => {
);
});
test('@settings @search @web Search settings from the header and open a result', async ({
page,
}) => {
await openSettings(page);
// The fresh browser context has no playlists; settings search must
// still be offered.
const search = page.locator(
'app-workspace-shell-header input[type="search"]'
);
await expect(search).toBeEnabled();
// "subtitles" is a keyword of the "Show captions" row.
await search.fill('subtitles');
await expect(page).toHaveURL(/\/workspace\/settings\/general\?q=subtitles$/);
await expect(
page.locator('[data-test-id="settings-search-results"]')
).toBeVisible();
await expect(page.locator('app-settings-general-section')).toHaveCount(0);
await expect(
page.locator('[data-test-id="settings-section-matches-general"]')
).toHaveText('1');
await page
.locator('[data-test-id="settings-search-result-show-captions"]')
.click();
await expect(page).toHaveURL(/\/workspace\/settings\/general$/);
await expect(search).toHaveValue('');
const row = page.locator('[data-setting-id="show-captions"]');
await expect(row).toBeFocused();
await expect(row).toHaveClass(/setting-item--revealed/);
await expect(row).not.toHaveClass(/setting-item--revealed/, {
timeout: 5000,
});
});
test('@settings @search @web Enter opens the best settings match', async ({
page,
}) => {
await openSettings(page);
const search = page.locator(
'app-workspace-shell-header input[type="search"]'
);
await search.fill('stream format');
await search.press('Enter');
await expect(page).toHaveURL(/\/workspace\/settings\/playback$/);
await expect(
page.locator('[data-setting-id="stream-format"]')
).toBeFocused();
});
test('@settings @search @web Command palette opens a setting from anywhere', async ({
page,
}) => {
// The shell registers Ctrl/Cmd+K once its lazy chunk has rendered.
await expect(
page.locator('a[href$="/workspace/settings"]')
).toBeVisible();
await expect(page).not.toHaveURL(/\/workspace\/settings/);
await page.keyboard.press('Control+k');
const palette = page.locator('.workspace-command-palette-overlay');
await expect(palette).toBeVisible();
await palette.locator('input[type="search"]').fill('ambient');
await expect(palette).toContainText('Settings');
await palette
.locator('.palette-command', { hasText: /ambient/i })
.first()
.click();
await expect(page).toHaveURL(/\/workspace\/settings\/playback$/);
await expect(
page.locator('[data-setting-id="player-ambient-mode"]')
).toBeFocused();
});
test.afterEach(async ({ page }, testInfo) => {
await page.screenshot({
path: join(