Add search to the Menu#695
Open
bjorkert wants to merge 2 commits into
Open
Conversation
Make SettingsRoute the single source of truth for the Settings list by moving each row's title, icon and search keywords onto the route, and grouping them via menuSections(nightscoutConfigured:). SettingsMenuView now renders from that data. Add .searchable to the Menu. Search results are assembled from the same sources that build the menu — the Settings routes, the tab features and the static rows — so they stay in sync automatically. A settings result deep-links straight into its sub-screen; features, log and support-link results reuse the menu's existing navigation.
Add a leaves list to SettingsRoute describing the individual settings inside each sub-screen (row titles plus search synonyms), and include them in the Menu search index after the screen-level items. A leaf result shows a Settings → <screen> subtitle and opens the screen that contains the setting, e.g. searching "basal" finds Graph Basal under Advanced. Info Display leaves are derived from InfoType so they follow the app's info rows automatically. NavigationRow gains an optional subtitle to render these results.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds a search field to the Menu tab, matching the iOS 26 style of the in-flight search additions to the Add Alarm sheet (#681) and the alarms list (#694).
Search covers the Menu's own rows (Settings, the tab features, View Log / Share Logs, and the support links) and the rows inside the Settings sub-screen (General, Graph, Units, Alarms, …). Typing e.g. "graph" surfaces the Graph settings row and tapping it deep-links straight into that screen.
Single source of truth
To avoid maintaining a parallel search index, the menu is now driven from the data that also feeds the search:
SettingsRoutecarries each row'stitle,iconand searchkeywords, and a newSettingsSection+menuSections(nightscoutConfigured:)groups the rows and encodes their conditional visibility (Information Display / Remote require Nightscout; Live Activity is excluded on Mac Catalyst) in one place.SettingsMenuViewrenders from this — visually unchanged.TabItem.featureOrder, and the handful of static rows, so adding a settings page automatically appears in both the list and the search with nothing to keep in sync.Empty search shows the normal menu; a query with no matches shows a "No Results" state consistent with #681/#694.