Add Power Saving settings to settings search - #1444
Open
gildor wants to merge 1 commit into
Open
Conversation
The Power Saving (lite mode) screen and its per-feature toggles were not part of the settings search index, so queries like "emoji", "animation" or "power" returned nothing and the screen could only be reached by knowing it lives under General. Index the screen plus every LiteMode.allKeys toggle, reusing the titles and descriptions those rows already display, so no new localized strings are required. Making the LiteModeKey title/info extension internal lets the search items reuse the same strings the controller renders.
|
|
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.
Problem
The Power Saving (lite mode) screen is not in the settings search index.
settingsSearchableItemsbuilds the index from explicit per-section lists (profile, stickers, notifications, privacy, data, proxy, appearance, language), and no list was ever added for lite mode when it shipped.The practical effect: searching Settings for
emoji,animation,sticker animationorpowerreturns nothing for these toggles. Since the screen is named after a motivation (saving battery) rather than what it controls (looping emoji, stickers, GIFs, videos, blur, menu animations), a user who wants to stop animated emoji from looping has no path to it except already knowing it lives under General.This is easy to hit in practice — the toggle people usually want is Emoji Animations, and search is the natural way to look for it.
Change
Adds
powerSavingSearchableItems, indexing:GeneralSettings.LiteMode, breadcrumbGeneralLiteMode.allKeys, using each key's existing.title, breadcrumbsGeneral › Power Saving ModeEach key's
.infotext is passed asalternate, so the descriptions already shown on the rows become searchable too — e.g. "Loop animated emoji in messages, reactions and statuses" makesloop,reactionsandstatusesfind the Emoji Animations toggle.All items push
LiteModeController. There is no item-tag/focus mechanism on that controller, so sub-items open the screen rather than scrolling to a specific row, matching how the language and sticker items behave.Supporting changes:
.powerSavingcase inSettingsSearchableItemIcon(reusestheme.icons.settingsGeneral) and inSettingsSearchableItemId(namespace 16, appended so existing persisted recent-search indices keep their meaning)extension LiteModeKeyinLiteModeController.swiftis no longerprivate, so the search items reuse the exact strings the rows renderNo new localized strings — everything reuses keys that already exist.
Notes
Synonyms are deliberately not added. Words like "battery" would need new
SettingsSearch.Synonyms.*entries, which go through the translations platform; happy to add them in a follow-up if you'd like.Verified by inspection and
swiftc -parse; I wasn't set up to run a full Xcode build locally, so please give it a compile before merging.