feat(Instagram): Restore classic search recents (up to 25) - #1741
feat(Instagram): Restore classic search recents (up to 25)#1741Manishrdy wants to merge 3 commits into
Conversation
|
I'll add screenshots shortly. |
|
You can probably extend the support for Long Override flags and then move these flags to recommended flags as recommended flags were built to server that purpose. Building patches for flags is kinda baseless as there are n number of flags controlling n number of things. |
Per kitadai31's review: a dedicated patch for 8 flags is overkill when Recommended Flags already exists to toggle individual MobileConfig flags without a new build. Recommended Flags only supported boolean overrides so far. Extends Flag/FlagsSharedPref/HookFlags/ScreenBuilder to handle long-typed ones too, then moves the 6 boolean + 2 long flags out of RestoreSearchRecentsPatch (deleted) and into the JSON catalog. HookFlagsPatch.kt's long-flag hook, added earlier in this PR, is unchanged. Fixed a bug in FlagsSharedPref.getAll() while at it -- a long override's numeric string would've been read as boolean false once both types started sharing the same pref file.
c9c14bd to
0f51834
Compare
|
Reworked this as per your feedback - extended Recommended Flags to support long-typed overrides (it only handled booleans before) and moved all 8 flags from the old dedicated patch into the JSON catalog. Branch is force-pushed and squashed to a single commit, so this should be a clean review from scratch. |
Fork-only, temporary. The search-recents flags added in the last two commits only exist in this fork's copy of docs/mappings/piko_recommended_flags_v3.json -- PR crimera#1741 that adds them upstream is still open. Without this, the app downloads crimera/piko's catalog at runtime and the new flags are simply not there to toggle. Revert once crimera#1741 merges into crimera/piko:dev.
|
Are you sure this patch is needed ? Bcoz we can remove those AI suggestions from classic search recents through flags itself. If you're addign it in the Recommended falgs, then it's another point. |
|
Already this pr, actually this doesn't add a patch. Used to, but I dropped that after swakwork said the same thing on an earlier pass. The 8 flags just live in the Recommended Flags catalog now. Only real code change is extending Recommended Flags to handle numbers too, it was bool-only before, and two of these (max recent searches) are counts, not on/off toggles. Worth calling out - even with the AI suggestions flag off, Meta's capped recent searches to the top 4 in newer builds. That count override is what actually brings back the full classic list - turning off the AI suggestions alone doesn't do it. |
Unify the "no override" sentinel through FlagState for both bool and long flags, instead of special-casing long flags to an empty string. Investigated the reviewer's stated concern (override backups, dev options) -- neither touches this storage, so this is purely about using one consistent sentinel rather than a hardcoded special case. Blanking the empty string previously prevented the numeric field from showing the literal word "default" -- since that's no longer the stored value, EditTextPref now blanks the field display itself (via onAddEditTextToDialogView) when it holds the FlagState.DEFAULT sentinel, without touching persisted state. Also comments out/removes the two debug logger calls in FlagsSharedPref per review -- the getAll() one predates this PR and was flagged as debug-only, the getAllLong() one mirrored it and isn't needed either.
Adds FlagType (mirrors FlagState's existing shape in the same package: plain enum, lowercased toString()) and switches Flag to parse/store it instead of comparing raw strings. Fixes the last unaddressed review comment on this PR -- makes adding a third flag type later a one-line enum addition instead of another magic string to remember everywhere type gets checked.
|
Pushed fixes for all four.
|
Search used to show up to 25 recent profiles on the empty-state screen. Newer builds swapped that for Meta AI suggestions plus a collapsed list you have to tap "show more" on this brings the old one back.
One thing had to happen first: the flag hook only did boolean MobileConfig overrides, and the recent count values are
long(MobileConfig has no real int type). Extended the hook to cover long-returning flags too. Same accessor class as the boolean one already hooked, same method shape, justJinstead ofZ.Tested on 439.0.0.37.89.