Skip to content

Add scroll targets and fix search index labels for settings search#1096

Open
gordolio wants to merge 11 commits intonightscout:feat/dev-scrollable-settings-searchfrom
gordolio:feat/dev-scrollable-settings-search-3-ui-scroll-targets
Open

Add scroll targets and fix search index labels for settings search#1096
gordolio wants to merge 11 commits intonightscout:feat/dev-scrollable-settings-searchfrom
gordolio:feat/dev-scrollable-settings-search-3-ui-scroll-targets

Conversation

@gordolio
Copy link
Copy Markdown

@gordolio gordolio commented Apr 9, 2026

Part 3 of #1095

  • Replace .listRowBackground(Color.chart) with .settingsSearchTarget(label:) on 7 User Interface sections so they become scroll targets for search
  • Add .settingsHighlightScroll() to User Interface screen
  • Add scrollTargetLabels mappings for Units/Limits, SMB, Target Behavior, Additionals, and User interface
  • Fix incorrect searchContents in Bolus Calculator and User Interface

About scrollTargetLabels

scrollTargetLabels maps the search term to the actual UI label:

scrollTargetLabels: [
    "Max IOB": "Maximum Insulin on Board (IOB)",
    "Max Bolus": "Maximum Bolus",
]

There are two cases where these are needed:

  1. Abbreviated search terms - the search result/index uses a shorter/common name but the label within the UI shows the full name (e.g. "Max Basal" → "Maximum Basal Rate")
  2. Multiple search terms targeting one section - several terms scroll to the same UI element
  • "Dark Mode", "Light Mode", and "Appearance" all scroll to the Appearance picker
  • "Cone" and "Lines" both scroll to the "Forecast Display Type"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the labeling changes in this file are breaking localization for our settings search terms, i.e. before this change you were able to search a localized setting name or an English one, and it would list the localized result. Now it lists the hardcoded label as of the collections that were added here.

Example:
-> Working
Image

-> Broken (see English items here)
Image

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for flagging the localization concern! I investigated and found that the untranslated search results ("Enable SMB With Temporary Target", "Allow SMB With High Temporary Target", "Max UAM SMB Basal Minutes", "Max Allowed Glucose Rise for SMB") are actually a pre-existing issue on dev. These strings were never added to the xcstrings file when they were introduced.

Here's the same "SMB" search on dev:

trio_dev_3

I had initially included some additional searchContents entries but have since removed them to keep this PR scoped strictly to scrollTargetLabels mappings and scroll target modifiers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but shouldn't the color be retained, and the settings search target modifier be added here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .settingsSearchTarget(label:) modifier includes .listRowBackground(Color.chart) as its base, with the highlight overlay on top. So the color is retained.

Settings search can now scroll to the matched setting and briefly
highlight it. Implemented for Algorithm > DynamicSettings as a starting
point. Remaining screens to follow.
Enables scroll-to-highlight support for settings search results
across all settings views that were missing the modifier.
Restore removed search entries ("X-Axis Interval Step", "Dark Scheme",
"Light Scheme", "Enable Reduced Bolus Factor", etc.) so they still
navigate to the correct screen. Add scrollTargetLabels so the old
names also scroll to and highlight the correct row.
Reduced Bolus Percentage and Super Bolus Percentage are displayed
inside SettingInputSection as conditionalLabel, but the scroll anchor
is registered under the parent label. Map all related search terms
to the actual anchor IDs.
@gordolio gordolio force-pushed the feat/dev-scrollable-settings-search-3-ui-scroll-targets branch from 905b5ac to 61ed450 Compare April 16, 2026 02:57
@gordolio gordolio requested a review from dnzxy April 16, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants