diff --git a/.changes/settings-search.md b/.changes/settings-search.md new file mode 100644 index 000000000..137d7eff1 --- /dev/null +++ b/.changes/settings-search.md @@ -0,0 +1,10 @@ +--- +type: feature +area: settings +highlight: Search your settings +--- + +Settings are now searchable: type in the search box on the Settings page to +find any option by name, description or a common word like "dark" or "mpv", +then jump straight to it. The command palette (Ctrl/Cmd+K) finds settings +too, from anywhere in the app. diff --git a/.github/workflows/build-and-make.yaml b/.github/workflows/build-and-make.yaml index d901a20ee..e31a370fc 100644 --- a/.github/workflows/build-and-make.yaml +++ b/.github/workflows/build-and-make.yaml @@ -1099,14 +1099,33 @@ jobs: sudo snap disconnect iptvnator:graphics-core22 mesa-core22:graphics-core22 snap connections iptvnator | awk \ '$2 == "iptvnator:graphics-core22" && $3 == "-" { found=1 } END { exit !found }' + probe_timed_out() { + # GNU timeout exits 124 when SIGTERM ends the app and 137 when -k + # escalates to SIGKILL. --verbose announces that KILL, so an app + # killed by anything else is not misreported as a timeout. + local status="$1" output="$2" + [ "${status}" -eq 124 ] && return 0 + [ "${status}" -eq 137 ] && + grep -Fq 'sending signal KILL to command' <<<"${output}" + } + # GNU timeout kills a packaged app that never exits, for example when the + # main process throws before app ready and Electron's uncaught-exception + # dialog blocks under xvfb. ELECTRON_ENABLE_LOGGING routes Chromium and + # main-process stderr into the captured output; the probe's JSON verdict is + # still a single stdout line that grep -Fx matches. set +e disconnected_probe="$( - xvfb-run -a env LIBGL_ALWAYS_SOFTWARE=1 \ + xvfb-run -a env LIBGL_ALWAYS_SOFTWARE=1 ELECTRON_ENABLE_LOGGING=1 \ + timeout --verbose -k 10 300 \ snap run iptvnator --embedded-mpv-runtime-probe 2>&1 )" disconnected_status=$? set -e printf '%s\n' "${disconnected_probe}" + if probe_timed_out "${disconnected_status}" "${disconnected_probe}"; then + echo "::error::The packaged Snap app did not exit within 300 seconds during the disconnected graphics runtime probe and was killed; inspect the probe output above for main-process startup errors." + exit 1 + fi test "${disconnected_status}" -eq 1 printf '%s\n' "${disconnected_probe}" | \ grep -Fx '{"usable":false,"reason":"snap-graphics-provider-unavailable"}' @@ -1117,27 +1136,43 @@ jobs: '$2 == "iptvnator:gnome-3-28-1804" && $3 == "gnome-3-28-1804:gnome-3-28-1804" { found=1 } END { exit !found }' snap connections iptvnator | awk \ '$1 == "shared-memory" && $2 == "iptvnator:shared-memory" && $3 == ":shared-memory" { found=1 } END { exit !found }' - xvfb-run -a env \ - LIBGL_ALWAYS_SOFTWARE=1 \ - IPTVNATOR_TRACE_PLAYER=1 \ - EGL_LOG_LEVEL=debug \ - LIBGL_DEBUG=verbose \ - __EGL_VENDOR_LIBRARY_FILENAMES=/tmp/hostile-egl-vendor.json \ - GBM_BACKEND=/tmp/hostile-gbm \ - MESA_LOADER_DRIVER_OVERRIDE=/tmp/hostile-dri \ - LIBVA_DRIVER_NAME=/tmp/hostile-va \ - VDPAU_DRIVER_PATH=/tmp/hostile-vdpau \ - VK_DRIVER_FILES=/tmp/hostile-vulkan-driver.json \ - VK_ICD_FILENAMES=/tmp/hostile-vulkan-icd.json \ - VK_ADD_DRIVER_FILES=/tmp/hostile-vulkan-add-driver.json \ - VK_ADD_LAYER_PATH=/tmp/hostile-vulkan-layers \ - VK_IMPLICIT_LAYER_PATH=/tmp/hostile-vulkan-implicit-layers \ - VK_ADD_IMPLICIT_LAYER_PATH=/tmp/hostile-vulkan-add-implicit-layers \ - XDG_CONFIG_HOME=/tmp/hostile-xdg-config-home \ - XDG_CONFIG_DIRS=/tmp/hostile-xdg-config-dirs \ - XDG_DATA_HOME=/tmp/hostile-xdg-data-home \ - XDG_DATA_DIRS=/tmp/hostile-xdg-data-dirs \ - snap run iptvnator --embedded-mpv-runtime-probe + set +e + hostile_probe="$( + xvfb-run -a env \ + LIBGL_ALWAYS_SOFTWARE=1 \ + ELECTRON_ENABLE_LOGGING=1 \ + IPTVNATOR_TRACE_PLAYER=1 \ + EGL_LOG_LEVEL=debug \ + LIBGL_DEBUG=verbose \ + __EGL_VENDOR_LIBRARY_FILENAMES=/tmp/hostile-egl-vendor.json \ + GBM_BACKEND=/tmp/hostile-gbm \ + MESA_LOADER_DRIVER_OVERRIDE=/tmp/hostile-dri \ + LIBVA_DRIVER_NAME=/tmp/hostile-va \ + VDPAU_DRIVER_PATH=/tmp/hostile-vdpau \ + VK_DRIVER_FILES=/tmp/hostile-vulkan-driver.json \ + VK_ICD_FILENAMES=/tmp/hostile-vulkan-icd.json \ + VK_ADD_DRIVER_FILES=/tmp/hostile-vulkan-add-driver.json \ + VK_ADD_LAYER_PATH=/tmp/hostile-vulkan-layers \ + VK_IMPLICIT_LAYER_PATH=/tmp/hostile-vulkan-implicit-layers \ + VK_ADD_IMPLICIT_LAYER_PATH=/tmp/hostile-vulkan-add-implicit-layers \ + XDG_CONFIG_HOME=/tmp/hostile-xdg-config-home \ + XDG_CONFIG_DIRS=/tmp/hostile-xdg-config-dirs \ + XDG_DATA_HOME=/tmp/hostile-xdg-data-home \ + XDG_DATA_DIRS=/tmp/hostile-xdg-data-dirs \ + timeout --verbose -k 10 300 \ + snap run iptvnator --embedded-mpv-runtime-probe 2>&1 + )" + hostile_status=$? + set -e + printf '%s\n' "${hostile_probe}" + if probe_timed_out "${hostile_status}" "${hostile_probe}"; then + echo "::error::The packaged Snap app did not exit within 300 seconds during the hostile-environment runtime probe and was killed; inspect the probe output above for main-process startup errors." + exit 1 + fi + if [ "${hostile_status}" -ne 0 ]; then + echo "::error::Snap hostile-environment runtime probe failed with status ${hostile_status}." + exit "${hostile_status}" + fi - name: Run packaged x64 frame-copy and fallback smoke if: matrix.os == 'linux' && matrix.linux_profile == 'portable' @@ -1223,26 +1258,49 @@ jobs: ELF_MAGIC="$(od -An -tx1 -N4 "${LAUNCHER_PATH}" | tr -d "[:space:]")" test "${ELF_MAGIC}" = "7f454c46" ' + probe_timed_out() { + # GNU timeout exits 124 when SIGTERM ends the app and 137 when -k + # escalates to SIGKILL. --verbose announces that KILL, so an app + # killed by anything else is not misreported as a timeout. + local status="$1" output="$2" + [ "${status}" -eq 124 ] && return 0 + [ "${status}" -eq 137 ] && + grep -Fq 'sending signal KILL to command' <<<"${output}" + } + # GNU timeout kills a packaged app that never exits, for example when the + # main process throws before app ready and Electron's uncaught-exception + # dialog blocks under xvfb. ELECTRON_ENABLE_LOGGING routes Chromium and + # main-process stderr into the captured output. set +e PROBE_OUTPUT="$( - xvfb-run -a dbus-run-session -- flatpak run \ + xvfb-run -a dbus-run-session -- timeout --verbose -k 10 300 flatpak run \ --env=LIBGL_ALWAYS_SOFTWARE=1 \ + --env=ELECTRON_ENABLE_LOGGING=1 \ com.fourgray.iptvnator \ --embedded-mpv-runtime-probe 2>&1 )" PROBE_STATUS=$? set -e + # Keep both ends of oversized output: logging can push a startup + # exception or the timeout notice past the first window. PROBE_OUTPUT_LIMIT=16384 - printf '%s\n' "${PROBE_OUTPUT:0:PROBE_OUTPUT_LIMIT}" - if [ "${#PROBE_OUTPUT}" -gt "${PROBE_OUTPUT_LIMIT}" ]; then - echo "::warning::Flatpak runtime probe output was truncated to ${PROBE_OUTPUT_LIMIT} characters." + if [ "${#PROBE_OUTPUT}" -le $((PROBE_OUTPUT_LIMIT * 2)) ]; then + printf '%s\n' "${PROBE_OUTPUT}" + else + printf '%s\n' "${PROBE_OUTPUT:0:PROBE_OUTPUT_LIMIT}" + echo "::warning::Flatpak runtime probe output was truncated to its first and last ${PROBE_OUTPUT_LIMIT} characters." + printf '%s\n' "${PROBE_OUTPUT: -PROBE_OUTPUT_LIMIT}" fi if [[ "${PROBE_OUTPUT}" == *"not an ELF file"* ]] || [[ "${PROBE_OUTPUT}" == *"Zypak needs to be called directly"* ]]; then echo "::error::Flatpak launched a wrapper instead of the Electron ELF." exit 1 fi + if probe_timed_out "${PROBE_STATUS}" "${PROBE_OUTPUT}"; then + echo "::error::The packaged Flatpak app did not exit within 300 seconds during the application runtime probe and was killed; inspect the probe output above for main-process startup errors." + exit 1 + fi if [ "${PROBE_STATUS}" -ne 0 ]; then echo "::error::Flatpak application runtime probe failed with status ${PROBE_STATUS}." exit "${PROBE_STATUS}" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72be0299b..33550a61b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -209,6 +209,10 @@ jobs: name: Unit Tests and Typechecks runs-on: ubuntu-latest timeout-minutes: 45 + permissions: + contents: read + # The scope step lists the PR's changed files through the API. + pull-requests: read steps: - name: Checkout code @@ -247,11 +251,75 @@ jobs: - name: Check i18n drift run: pnpm run i18n:check + # A pull request whose changes cannot reach any Tier A test (docs, + # notes, other workflows, website, E2E and mock-server apps, release + # and packaging tooling, a scripts-only package.json edit) skips the + # suite. The allowlist lives in a unit-tested script; anything it + # does not know runs everything, and master always runs everything. + - name: Decide unit coverage scope + id: scope + env: + EVENT_NAME: ${{ github.event_name }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + BASE_SHA: ${{ github.event.pull_request.base.sha }} + CHANGED_FILES: ${{ github.event.pull_request.changed_files }} + run: | + set -euo pipefail + if [ "$EVENT_NAME" != "pull_request" ]; then + echo "Not a pull request; running the full suite." + echo "run=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + # The list-files endpoint stops at 3,000 files; a truncated + # list could hide a file that needs the suite. + if [ "${CHANGED_FILES:-0}" -ge 3000 ]; then + echo "PR changes ${CHANGED_FILES} files, beyond the API listing limit; running the full suite." + echo "run=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + git fetch --no-tags --depth=1 origin "$BASE_SHA" + gh api "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/files?per_page=100" \ + --paginate --jq '.[] | .filename, (.previous_filename // empty)' | + node tools/coverage/unit-coverage-scope.mjs --base FETCH_HEAD --github-output + + # Jest's transform cache (TypeScript/Angular transpilation plus + # coverage instrumentation, keyed by file content) is persisted + # between runs. Only master pushes and maintainer dispatches save + # it; pull requests restore it and never write, so a PR cannot plant + # an entry that a later master run would read. + - name: Restore Jest transform cache + if: steps.scope.outputs.run == 'true' && github.event_name != 'push' + uses: actions/cache/restore@v6 + with: + path: ${{ runner.temp }}/jest-cache + key: jest-transform-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'tsconfig.base.json', 'jest.preset.js', 'jest.web-esm.workspace.ts', 'apps/web/jest.config.ts') }}-${{ github.run_id }} + restore-keys: | + jest-transform-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'tsconfig.base.json', 'jest.preset.js', 'jest.web-esm.workspace.ts', 'apps/web/jest.config.ts') }}- + - name: Run Tier A unit coverage suite + if: steps.scope.outputs.run == 'true' run: pnpm run coverage:ci env: CI: true NX_TASKS_RUNNER_DYNAMIC_OUTPUT: false + JEST_CACHE_DIRECTORY: ${{ runner.temp }}/jest-cache + + - name: Validate coverage tooling (suite skipped) + if: steps.scope.outputs.run != 'true' + run: pnpm run coverage:tools:test && pnpm run coverage:policy:check + + # Master pushes start from an empty cache, so the saved cache holds + # exactly the current tree and does not grow run over run. + - name: Save Jest transform cache + if: >- + steps.scope.outputs.run == 'true' && + (github.event_name == 'workflow_dispatch' || + (github.event_name == 'push' && github.ref == 'refs/heads/master')) + uses: actions/cache/save@v6 + with: + path: ${{ runner.temp }}/jest-cache + key: jest-transform-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'tsconfig.base.json', 'jest.preset.js', 'jest.web-esm.workspace.ts', 'apps/web/jest.config.ts') }}-${{ github.run_id }} - name: Run Tier B/C validation commands run: node tools/coverage/check-coverage-policy.mjs --run-non-tier-a @@ -260,7 +328,7 @@ jobs: NX_TASKS_RUNNER_DYNAMIC_OUTPUT: false - name: Upload unit coverage artifact - if: always() + if: always() && steps.scope.outputs.run == 'true' uses: actions/upload-artifact@v7 with: name: unit-coverage @@ -269,7 +337,7 @@ jobs: retention-days: 14 - name: Upload unit coverage to Codecov - if: always() + if: always() && steps.scope.outputs.run == 'true' uses: codecov/codecov-action@v7 with: files: ./coverage/merged/lcov.info,./coverage/merged/cobertura-coverage.xml diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index dd4031464..24d672d5e 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -42,17 +42,26 @@ jobs: # The sequential Electron suite is split into Playwright shards (one # runner each, split by spec file). Measured on 2026-09-26, a third of # the suite is 6-12 minutes of test time on top of 3-7 minutes of - # setup, so 30 minutes leaves room for retries on every OS. - timeout-minutes: 30 + # setup. macOS uses two shards because its runners are the scarcest: + # three macOS shards per run queued for 45-57 minutes on master. Half + # of the suite is about 15 minutes of test time on macOS, so it gets + # a longer timeout to leave room for retries. + timeout-minutes: ${{ matrix.os == 'macos-latest' && 40 || 30 }} env: IPTVNATOR_ALLOW_PRIVATE_NETWORK_URLS: '1' NX_SKIP_NX_CACHE: true strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - shard: [1, 2, 3] - shard-total: [3] + include: + - { os: ubuntu-latest, shard: 1, shard-total: 3 } + - { os: ubuntu-latest, shard: 2, shard-total: 3 } + - { os: ubuntu-latest, shard: 3, shard-total: 3 } + - { os: macos-latest, shard: 1, shard-total: 2 } + - { os: macos-latest, shard: 2, shard-total: 2 } + - { os: windows-latest, shard: 1, shard-total: 3 } + - { os: windows-latest, shard: 2, shard-total: 3 } + - { os: windows-latest, shard: 3, shard-total: 3 } steps: - uses: actions/checkout@v7 diff --git a/README.md b/README.md index fbec01873..25bcbb9d8 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,8 @@ The application is a cross-platform, open-source project built with Electron and - Per-playlist and global favorites, aggregated across all playlists ⭐ - Recently viewed / watch history -- Command palette (`Ctrl/Cmd+K`) +- Command palette (`Ctrl/Cmd+K`) that also finds and opens individual settings +- Settings search from the header search box on the Settings page **Platform** @@ -76,9 +77,9 @@ Press `?` or `Shift+/` in the workspace to open the in-app shortcuts list. | Area | Shortcut | Action | | ----------------- | --------------------------- | ---------------------------------------------------------- | | Global | `Ctrl/Cmd+K` | Open command palette | -| Global | `Ctrl/Cmd+F` | Open global search in the desktop app | +| Global | `Ctrl/Cmd+F` | Open global search (desktop); on Settings, search settings | | Global | `Ctrl/Cmd+R` | Open recently viewed in the desktop app | -| Global | `Enter` in workspace search | Submit the current search | +| Global | `Enter` in workspace search | Submit the search; on Settings, open the best match | | Global | `F11` | Toggle app window fullscreen in the desktop app | | Navigation | `Ctrl/Cmd+B` | Toggle the live sidebar | | Navigation | `0-9` | Select an M3U channel by number | diff --git a/apps/electron-backend/tsconfig.spec.json b/apps/electron-backend/tsconfig.spec.json index ae084b520..be2310d6e 100644 --- a/apps/electron-backend/tsconfig.spec.json +++ b/apps/electron-backend/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../dist/out-tsc", "esModuleInterop": true, "allowJs": true, diff --git a/apps/web-backend/tsconfig.spec.json b/apps/web-backend/tsconfig.spec.json index 09849f85f..58b060efd 100644 --- a/apps/web-backend/tsconfig.spec.json +++ b/apps/web-backend/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../dist/out-tsc", "module": "commonjs", "moduleResolution": "node10", diff --git a/apps/web-e2e/src/settings.e2e.ts b/apps/web-e2e/src/settings.e2e.ts index 6461bd370..e12bb9d7b 100644 --- a/apps/web-e2e/src/settings.e2e.ts +++ b/apps/web-e2e/src/settings.e2e.ts @@ -310,6 +310,84 @@ test.describe('Settings', () => { await expect(languageSelect).toContainText('Deutsch'); }); + 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( diff --git a/apps/web/jest.config.ts b/apps/web/jest.config.ts index 6fb90a9a1..3186de1c7 100644 --- a/apps/web/jest.config.ts +++ b/apps/web/jest.config.ts @@ -21,6 +21,10 @@ const collectCoverageFrom = [ export default { ...nxPreset, ...angularEsmPreset, + // See jest.preset.js: CI persists the transform cache from this directory. + ...(process.env.JEST_CACHE_DIRECTORY + ? { cacheDirectory: process.env.JEST_CACHE_DIRECTORY } + : {}), displayName: 'web', setupFilesAfterEnv: ['/src/test-setup.ts'], coverageDirectory: '../../coverage/apps/web', diff --git a/apps/web/src/app/settings/settings-about-section.component.html b/apps/web/src/app/settings/settings-about-section.component.html index 7542ce093..0d6f87c9f 100644 --- a/apps/web/src/app/settings/settings-about-section.component.html +++ b/apps/web/src/app/settings/settings-about-section.component.html @@ -9,7 +9,7 @@ -
+

{{ 'SETTINGS.VERSION' | translate }}

{{ 'SETTINGS.VERSION_DESCRIPTION' | translate }}

@@ -31,7 +31,10 @@
@if (isDesktop() && appUpdateStatus(); as updateStatus) { -
+

{{ 'SETTINGS.APP_UPDATE_TITLE' | translate }}

{{ 'SETTINGS.APP_UPDATE_DESCRIPTION' | translate }}

@@ -263,7 +266,10 @@
} -
+

{{ 'SETTINGS.TMDB_CREDITS' | translate }}

{{ 'SETTINGS.TMDB_ATTRIBUTION' | translate }}

@@ -281,7 +287,10 @@
-
+

{{ 'SETTINGS.COMMUNITY' | translate }}

{{ 'SETTINGS.COMMUNITY_DESCRIPTION' | translate }}

@@ -364,7 +373,10 @@
-
+
diff --git a/apps/web/src/app/settings/settings-backup-section.component.html b/apps/web/src/app/settings/settings-backup-section.component.html index bae147754..4c9a3ee07 100644 --- a/apps/web/src/app/settings/settings-backup-section.component.html +++ b/apps/web/src/app/settings/settings-backup-section.component.html @@ -1,7 +1,4 @@ -
+
backup @@ -12,7 +9,7 @@
-
+

{{ 'SETTINGS.IMPORT_EXPORT_DATA' | translate }}

diff --git a/apps/web/src/app/settings/settings-dashboard-section.component.html b/apps/web/src/app/settings/settings-dashboard-section.component.html index 5c5657c4f..cd5ee2e0e 100644 --- a/apps/web/src/app/settings/settings-dashboard-section.component.html +++ b/apps/web/src/app/settings/settings-dashboard-section.component.html @@ -1,8 +1,4 @@ -

+
dashboard @@ -13,7 +9,7 @@
-
+

{{ 'SETTINGS.SHOW_DASHBOARD' | translate }}

@@ -29,7 +25,7 @@

-
+

{{ 'SETTINGS.DASHBOARD_HERO' | translate }}

@@ -44,7 +40,10 @@

-
+

{{ 'SETTINGS.DASHBOARD_RAIL_CONTINUE' | translate }}

@@ -62,11 +61,14 @@

-
+
-

{{ - 'SETTINGS.DASHBOARD_RAIL_LIVE_FAVORITES' | translate - }}

+

+ {{ 'SETTINGS.DASHBOARD_RAIL_LIVE_FAVORITES' | translate }} +

{{ 'SETTINGS.DASHBOARD_RAIL_LIVE_FAVORITES_DESCRIPTION' @@ -82,11 +84,9 @@

-
+
-

{{ - 'SETTINGS.DASHBOARD_RAIL_RECENT_LIVE' | translate - }}

+

{{ 'SETTINGS.DASHBOARD_RAIL_RECENT_LIVE' | translate }}

{{ 'SETTINGS.DASHBOARD_RAIL_RECENT_LIVE_DESCRIPTION' @@ -102,11 +102,11 @@

-
+
-

{{ - 'SETTINGS.DASHBOARD_RAIL_FAVORITE_VOD' | translate - }}

+

+ {{ 'SETTINGS.DASHBOARD_RAIL_FAVORITE_VOD' | translate }} +

{{ 'SETTINGS.DASHBOARD_RAIL_FAVORITE_VOD_DESCRIPTION' @@ -122,7 +122,7 @@

-
+

{{ 'SETTINGS.DASHBOARD_RAIL_SOURCES' | translate }}

@@ -140,11 +140,11 @@

-
+
-

{{ - 'SETTINGS.DASHBOARD_RAIL_XTREAM_ADDED' | translate - }}

+

+ {{ 'SETTINGS.DASHBOARD_RAIL_XTREAM_ADDED' | translate }} +

{{ 'SETTINGS.DASHBOARD_RAIL_XTREAM_ADDED_DESCRIPTION' @@ -160,9 +160,14 @@

-
+
-

{{ 'SETTINGS.DASHBOARD_RAIL_TMDB_TRENDING' | translate }}

+

+ {{ 'SETTINGS.DASHBOARD_RAIL_TMDB_TRENDING' | translate }} +

{{ 'SETTINGS.DASHBOARD_RAIL_TMDB_TRENDING_DESCRIPTION' @@ -178,7 +183,10 @@

-
+

{{ diff --git a/apps/web/src/app/settings/settings-epg-section.component.html b/apps/web/src/app/settings/settings-epg-section.component.html index c8a96c1c1..b82aa1643 100644 --- a/apps/web/src/app/settings/settings-epg-section.component.html +++ b/apps/web/src/app/settings/settings-epg-section.component.html @@ -9,7 +9,10 @@

-
+

{{ 'SETTINGS.EPG_VIEW_MODE' | translate }}

{{ 'SETTINGS.EPG_VIEW_MODE_DESCRIPTION' | translate }}

@@ -43,7 +46,10 @@
-
+

{{ 'SETTINGS.EPG_OFFSET_TITLE' | translate }}

{{ 'SETTINGS.EPG_OFFSET_HINT' | translate }}

@@ -69,7 +75,10 @@
-
+

{{ 'SETTINGS.EPG_SOURCE_LIST_TITLE' | translate }}

{{ 'SETTINGS.EPG_SOURCE_FORMATS_HINT' | translate }}

@@ -178,7 +187,7 @@
-
+

{{ 'SETTINGS.PREFER_UPLOADED_EPG_TITLE' | translate }}

{{ 'SETTINGS.PREFER_UPLOADED_EPG_HINT' | translate }}

diff --git a/apps/web/src/app/settings/settings-general-section.component.html b/apps/web/src/app/settings/settings-general-section.component.html index 452ed72a9..012a8f449 100644 --- a/apps/web/src/app/settings/settings-general-section.component.html +++ b/apps/web/src/app/settings/settings-general-section.component.html @@ -9,7 +9,7 @@
-
+

{{ 'SETTINGS.LANGUAGE' | translate }}

{{ 'SETTINGS.LANGUAGE_DESCRIPTION' | translate }}

@@ -40,7 +40,10 @@
-
+

{{ 'SETTINGS.THEME' | translate }}

{{ 'SETTINGS.THEME_DESCRIPTION' | translate }}

@@ -74,7 +77,10 @@
-
+

{{ 'SETTINGS.COVER_SIZE' | translate }}

{{ 'SETTINGS.COVER_SIZE_DESCRIPTION' | translate }}

@@ -108,7 +114,7 @@
-
+

{{ 'SETTINGS.COVER_TITLES' | translate }} @@ -127,7 +133,7 @@

-
+

{{ 'SETTINGS.STARTUP_BEHAVIOR' | translate }}

@@ -160,7 +166,11 @@

@if (supportsStartupWindowMode()) { -
+

{{ 'SETTINGS.STARTUP_WINDOW_MODE' | translate }}

@@ -195,7 +205,7 @@

} -
+

{{ 'SETTINGS.SHOW_CAPTIONS' | translate }}

@@ -207,7 +217,7 @@

-
+

{{ 'SETTINGS.STRIP_COUNTRY_PREFIX' | translate }}

@@ -233,7 +243,7 @@

{{ 'SETTINGS.PORTAL_CONNECTIONS' | translate }}

-
+

{{ 'SETTINGS.PORTAL_CONNECTIVITY_GUARD' | translate }} diff --git a/apps/web/src/app/settings/settings-options.ts b/apps/web/src/app/settings/settings-options.ts index 8c3a34799..3b03e57aa 100644 --- a/apps/web/src/app/settings/settings-options.ts +++ b/apps/web/src/app/settings/settings-options.ts @@ -5,6 +5,10 @@ import { Theme, VideoPlayer, } from '@iptvnator/shared/interfaces'; +import { + meetsSettingsRequirements, + SETTINGS_SECTION_DEFINITIONS, +} from '@iptvnator/workspace/shell/util/settings-search'; import { CoverSizeOption, EpgViewModeOption, @@ -164,71 +168,14 @@ export function buildSettingsSectionNavItems({ supportsEpg, supportsRemoteControl, }: SettingsSectionVisibility): SettingsSection[] { - return [ - { - id: 'general', - label: 'SETTINGS.NAV_GENERAL', - icon: 'tune', - visible: true, - }, - { - id: 'playback', - label: 'SETTINGS.NAV_PLAYBACK', - icon: 'play_circle', - visible: true, - }, - { - id: 'epg', - label: 'SETTINGS.NAV_EPG', - icon: 'calendar_month', - visible: supportsEpg, - }, - { - id: 'dashboard', - label: 'SETTINGS.NAV_DASHBOARD', - icon: 'dashboard', - visible: true, - }, - { - // Must match the section's HTML id (`remote-control`) so the - // settings-section-scroll directive can resolve the anchor. - // Was previously '@iptvnator/ui/remote-control' (the NX lib - // name), which meant clicking the nav item silently no-op'd - // because document.getElementById of that string returned null. - id: 'remote-control', - label: 'SETTINGS.NAV_REMOTE', - icon: 'smartphone', - visible: supportsRemoteControl, - }, - { - id: 'tmdb', - label: 'SETTINGS.NAV_TMDB', - icon: 'movie', - visible: true, - }, - { - id: 'parental', - label: 'SETTINGS.NAV_PARENTAL', - icon: 'family_restroom', - visible: true, - }, - { - id: 'backup', - label: 'SETTINGS.NAV_BACKUP', - icon: 'backup', - visible: true, - }, - { - id: 'reset', - label: 'SETTINGS.NAV_RESET', - icon: 'delete_sweep', - visible: true, - }, - { - id: 'about', - label: 'SETTINGS.NAV_ABOUT', - icon: 'info', - visible: true, - }, - ]; + const capabilities = { + epg: supportsEpg, + 'remote-control': supportsRemoteControl, + }; + return SETTINGS_SECTION_DEFINITIONS.map((section) => ({ + id: section.id, + label: section.navLabelKey, + icon: section.icon, + visible: meetsSettingsRequirements(section.requires, capabilities), + })); } diff --git a/apps/web/src/app/settings/settings-parental-lock-section.component.html b/apps/web/src/app/settings/settings-parental-section.component.html similarity index 93% rename from apps/web/src/app/settings/settings-parental-lock-section.component.html rename to apps/web/src/app/settings/settings-parental-section.component.html index e079239a9..8405cecbf 100644 --- a/apps/web/src/app/settings/settings-parental-lock-section.component.html +++ b/apps/web/src/app/settings/settings-parental-section.component.html @@ -9,7 +9,7 @@

-
+

{{ 'SETTINGS.PARENTAL_LOCK.ENABLE' | translate }}

{{ 'SETTINGS.PARENTAL_LOCK.ENABLE_DESCRIPTION' | translate }}

@@ -26,7 +26,7 @@
@if (enabled()) { -
+

{{ 'SETTINGS.PARENTAL_LOCK.STATUS' | translate }}

@@ -65,7 +65,7 @@

-
+

{{ 'SETTINGS.PARENTAL_LOCK.RELOCK' | translate }}

@@ -100,7 +100,7 @@

-
+

{{ 'SETTINGS.PARENTAL_LOCK.CHANGE_PIN' | translate }}

@@ -124,7 +124,7 @@

-
+

{{ 'SETTINGS.PARENTAL_LOCK.HOW_TO_LOCK' | translate }}

diff --git a/apps/web/src/app/settings/settings-parental-lock-section.component.ts b/apps/web/src/app/settings/settings-parental-section.component.ts similarity index 96% rename from apps/web/src/app/settings/settings-parental-lock-section.component.ts rename to apps/web/src/app/settings/settings-parental-section.component.ts index 16c7d0f3c..95a33ec71 100644 --- a/apps/web/src/app/settings/settings-parental-lock-section.component.ts +++ b/apps/web/src/app/settings/settings-parental-section.component.ts @@ -17,7 +17,7 @@ import { ParentalLockRelockMinutes } from '@iptvnator/shared/interfaces'; MatSlideToggleModule, TranslateModule, ], - templateUrl: './settings-parental-lock-section.component.html', + templateUrl: './settings-parental-section.component.html', encapsulation: ViewEncapsulation.None, styles: [':host { display: contents; }'], }) diff --git a/apps/web/src/app/settings/settings-playback-section.component.html b/apps/web/src/app/settings/settings-playback-section.component.html index 121bcafb2..7c93d5840 100644 --- a/apps/web/src/app/settings/settings-playback-section.component.html +++ b/apps/web/src/app/settings/settings-playback-section.component.html @@ -9,7 +9,7 @@

-
+

{{ 'SETTINGS.VIDEO_PLAYER_LABEL' | translate }}

{{ 'SETTINGS.VIDEO_PLAYER_DESCRIPTION' | translate }}

@@ -35,7 +35,7 @@
-
+

{{ 'SETTINGS.STREAM_FORMAT' | translate }}

{{ 'SETTINGS.STREAM_FORMAT_DESCRIPTION' | translate }}

@@ -67,6 +67,7 @@ @if (isWebPlayerSelected()) {
@@ -91,7 +92,11 @@
-
+

{{ 'SETTINGS.PLAYER_AMBIENT_MODE' | translate }} @@ -109,7 +114,11 @@

-
+

{{ 'SETTINGS.PLAYER_UP_NEXT_RAIL' | translate }} @@ -131,6 +140,7 @@ @if (supportsFullscreenChannelPanel()) {
@@ -159,7 +169,11 @@ @if (supportsVodMultiSource() && isWebPlayerSelected()) { -
+

{{ 'SETTINGS.VOD_AUTO_FAILOVER' | translate }} @@ -181,6 +195,7 @@ @if (supportsManagedExternalPlayers() && isExternalPlayerSelected()) {
@@ -206,7 +221,7 @@ } @if (isDesktop()) { -
+

{{ 'SETTINGS.SHOW_EXTERNAL_PLAYBACK_BAR' | translate }}

@@ -226,6 +241,7 @@ @if (frameCopyAvailable() || form().value.embeddedMpvFrameCopy) {

@@ -262,6 +278,7 @@ @if (form().value.player === 'embedded-mpv') {
@@ -332,6 +349,7 @@
@@ -354,7 +372,11 @@
} -
+

{{ 'SETTINGS.RECORDING_FOLDER_LABEL' | translate }}

@@ -391,7 +413,7 @@ @if ( supportsExternalPlayerPathSettings() && form().value.player === 'mpv' ) { -

+

{{ 'SETTINGS.MPV_PLAYER_PATH_LABEL' | translate }}

@@ -418,6 +440,7 @@

@@ -449,7 +472,7 @@
-
+

{{ 'SETTINGS.MPV_REUSE_INSTANCE_LABEL' | translate }}

@@ -465,7 +488,7 @@ @if ( supportsExternalPlayerPathSettings() && form().value.player === 'vlc' ) { -

+

{{ 'SETTINGS.VLC_PLAYER_PATH_LABEL' | translate }}

@@ -489,6 +512,7 @@

@@ -520,7 +544,7 @@
-
+

{{ 'SETTINGS.VLC_REUSE_INSTANCE_LABEL' | translate }}

diff --git a/apps/web/src/app/settings/settings-remote-control-section.component.html b/apps/web/src/app/settings/settings-remote-control-section.component.html index 510c81ea4..bdead5a0d 100644 --- a/apps/web/src/app/settings/settings-remote-control-section.component.html +++ b/apps/web/src/app/settings/settings-remote-control-section.component.html @@ -1,8 +1,4 @@ -

+
settings_remote @@ -13,7 +9,7 @@
-
+

{{ 'SETTINGS.REMOTE_CONTROL' | translate }}

{{ 'SETTINGS.REMOTE_CONTROL_DESCRIPTION' | translate }}

@@ -27,7 +23,7 @@
@if (form().value.remoteControl === true) { -
+

{{ 'SETTINGS.REMOTE_CONTROL_PORT' | translate }}

@@ -76,7 +72,7 @@

@if (localIpAddresses().length > 0) { -
+

{{ 'SETTINGS.REMOTE_CONTROL_URL' | translate }}

diff --git a/apps/web/src/app/settings/settings-reset-section.component.html b/apps/web/src/app/settings/settings-reset-section.component.html index 18b4f441e..cb15ca67b 100644 --- a/apps/web/src/app/settings/settings-reset-section.component.html +++ b/apps/web/src/app/settings/settings-reset-section.component.html @@ -1,7 +1,4 @@ -

+
delete_sweep @@ -12,7 +9,10 @@
-
+

{{ 'SETTINGS.REMOVE_ALL' | translate }}

diff --git a/apps/web/src/app/settings/settings-search-registry.spec.ts b/apps/web/src/app/settings/settings-search-registry.spec.ts new file mode 100644 index 000000000..f6afbf8fa --- /dev/null +++ b/apps/web/src/app/settings/settings-search-registry.spec.ts @@ -0,0 +1,129 @@ +import { readdirSync, readFileSync } from 'node:fs'; +import { join, resolve } from 'node:path'; +import { SETTINGS_SEARCH_ENTRIES } from '@iptvnator/workspace/shell/util/settings-search'; + +/** + * The settings search index is hand-maintained next to templates whose + * labels are hard-coded translate keys. This spec keeps the two in step: a + * new settings row without an index entry (or a renamed key) fails here + * instead of silently becoming unsearchable. + */ +interface TemplateRow { + file: string; + id: string | null; + labelKey: string | null; + descriptionKey: string | null; +} + +// The web jest config runs as ESM, so there is no `__dirname` here. +const SETTINGS_DIR = resolve(process.cwd(), 'apps/web/src/app/settings'); +const EN = JSON.parse( + readFileSync(join(SETTINGS_DIR, '../../assets/i18n/en.json'), 'utf8') +); + +function readTemplateRows(): TemplateRow[] { + const rows: TemplateRow[] = []; + const files = readdirSync(SETTINGS_DIR).filter((file) => + /^settings-.+-section\.component\.html$/.test(file) + ); + + for (const file of files) { + const html = readFileSync(join(SETTINGS_DIR, file), 'utf8'); + // Row containers only: `setting-item` itself, not `__meta` etc. + const starts = [ + ...html.matchAll(/]*class="setting-item(?:\s[^"]*)?"/g), + ]; + starts.forEach((match, index) => { + const end = starts[index + 1]?.index ?? html.length; + const chunk = html.slice(match.index, end); + const tag = chunk.slice(0, chunk.indexOf('>') + 1); + const meta = chunk.split('setting-item__control')[0]; + rows.push({ + file, + id: tag.match(/data-setting-id="([^"]+)"/)?.[1] ?? null, + labelKey: + chunk.match( + /]*>\s*\{\{\s*'(SETTINGS\.[A-Z0-9_]+)'/ + )?.[1] ?? null, + descriptionKey: + meta.match( + /]*>\s*\{\{\s*'(SETTINGS\.[A-Z0-9_]+)'/ + )?.[1] ?? null, + }); + }); + } + return rows; +} + +function translationExists(key: string): boolean { + return ( + typeof key + .split('.') + .reduce( + (node, part) => + node && typeof node === 'object' + ? (node as Record)[part] + : undefined, + EN + ) === 'string' + ); +} + +describe('settings search registry', () => { + const rows = readTemplateRows(); + const titledRows = rows.filter((row) => row.labelKey !== null); + const byId = new Map(SETTINGS_SEARCH_ENTRIES.map((e) => [e.id, e])); + + it('finds the settings rows in the section templates', () => { + expect(titledRows.length).toBeGreaterThan(40); + }); + + it('anchors every titled settings row with a registered id', () => { + const missing = titledRows + .filter((row) => !row.id || !byId.has(row.id)) + .map((row) => `${row.file}: ${row.labelKey}`); + + expect(missing).toEqual([]); + }); + + it('registers every anchored row exactly once', () => { + const templateIds = rows.flatMap((row) => (row.id ? [row.id] : [])); + + expect(new Set(templateIds).size).toBe(templateIds.length); + expect(templateIds.slice().sort()).toEqual( + SETTINGS_SEARCH_ENTRIES.map((entry) => entry.id).sort() + ); + }); + + it('indexes the same title and description the row renders', () => { + const mismatches = titledRows.flatMap((row) => { + const entry = row.id ? byId.get(row.id) : undefined; + if (!entry) { + return []; + } + const problems: string[] = []; + if (entry.labelKey !== row.labelKey) { + problems.push(`${row.id}: label ${row.labelKey}`); + } + if (entry.descriptionKey !== (row.descriptionKey ?? undefined)) { + problems.push(`${row.id}: description ${row.descriptionKey}`); + } + if (!row.file.includes(`settings-${entry.section}-section`)) { + problems.push(`${row.id}: rendered in ${row.file}`); + } + return problems; + }); + + expect(mismatches).toEqual([]); + }); + + it('uses translation keys that exist in English', () => { + const missing = SETTINGS_SEARCH_ENTRIES.flatMap((entry) => + [entry.labelKey, entry.descriptionKey].filter( + (key): key is string => !!key && !translationExists(key) + ) + ); + + expect(missing).toEqual([]); + }); +}); diff --git a/apps/web/src/app/settings/settings-search-results.component.html b/apps/web/src/app/settings/settings-search-results.component.html new file mode 100644 index 000000000..d1290af20 --- /dev/null +++ b/apps/web/src/app/settings/settings-search-results.component.html @@ -0,0 +1,62 @@ +
+
+
+

+ {{ 'SETTINGS.SEARCH_RESULTS_TITLE' | translate }} +

+

+ {{ + 'SETTINGS.SEARCH_RESULTS_COUNT' + | translate: { count: results().length, query: query() } + }} +

+
+
+ + @if (results().length > 0) { +
    + @for (result of results(); track result.entry.id) { +
  • + +
  • + } +
+ } @else { +
+ search_off +

{{ 'SETTINGS.SEARCH_EMPTY_HINT' | translate }}

+
+ } +
diff --git a/apps/web/src/app/settings/settings-search-results.component.scss b/apps/web/src/app/settings/settings-search-results.component.scss new file mode 100644 index 000000000..7e5f8ebd7 --- /dev/null +++ b/apps/web/src/app/settings/settings-search-results.component.scss @@ -0,0 +1,121 @@ +:host { + display: block; +} + +.settings-search-results__list { + list-style: none; + margin: 0; + padding: 0; +} + +.settings-search-result { + display: flex; + align-items: center; + gap: 14px; + width: 100%; + min-height: 56px; + padding: 12px 10px; + border: 0; + border-top: 1px solid var(--settings-item-border); + border-radius: 0; + background: transparent; + color: inherit; + font: inherit; + text-align: left; + cursor: pointer; + + &:hover { + background: var(--app-hover-overlay); + } + + &:focus-visible { + outline: 2px solid var(--app-selection-color); + outline-offset: -2px; + border-radius: 8px; + } +} + +li:first-child .settings-search-result { + border-top: 0; +} + +.settings-search-result__icon, +.settings-search-result__chevron { + flex-shrink: 0; + color: var(--settings-muted); +} + +.settings-search-result__text { + display: flex; + flex: 1 1 auto; + flex-direction: column; + gap: 3px; + min-width: 0; +} + +.settings-search-result__label { + font-size: 0.95rem; + font-weight: 650; + letter-spacing: -0.01em; + color: var(--app-heading-color); +} + +.settings-search-result__description { + overflow: hidden; + color: var(--settings-muted); + font-size: 0.84rem; + line-height: 1.45; + text-overflow: ellipsis; + white-space: nowrap; +} + +.settings-search-result__section { + flex-shrink: 0; + padding: 2px 10px; + border: 1px solid var(--settings-item-border); + border-radius: 999px; + color: var(--settings-muted); + font-size: 0.78rem; + white-space: nowrap; +} + +.settings-search-empty { + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; + padding: 40px 16px; + color: var(--settings-muted); + text-align: center; + + mat-icon { + width: 32px; + height: 32px; + font-size: 32px; + } + + p { + margin: 0; + max-width: 420px; + line-height: 1.45; + } +} + +@media (max-width: 640px) { + .settings-search-result { + flex-wrap: wrap; + padding: 12px 14px; + } + + .settings-search-result__description { + white-space: normal; + } + + .settings-search-result__section { + margin-left: 38px; + } + + .settings-search-result__chevron { + display: none; + } +} diff --git a/apps/web/src/app/settings/settings-search-results.component.ts b/apps/web/src/app/settings/settings-search-results.component.ts new file mode 100644 index 000000000..3bb002d23 --- /dev/null +++ b/apps/web/src/app/settings/settings-search-results.component.ts @@ -0,0 +1,30 @@ +import { + ChangeDetectionStrategy, + Component, + input, + output, +} from '@angular/core'; +import { MatIconModule } from '@angular/material/icon'; +import { TranslatePipe } from '@ngx-translate/core'; +import { + SettingsSearchEntry, + SettingsSearchResult, +} from '@iptvnator/workspace/shell/util/settings-search'; + +/** + * Ranked settings matches for the header search term, shown in place of the + * section page while a term is active. Best match first — the same row the + * Enter key in the header search opens. + */ +@Component({ + selector: 'app-settings-search-results', + imports: [MatIconModule, TranslatePipe], + templateUrl: './settings-search-results.component.html', + styleUrl: './settings-search-results.component.scss', + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class SettingsSearchResultsComponent { + readonly query = input.required(); + readonly results = input.required(); + readonly selected = output(); +} diff --git a/apps/web/src/app/settings/settings-search.facade.ts b/apps/web/src/app/settings/settings-search.facade.ts new file mode 100644 index 000000000..5d8c2ce55 --- /dev/null +++ b/apps/web/src/app/settings/settings-search.facade.ts @@ -0,0 +1,178 @@ +import { + afterNextRender, + computed, + DestroyRef, + effect, + ElementRef, + inject, + Injectable, + Injector, + Signal, +} from '@angular/core'; +import { toSignal } from '@angular/core/rxjs-interop'; +import { ActivatedRoute } from '@angular/router'; +import { TranslateService } from '@ngx-translate/core'; +import { SettingsContextService } from '@iptvnator/workspace/shell/util'; +import { + SettingsRevealRequest, + SettingsSearchEntry, + SettingsSearchService, +} from '@iptvnator/workspace/shell/util/settings-search'; +import { map, startWith } from 'rxjs'; + +/** How long a revealed row keeps its highlight. */ +export const SETTINGS_REVEAL_HIGHLIGHT_MS = 2400; +export const SETTINGS_REVEALED_CLASS = 'setting-item--revealed'; + +export interface SettingsRevealBinding { + /** Section page currently rendered. */ + readonly activeSection: Signal; + /** True once the form is hydrated, so form-dependent rows exist. */ + readonly ready: Signal; +} + +/** + * Settings page side of settings search. The header search writes the term + * to the `q` query param (shell-owned); this facade turns it into ranked + * results, publishes per-section match counts to the settings navigation, + * and scrolls to and highlights a row that search or the command palette + * asked `SettingsSearchService` to reveal. + */ +@Injectable() +export class SettingsSearchFacade { + private readonly route = inject(ActivatedRoute); + private readonly settingsSearch = inject(SettingsSearchService); + private readonly settingsCtx = inject(SettingsContextService); + private readonly translate = inject(TranslateService); + private readonly host = inject(ElementRef); + private readonly injector = inject(Injector); + private highlightTimeoutId: ReturnType | null = null; + + private readonly languageTick = toSignal( + this.translate.onLangChange.pipe(startWith(null)), + { initialValue: null } + ); + + readonly query = toSignal( + this.route.queryParamMap.pipe( + map((params) => (params.get('q') ?? '').trim()) + ), + { initialValue: '' } + ); + readonly isSearching = computed(() => this.query().length > 0); + readonly results = computed(() => { + this.languageTick(); + return this.settingsSearch.search(this.query()); + }); + + constructor() { + void this.settingsSearch.ensureEmbeddedMpvSupportLoaded(); + + effect(() => { + if (!this.isSearching()) { + this.settingsCtx.setMatchCounts(null); + return; + } + + const counts: Record = {}; + for (const { entry } of this.results()) { + counts[entry.section] = (counts[entry.section] ?? 0) + 1; + } + this.settingsCtx.setMatchCounts(counts); + }); + + inject(DestroyRef).onDestroy(() => { + this.settingsCtx.setMatchCounts(null); + this.clearHighlightTimer(); + }); + } + + select(entry: SettingsSearchEntry): void { + this.settingsSearch.reveal(entry); + } + + /** Starts handling reveal requests once the page can render them. */ + bindReveal({ activeSection, ready }: SettingsRevealBinding): void { + effect( + () => { + const request = this.settingsSearch.pendingReveal(); + if ( + !request || + !ready() || + this.isSearching() || + activeSection() !== request.section + ) { + return; + } + + afterNextRender(() => this.revealRow(request), { + injector: this.injector, + }); + }, + { injector: this.injector } + ); + } + + private revealRow(request: SettingsRevealRequest): void { + // A request superseded before this render is handled by its successor. + if (this.settingsSearch.pendingReveal()?.nonce !== request.nonce) { + return; + } + this.settingsSearch.completeReveal(request); + + const row = + this.findRow(request.id) ?? + (request.fallbackId ? this.findRow(request.fallbackId) : null); + if (!row) { + return; + } + + this.clearHighlight(); + row.scrollIntoView({ + block: 'center', + behavior: prefersReducedMotion() ? 'auto' : 'smooth', + }); + // Moving focus to the row lets keyboard and screen-reader users + // continue from the setting they searched for; Tab reaches its + // control next. + if (!row.hasAttribute('tabindex')) { + row.setAttribute('tabindex', '-1'); + } + row.focus({ preventScroll: true }); + row.classList.add(SETTINGS_REVEALED_CLASS); + this.highlightTimeoutId = setTimeout( + () => this.clearHighlight(), + SETTINGS_REVEAL_HIGHLIGHT_MS + ); + } + + /** `id` comes from the static registry (`[a-z0-9-]`), never from input. */ + private findRow(id: string): HTMLElement | null { + return (this.host.nativeElement as HTMLElement).querySelector( + `[data-setting-id="${id}"]` + ); + } + + private clearHighlight(): void { + this.clearHighlightTimer(); + (this.host.nativeElement as HTMLElement) + .querySelectorAll(`.${SETTINGS_REVEALED_CLASS}`) + .forEach((element) => + element.classList.remove(SETTINGS_REVEALED_CLASS) + ); + } + + private clearHighlightTimer(): void { + if (this.highlightTimeoutId !== null) { + clearTimeout(this.highlightTimeoutId); + this.highlightTimeoutId = null; + } + } +} + +function prefersReducedMotion(): boolean { + return ( + typeof window.matchMedia === 'function' && + window.matchMedia('(prefers-reduced-motion: reduce)').matches + ); +} diff --git a/apps/web/src/app/settings/settings-tmdb-section.component.html b/apps/web/src/app/settings/settings-tmdb-section.component.html index c273acb47..fbb63aca5 100644 --- a/apps/web/src/app/settings/settings-tmdb-section.component.html +++ b/apps/web/src/app/settings/settings-tmdb-section.component.html @@ -10,7 +10,7 @@
-
+

{{ 'SETTINGS.TMDB_ENABLE' | translate }}

{{ 'SETTINGS.TMDB_ENABLE_DESCRIPTION' | translate }}

@@ -24,7 +24,7 @@
@if (form().value.tmdb?.enabled === true) { -
+

{{ 'SETTINGS.TMDB_API_KEY' | translate }}

{{ 'SETTINGS.TMDB_API_KEY_DESCRIPTION' | translate }}

@@ -96,7 +96,10 @@ @if (form().value.tmdb?.enabled === true) { @if (m3uVodDetailsControl; as m3uVodDetails) { -
+

{{ 'SETTINGS.TMDB_M3U_VOD_DETAILS' | translate }} @@ -118,7 +121,7 @@ } } -
+

{{ 'SETTINGS.TMDB_CACHE' | translate }}

diff --git a/apps/web/src/app/settings/settings.component.html b/apps/web/src/app/settings/settings.component.html index a7a876065..19ab3fd33 100644 --- a/apps/web/src/app/settings/settings.component.html +++ b/apps/web/src/app/settings/settings.component.html @@ -16,130 +16,154 @@ - @switch (activeSection()) { - @case ('playback') { - - } - @case ('epg') { - - } - @case ('dashboard') { - - } - @case ('remote-control') { - - } - @case ('tmdb') { - - } - @case ('parental') { - - } - @case ('backup') { - - } - @case ('reset') { - - } - @case ('about') { - - } - @default { - + + @if (search.isSearching()) { + + } @else { + @switch (activeSection()) { + @case ('playback') { + + } + @case ('epg') { + + } + @case ('dashboard') { + + } + @case ('remote-control') { + + } + @case ('tmdb') { + + } + @case ('parental') { + + } + @case ('backup') { + + } + @case ('reset') { + + } + @case ('about') { + + } + @default { + + } } }

diff --git a/apps/web/src/app/settings/settings.component.scss b/apps/web/src/app/settings/settings.component.scss index 7e6190bbb..e02e8e917 100644 --- a/apps/web/src/app/settings/settings.component.scss +++ b/apps/web/src/app/settings/settings.component.scss @@ -114,6 +114,64 @@ margin-bottom: 0; } +// A row opened from settings search or the command palette. It receives +// programmatic focus (tabindex -1). Keyboard users keep a focus ring after +// the temporary highlight fades; pointer users rely on the highlight alone, +// as with any mouse-driven focus. The wash fills the row's own padding box +// and two offset shadows widen it past the flush-left row edges without +// shifting layout or painting over the separators above and below. +.setting-item[data-setting-id] { + scroll-margin: 96px 0 calc(96px + var(--settings-action-bar-space)); + + &:focus { + outline: none; + } + + &:focus-visible { + outline: 2px solid + color-mix(in srgb, var(--app-selection-color) 60%, transparent); + outline-offset: 6px; + border-radius: 4px; + } +} + +.setting-item--revealed { + --settings-reveal-wash: color-mix( + in srgb, + var(--app-selection-color) 12%, + transparent + ); + + background: var(--settings-reveal-wash); + box-shadow: + -12px 0 0 var(--settings-reveal-wash), + 12px 0 0 var(--settings-reveal-wash); + animation: settings-reveal-fade 2.4s ease-out forwards; +} + +@keyframes settings-reveal-fade { + 0%, + 60% { + background: var(--settings-reveal-wash); + box-shadow: + -12px 0 0 var(--settings-reveal-wash), + 12px 0 0 var(--settings-reveal-wash); + } + + 100% { + background: transparent; + box-shadow: + -12px 0 0 transparent, + 12px 0 0 transparent; + } +} + +@media (prefers-reduced-motion: reduce) { + .setting-item--revealed { + animation: none; + } +} + .setting-item__meta { h4 { margin: 0; diff --git a/apps/web/src/app/settings/settings.component.search.spec.ts b/apps/web/src/app/settings/settings.component.search.spec.ts new file mode 100644 index 000000000..197ffd3e4 --- /dev/null +++ b/apps/web/src/app/settings/settings.component.search.spec.ts @@ -0,0 +1,181 @@ +import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; +import { Router } from '@angular/router'; +import { SettingsContextService } from '@iptvnator/workspace/shell/util'; +import { + SETTINGS_SEARCH_ENTRIES, + SettingsSearchEntry, + SettingsSearchService, +} from '@iptvnator/workspace/shell/util/settings-search'; +import { SettingsComponent } from './settings.component'; +import { SETTINGS_REVEALED_CLASS } from './settings-search.facade'; +import { + configureSettingsComponentTestBed, + createElectronStub, + createEpgBridgeStub, + MockRouter, + setSettingsSearchQuery, + setSettingsSection, + stubSettingsSideEffects, +} from './test-stubs/settings-test-harness.stub'; + +function entry(id: string): SettingsSearchEntry { + const found = SETTINGS_SEARCH_ENTRIES.find((item) => item.id === id); + if (!found) { + throw new Error(`unknown settings entry ${id}`); + } + return found; +} + +/** + * Settings search on the page: the shell writes the header term to `q`, + * the page swaps the section for ranked results, and a chosen result (or a + * command palette pick) scrolls to and highlights the row. The labels are + * translation keys here (no translations are loaded), which the index + * searches like any other text. + */ +describe('SettingsComponent search', () => { + let fixture: ComponentFixture; + let component: SettingsComponent; + let settingsSearch: SettingsSearchService; + let settingsCtx: SettingsContextService; + let scrollIntoView: jest.Mock; + const originalElectron = window.electron; + const originalScrollIntoView = Element.prototype.scrollIntoView; + + const element = (): HTMLElement => fixture.nativeElement as HTMLElement; + const query = (selector: string) => element().querySelector(selector); + + beforeEach(waitForAsync(() => { + configureSettingsComponentTestBed(createEpgBridgeStub()); + })); + + beforeEach(async () => { + window.electron = createElectronStub(); + scrollIntoView = jest.fn(); + Element.prototype.scrollIntoView = scrollIntoView; + + fixture = TestBed.createComponent(SettingsComponent); + component = fixture.componentInstance; + settingsSearch = TestBed.inject(SettingsSearchService); + settingsCtx = TestBed.inject(SettingsContextService); + stubSettingsSideEffects(component); + const loadSettings = jest.spyOn(component.form, 'loadSettings'); + fixture.detectChanges(); + await loadSettings.mock.results[0].value; + await fixture.whenStable(); + fixture.detectChanges(); + }); + + afterEach(() => { + jest.useRealTimers(); + window.electron = originalElectron; + Element.prototype.scrollIntoView = originalScrollIntoView; + }); + + it('replaces the section page with ranked results while searching', () => { + expect(query('app-settings-general-section')).not.toBeNull(); + + setSettingsSearchQuery('theme'); + fixture.detectChanges(); + + expect(query('app-settings-general-section')).toBeNull(); + expect( + query('[data-test-id="settings-search-result-theme"]') + ).not.toBeNull(); + expect( + query('[data-test-id="settings-search-summary"]')?.getAttribute( + 'aria-live' + ) + ).toBe('polite'); + + setSettingsSearchQuery(''); + fixture.detectChanges(); + + expect(query('[data-test-id="settings-search-results"]')).toBeNull(); + expect(query('app-settings-general-section')).not.toBeNull(); + }); + + it('shows an empty state when nothing matches', () => { + setSettingsSearchQuery('zzzz-no-such-setting'); + fixture.detectChanges(); + + expect(query('[data-test-id="settings-search-empty"]')).not.toBeNull(); + expect(query('.settings-search-result')).toBeNull(); + }); + + it('publishes match counts per section for the navigation', () => { + setSettingsSearchQuery('dark'); + fixture.detectChanges(); + + expect(settingsCtx.matchCounts()).toEqual( + expect.objectContaining({ general: 1 }) + ); + + setSettingsSearchQuery(''); + fixture.detectChanges(); + expect(settingsCtx.matchCounts()).toBeNull(); + }); + + it('reveals the chosen result through the settings search service', () => { + const reveal = jest.spyOn(settingsSearch, 'reveal'); + setSettingsSearchQuery('theme'); + fixture.detectChanges(); + + ( + query( + '[data-test-id="settings-search-result-theme"]' + ) as HTMLButtonElement + ).click(); + + expect(reveal).toHaveBeenCalledWith(entry('theme')); + expect( + (TestBed.inject(Router) as unknown as MockRouter).navigate + ).toHaveBeenCalledWith(['/workspace/settings', 'general']); + }); + + it('scrolls to, focuses and briefly highlights a revealed row', () => { + jest.useFakeTimers(); + + settingsSearch.reveal(entry('show-captions')); + fixture.detectChanges(); + + const row = query('[data-setting-id="show-captions"]') as HTMLElement; + expect(scrollIntoView).toHaveBeenCalled(); + expect(scrollIntoView.mock.contexts[0]).toBe(row); + expect(row.classList).toContain(SETTINGS_REVEALED_CLASS); + expect(document.activeElement).toBe(row); + expect(settingsSearch.pendingReveal()).toBeNull(); + + jest.runOnlyPendingTimers(); + expect(row.classList).not.toContain(SETTINGS_REVEALED_CLASS); + }); + + it('waits for the section page before revealing a row on it', () => { + settingsSearch.reveal(entry('epg-offset')); + fixture.detectChanges(); + + expect(scrollIntoView).not.toHaveBeenCalled(); + expect(settingsSearch.pendingReveal()?.id).toBe('epg-offset'); + + setSettingsSection('epg'); + fixture.detectChanges(); + + expect(query('[data-setting-id="epg-offset"]')?.classList).toContain( + SETTINGS_REVEALED_CLASS + ); + }); + + it('falls back to the controlling row when the searched row is hidden', () => { + // The API key row only renders while TMDB is enabled. + setSettingsSection('tmdb'); + fixture.detectChanges(); + expect(query('[data-setting-id="tmdb-api-key"]')).toBeNull(); + + settingsSearch.reveal(entry('tmdb-api-key')); + fixture.detectChanges(); + + expect(query('[data-setting-id="tmdb-enable"]')?.classList).toContain( + SETTINGS_REVEALED_CLASS + ); + }); +}); diff --git a/apps/web/src/app/settings/settings.component.ts b/apps/web/src/app/settings/settings.component.ts index 5c733af10..afeeaba60 100644 --- a/apps/web/src/app/settings/settings.component.ts +++ b/apps/web/src/app/settings/settings.component.ts @@ -6,6 +6,7 @@ import { inject, OnDestroy, OnInit, + signal, ViewEncapsulation, ChangeDetectionStrategy, } from '@angular/core'; @@ -46,11 +47,13 @@ import { SETTINGS_THEME_OPTIONS, } from './settings-options'; import { SettingsParentalLockFacade } from './settings-parental-lock.facade'; -import { SettingsParentalLockSectionComponent } from './settings-parental-lock-section.component'; +import { SettingsParentalLockSectionComponent } from './settings-parental-section.component'; import { SettingsPlaybackSectionComponent } from './settings-playback-section.component'; import { SettingsRemoteControlFacade } from './settings-remote-control.facade'; import { SettingsRemoteControlSectionComponent } from './settings-remote-control-section.component'; import { SettingsResetSectionComponent } from './settings-reset-section.component'; +import { SettingsSearchFacade } from './settings-search.facade'; +import { SettingsSearchResultsComponent } from './settings-search-results.component'; import { SettingsTmdbSectionComponent } from './settings-tmdb-section.component'; import { SettingsUnsavedChangesChoice, @@ -96,6 +99,7 @@ export const SETTINGS_DEFAULT_SECTION = 'general'; SettingsPlaybackSectionComponent, SettingsRemoteControlSectionComponent, SettingsResetSectionComponent, + SettingsSearchResultsComponent, SettingsTmdbSectionComponent, ], // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection -- Preserve pre-Angular 22 eager checking during the framework upgrade. @@ -109,6 +113,7 @@ export const SETTINGS_DEFAULT_SECTION = 'general'; SettingsParentalLockFacade, SettingsPlaylistResetFacade, SettingsRemoteControlFacade, + SettingsSearchFacade, SettingsSnackbarService, SettingsUnloadGuardService, ], @@ -124,6 +129,7 @@ export class SettingsComponent readonly parentalLock = inject(SettingsParentalLockFacade); readonly playlistReset = inject(SettingsPlaylistResetFacade); readonly remoteControl = inject(SettingsRemoteControlFacade); + readonly search = inject(SettingsSearchFacade); private readonly settingsCtx = inject(SettingsContextService); private readonly settingsSnackbar = inject(SettingsSnackbarService); @@ -160,6 +166,9 @@ export class SettingsComponent /** Settings form object */ readonly settingsForm = this.form.form; + /** Set once the form is hydrated, so form-dependent rows can render. */ + private readonly formReady = signal(false); + /** Player options */ readonly players = computed(() => buildSettingsPlayerOptions({ @@ -224,10 +233,16 @@ export class SettingsComponent // on purpose — this is navigation, not an animated transition. effect(() => { this.activeSection(); + this.search.isSearching(); this.hostElement.nativeElement .closest('main.workspace-content') ?.scrollTo({ top: 0 }); }); + + this.search.bindReveal({ + activeSection: this.activeSection, + ready: this.formReady.asReadonly(), + }); } /** @@ -246,6 +261,7 @@ export class SettingsComponent await this.form.loadSettings(); this.form.hydrateFromStore(); this.form.bindDashboardControlsEnabledState(); + this.formReady.set(true); void this.embeddedMpv.load(); this.appUpdate.checkAppVersion(); this.appUpdate.init(); diff --git a/apps/web/src/app/settings/test-stubs/settings-test-harness.stub.ts b/apps/web/src/app/settings/test-stubs/settings-test-harness.stub.ts index 4a2b516ef..7c7925187 100644 --- a/apps/web/src/app/settings/test-stubs/settings-test-harness.stub.ts +++ b/apps/web/src/app/settings/test-stubs/settings-test-harness.stub.ts @@ -146,19 +146,28 @@ export class MockRouter { } /** - * Stands in for the `:section` route param the settings page renders from. - * Specs switch section pages with `setSettingsSection` below. + * Stands in for the `:section` route param the settings page renders from + * and the shell-owned `q` search param. Specs switch section pages with + * `setSettingsSection` and search with `setSettingsSearchQuery` below. */ export class MockActivatedRoute { private readonly params = new BehaviorSubject( convertToParamMap({ section: 'general' }) ); + private readonly queryParams = new BehaviorSubject( + convertToParamMap({}) + ); readonly paramMap = this.params.asObservable(); + readonly queryParamMap = this.queryParams.asObservable(); setSection(section: string): void { this.params.next(convertToParamMap({ section })); } + + setQuery(query: string): void { + this.queryParams.next(convertToParamMap(query ? { q: query } : {})); + } } /** Routes the rendered settings page to the given section page. */ @@ -168,6 +177,13 @@ export function setSettingsSection(section: string): void { ).setSection(section); } +/** Sets the header search term (`q`) the settings page searches for. */ +export function setSettingsSearchQuery(query: string): void { + ( + TestBed.inject(ActivatedRoute) as unknown as MockActivatedRoute + ).setQuery(query); +} + export class MockSettingsStore { private _settings = signal(DEFAULT_SETTINGS); diff --git a/apps/web/src/assets/i18n/ar.json b/apps/web/src/assets/i18n/ar.json index 35d8f4088..4514539d0 100644 --- a/apps/web/src/assets/i18n/ar.json +++ b/apps/web/src/assets/i18n/ar.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "بعد تكرار فشل الاتصال، تُوقف طلبات Xtream وStalker الجديدة لمدة 30 ثانية. جرّب تعطيل هذا الخيار إذا كانت البوابة تصبح غير متاحة بشكل متقطع. يُطبّق بعد الحفظ دون إعادة التشغيل.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "سيُنفّذ كل طلب بشكل مستقل. قد يستغرق ظهور الخطأ وقتًا أطول عند عدم توفر الخادم.", "TITLE": "الإعدادات", + "SEARCH_RESULTS_TITLE": "نتائج البحث", + "SEARCH_RESULTS_COUNT": "الإعدادات المطابقة لـ «{{query}}»: {{count}}", + "SEARCH_EMPTY_HINT": "لا توجد إعدادات مطابقة. جرّب كلمة أخرى، مثل المشغل أو السمة أو EPG.", "GENERAL": "عام", "GENERAL_SUBTITLE": "تغيير تكوين التطبيق", "PLAYBACK": "التشغيل", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "إجراءات السياق", "SEARCH_LABEL": "بحث", "SEARCH_SOURCES_PLACEHOLDER": "البحث في المصادر (جميع قوائم التشغيل)...", + "SEARCH_SETTINGS_PLACEHOLDER": "البحث في الإعدادات...", "SEARCH_GLOBAL_PLACEHOLDER": "البحث في كل قوائم التشغيل...", "SEARCH_PLAYLIST_PLACEHOLDER": "البحث في قائمة التشغيل هذه...", "SEARCH_SECTION_PLACEHOLDER": "البحث في هذا القسم...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "لوحة الأوامر", "SUBTITLE": "إجراءات عامة وسياقية", - "SEARCH_PLACEHOLDER": "اكتب لتصفية الأوامر", + "SEARCH_PLACEHOLDER": "البحث في الأوامر والإعدادات", "SEARCH_LABEL": "تصفية الأوامر", "EMPTY": "لم يتم العثور على أوامر", "GROUP_GLOBAL": "الإجراءات العامة", "GROUP_PLAYLIST": "قائمة التشغيل هذه", "GROUP_VIEW": "العرض الحالي", "GROUP_SECTION": "هذا القسم", - "GROUP_RECENT": "المستخدمة مؤخرًا" + "GROUP_RECENT": "المستخدمة مؤخرًا", + "GROUP_SETTINGS": "الإعدادات" }, "SHORTCUTS": { "TITLE": "اختصارات لوحة المفاتيح", diff --git a/apps/web/src/assets/i18n/ary.json b/apps/web/src/assets/i18n/ary.json index ef0e13638..aebd003cf 100644 --- a/apps/web/src/assets/i18n/ary.json +++ b/apps/web/src/assets/i18n/ary.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "من بعد ما يفشل الاتصال عدة مرات، كيوقف طلبات Xtream وStalker الجديدة لمدة 30 ثانية. جرّب تطفي هاد الخيار إلا كانت البوابة كتقطع مرة مرة. كيتطبق من بعد الحفظ بلا إعادة التشغيل.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "كل طلب غادي يتنفذ بوحدو. إلا كان السيرفر ما متاحش، رسالة الخطأ تقدر تتأخر.", "TITLE": "الإعدادات", + "SEARCH_RESULTS_TITLE": "نتائج البحث", + "SEARCH_RESULTS_COUNT": "الإعدادات اللي كتطابق «{{query}}»: {{count}}", + "SEARCH_EMPTY_HINT": "ما كاين حتى إعداد مطابق. جرب كلمة أخرى، بحال المشغل ولا المظهر ولا EPG.", "GENERAL": "عام", "GENERAL_SUBTITLE": "بدل تكوين التطبيق", "PLAYBACK": "التشغيل", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "إجراءات القسم", "SEARCH_LABEL": "بحث", "SEARCH_SOURCES_PLACEHOLDER": "قلب على مصادر (جميع قوائم التشغيل)...", + "SEARCH_SETTINGS_PLACEHOLDER": "قلب فالإعدادات...", "SEARCH_GLOBAL_PLACEHOLDER": "قلب فكل لوائح التشغيل...", "SEARCH_PLAYLIST_PLACEHOLDER": "قلب في هاد قائمة التشغيل...", "SEARCH_SECTION_PLACEHOLDER": "قلب فهاد القسم...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "لوحة الأوامر", "SUBTITLE": "إجراءات عامة وسياقية", - "SEARCH_PLACEHOLDER": "كتب باش تفلتر الأوامر", + "SEARCH_PLACEHOLDER": "قلب على الأوامر والإعدادات", "SEARCH_LABEL": "فلتر الأوامر", "EMPTY": "ما تلقاتش حتى أمر", "GROUP_GLOBAL": "إجراءات عامة", "GROUP_PLAYLIST": "هاد قائمة التشغيل", "GROUP_VIEW": "العرض الحالي", "GROUP_SECTION": "هاد القسم", - "GROUP_RECENT": "مستعملة مؤخراً" + "GROUP_RECENT": "مستعملة مؤخراً", + "GROUP_SETTINGS": "الإعدادات" }, "SHORTCUTS": { "TITLE": "اختصارات الكلافيي", diff --git a/apps/web/src/assets/i18n/by.json b/apps/web/src/assets/i18n/by.json index 0e743de81..6956affeb 100644 --- a/apps/web/src/assets/i18n/by.json +++ b/apps/web/src/assets/i18n/by.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "Пасля паўторных памылак падключэння прыпыняць новыя запыты Xtream і Stalker на 30 секунд. Паспрабуйце выключыць, калі партал перыядычна становіцца недаступным. Ужываецца пасля захавання без перазапуску.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "Кожны запыт будзе выконвацца незалежна. Калі сервер недаступны, чаканне памылкі можа павялічыцца.", "TITLE": "Налады", + "SEARCH_RESULTS_TITLE": "Вынікі пошуку", + "SEARCH_RESULTS_COUNT": "Налады па запыце «{{query}}»: {{count}}", + "SEARCH_EMPTY_HINT": "Нічога не знойдзена. Паспрабуйце іншае слова, напрыклад «прайгравальнік», «тэма» ці «EPG».", "GENERAL": "Агульныя", "GENERAL_SUBTITLE": "Змяніце канфігурацыю праграмы", "PLAYBACK": "Прайграванне", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "Кантэкстныя дзеянні", "SEARCH_LABEL": "Пошук", "SEARCH_SOURCES_PLACEHOLDER": "Пошук крыніц (усе плэйлісты)...", + "SEARCH_SETTINGS_PLACEHOLDER": "Шукаць у наладах...", "SEARCH_GLOBAL_PLACEHOLDER": "Шукаць ва ўсіх плэйлістах...", "SEARCH_PLAYLIST_PLACEHOLDER": "Пошук у гэтым плэйлісце...", "SEARCH_SECTION_PLACEHOLDER": "Шукаць у гэтым раздзеле...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "Палітра каманд", "SUBTITLE": "Глабальныя і кантэкстныя дзеянні", - "SEARCH_PLACEHOLDER": "Увядзіце для фільтрацыі каманд", + "SEARCH_PLACEHOLDER": "Шукаць каманды і налады", "SEARCH_LABEL": "Фільтр каманд", "EMPTY": "Каманд не знойдзена", "GROUP_GLOBAL": "Глабальныя дзеянні", "GROUP_PLAYLIST": "Гэты плэйліст", "GROUP_VIEW": "Бягучы выгляд", "GROUP_SECTION": "Гэты раздзел", - "GROUP_RECENT": "Нядаўна выкарыстаныя" + "GROUP_RECENT": "Нядаўна выкарыстаныя", + "GROUP_SETTINGS": "Налады" }, "SHORTCUTS": { "TITLE": "Спалучэнні клавіш", diff --git a/apps/web/src/assets/i18n/de.json b/apps/web/src/assets/i18n/de.json index 33b864548..2fde7bcdc 100644 --- a/apps/web/src/assets/i18n/de.json +++ b/apps/web/src/assets/i18n/de.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "Nach wiederholten Verbindungsfehlern neue Xtream- und Stalker-Anfragen 30 Sekunden pausieren. Bei zeitweise nicht erreichbaren Portalen versuchsweise deaktivieren. Gilt nach dem Speichern ohne Neustart.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "Jede Anfrage wird unabhängig ausgeführt. Bei nicht erreichbaren Servern kann die Fehlermeldung länger dauern.", "TITLE": "Einstellungen", + "SEARCH_RESULTS_TITLE": "Suchergebnisse", + "SEARCH_RESULTS_COUNT": "Einstellungen zu „{{query}}“: {{count}}", + "SEARCH_EMPTY_HINT": "Keine passenden Einstellungen. Ein anderes Wort versuchen, etwa Player, Design oder EPG.", "GENERAL": "Allgemein", "GENERAL_SUBTITLE": "Allgemeine App-Einstellungen ändern", "PLAYBACK": "Wiedergabe", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "Abschnittsaktionen", "SEARCH_LABEL": "Suche", "SEARCH_SOURCES_PLACEHOLDER": "Quellen durchsuchen (alle Playlists)...", + "SEARCH_SETTINGS_PLACEHOLDER": "Einstellungen durchsuchen...", "SEARCH_GLOBAL_PLACEHOLDER": "Alle Wiedergabelisten durchsuchen...", "SEARCH_PLAYLIST_PLACEHOLDER": "In dieser Playlist suchen...", "SEARCH_SECTION_PLACEHOLDER": "In diesem Abschnitt suchen...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "Befehlspalette", "SUBTITLE": "Globale und kontextbezogene Aktionen", - "SEARCH_PLACEHOLDER": "Zum Filtern der Befehle tippen", + "SEARCH_PLACEHOLDER": "Befehle und Einstellungen durchsuchen", "SEARCH_LABEL": "Befehle filtern", "EMPTY": "Keine Befehle gefunden", "GROUP_GLOBAL": "Globale Aktionen", "GROUP_PLAYLIST": "Diese Playlist", "GROUP_VIEW": "Aktuelle Ansicht", "GROUP_SECTION": "Dieser Abschnitt", - "GROUP_RECENT": "Kürzlich verwendet" + "GROUP_RECENT": "Kürzlich verwendet", + "GROUP_SETTINGS": "Einstellungen" }, "SHORTCUTS": { "TITLE": "Tastenkürzel", diff --git a/apps/web/src/assets/i18n/el.json b/apps/web/src/assets/i18n/el.json index 2825af325..bd7a280ee 100644 --- a/apps/web/src/assets/i18n/el.json +++ b/apps/web/src/assets/i18n/el.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "Μετά από επανειλημμένα σφάλματα σύνδεσης, παύση νέων αιτημάτων Xtream και Stalker για 30 δευτερόλεπτα. Δοκιμάστε να το απενεργοποιήσετε αν μια πύλη είναι κατά διαστήματα μη διαθέσιμη. Ισχύει μετά την αποθήκευση, χωρίς επανεκκίνηση.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "Κάθε αίτημα εκτελείται ανεξάρτητα. Οι μη διαθέσιμοι διακομιστές μπορεί να αργούν περισσότερο να αναφέρουν σφάλμα.", "TITLE": "Ρυθμίσεις", + "SEARCH_RESULTS_TITLE": "Αποτελέσματα αναζήτησης", + "SEARCH_RESULTS_COUNT": "Ρυθμίσεις για «{{query}}»: {{count}}", + "SEARCH_EMPTY_HINT": "Δεν βρέθηκαν ρυθμίσεις. Δοκιμάστε άλλη λέξη, π.χ. αναπαραγωγή, θέμα ή EPG.", "GENERAL": "Γενικά", "GENERAL_SUBTITLE": "Αλλαγή της διαμόρφωσης της εφαρμογής", "PLAYBACK": "Αναπαραγωγή", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "Ενέργειες ενότητας", "SEARCH_LABEL": "Αναζήτηση", "SEARCH_SOURCES_PLACEHOLDER": "Αναζήτηση πηγών (όλες οι λίστες αναπαραγωγής)...", + "SEARCH_SETTINGS_PLACEHOLDER": "Αναζήτηση ρυθμίσεων...", "SEARCH_GLOBAL_PLACEHOLDER": "Αναζήτηση σε όλες τις λίστες...", "SEARCH_PLAYLIST_PLACEHOLDER": "Αναζήτηση σε αυτή τη λίστα αναπαραγωγής...", "SEARCH_SECTION_PLACEHOLDER": "Αναζήτηση σε αυτή την ενότητα...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "Παλέτα εντολών", "SUBTITLE": "Καθολικές και συμφραζόμενες ενέργειες", - "SEARCH_PLACEHOLDER": "Πληκτρολογήστε για φιλτράρισμα εντολών", + "SEARCH_PLACEHOLDER": "Αναζήτηση εντολών και ρυθμίσεων", "SEARCH_LABEL": "Φιλτράρισμα εντολών", "EMPTY": "Δεν βρέθηκαν εντολές", "GROUP_GLOBAL": "Καθολικές ενέργειες", "GROUP_PLAYLIST": "Αυτή η λίστα αναπαραγωγής", "GROUP_VIEW": "Τρέχουσα προβολή", "GROUP_SECTION": "Αυτή η ενότητα", - "GROUP_RECENT": "Πρόσφατα χρησιμοποιημένες" + "GROUP_RECENT": "Πρόσφατα χρησιμοποιημένες", + "GROUP_SETTINGS": "Ρυθμίσεις" }, "SHORTCUTS": { "TITLE": "Συντομεύσεις πληκτρολογίου", diff --git a/apps/web/src/assets/i18n/en.json b/apps/web/src/assets/i18n/en.json index 048380dc5..a9c69ed3a 100644 --- a/apps/web/src/assets/i18n/en.json +++ b/apps/web/src/assets/i18n/en.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "After repeated connection failures, pause new Xtream and Stalker requests for 30 seconds. Try disabling this if a portal becomes unavailable intermittently. Applies after saving, without restarting.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "Each request will run independently. Unavailable servers may take longer to report an error.", "TITLE": "Settings", + "SEARCH_RESULTS_TITLE": "Search results", + "SEARCH_RESULTS_COUNT": "Settings matching “{{query}}”: {{count}}", + "SEARCH_EMPTY_HINT": "No settings match. Try another word, such as player, theme or EPG.", "GENERAL": "General", "GENERAL_SUBTITLE": "Change the configuration of the application", "PLAYBACK": "Playback", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "Section actions", "SEARCH_LABEL": "Search", "SEARCH_SOURCES_PLACEHOLDER": "Search sources (all playlists)...", + "SEARCH_SETTINGS_PLACEHOLDER": "Search settings...", "SEARCH_GLOBAL_PLACEHOLDER": "Search all playlists...", "SEARCH_PLAYLIST_PLACEHOLDER": "Search in this playlist...", "SEARCH_SECTION_PLACEHOLDER": "Search in this section...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "Command palette", "SUBTITLE": "Global and contextual actions", - "SEARCH_PLACEHOLDER": "Type to filter commands", + "SEARCH_PLACEHOLDER": "Search commands and settings", "SEARCH_LABEL": "Filter commands", "EMPTY": "No commands found", "GROUP_GLOBAL": "Global actions", "GROUP_PLAYLIST": "This playlist", "GROUP_VIEW": "Current view", "GROUP_SECTION": "This section", - "GROUP_RECENT": "Recently used" + "GROUP_RECENT": "Recently used", + "GROUP_SETTINGS": "Settings" }, "SHORTCUTS": { "TITLE": "Keyboard shortcuts", diff --git a/apps/web/src/assets/i18n/es.json b/apps/web/src/assets/i18n/es.json index bf61af682..e1d9fa9a5 100644 --- a/apps/web/src/assets/i18n/es.json +++ b/apps/web/src/assets/i18n/es.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "Tras varios fallos de conexión, pausar las nuevas solicitudes de Xtream y Stalker durante 30 segundos. Prueba a desactivarlo si un portal deja de estar disponible de forma intermitente. Se aplica al guardar, sin reiniciar.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "Cada solicitud se ejecutará de forma independiente. Los servidores no disponibles pueden tardar más en mostrar un error.", "TITLE": "Ajustes", + "SEARCH_RESULTS_TITLE": "Resultados de búsqueda", + "SEARCH_RESULTS_COUNT": "Ajustes que coinciden con «{{query}}»: {{count}}", + "SEARCH_EMPTY_HINT": "Ningún ajuste coincide. Prueba con otra palabra, como reproductor, tema o EPG.", "GENERAL": "General", "GENERAL_SUBTITLE": "Cambia la configuracion general de la aplicacion", "PLAYBACK": "Reproduccion", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "Acciones de la sección", "SEARCH_LABEL": "Buscar", "SEARCH_SOURCES_PLACEHOLDER": "Buscar fuentes (todas las listas)…", + "SEARCH_SETTINGS_PLACEHOLDER": "Buscar en ajustes…", "SEARCH_GLOBAL_PLACEHOLDER": "Buscar en todas las listas...", "SEARCH_PLAYLIST_PLACEHOLDER": "Buscar en esta lista de reproducción…", "SEARCH_SECTION_PLACEHOLDER": "Buscar en esta sección...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "Paleta de comandos", "SUBTITLE": "Acciones globales y contextuales", - "SEARCH_PLACEHOLDER": "Escribe para filtrar comandos", + "SEARCH_PLACEHOLDER": "Buscar comandos y ajustes", "SEARCH_LABEL": "Filtrar comandos", "EMPTY": "No se encontraron comandos", "GROUP_GLOBAL": "Acciones globales", "GROUP_PLAYLIST": "Esta lista de reproducción", "GROUP_VIEW": "Vista actual", "GROUP_SECTION": "Esta sección", - "GROUP_RECENT": "Usados recientemente" + "GROUP_RECENT": "Usados recientemente", + "GROUP_SETTINGS": "Ajustes" }, "SHORTCUTS": { "TITLE": "Atajos de teclado", diff --git a/apps/web/src/assets/i18n/fr.json b/apps/web/src/assets/i18n/fr.json index 156ff7303..e62de7adb 100644 --- a/apps/web/src/assets/i18n/fr.json +++ b/apps/web/src/assets/i18n/fr.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "Après plusieurs échecs de connexion, suspendre les nouvelles requêtes Xtream et Stalker pendant 30 secondes. Essayez de désactiver cette option si un portail devient indisponible par intermittence. Prend effet après enregistrement, sans redémarrage.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "Chaque requête sera exécutée indépendamment. Les serveurs indisponibles peuvent mettre plus de temps à signaler une erreur.", "TITLE": "Paramètres", + "SEARCH_RESULTS_TITLE": "Résultats de la recherche", + "SEARCH_RESULTS_COUNT": "Paramètres correspondant à « {{query}} » : {{count}}", + "SEARCH_EMPTY_HINT": "Aucun paramètre ne correspond. Essayez un autre mot, par exemple lecteur, thème ou EPG.", "GENERAL": "Général", "GENERAL_SUBTITLE": "Modifier la configuration de l'application", "PLAYBACK": "Lecture", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "Actions de la section", "SEARCH_LABEL": "Rechercher", "SEARCH_SOURCES_PLACEHOLDER": "Rechercher des sources (toutes les listes)…", + "SEARCH_SETTINGS_PLACEHOLDER": "Rechercher dans les paramètres…", "SEARCH_GLOBAL_PLACEHOLDER": "Rechercher dans toutes les playlists...", "SEARCH_PLAYLIST_PLACEHOLDER": "Rechercher dans cette liste de lecture…", "SEARCH_SECTION_PLACEHOLDER": "Rechercher dans cette section...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "Palette de commandes", "SUBTITLE": "Actions globales et contextuelles", - "SEARCH_PLACEHOLDER": "Saisir pour filtrer les commandes", + "SEARCH_PLACEHOLDER": "Rechercher des commandes et des paramètres", "SEARCH_LABEL": "Filtrer les commandes", "EMPTY": "Aucune commande trouvée", "GROUP_GLOBAL": "Actions globales", "GROUP_PLAYLIST": "Cette liste de lecture", "GROUP_VIEW": "Vue actuelle", "GROUP_SECTION": "Cette section", - "GROUP_RECENT": "Récemment utilisées" + "GROUP_RECENT": "Récemment utilisées", + "GROUP_SETTINGS": "Paramètres" }, "SHORTCUTS": { "TITLE": "Raccourcis clavier", diff --git a/apps/web/src/assets/i18n/hu.json b/apps/web/src/assets/i18n/hu.json index 47062710c..792e33eb4 100644 --- a/apps/web/src/assets/i18n/hu.json +++ b/apps/web/src/assets/i18n/hu.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "Ismételt kapcsolódási hibák után az új Xtream- és Stalker-kérések szüneteltetése 30 másodpercre. Ha egy portál időnként elérhetetlenné válik, próbálja kikapcsolni. Mentés után, újraindítás nélkül érvényesül.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "Minden kérés önállóan fut. Elérhetetlen szervereknél a hiba megjelenése tovább tarthat.", "TITLE": "Beállítások", + "SEARCH_RESULTS_TITLE": "Keresési találatok", + "SEARCH_RESULTS_COUNT": "„{{query}}” kifejezésre illeszkedő beállítások: {{count}}", + "SEARCH_EMPTY_HINT": "Nincs illeszkedő beállítás. Próbáljon másik szót, például lejátszó, téma vagy EPG.", "GENERAL": "Általános", "GENERAL_SUBTITLE": "Az alkalmazás beállításainak módosítása", "PLAYBACK": "Lejátszás", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "Szakaszműveletek", "SEARCH_LABEL": "Keresés", "SEARCH_SOURCES_PLACEHOLDER": "Keresés a források között (összes lejátszási lista)…", + "SEARCH_SETTINGS_PLACEHOLDER": "Keresés a beállításokban…", "SEARCH_GLOBAL_PLACEHOLDER": "Keresés az összes lejátszási listában…", "SEARCH_PLAYLIST_PLACEHOLDER": "Keresés ebben a lejátszási listában…", "SEARCH_SECTION_PLACEHOLDER": "Keresés ebben a szakaszban…", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "Parancspaletta", "SUBTITLE": "Globális és környezetfüggő műveletek", - "SEARCH_PLACEHOLDER": "A parancsok szűréséhez kezdjen gépelni", + "SEARCH_PLACEHOLDER": "Parancsok és beállítások keresése", "SEARCH_LABEL": "Parancsok szűrése", "EMPTY": "Nincs találat a parancsok között", "GROUP_GLOBAL": "Globális műveletek", "GROUP_PLAYLIST": "Ez a lejátszási lista", "GROUP_VIEW": "Aktuális nézet", "GROUP_SECTION": "Aktuális szakasz", - "GROUP_RECENT": "Legutóbb használt" + "GROUP_RECENT": "Legutóbb használt", + "GROUP_SETTINGS": "Beállítások" }, "SHORTCUTS": { "TITLE": "Billentyűparancsok", diff --git a/apps/web/src/assets/i18n/it.json b/apps/web/src/assets/i18n/it.json index 1cc0dc94c..ce173034f 100644 --- a/apps/web/src/assets/i18n/it.json +++ b/apps/web/src/assets/i18n/it.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "Dopo ripetuti errori di connessione, sospendi le nuove richieste Xtream e Stalker per 30 secondi. Prova a disattivare se un portale diventa intermittentemente non disponibile. Si applica al salvataggio, senza riavvio.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "Ogni richiesta verrà eseguita indipendentemente. I server non disponibili potrebbero impiegare più tempo a segnalare un errore.", "TITLE": "Impostazioni IPTVnator", + "SEARCH_RESULTS_TITLE": "Risultati della ricerca", + "SEARCH_RESULTS_COUNT": "Impostazioni corrispondenti a “{{query}}”: {{count}}", + "SEARCH_EMPTY_HINT": "Nessuna impostazione corrisponde. Prova un'altra parola, ad esempio riproduttore, tema o EPG.", "GENERAL": "Generale", "GENERAL_SUBTITLE": "Modifica le impostazioni generali dell'applicazione", "PLAYBACK": "Riproduzione", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "Azioni sezione", "SEARCH_LABEL": "Cerca", "SEARCH_SOURCES_PLACEHOLDER": "Cerca sorgenti (tutte le playlist)...", + "SEARCH_SETTINGS_PLACEHOLDER": "Cerca nelle impostazioni...", "SEARCH_GLOBAL_PLACEHOLDER": "Cerca in tutte le playlist...", "SEARCH_PLAYLIST_PLACEHOLDER": "Cerca in questa playlist...", "SEARCH_SECTION_PLACEHOLDER": "Cerca in questa sezione...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "Tavolozza comandi", "SUBTITLE": "Azioni globali e contestuali", - "SEARCH_PLACEHOLDER": "Digita per filtrare i comandi", + "SEARCH_PLACEHOLDER": "Cerca comandi e impostazioni", "SEARCH_LABEL": "Filtra comandi", "EMPTY": "Nessun comando trovato", "GROUP_GLOBAL": "Azioni globali", "GROUP_PLAYLIST": "Questa playlist", "GROUP_VIEW": "Vista corrente", "GROUP_SECTION": "Questa sezione", - "GROUP_RECENT": "Usati di recente" + "GROUP_RECENT": "Usati di recente", + "GROUP_SETTINGS": "Impostazioni" }, "SHORTCUTS": { "TITLE": "Scorciatoie da tastiera", diff --git a/apps/web/src/assets/i18n/ja.json b/apps/web/src/assets/i18n/ja.json index 07a83653c..74d34ae6f 100644 --- a/apps/web/src/assets/i18n/ja.json +++ b/apps/web/src/assets/i18n/ja.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "接続エラーが繰り返された場合、新しい Xtream と Stalker のリクエストを30秒間停止します。ポータルが断続的に利用できなくなる場合は、無効にしてみてください。保存後、再起動せずに適用されます。", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "各リクエストは個別に実行されます。サーバーが利用できない場合、エラーの表示に時間がかかることがあります。", "TITLE": "設定", + "SEARCH_RESULTS_TITLE": "検索結果", + "SEARCH_RESULTS_COUNT": "「{{query}}」に一致する設定: {{count}}", + "SEARCH_EMPTY_HINT": "一致する設定がありません。「プレーヤー」「テーマ」「EPG」など別の言葉を試してください。", "GENERAL": "一般", "GENERAL_SUBTITLE": "アプリケーションの設定を変更", "PLAYBACK": "再生", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "コンテキスト操作", "SEARCH_LABEL": "検索", "SEARCH_SOURCES_PLACEHOLDER": "ソースを検索(すべてのプレイリスト)...", + "SEARCH_SETTINGS_PLACEHOLDER": "設定を検索...", "SEARCH_GLOBAL_PLACEHOLDER": "すべてのプレイリストを検索...", "SEARCH_PLAYLIST_PLACEHOLDER": "このプレイリスト内を検索...", "SEARCH_SECTION_PLACEHOLDER": "このセクション内を検索...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "コマンドパレット", "SUBTITLE": "グローバルおよびコンテキストアクション", - "SEARCH_PLACEHOLDER": "コマンドを絞り込むには入力", + "SEARCH_PLACEHOLDER": "コマンドと設定を検索", "SEARCH_LABEL": "コマンドを絞り込む", "EMPTY": "コマンドが見つかりません", "GROUP_GLOBAL": "グローバルアクション", "GROUP_PLAYLIST": "このプレイリスト", "GROUP_VIEW": "現在のビュー", "GROUP_SECTION": "現在のセクション", - "GROUP_RECENT": "最近使用" + "GROUP_RECENT": "最近使用", + "GROUP_SETTINGS": "設定" }, "SHORTCUTS": { "TITLE": "キーボードショートカット", diff --git a/apps/web/src/assets/i18n/ko.json b/apps/web/src/assets/i18n/ko.json index 36434beb2..72ce5ee18 100644 --- a/apps/web/src/assets/i18n/ko.json +++ b/apps/web/src/assets/i18n/ko.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "연결 오류가 반복되면 새 Xtream 및 Stalker 요청을 30초 동안 중지합니다. 포털을 간헐적으로 사용할 수 없다면 이 옵션을 꺼 보세요. 저장 후 재시작 없이 적용됩니다.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "각 요청이 독립적으로 실행됩니다. 서버를 사용할 수 없으면 오류가 표시되기까지 더 오래 걸릴 수 있습니다.", "TITLE": "설정", + "SEARCH_RESULTS_TITLE": "검색 결과", + "SEARCH_RESULTS_COUNT": "“{{query}}”와 일치하는 설정: {{count}}", + "SEARCH_EMPTY_HINT": "일치하는 설정이 없습니다. 플레이어, 테마, EPG 같은 다른 단어로 검색해 보세요.", "GENERAL": "일반", "GENERAL_SUBTITLE": "애플리케이션 구성을 변경합니다", "PLAYBACK": "재생", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "컨텍스트 작업", "SEARCH_LABEL": "검색", "SEARCH_SOURCES_PLACEHOLDER": "소스 검색 (모든 재생목록)...", + "SEARCH_SETTINGS_PLACEHOLDER": "설정 검색...", "SEARCH_GLOBAL_PLACEHOLDER": "모든 플레이리스트 검색...", "SEARCH_PLAYLIST_PLACEHOLDER": "이 재생목록에서 검색...", "SEARCH_SECTION_PLACEHOLDER": "이 섹션에서 검색...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "명령어 팔레트", "SUBTITLE": "전역 및 상황별 작업", - "SEARCH_PLACEHOLDER": "명령어를 필터링하려면 입력하세요", + "SEARCH_PLACEHOLDER": "명령어와 설정 검색", "SEARCH_LABEL": "명령어 필터", "EMPTY": "명령어를 찾을 수 없습니다", "GROUP_GLOBAL": "전역 작업", "GROUP_PLAYLIST": "이 재생목록", "GROUP_VIEW": "현재 화면", "GROUP_SECTION": "현재 섹션", - "GROUP_RECENT": "최근 사용" + "GROUP_RECENT": "최근 사용", + "GROUP_SETTINGS": "설정" }, "SHORTCUTS": { "TITLE": "키보드 단축키", diff --git a/apps/web/src/assets/i18n/nl.json b/apps/web/src/assets/i18n/nl.json index 573844467..ed51d72d8 100644 --- a/apps/web/src/assets/i18n/nl.json +++ b/apps/web/src/assets/i18n/nl.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "Pauzeer nieuwe Xtream- en Stalker-verzoeken 30 seconden na herhaalde verbindingsfouten. Probeer dit uit te schakelen als een portal af en toe onbereikbaar is. Geldt na opslaan, zonder herstart.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "Elk verzoek wordt onafhankelijk uitgevoerd. Bij onbereikbare servers kan een foutmelding langer duren.", "TITLE": "Instellingen", + "SEARCH_RESULTS_TITLE": "Zoekresultaten", + "SEARCH_RESULTS_COUNT": "Instellingen voor “{{query}}”: {{count}}", + "SEARCH_EMPTY_HINT": "Geen instellingen gevonden. Probeer een ander woord, zoals speler, thema of EPG.", "GENERAL": "Algemeen", "GENERAL_SUBTITLE": "Wijzig de configuratie van de applicatie", "PLAYBACK": "Afspelen", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "Sectieacties", "SEARCH_LABEL": "Zoeken", "SEARCH_SOURCES_PLACEHOLDER": "Zoek bronnen (alle afspeellijsten)...", + "SEARCH_SETTINGS_PLACEHOLDER": "Zoek in instellingen...", "SEARCH_GLOBAL_PLACEHOLDER": "Alle afspeellijsten doorzoeken...", "SEARCH_PLAYLIST_PLACEHOLDER": "Zoek in deze afspeellijst...", "SEARCH_SECTION_PLACEHOLDER": "Zoeken in deze sectie...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "Opdrachtenpalet", "SUBTITLE": "Algemene en contextuele acties", - "SEARCH_PLACEHOLDER": "Typ om opdrachten te filteren", + "SEARCH_PLACEHOLDER": "Zoek opdrachten en instellingen", "SEARCH_LABEL": "Filter opdrachten", "EMPTY": "Geen opdrachten gevonden", "GROUP_GLOBAL": "Algemene acties", "GROUP_PLAYLIST": "Deze afspeellijst", "GROUP_VIEW": "Huidige weergave", "GROUP_SECTION": "Deze sectie", - "GROUP_RECENT": "Recent gebruikt" + "GROUP_RECENT": "Recent gebruikt", + "GROUP_SETTINGS": "Instellingen" }, "SHORTCUTS": { "TITLE": "Sneltoetsen", diff --git a/apps/web/src/assets/i18n/pl.json b/apps/web/src/assets/i18n/pl.json index 50cb40e0e..084c14c4a 100644 --- a/apps/web/src/assets/i18n/pl.json +++ b/apps/web/src/assets/i18n/pl.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "Po powtarzających się błędach połączenia wstrzymuj nowe żądania Xtream i Stalker na 30 sekund. Spróbuj wyłączyć, jeśli portal bywa niedostępny. Zmiana działa po zapisaniu, bez ponownego uruchomienia.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "Każde żądanie będzie wykonywane niezależnie. Niedostępne serwery mogą zgłaszać błąd z większym opóźnieniem.", "TITLE": "Ustawienia", + "SEARCH_RESULTS_TITLE": "Wyniki wyszukiwania", + "SEARCH_RESULTS_COUNT": "Ustawienia pasujące do „{{query}}”: {{count}}", + "SEARCH_EMPTY_HINT": "Brak pasujących ustawień. Spróbuj innego słowa, np. odtwarzacz, motyw lub EPG.", "GENERAL": "Ogólne", "GENERAL_SUBTITLE": "Zmień konfigurację aplikacji", "PLAYBACK": "Odtwarzanie", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "Akcje sekcji", "SEARCH_LABEL": "Szukaj", "SEARCH_SOURCES_PLACEHOLDER": "Szukaj źródeł (wszystkie listy odtwarzania)...", + "SEARCH_SETTINGS_PLACEHOLDER": "Szukaj w ustawieniach...", "SEARCH_GLOBAL_PLACEHOLDER": "Przeszukaj wszystkie listy odtwarzania...", "SEARCH_PLAYLIST_PLACEHOLDER": "Szukaj na tej liście odtwarzania...", "SEARCH_SECTION_PLACEHOLDER": "Szukaj w tej sekcji...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "Paleta poleceń", "SUBTITLE": "Akcje globalne i kontekstowe", - "SEARCH_PLACEHOLDER": "Wpisz, aby filtrować polecenia", + "SEARCH_PLACEHOLDER": "Szukaj poleceń i ustawień", "SEARCH_LABEL": "Filtruj polecenia", "EMPTY": "Nie znaleziono poleceń", "GROUP_GLOBAL": "Akcje globalne", "GROUP_PLAYLIST": "Ta lista odtwarzania", "GROUP_VIEW": "Bieżący widok", "GROUP_SECTION": "Ta sekcja", - "GROUP_RECENT": "Ostatnio używane" + "GROUP_RECENT": "Ostatnio używane", + "GROUP_SETTINGS": "Ustawienia" }, "SHORTCUTS": { "TITLE": "Skróty klawiaturowe", diff --git a/apps/web/src/assets/i18n/pt.json b/apps/web/src/assets/i18n/pt.json index b9af24bb1..f0c246995 100644 --- a/apps/web/src/assets/i18n/pt.json +++ b/apps/web/src/assets/i18n/pt.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "Após falhas repetidas de ligação, pausar novos pedidos Xtream e Stalker durante 30 segundos. Experimente desativar se um portal ficar indisponível de forma intermitente. Aplica-se ao guardar, sem reiniciar.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "Cada pedido será executado de forma independente. Os servidores indisponíveis podem demorar mais a indicar um erro.", "TITLE": "Configurações", + "SEARCH_RESULTS_TITLE": "Resultados da pesquisa", + "SEARCH_RESULTS_COUNT": "Configurações correspondentes a “{{query}}”: {{count}}", + "SEARCH_EMPTY_HINT": "Nenhuma configuração corresponde. Tente outra palavra, como reprodutor, tema ou EPG.", "GENERAL": "Geral", "GENERAL_SUBTITLE": "Altere a configuração do aplicativo", "PLAYBACK": "Reprodução", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "Ações de contexto", "SEARCH_LABEL": "Pesquisar", "SEARCH_SOURCES_PLACEHOLDER": "Pesquisar fontes (todas as playlists)...", + "SEARCH_SETTINGS_PLACEHOLDER": "Pesquisar nas configurações...", "SEARCH_GLOBAL_PLACEHOLDER": "Pesquisar todas as playlists...", "SEARCH_PLAYLIST_PLACEHOLDER": "Pesquisar nesta playlist...", "SEARCH_SECTION_PLACEHOLDER": "Pesquisar nesta seção...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "Paleta de comandos", "SUBTITLE": "Ações globais e contextuais", - "SEARCH_PLACEHOLDER": "Digite para filtrar comandos", + "SEARCH_PLACEHOLDER": "Pesquisar comandos e configurações", "SEARCH_LABEL": "Filtrar comandos", "EMPTY": "Nenhum comando encontrado", "GROUP_GLOBAL": "Ações globais", "GROUP_PLAYLIST": "Esta playlist", "GROUP_VIEW": "Visualização atual", "GROUP_SECTION": "Esta seção", - "GROUP_RECENT": "Usados recentemente" + "GROUP_RECENT": "Usados recentemente", + "GROUP_SETTINGS": "Configurações" }, "SHORTCUTS": { "TITLE": "Atalhos de teclado", diff --git a/apps/web/src/assets/i18n/ru.json b/apps/web/src/assets/i18n/ru.json index 05830c28e..4ea1b1456 100644 --- a/apps/web/src/assets/i18n/ru.json +++ b/apps/web/src/assets/i18n/ru.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "После повторных ошибок подключения приостанавливать новые запросы Xtream и Stalker на 30 секунд. Попробуйте отключить, если портал периодически становится недоступен. Применяется после сохранения без перезапуска.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "Каждый запрос будет выполняться независимо. Если сервер недоступен, ожидание ошибки может увеличиться.", "TITLE": "Настройки", + "SEARCH_RESULTS_TITLE": "Результаты поиска", + "SEARCH_RESULTS_COUNT": "Настройки по запросу «{{query}}»: {{count}}", + "SEARCH_EMPTY_HINT": "Ничего не найдено. Попробуйте другое слово, например «плеер», «тема» или «EPG».", "GENERAL": "Общие", "GENERAL_SUBTITLE": "Изменение основных параметров приложения", "PLAYBACK": "Воспроизведение", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "Действия раздела", "SEARCH_LABEL": "Поиск", "SEARCH_SOURCES_PLACEHOLDER": "Искать источники (все плейлисты)...", + "SEARCH_SETTINGS_PLACEHOLDER": "Искать в настройках...", "SEARCH_GLOBAL_PLACEHOLDER": "Искать во всех плейлистах...", "SEARCH_PLAYLIST_PLACEHOLDER": "Искать в этом плейлисте...", "SEARCH_SECTION_PLACEHOLDER": "Искать в этом разделе...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "Палитра команд", "SUBTITLE": "Глобальные и контекстные действия", - "SEARCH_PLACEHOLDER": "Введите текст для фильтрации команд", + "SEARCH_PLACEHOLDER": "Искать команды и настройки", "SEARCH_LABEL": "Фильтровать команды", "EMPTY": "Команды не найдены", "GROUP_GLOBAL": "Глобальные действия", "GROUP_PLAYLIST": "Этот плейлист", "GROUP_VIEW": "Текущее представление", "GROUP_SECTION": "Этот раздел", - "GROUP_RECENT": "Недавно использованные" + "GROUP_RECENT": "Недавно использованные", + "GROUP_SETTINGS": "Настройки" }, "SHORTCUTS": { "TITLE": "Сочетания клавиш", diff --git a/apps/web/src/assets/i18n/tr.json b/apps/web/src/assets/i18n/tr.json index 313bca312..aed2740a3 100644 --- a/apps/web/src/assets/i18n/tr.json +++ b/apps/web/src/assets/i18n/tr.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "Tekrarlanan bağlantı hatalarından sonra yeni Xtream ve Stalker isteklerini 30 saniye duraklatır. Portal zaman zaman kullanılamıyorsa kapatmayı deneyin. Kaydettikten sonra yeniden başlatmadan uygulanır.", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "Her istek bağımsız yürütülür. Kullanılamayan sunucularda hata bildirimi daha uzun sürebilir.", "TITLE": "Ayarlar", + "SEARCH_RESULTS_TITLE": "Arama sonuçları", + "SEARCH_RESULTS_COUNT": "“{{query}}” ile eşleşen ayarlar: {{count}}", + "SEARCH_EMPTY_HINT": "Eşleşen ayar yok. Oynatıcı, tema veya EPG gibi başka bir kelime deneyin.", "GENERAL": "Genel", "GENERAL_SUBTITLE": "Uygulamanın yapılandırmasını değiştirin", "PLAYBACK": "Oynatma", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "Bölüm eylemleri", "SEARCH_LABEL": "Ara", "SEARCH_SOURCES_PLACEHOLDER": "Kaynaklarda ara (tüm oynatma listeleri)...", + "SEARCH_SETTINGS_PLACEHOLDER": "Ayarlarda ara...", "SEARCH_GLOBAL_PLACEHOLDER": "Tüm oynatma listelerinde ara...", "SEARCH_PLAYLIST_PLACEHOLDER": "Bu oynatma listesinde ara...", "SEARCH_SECTION_PLACEHOLDER": "Bu bölümde ara...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "Komut paleti", "SUBTITLE": "Genel ve bağlamsal işlemler", - "SEARCH_PLACEHOLDER": "Komutları filtrelemek için yazın", + "SEARCH_PLACEHOLDER": "Komutlarda ve ayarlarda ara", "SEARCH_LABEL": "Komutları filtrele", "EMPTY": "Komut bulunamadı", "GROUP_GLOBAL": "Genel işlemler", "GROUP_PLAYLIST": "Bu oynatma listesi", "GROUP_VIEW": "Geçerli görünüm", "GROUP_SECTION": "Bu bölüm", - "GROUP_RECENT": "Son kullanılanlar" + "GROUP_RECENT": "Son kullanılanlar", + "GROUP_SETTINGS": "Ayarlar" }, "SHORTCUTS": { "TITLE": "Klavye kısayolları", diff --git a/apps/web/src/assets/i18n/zh.json b/apps/web/src/assets/i18n/zh.json index f57e882d0..51cdc5518 100644 --- a/apps/web/src/assets/i18n/zh.json +++ b/apps/web/src/assets/i18n/zh.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "连接连续失败后,暂停新的 Xtream 和 Stalker 请求 30 秒。如果门户间歇性不可用,请尝试关闭此选项。保存后生效,无需重启。", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "每个请求将独立执行。服务器不可用时,可能需要更长时间才能显示错误。", "TITLE": "设置", + "SEARCH_RESULTS_TITLE": "搜索结果", + "SEARCH_RESULTS_COUNT": "与“{{query}}”匹配的设置:{{count}}", + "SEARCH_EMPTY_HINT": "没有匹配的设置。试试其他词,例如“播放器”“主题”或“EPG”。", "GENERAL": "通用", "GENERAL_SUBTITLE": "更改应用程序的配置", "PLAYBACK": "播放", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "上下文操作", "SEARCH_LABEL": "搜索", "SEARCH_SOURCES_PLACEHOLDER": "搜索源(所有播放列表)…", + "SEARCH_SETTINGS_PLACEHOLDER": "搜索设置…", "SEARCH_GLOBAL_PLACEHOLDER": "搜索所有播放列表…", "SEARCH_PLAYLIST_PLACEHOLDER": "在此播放列表中搜索…", "SEARCH_SECTION_PLACEHOLDER": "在此区域中搜索…", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "命令面板", "SUBTITLE": "全局和上下文操作", - "SEARCH_PLACEHOLDER": "输入以筛选命令", + "SEARCH_PLACEHOLDER": "搜索命令和设置", "SEARCH_LABEL": "筛选命令", "EMPTY": "未找到命令", "GROUP_GLOBAL": "全局操作", "GROUP_PLAYLIST": "本播放列表", "GROUP_VIEW": "当前视图", "GROUP_SECTION": "当前区域", - "GROUP_RECENT": "最近使用" + "GROUP_RECENT": "最近使用", + "GROUP_SETTINGS": "设置" }, "SHORTCUTS": { "TITLE": "键盘快捷键", diff --git a/apps/web/src/assets/i18n/zhtw.json b/apps/web/src/assets/i18n/zhtw.json index b99a23e93..66b5135d4 100644 --- a/apps/web/src/assets/i18n/zhtw.json +++ b/apps/web/src/assets/i18n/zhtw.json @@ -264,6 +264,9 @@ "PORTAL_CONNECTIVITY_GUARD_DESCRIPTION": "連線連續失敗後,暫停新的 Xtream 和 Stalker 請求 30 秒。如果入口網站間歇性無法使用,請嘗試關閉此選項。儲存後生效,無需重新啟動。", "PORTAL_CONNECTIVITY_GUARD_DISABLED": "每個請求將獨立執行。伺服器無法使用時,可能需要更長時間才能顯示錯誤。", "TITLE": "設定", + "SEARCH_RESULTS_TITLE": "搜尋結果", + "SEARCH_RESULTS_COUNT": "符合「{{query}}」的設定:{{count}}", + "SEARCH_EMPTY_HINT": "沒有符合的設定。試試其他詞,例如「播放器」「主題」或「EPG」。", "GENERAL": "一般", "GENERAL_SUBTITLE": "更改應用程式的配置", "PLAYBACK": "播放", @@ -1594,6 +1597,7 @@ "RAIL_CONTEXT_ACTIONS": "區段操作", "SEARCH_LABEL": "搜尋", "SEARCH_SOURCES_PLACEHOLDER": "搜尋來源(所有播放清單)...", + "SEARCH_SETTINGS_PLACEHOLDER": "搜尋設定...", "SEARCH_GLOBAL_PLACEHOLDER": "搜尋所有播放清單…", "SEARCH_PLAYLIST_PLACEHOLDER": "在此播放清單中搜尋...", "SEARCH_SECTION_PLACEHOLDER": "在此區段中搜尋...", @@ -1751,14 +1755,15 @@ "COMMAND_PALETTE": { "TITLE": "命令選擇區", "SUBTITLE": "全域與情境化操作", - "SEARCH_PLACEHOLDER": "輸入以篩選命令", + "SEARCH_PLACEHOLDER": "搜尋命令和設定", "SEARCH_LABEL": "篩選命令", "EMPTY": "找不到命令", "GROUP_GLOBAL": "全域操作", "GROUP_PLAYLIST": "此播放清單", "GROUP_VIEW": "目前畫面", "GROUP_SECTION": "此區段", - "GROUP_RECENT": "最近使用" + "GROUP_RECENT": "最近使用", + "GROUP_SETTINGS": "設定" }, "SHORTCUTS": { "TITLE": "鍵盤快捷鍵", diff --git a/apps/web/tsconfig.spec.json b/apps/web/tsconfig.spec.json index fd45b3daa..35ee5ed11 100644 --- a/apps/web/tsconfig.spec.json +++ b/apps/web/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../dist/out-tsc", "module": "ESNext", "target": "ESNext", diff --git a/docs/architecture/nx-workspace-boundaries.md b/docs/architecture/nx-workspace-boundaries.md index 8d238199b..9ea588c11 100644 --- a/docs/architecture/nx-workspace-boundaries.md +++ b/docs/architecture/nx-workspace-boundaries.md @@ -232,6 +232,9 @@ sub-entrypoints are `@iptvnator/shared/interfaces/ipc-commands` and `@iptvnator/shared/interfaces` barrel pulls in `ngx-indexed-db`, which the preload bundle must not carry, so the preload only type-imports the barrel and value-imports those two dependency-free modules directly. +`@iptvnator/workspace/shell/util/settings-search` exists for the opposite +reason: the main `workspace-shell-util` barrel is imported eagerly, and the +settings search index must stay in the lazy settings and shell chunks. For a buildable library that has a local `package.json`, its `name` must match the scoped alias. Nx uses that package name when rewriting buildable dependency diff --git a/docs/architecture/parental-lock.md b/docs/architecture/parental-lock.md index 0d8019241..c448cb308 100644 --- a/docs/architecture/parental-lock.md +++ b/docs/architecture/parental-lock.md @@ -403,7 +403,7 @@ predicate is `ParentalLockService.is*Locked`. persisted lock set, its unreadable state and the SQLite re-stamp), `apps/web/src/app/services/parental-lock-prompt.service.ts`, `parental-lock-enforcement.service.ts`, - `apps/web/src/app/settings/settings-parental-lock*`, + `apps/web/src/app/settings/settings-parental-section.component.*` and `settings-parental-lock.facade.ts` (rows anchored and indexed for settings search), `libs/ui/components/src/lib/parental-lock-pin-dialog/`, `libs/portal/stalker/feature/src/lib/stalker-category-lock-dialog/`. - Electron: `apps/electron-backend/src/app/database/parental-lock-state.ts`, diff --git a/docs/architecture/validation-map.md b/docs/architecture/validation-map.md index 0e0e6e767..897561211 100644 --- a/docs/architecture/validation-map.md +++ b/docs/architecture/validation-map.md @@ -71,6 +71,39 @@ behavior. Tier A coverage is fail-closed. `coverage:unit:ci` relays Jest output but exits nonzero on a `Failed to collect coverage` marker, a missing or invalid project report, or a runtime-owning production TypeScript file absent from that report. +It runs projects a few at a time, largest first, with a bounded Jest worker +count per project (defaults: `min(3, cores - 1)` in flight and +`ceil(cores / concurrency)` workers each; override with `--concurrency=N`, +`--max-workers=N` or `TIER_A_CONCURRENCY` / `TIER_A_MAX_WORKERS`). Each +project's output is printed as one block when it finishes, and the run ends +with the wall-clock total and the longest projects. Spec `tsconfig`s set +`isolatedModules: true`, so ts-jest transpiles files one at a time instead of +type-checking each through a language service; spec type errors therefore do +not fail Jest (the web configs already ran with `diagnostics: false`), while +`isolatedModules`-incompatible syntax such as a type re-export without +`export type` still fails at load time. + +In CI, a pull request skips the Tier A suite (and the merged-coverage upload) +when every changed file is outside Tier A test inputs: +`tools/coverage/unit-coverage-scope.mjs` holds the allowlist (Markdown, `docs/`, +notes and plans, agent guidance, workflows other than `ci.yml` and +`build-and-make.yaml`, the website, E2E and mock-server apps, +release/packaging/skills/performance tooling, and a `package.json` edit +confined to non-`coverage:*` scripts). Anything else, including files no Nx +project owns such as `jest.preset.js` or `tsconfig.base.json`, and every +`{workspaceRoot}` input a Tier A test target declares, runs the full suite; +master pushes always run it. `nx affected` is deliberately not used for this +decision because a change to an unowned file affects no project. A node test +parses every Tier A source for string literals that point at repository files +outside the owning project (`tier-a-external-references.mjs`) and fails if the +allowlist would skip any of them, so a new cross-project read cannot be +silently exempted. +Jest's transform cache is kept in `JEST_CACHE_DIRECTORY` and persisted with +`actions/cache`: pull requests restore it, while only master pushes (starting +from an empty cache, so it holds exactly the current tree) and maintainer +dispatches save it. A shared Nx task cache is not used: Nx indexes its local +cache in a machine-specific database, so a restored cache folder is never hit, +and sharing it safely needs Nx Cloud or another supported remote cache. `coverage:merge` requires every configured Tier A report before replacing the merged output. Strict health validation also requires the merged Istanbul map itself to contain usable instrumentation for every runtime-owning Tier A file, @@ -135,8 +168,9 @@ After an E2E run, generate the semantic summary with: pnpm run coverage:e2e:summary ``` -CI runs the Electron suite as three Playwright shards per OS -(`--shard=/3`, split by spec file because the suite is sequential). Each +CI runs the Electron suite as Playwright shards (`--shard=/`, split +by spec file because the suite is sequential): three shards on Ubuntu and +Windows, two on macOS, whose runners are the scarcest and queued longest. Each shard uploads `playwright-report-electron--`; the follow-up `Electron E2E summary` job downloads the shards of each OS into their own directory and runs the summary per OS with `--input=` and diff --git a/docs/architecture/workspace-shell.md b/docs/architecture/workspace-shell.md index efb6add5c..d0116fd30 100644 --- a/docs/architecture/workspace-shell.md +++ b/docs/architecture/workspace-shell.md @@ -172,7 +172,8 @@ restarting playback; remote commands retain captured playback order. See the Search is shell-owned and route-aware: -1. Disabled on settings routes. +1. On settings routes, searches the settings themselves (see + [Settings search](#settings-search)). 2. Enabled on sources routes. 3. Enabled for `/workspace/search`, which is the Electron-only routed global-search view. `Ctrl/Cmd+F` in Electron opens this route and @@ -217,8 +218,10 @@ Rail navigation is also shell-owned: Command palette behavior is shell-owned but view-extensible: -1. The shell resolves commands into three groups in fixed order: current view, - this playlist, then global. +1. The shell resolves commands into groups in fixed order: current view, + this playlist, global, then settings. The settings group appears only for a + non-empty query and holds at most six settings matches (see + [Settings search](#settings-search)). 2. Shell-owned commands are derived from route context and current playlist state; empty groups are omitted instead of rendering disabled placeholders. 3. Workspace features contribute current-view commands through @@ -248,6 +251,51 @@ Command palette behavior is shell-owned but view-extensible: is disabled. The new player setting applies to the next playback session; an existing stream is not re-mounted. +### Settings search + +Settings rows are searchable from the header search on `/workspace/settings` +and from the command palette. Both use the same index and ranking. + +1. The index is `SETTINGS_SEARCH_ENTRIES` in + `libs/workspace/shell/util/src/lib/settings-search/`, published through the + `@iptvnator/workspace/shell/util/settings-search` sub-entrypoint. Eager + code imports the main shell util barrel, so the index stays out of it and + ships only in lazy chunks (the initial-bytes ratchet enforces this). +2. Each entry names its section, title and description translation keys, + untranslated synonyms (`keywords`), runtime `requires`, and an optional + `fallbackId`. Section definitions (`SETTINGS_SECTION_DEFINITIONS`) are the + single source for the settings navigation too. +3. Every titled `.setting-item` in the section templates carries + `data-setting-id`. `settings-search-registry.spec.ts` fails when a row, id, + title key or description key drifts from the index, so a new settings row + must be added to the index in the same change. +4. `SettingsSearchService.search()` matches the translated title and + description of the current language plus the keywords; every query token + must match (AND), and a label prefix outranks a word start, which outranks + an inner match. Rows whose `requires` the runtime lacks are never returned. + Embedded MPV rows depend on a lazy support probe + (`ensureEmbeddedMpvSupportLoaded()`), run when the settings page or the + command palette opens, never from shell bootstrap; frame copy also needs + `frameCopyAvailable`, matching the settings page gate. +5. Settings routes use `local-filter` search mode, so the term lives in `q`. + While `q` is set, the settings page shows ranked results in place of the + section page and the settings context panel shows per-section match + counts, muting sections without matches. The search box is shown on + settings even when no playlist exists. +6. Choosing a result, pressing `Enter` in the header search (best match), or + picking a settings command in the palette calls `reveal()`: it navigates + to the section page without `q` (which clears the box) and the page + scrolls to, focuses, and briefly highlights the row once the form is + hydrated. A row hidden by the current form state falls back to its + `fallbackId`, the control that makes it appear. A reveal must win over the + typed term: `WorkspaceShellSearchSyncService` drops a keystroke still + waiting for its debounce through `onReveal()`, and Enter does not apply + the term first, because either `q` sync navigation would supersede the + reveal navigation. Keyboard users keep a `:focus-visible` ring on the row + after the highlight fades. +7. `Ctrl/Cmd+F` on settings focuses the header search instead of opening + global search. + Keyboard shortcut help is shell-owned: 1. `WorkspaceKeyboardShortcutsService` is provided by `WorkspaceShellComponent`. diff --git a/docs/development/electron-debugging.md b/docs/development/electron-debugging.md index 0734f9e15..1e9f60f55 100644 --- a/docs/development/electron-debugging.md +++ b/docs/development/electron-debugging.md @@ -91,6 +91,13 @@ exit. The retained handle still provides the actual exit code and signal. The Linux portable build uploads `packaged-frame-copy-smoke` reports and traces even when the smoke fails. Check the paused-frame screenshot and trace before classifying a zero rendered-frame signal as an infrastructure flake. +The Snap and Flatpak `--embedded-mpv-runtime-probe` launches in +`build-and-make.yaml` run under GNU `timeout --verbose -k 10 300` with +`ELECTRON_ENABLE_LOGGING=1`, so a main process that throws before app ready +and blocks on Electron's uncaught-exception dialog under xvfb fails within +five minutes with a distinct `::error::` (exit 124, or 137 after timeout's +announced KILL escalation) and its stderr in the step log, instead of holding +the job until the 120-minute limit. ## Main-process ownership diff --git a/jest.preset.js b/jest.preset.js index 0f7d1350d..02c56a0ff 100644 --- a/jest.preset.js +++ b/jest.preset.js @@ -12,8 +12,16 @@ const collectCoverageFrom = [ '!src/**/index.ts', ]; +// CI points every Jest run at one directory (JEST_CACHE_DIRECTORY) so the +// transform cache can be persisted between workflow runs; unset, Jest keeps +// its default per-user temp directory. +const cacheDirectory = process.env.JEST_CACHE_DIRECTORY + ? { cacheDirectory: process.env.JEST_CACHE_DIRECTORY } + : {}; + module.exports = { ...nxPreset, + ...cacheDirectory, coverageReporters, collectCoverageFrom, }; diff --git a/jest.web-esm.workspace.ts b/jest.web-esm.workspace.ts index c0b3f992e..1d81db5dc 100644 --- a/jest.web-esm.workspace.ts +++ b/jest.web-esm.workspace.ts @@ -11,6 +11,10 @@ const coverageReporters = ['json', 'json-summary', 'lcovonly', 'text-summary']; export default { ...nxPreset, ...angularEsmPreset, + // See jest.preset.js: CI persists the transform cache from this directory. + ...(process.env.JEST_CACHE_DIRECTORY + ? { cacheDirectory: process.env.JEST_CACHE_DIRECTORY } + : {}), rootDir: '.', roots: ['/apps/web', '/libs'], // Jest's 5s default is thin for Angular component specs: TestBed compiles diff --git a/libs/epg/data-access/tsconfig.spec.json b/libs/epg/data-access/tsconfig.spec.json index 7b3e56bde..7f31bb031 100644 --- a/libs/epg/data-access/tsconfig.spec.json +++ b/libs/epg/data-access/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../dist/out-tsc", "module": "commonjs", "target": "es2016", diff --git a/libs/m3u-state/tsconfig.spec.json b/libs/m3u-state/tsconfig.spec.json index 19497995e..3e3a2a849 100644 --- a/libs/m3u-state/tsconfig.spec.json +++ b/libs/m3u-state/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../dist/out-tsc", "module": "preserve", "target": "es2016", diff --git a/libs/playback/util/tsconfig.spec.json b/libs/playback/util/tsconfig.spec.json index 01174f48f..f4ba36395 100644 --- a/libs/playback/util/tsconfig.spec.json +++ b/libs/playback/util/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../dist/out-tsc", "module": "ESNext", "target": "ESNext", diff --git a/libs/playlist/import/feature/tsconfig.spec.json b/libs/playlist/import/feature/tsconfig.spec.json index c0bb248be..6aa6499b9 100644 --- a/libs/playlist/import/feature/tsconfig.spec.json +++ b/libs/playlist/import/feature/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../../dist/out-tsc", "module": "commonjs", "target": "es2016", diff --git a/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.ts b/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.ts index 1ab9a3f84..dc0c817b0 100644 --- a/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.ts +++ b/libs/playlist/shared/ui/src/lib/recent-playlists/playlist-item/playlist-item.component.ts @@ -28,7 +28,7 @@ import { PortalStatusService, RuntimeCapabilitiesService, } from '@iptvnator/services'; -import { PlaylistMeta } from '@iptvnator/shared/interfaces'; +import type { PlaylistMeta } from '@iptvnator/shared/interfaces'; @Component({ selector: 'app-playlist-item', diff --git a/libs/playlist/shared/ui/tsconfig.spec.json b/libs/playlist/shared/ui/tsconfig.spec.json index c0bb248be..6aa6499b9 100644 --- a/libs/playlist/shared/ui/tsconfig.spec.json +++ b/libs/playlist/shared/ui/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../../dist/out-tsc", "module": "commonjs", "target": "es2016", diff --git a/libs/playlist/shared/util/tsconfig.spec.json b/libs/playlist/shared/util/tsconfig.spec.json index c0bb248be..6aa6499b9 100644 --- a/libs/playlist/shared/util/tsconfig.spec.json +++ b/libs/playlist/shared/util/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../../dist/out-tsc", "module": "commonjs", "target": "es2016", diff --git a/libs/portal/catalog/feature/tsconfig.spec.json b/libs/portal/catalog/feature/tsconfig.spec.json index c0bb248be..6aa6499b9 100644 --- a/libs/portal/catalog/feature/tsconfig.spec.json +++ b/libs/portal/catalog/feature/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../../dist/out-tsc", "module": "commonjs", "target": "es2016", diff --git a/libs/portal/downloads/feature/tsconfig.spec.json b/libs/portal/downloads/feature/tsconfig.spec.json index c0bb248be..6aa6499b9 100644 --- a/libs/portal/downloads/feature/tsconfig.spec.json +++ b/libs/portal/downloads/feature/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../../dist/out-tsc", "module": "commonjs", "target": "es2016", diff --git a/libs/portal/shared/data-access/tsconfig.spec.json b/libs/portal/shared/data-access/tsconfig.spec.json index c0bb248be..6aa6499b9 100644 --- a/libs/portal/shared/data-access/tsconfig.spec.json +++ b/libs/portal/shared/data-access/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../../dist/out-tsc", "module": "commonjs", "target": "es2016", diff --git a/libs/portal/shared/ui/tsconfig.spec.json b/libs/portal/shared/ui/tsconfig.spec.json index c0bb248be..6aa6499b9 100644 --- a/libs/portal/shared/ui/tsconfig.spec.json +++ b/libs/portal/shared/ui/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../../dist/out-tsc", "module": "commonjs", "target": "es2016", diff --git a/libs/portal/shared/util/src/lib/workspace-view-command.types.ts b/libs/portal/shared/util/src/lib/workspace-view-command.types.ts index 5cd305609..905a971f3 100644 --- a/libs/portal/shared/util/src/lib/workspace-view-command.types.ts +++ b/libs/portal/shared/util/src/lib/workspace-view-command.types.ts @@ -1,4 +1,9 @@ -export type WorkspaceCommandGroup = 'view' | 'playlist' | 'global'; +/** + * `settings` holds one command per searchable settings row. The palette + * lists them only for a non-empty query, ranked and capped, so they never + * flood the default command list. + */ +export type WorkspaceCommandGroup = 'view' | 'playlist' | 'global' | 'settings'; export interface WorkspaceCommandActionContext { query: string; diff --git a/libs/portal/shared/util/tsconfig.spec.json b/libs/portal/shared/util/tsconfig.spec.json index c0bb248be..6aa6499b9 100644 --- a/libs/portal/shared/util/tsconfig.spec.json +++ b/libs/portal/shared/util/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../../dist/out-tsc", "module": "commonjs", "target": "es2016", diff --git a/libs/portal/stalker/data-access/src/lib/models/stalker-serial-details.interface.ts b/libs/portal/stalker/data-access/src/lib/models/stalker-serial-details.interface.ts index 648cb1cb0..83815ffac 100644 --- a/libs/portal/stalker/data-access/src/lib/models/stalker-serial-details.interface.ts +++ b/libs/portal/stalker/data-access/src/lib/models/stalker-serial-details.interface.ts @@ -2,4 +2,4 @@ * @deprecated Import from '@iptvnator/shared/interfaces' instead. * This re-export exists for backward compatibility. */ -export { StalkerSerialDetails } from '@iptvnator/shared/interfaces'; +export type { StalkerSerialDetails } from '@iptvnator/shared/interfaces'; diff --git a/libs/portal/stalker/data-access/src/lib/models/stalker-vod-details.interface.ts b/libs/portal/stalker/data-access/src/lib/models/stalker-vod-details.interface.ts index 48839c6c8..349a0a1cd 100644 --- a/libs/portal/stalker/data-access/src/lib/models/stalker-vod-details.interface.ts +++ b/libs/portal/stalker/data-access/src/lib/models/stalker-vod-details.interface.ts @@ -2,7 +2,7 @@ * @deprecated Import from '@iptvnator/shared/interfaces' instead. * This re-export exists for backward compatibility. */ -export { +export type { StalkerVodDetails, StalkerVodInfo, } from '@iptvnator/shared/interfaces'; diff --git a/libs/portal/stalker/data-access/tsconfig.spec.json b/libs/portal/stalker/data-access/tsconfig.spec.json index c0bb248be..6aa6499b9 100644 --- a/libs/portal/stalker/data-access/tsconfig.spec.json +++ b/libs/portal/stalker/data-access/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../../dist/out-tsc", "module": "commonjs", "target": "es2016", diff --git a/libs/portal/stalker/feature/tsconfig.spec.json b/libs/portal/stalker/feature/tsconfig.spec.json index c0bb248be..6aa6499b9 100644 --- a/libs/portal/stalker/feature/tsconfig.spec.json +++ b/libs/portal/stalker/feature/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../../dist/out-tsc", "module": "commonjs", "target": "es2016", diff --git a/libs/portal/xtream/data-access/src/lib/data-sources/xtream-data-source.interface.ts b/libs/portal/xtream/data-access/src/lib/data-sources/xtream-data-source.interface.ts index b7ec0e116..1728416a6 100644 --- a/libs/portal/xtream/data-access/src/lib/data-sources/xtream-data-source.interface.ts +++ b/libs/portal/xtream/data-access/src/lib/data-sources/xtream-data-source.interface.ts @@ -16,7 +16,7 @@ import { } from '../services/xtream-api.service'; // Re-export for backward compatibility -export { PlaybackPositionData }; +export type { PlaybackPositionData }; /** * Playlist representation in the data source diff --git a/libs/portal/xtream/data-access/tsconfig.spec.json b/libs/portal/xtream/data-access/tsconfig.spec.json index c0bb248be..6aa6499b9 100644 --- a/libs/portal/xtream/data-access/tsconfig.spec.json +++ b/libs/portal/xtream/data-access/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../../dist/out-tsc", "module": "commonjs", "target": "es2016", diff --git a/libs/portal/xtream/feature/tsconfig.spec.json b/libs/portal/xtream/feature/tsconfig.spec.json index c0bb248be..6aa6499b9 100644 --- a/libs/portal/xtream/feature/tsconfig.spec.json +++ b/libs/portal/xtream/feature/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../../dist/out-tsc", "module": "commonjs", "target": "es2016", diff --git a/libs/services/tsconfig.spec.json b/libs/services/tsconfig.spec.json index 19497995e..3e3a2a849 100644 --- a/libs/services/tsconfig.spec.json +++ b/libs/services/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../dist/out-tsc", "module": "preserve", "target": "es2016", diff --git a/libs/shared/database/tsconfig.spec.json b/libs/shared/database/tsconfig.spec.json index 90592e418..fd2a917d0 100644 --- a/libs/shared/database/tsconfig.spec.json +++ b/libs/shared/database/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../dist/out-tsc", "esModuleInterop": true, "module": "commonjs", diff --git a/libs/shared/host-health/tsconfig.spec.json b/libs/shared/host-health/tsconfig.spec.json index 4b0383fc4..d3d081d10 100644 --- a/libs/shared/host-health/tsconfig.spec.json +++ b/libs/shared/host-health/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../dist/out-tsc", "module": "commonjs", "moduleResolution": "node10", diff --git a/libs/shared/interfaces/tsconfig.spec.json b/libs/shared/interfaces/tsconfig.spec.json index 4b0383fc4..d3d081d10 100644 --- a/libs/shared/interfaces/tsconfig.spec.json +++ b/libs/shared/interfaces/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../dist/out-tsc", "module": "commonjs", "moduleResolution": "node10", diff --git a/libs/shared/logging/tsconfig.spec.json b/libs/shared/logging/tsconfig.spec.json index 4b0383fc4..d3d081d10 100644 --- a/libs/shared/logging/tsconfig.spec.json +++ b/libs/shared/logging/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../dist/out-tsc", "module": "commonjs", "moduleResolution": "node10", diff --git a/libs/shared/m3u-utils/tsconfig.spec.json b/libs/shared/m3u-utils/tsconfig.spec.json index 4b0383fc4..d3d081d10 100644 --- a/libs/shared/m3u-utils/tsconfig.spec.json +++ b/libs/shared/m3u-utils/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../dist/out-tsc", "module": "commonjs", "moduleResolution": "node10", diff --git a/libs/ui/components/tsconfig.spec.json b/libs/ui/components/tsconfig.spec.json index 7b3e56bde..7f31bb031 100644 --- a/libs/ui/components/tsconfig.spec.json +++ b/libs/ui/components/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../dist/out-tsc", "module": "commonjs", "target": "es2016", diff --git a/libs/ui/pipes/tsconfig.spec.json b/libs/ui/pipes/tsconfig.spec.json index 7b3e56bde..7f31bb031 100644 --- a/libs/ui/pipes/tsconfig.spec.json +++ b/libs/ui/pipes/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../dist/out-tsc", "module": "commonjs", "target": "es2016", diff --git a/libs/ui/playback/src/lib/html-video-player/html-video-player.component.ts b/libs/ui/playback/src/lib/html-video-player/html-video-player.component.ts index b73989560..9cbb37f06 100644 --- a/libs/ui/playback/src/lib/html-video-player/html-video-player.component.ts +++ b/libs/ui/playback/src/lib/html-video-player/html-video-player.component.ts @@ -17,7 +17,7 @@ import { } from '@angular/core'; import Hls, { type ErrorData, type ManifestParsedData } from 'hls.js'; import mpegts from 'mpegts.js'; -import { Channel, createDevLogger } from '@iptvnator/shared/interfaces'; +import { type Channel, createDevLogger } from '@iptvnator/shared/interfaces'; import { releaseVideoPictureInPicture } from '../player-controls/web-video-picture-in-picture-lifecycle'; import { InlinePlaybackPlayer, diff --git a/libs/workspace/dashboard/data-access/tsconfig.spec.json b/libs/workspace/dashboard/data-access/tsconfig.spec.json index e7d59a0a6..4bee0750e 100644 --- a/libs/workspace/dashboard/data-access/tsconfig.spec.json +++ b/libs/workspace/dashboard/data-access/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../../dist/out-tsc", "module": "commonjs", "moduleResolution": "node10", diff --git a/libs/workspace/dashboard/feature/tsconfig.spec.json b/libs/workspace/dashboard/feature/tsconfig.spec.json index e7d59a0a6..4bee0750e 100644 --- a/libs/workspace/dashboard/feature/tsconfig.spec.json +++ b/libs/workspace/dashboard/feature/tsconfig.spec.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "emitDecoratorMetadata": false, "outDir": "../../../../dist/out-tsc", "module": "commonjs", "moduleResolution": "node10", diff --git a/libs/workspace/shell/feature/src/lib/global-favorites/global-favorites-list.component.ts b/libs/workspace/shell/feature/src/lib/global-favorites/global-favorites-list.component.ts index cadecccc7..246af0ece 100644 --- a/libs/workspace/shell/feature/src/lib/global-favorites/global-favorites-list.component.ts +++ b/libs/workspace/shell/feature/src/lib/global-favorites/global-favorites-list.component.ts @@ -1,4 +1,4 @@ export { - EnrichedUnifiedFavorite, + type EnrichedUnifiedFavorite, GlobalFavoritesListComponent, } from '@iptvnator/portal/shared/ui'; diff --git a/libs/workspace/shell/feature/src/lib/global-favorites/unified-favorite-channel.interface.ts b/libs/workspace/shell/feature/src/lib/global-favorites/unified-favorite-channel.interface.ts index e642808ce..7b09dd6c5 100644 --- a/libs/workspace/shell/feature/src/lib/global-favorites/unified-favorite-channel.interface.ts +++ b/libs/workspace/shell/feature/src/lib/global-favorites/unified-favorite-channel.interface.ts @@ -1,5 +1,5 @@ export { buildFavoriteUid, - FavoriteSourceType, - UnifiedFavoriteChannel, + type FavoriteSourceType, + type UnifiedFavoriteChannel, } from '@iptvnator/portal/shared/util'; diff --git a/libs/workspace/shell/feature/src/lib/workspace-command-palette/workspace-command-palette.component.spec.ts b/libs/workspace/shell/feature/src/lib/workspace-command-palette/workspace-command-palette.component.spec.ts index 65b776133..de5b4af46 100644 --- a/libs/workspace/shell/feature/src/lib/workspace-command-palette/workspace-command-palette.component.spec.ts +++ b/libs/workspace/shell/feature/src/lib/workspace-command-palette/workspace-command-palette.component.spec.ts @@ -381,3 +381,149 @@ describe('WorkspaceCommandPaletteComponent - recent section', () => { ).toBe(false); }); }); + +describe('WorkspaceCommandPaletteComponent - settings group', () => { + function settingsCommand( + id: string, + label: string + ): WorkspaceResolvedCommandItem { + return { + id: `settings:${id}`, + label, + description: 'Playback', + group: 'settings', + icon: 'play_circle', + keywords: [], + priority: 100, + visible: true, + enabled: true, + run: () => undefined, + }; + } + + const commands: WorkspaceResolvedCommandItem[] = [ + { + id: 'open-settings', + label: 'Open settings', + description: '', + group: 'global', + icon: 'settings', + keywords: ['settings'], + priority: 50, + visible: true, + enabled: true, + run: () => undefined, + }, + settingsCommand('video-player', 'Video player'), + settingsCommand('theme', 'Theme'), + ]; + + function setup(options: { + query: string; + recentIds?: readonly string[]; + searchSettings?: jest.Mock; + }) { + const searchSettings = + options.searchSettings ?? + jest.fn((query: string) => + query.includes('player') ? ['settings:video-player'] : [] + ); + + TestBed.resetTestingModule(); + TestBed.configureTestingModule({ + imports: [WorkspaceCommandPaletteComponent], + providers: [ + { provide: MatDialogRef, useValue: { close: jest.fn() } }, + { + provide: MAT_DIALOG_DATA, + useValue: { + query: options.query, + commands, + recentIds: options.recentIds ?? [], + searchSettings, + }, + }, + { + provide: TranslateService, + useValue: { + instant: (key: string) => key, + get: (key: string) => of(key), + stream: (key: string) => of(key), + onLangChange: of(null), + onTranslationChange: of(null), + onDefaultLangChange: of(null), + currentLang: 'en', + defaultLang: 'en', + }, + }, + ], + }); + + const fixture = TestBed.createComponent( + WorkspaceCommandPaletteComponent + ); + fixture.detectChanges(); + return { + component: fixture.componentInstance, + fixture, + searchSettings, + }; + } + + it('keeps settings out of the list while the query is empty', () => { + const { component, searchSettings } = setup({ query: '' }); + + expect(component.flatCommands().map((command) => command.id)).toEqual([ + 'open-settings', + ]); + expect(searchSettings).not.toHaveBeenCalled(); + }); + + it('lists settings matches after the command groups, in search order', () => { + const searchSettings = jest.fn(() => [ + 'settings:theme', + 'settings:video-player', + ]); + const { component, fixture } = setup({ + query: 'settings', + searchSettings, + }); + + const groups = component.commandGroups(); + expect(groups.map((group) => group.group)).toEqual([ + 'global', + 'settings', + ]); + expect(groups[1].items.map((item) => item.id)).toEqual([ + 'settings:theme', + 'settings:video-player', + ]); + expect(searchSettings).toHaveBeenLastCalledWith('settings'); + expect(fixture.nativeElement.textContent).toContain( + 'WORKSPACE.COMMAND_PALETTE.GROUP_SETTINGS' + ); + }); + + it('ranks settings only through the search callback, never by substring', () => { + const { component } = setup({ query: 'theme' }); + + // "Theme" contains the query, but the search callback decides. + expect(component.flatCommands()).toEqual([]); + + component.query.set('player'); + expect(component.flatCommands().map((command) => command.id)).toEqual([ + 'settings:video-player', + ]); + }); + + it('shows a recently opened setting in the recent section', () => { + const { component } = setup({ + query: '', + recentIds: ['settings:theme'], + }); + + const [recent] = component.commandGroups(); + expect(recent.group).toBe('recent'); + expect(recent.items.map((item) => item.id)).toEqual(['settings:theme']); + }); +}); diff --git a/libs/workspace/shell/feature/src/lib/workspace-command-palette/workspace-command-palette.component.ts b/libs/workspace/shell/feature/src/lib/workspace-command-palette/workspace-command-palette.component.ts index 2d35a1e8b..b0d8f3889 100644 --- a/libs/workspace/shell/feature/src/lib/workspace-command-palette/workspace-command-palette.component.ts +++ b/libs/workspace/shell/feature/src/lib/workspace-command-palette/workspace-command-palette.component.ts @@ -23,10 +23,15 @@ import { } from '@iptvnator/portal/shared/util'; import { foldSearchText } from '@iptvnator/shared/interfaces'; -interface WorkspaceCommandPaletteData { +export interface WorkspaceCommandPaletteData { commands: WorkspaceResolvedCommandItem[]; query?: string; recentIds?: readonly string[]; + /** + * Ranked ids of the `settings` group commands matching a query. Settings + * commands are listed only through this, never for an empty query. + */ + searchSettings?: (query: string) => readonly string[]; } type PaletteSectionGroup = WorkspaceCommandGroup | 'recent'; @@ -65,7 +70,9 @@ export class WorkspaceCommandPaletteComponent implements AfterViewInit { readonly filteredCommands = computed(() => { const term = foldSearchText(this.query().trim()); - const commands = this.visibleCommands(); + const commands = this.visibleCommands().filter( + (command) => command.group !== 'settings' + ); if (!term) { return commands; @@ -107,6 +114,28 @@ export class WorkspaceCommandPaletteComponent implements AfterViewInit { } ); + readonly settingsSection = computed( + () => { + const query = this.query().trim(); + const searchSettings = this.data?.searchSettings; + if (!query || !searchSettings) { + return null; + } + + const byId = new Map( + this.visibleCommands().map((command) => [command.id, command]) + ); + const items = searchSettings(query) + .map((id) => byId.get(id)) + .filter( + (command): command is WorkspaceResolvedCommandItem => + command?.group === 'settings' + ); + + return items.length === 0 ? null : { group: 'settings', items }; + } + ); + readonly commandGroups = computed(() => { const commands = this.filteredCommands(); const recent = this.recentSection(); @@ -144,6 +173,12 @@ export class WorkspaceCommandPaletteComponent implements AfterViewInit { ); sections.push(...groups); + + const settings = this.settingsSection(); + if (settings) { + sections.push(settings); + } + return sections; }); @@ -259,6 +294,9 @@ export class WorkspaceCommandPaletteComponent implements AfterViewInit { if (group === 'playlist') { return 'WORKSPACE.COMMAND_PALETTE.GROUP_PLAYLIST'; } + if (group === 'settings') { + return 'WORKSPACE.COMMAND_PALETTE.GROUP_SETTINGS'; + } return 'WORKSPACE.COMMAND_PALETTE.GROUP_GLOBAL'; } diff --git a/libs/workspace/shell/feature/src/lib/workspace-context-panel/workspace-settings-context-panel.component.scss b/libs/workspace/shell/feature/src/lib/workspace-context-panel/workspace-settings-context-panel.component.scss index c439cb7e2..faf6063f2 100644 --- a/libs/workspace/shell/feature/src/lib/workspace-context-panel/workspace-settings-context-panel.component.scss +++ b/libs/workspace/shell/feature/src/lib/workspace-context-panel/workspace-settings-context-panel.component.scss @@ -45,6 +45,11 @@ border-top: 1px solid var(--app-separator); } +// Sections without settings-search matches stay reachable but recede. +.settings-section-item.has-no-matches:not(.active) { + opacity: 0.55; +} + .settings-section-item:hover:not(.active):not(.selected), .settings-back-button:hover:not(.active):not(.selected) { background: var(--app-selection-surface); diff --git a/libs/workspace/shell/feature/src/lib/workspace-context-panel/workspace-settings-context-panel.component.spec.ts b/libs/workspace/shell/feature/src/lib/workspace-context-panel/workspace-settings-context-panel.component.spec.ts new file mode 100644 index 000000000..ec6ee1e5d --- /dev/null +++ b/libs/workspace/shell/feature/src/lib/workspace-context-panel/workspace-settings-context-panel.component.spec.ts @@ -0,0 +1,75 @@ +import { TestBed } from '@angular/core/testing'; +import { provideRouter } from '@angular/router'; +import { TranslateService } from '@ngx-translate/core'; +import { of } from 'rxjs'; +import { SettingsContextService } from '@iptvnator/workspace/shell/util'; +import { WorkspaceSettingsContextPanelComponent } from './workspace-settings-context-panel.component'; + +describe('WorkspaceSettingsContextPanelComponent', () => { + function setup() { + TestBed.configureTestingModule({ + imports: [WorkspaceSettingsContextPanelComponent], + providers: [ + provideRouter([]), + { + provide: TranslateService, + useValue: { + instant: (key: string) => key, + get: (key: string) => of(key), + stream: (key: string) => of(key), + onLangChange: of(null), + onTranslationChange: of(null), + onDefaultLangChange: of(null), + currentLang: 'en', + defaultLang: 'en', + }, + }, + ], + }); + const ctx = TestBed.inject(SettingsContextService); + ctx.setSections([ + { id: 'general', label: 'SETTINGS.NAV_GENERAL', icon: 'tune' }, + { + id: 'playback', + label: 'SETTINGS.NAV_PLAYBACK', + icon: 'play_circle', + }, + ]); + const fixture = TestBed.createComponent( + WorkspaceSettingsContextPanelComponent + ); + fixture.detectChanges(); + const link = (id: string) => + (fixture.nativeElement as HTMLElement).querySelector( + `[data-test-id="settings-section-${id}"]` + ) as HTMLElement; + return { ctx, fixture, link }; + } + + it('shows no counts while settings search is idle', () => { + const { link } = setup(); + + expect(link('general').querySelector('.nav-item-meta')).toBeNull(); + expect(link('general').classList).not.toContain('has-no-matches'); + }); + + it('shows per-section match counts and mutes sections without matches', () => { + const { ctx, fixture, link } = setup(); + + ctx.setMatchCounts({ general: 2 }); + fixture.detectChanges(); + + expect( + link('general').querySelector('.nav-item-meta')?.textContent + ).toBe('2'); + expect( + link('playback').querySelector('.nav-item-meta')?.textContent + ).toBe('0'); + expect(link('general').classList).not.toContain('has-no-matches'); + expect(link('playback').classList).toContain('has-no-matches'); + + ctx.reset(); + fixture.detectChanges(); + expect(ctx.matchCounts()).toBeNull(); + }); +}); diff --git a/libs/workspace/shell/feature/src/lib/workspace-context-panel/workspace-settings-context-panel.component.ts b/libs/workspace/shell/feature/src/lib/workspace-context-panel/workspace-settings-context-panel.component.ts index 2c736855f..92448563f 100644 --- a/libs/workspace/shell/feature/src/lib/workspace-context-panel/workspace-settings-context-panel.component.ts +++ b/libs/workspace/shell/feature/src/lib/workspace-context-panel/workspace-settings-context-panel.component.ts @@ -28,10 +28,27 @@ import { [routerLink]="['/workspace/settings', section.id]" [replaceUrl]="true" [attr.data-test-id]="'settings-section-' + section.id" + [class.has-no-matches]=" + ctx.matchCounts() !== null && + !ctx.matchCounts()?.[section.id] + " (click)="onSectionClicked()" > {{ section.icon }} - {{ section.label | translate }} + {{ + section.label | translate + }} + + @if (ctx.matchCounts(); as counts) { + {{ counts[section.id] ?? 0 }} + } }
diff --git a/libs/workspace/shell/feature/src/lib/workspace-shell/components/workspace-shell-header/workspace-shell-header.component.html b/libs/workspace/shell/feature/src/lib/workspace-shell/components/workspace-shell-header/workspace-shell-header.component.html index 5d64c9d8e..0427a6a6c 100644 --- a/libs/workspace/shell/feature/src/lib/workspace-shell/components/workspace-shell-header/workspace-shell-header.component.html +++ b/libs/workspace/shell/feature/src/lib/workspace-shell/components/workspace-shell-header/workspace-shell-header.component.html @@ -42,7 +42,9 @@ /> } - @if (!hasNoPlaylists()) { + + @if (!hasNoPlaylists() || isSettingsRoute()) {