You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(settings): add search index and jump bar - #1528
Make our settings even more user friendly: add a search bar at the top of the settings so people looking for specific settings can go to them easily, and add specific metadata or relevant keywords or related keywords or synonyms to each of these settings so that even if there's not an exact match for that setting people are still able to find it and in different languages as well.
What Changed
Added a settings search catalog and matcher (frontend/src/lib/settings-search.ts) indexing all 21 settings tabs with localized titles, hints, extra translation keys across settings, pos, customerDisplay, tax, qrMenu, update, and productAnalytics namespaces, multilingual synonyms/keywords, diacritic-insensitive normalization, and role/permission filtering.
Added a top-level settings search combobox (frontend/src/app/(dashboard)/settings/page.tsx) with / and Ctrl+K/Cmd+K keyboard shortcuts, arrow-key navigation with aria-activedescendant, and tab-switching plus scroll-and-highlight navigation to matching [data-setting-section] anchors across settings tabs and cards.
Added unit and E2E test suites (tests/settings-search.test.ts, frontend/e2e/settings-search.spec.ts) covering catalog anchor integrity, localized and synonym matching, permission filtering, and interactive jump-bar navigation.
Risk Assessment
✅ Low: The settings search catalog, combobox UI, section anchors, and permission filtering are well-bounded, client-side additions with thorough unit and E2E test coverage and no regressions to existing settings behavior.
Testing
Ran the settings search unit suite across all 32 locales, test script coverage check, full backend and static frontend build, the Playwright E2E spec frontend/e2e/settings-search.spec.ts, and an isolated live Chromium verification pass across manager, server, and owner sessions in English, Spanish, and Hindi, capturing 7 screenshot artifacts; all checks and live scenarios passed.
Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario
Result
Live
Evidence
User searches Settings by non-exact synonym or related keyword ('parcel', '58mm', 'footer message') and jumps to the highlighted setting card on the target tab
Adversarial keyboard shortcut and combobox boundary: '/' focuses search when outside form inputs, types literally into an active form input without hijacking focus, Ctrl+K focuses search from inside a…
User switches UI language (Spanish and Hindi) and finds settings using localized terms, diacritic-stripped queries ('programa de fidelidad'), native non-Latin script ('प्रिंटर'), and universal keyword…
✅ pass
live
npm run test:settings-search, ~/.no-mistakes/evidence/01M6YM424N6BX59ECR4CDAM3XT/settings-search-spanish-diacritic-dropdown.png, and ~/.no-mistakes/evidence/0…
Adversarial role-permission boundary: restricted roles (manager and server) cannot find unauthorized owner/admin/database/tax settings in search results, while owner can find and jump to Master PIN on…
✅ pass
live
~/.no-mistakes/evidence/01M6YM424N6BX59ECR4CDAM3XT/settings-search-restricted-role-filtered.png and ~/.no-mistakes/evidence/01M6YM424N6BX59ECR4CDAM3XT/settings-…
Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario
Result
Live
Evidence
User searches Settings by non-exact synonym or related keyword ('parcel', '58mm', 'footer message') and jumps to the highlighted setting card on the target tab
Adversarial keyboard shortcut and combobox boundary: '/' focuses search when outside form inputs, types literally into an active form input without hijacking focus, Ctrl+K focuses search from inside a…
User switches UI language (Spanish and Hindi) and finds settings using localized terms, diacritic-stripped queries ('programa de fidelidad'), native non-Latin script ('प्रिंटर'), and universal keyword…
✅ pass
live
npm run test:settings-search, ~/.no-mistakes/evidence/01M6YM424N6BX59ECR4CDAM3XT/settings-search-spanish-diacritic-dropdown.png, and ~/.no-mistakes/evidence/0…
Adversarial role-permission boundary: restricted roles (manager and server) cannot find unauthorized owner/admin/database/tax settings in search results, while owner can find and jump to Master PIN on…
✅ pass
live
~/.no-mistakes/evidence/01M6YM424N6BX59ECR4CDAM3XT/settings-search-restricted-role-filtered.png and ~/.no-mistakes/evidence/01M6YM424N6BX59ECR4CDAM3XT/settings-…
npm run test:settings-search
npm run test:script-coverage
npm run build && npm run build:frontend
cd frontend && E2E_BASE_URL=http://127.0.0.1:43101 E2E_KDS_BASE_URL=http://127.0.0.1:43102 E2E_SERVER_APP_BASE_URL=http://127.0.0.1:43103 npx playwright test e2e/settings-search.spec.ts --config=playwright.config.ts --project=chromium
Live Playwright Chromium verification against node tests/e2e-server.cjs covering synonym search, keyboard shortcut guards (/ vs Ctrl+K), combobox aria-activedescendant scrolling, Spanish (es) and Hindi (hi) localized search, and owner/manager/server permission filtering with screenshot capture
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
Add searchable settings catalog and jump-to-setting bar
✨ Enhancement🧪 Tests🕐 40+ Minutes
AI Description
• Index settings across 21 tabs using localized labels, related keywords, relevance ranking, and
permission filtering.
• Add keyboard-accessible search that switches tabs, scrolls to settings, and briefly highlights
them.
• Add search tests and section anchors so results lead to the intended controls.
The following are alternative approaches to this PR:
1. Derive results from rendered settings controls
➕ Search targets could follow visible UI changes without a separate catalog.
➖ Inactive tabs and conditional panels may not be rendered.
➖ Synonyms, relevance ranking, and permission-aware discovery would be harder to maintain.
Recommendation: Keep the explicit catalog and section-anchor approach: it supports synonyms and localized discovery across inactive tabs while making result visibility intentional. Maintain the catalog-to-anchor tests as settings change so the two representations do not drift.
Files changed (19) +3887 / -565
Enhancement (16) +3557 / -564
page.tsxAdd Settings search and jump interactions+443/-31
Add Settings search and jump interactions
• Adds the search combobox, keyboard shortcuts and result navigation. It switches tabs, finds section anchors, scrolls to them, and applies a temporary highlight; it also anchors settings rendered directly on the page.
PrintersSettingsTab.tsxAnchor printer and receipt controls+32/-8
Anchor printer and receipt controls
• Adds destinations for hardware, printing options, cash drawers, kitchen tickets, receipt languages, bill content, WhatsApp sharing, and bill templates.
settings-search.tsDefine the localized settings search catalog+2122/-0
Define the localized settings search catalog
• Indexes settings across all 21 tabs with translation keys, related keywords, target IDs, and visibility requirements. Implements text normalization and tiered match scoring to return ranked results with navigation metadata.
1. Search shortcut fails in settings forms 🐞 Bug≡ Correctness
Description
handleGlobalKeyDown applies the editable-element guard to both / and Cmd/Ctrl+K, returning
before it can focus the search input. When someone is editing a settings field, Cmd/Ctrl+K cannot
open search even though the guard needed to protect ordinary typing applies to /.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
Cmd/Ctrl+K does not focus settings search while a form field is active.
## Fix Focus Areas
- frontend/src/app/(dashboard)/settings/page.tsx[641-669]
## Recommended Fix
Apply the editable-element guard to `/` only, while allowing Cmd/Ctrl+K to focus and select the search input from settings form fields; retain the dialog guard.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
2. Subscription searches show Languages 🐞 Bug≡ Correctness
Description
The subscription catalog entry assigns languages as its title and subscription as its hint,
reversing the label of the section it targets. A search for a subscription or plan therefore offers
a result headed “Languages,” although the destination is headed “Subscription” and languages is only
a field within it.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
Subscription-related searches display a result titled Languages rather than the destination section's title.
## Fix Focus Areas
- frontend/src/lib/settings-search.ts[317-323]
## Recommended Fix
Use `subscription` as the entry title and retain languages in the searchable hint, extra keys, or keywords so language searches still reach this section.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
At PR head, the search input sets aria-activedescendant={activeSearchOptionId} (derived from
searchResults[activeSearchIndex]), and each result button has
id={settings-search-option-${result.id}} with role="option" and aria-selected. The active option
is therefore announced to assistive tech, matching the suggested fix. The listbox also has id
settings-search-listbox referenced by aria-controls.
Description
The search input declares a combobox but has no aria-activedescendant, and its options have no IDs
for that attribute to reference. When arrow keys change selectedSearchIndex, focus remains on the
input, so its newly selected result is not identified to screen-reader users.
View medium (1) 4. Keyboard users lose sight of results✓ Resolved
Arrow-key navigation changes selectedSearchIndex, but it never scrolls the selected option into
the dropdown's visible area. For a broad query with more results than fit in the height-limited
list, the highlighted result moves out of view while Enter still selects it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1520
Intent
Make our settings even more user friendly: add a search bar at the top of the settings so people looking for specific settings can go to them easily, and add specific metadata or relevant keywords or related keywords or synonyms to each of these settings so that even if there's not an exact match for that setting people are still able to find it and in different languages as well.
What Changed
frontend/src/lib/settings-search.ts) indexing all 21 settings tabs with localized titles, hints, extra translation keys acrosssettings,pos,customerDisplay,tax,qrMenu,update, andproductAnalyticsnamespaces, multilingual synonyms/keywords, diacritic-insensitive normalization, and role/permission filtering.frontend/src/app/(dashboard)/settings/page.tsx) with/andCtrl+K/Cmd+Kkeyboard shortcuts, arrow-key navigation witharia-activedescendant, and tab-switching plus scroll-and-highlight navigation to matching[data-setting-section]anchors across settings tabs and cards.tests/settings-search.test.ts,frontend/e2e/settings-search.spec.ts) covering catalog anchor integrity, localized and synonym matching, permission filtering, and interactive jump-bar navigation.Risk Assessment
✅ Low: The settings search catalog, combobox UI, section anchors, and permission filtering are well-bounded, client-side additions with thorough unit and E2E test coverage and no regressions to existing settings behavior.
Testing
Ran the settings search unit suite across all 32 locales, test script coverage check, full backend and static frontend build, the Playwright E2E spec
frontend/e2e/settings-search.spec.ts, and an isolated live Chromium verification pass across manager, server, and owner sessions in English, Spanish, and Hindi, capturing 7 screenshot artifacts; all checks and live scenarios passed.npm run test:settings-search, ~/.no-mistakes/evidence/01M6YM424N6BX59ECR4CDAM3XT/settings-search-spanish-diacritic-dropdown.png, and ~/.no-mistakes/evidence/0…Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
npm run test:settings-search, ~/.no-mistakes/evidence/01M6YM424N6BX59ECR4CDAM3XT/settings-search-spanish-diacritic-dropdown.png, and ~/.no-mistakes/evidence/0…npm run test:settings-searchnpm run test:script-coveragenpm run build && npm run build:frontendcd frontend && E2E_BASE_URL=http://127.0.0.1:43101 E2E_KDS_BASE_URL=http://127.0.0.1:43102 E2E_SERVER_APP_BASE_URL=http://127.0.0.1:43103 npx playwright test e2e/settings-search.spec.ts --config=playwright.config.ts --project=chromiumLive Playwright Chromium verification againstnode tests/e2e-server.cjscovering synonym search, keyboard shortcut guards (/vsCtrl+K), comboboxaria-activedescendantscrolling, Spanish (es) and Hindi (hi) localized search, andowner/manager/serverpermission filtering with screenshot capture✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.