Skip to content

feat(Instagram): Restore classic search recents (up to 25) - #1741

Open
Manishrdy wants to merge 3 commits into
crimera:devfrom
Manishrdy:feat/restore-classic-search-recents
Open

feat(Instagram): Restore classic search recents (up to 25)#1741
Manishrdy wants to merge 3 commits into
crimera:devfrom
Manishrdy:feat/restore-classic-search-recents

Conversation

@Manishrdy

@Manishrdy Manishrdy commented Aug 17, 2026

Copy link
Copy Markdown

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, just J instead of Z.

Tested on 439.0.0.37.89.

@Manishrdy

Copy link
Copy Markdown
Author

I'll add screenshots shortly.

@swakwork

Copy link
Copy Markdown
Collaborator

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.
@Manishrdy
Manishrdy force-pushed the feat/restore-classic-search-recents branch from c9c14bd to 0f51834 Compare August 17, 2026 20:32
@Manishrdy

Manishrdy commented Aug 17, 2026

Copy link
Copy Markdown
Author

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. RestoreSearchRecentsPatch.kt is gone; the long-flag bytecode hook in HookFlagsPatch.kt is unchanged from before.

Branch is force-pushed and squashed to a single commit, so this should be a clean review from scratch.

Manishrdy pushed a commit to Manishrdy/piko that referenced this pull request Aug 18, 2026
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.
@vippium

vippium commented Aug 18, 2026

Copy link
Copy Markdown

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.

@Manishrdy

Manishrdy commented Aug 18, 2026

Copy link
Copy Markdown
Author

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.

dryrun added 2 commits August 20, 2026 14:59
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.
@Manishrdy

Copy link
Copy Markdown
Author

Pushed fixes for all four.

  • Flag now uses a real FlagType enum instead of comparing strings - same shape as FlagState, plain enum with lowercase toString().
  • defaultValue uses FlagState.DEFAULT for both types now instead of the hardcoded "" for long flags. Turns out that brought back exactly the problem the "" was there to avoid - the numeric field would show the literal word "default"; so EditTextPref blanks that out on display now, doesn't touch what's actually persisted.
  • Commented out your getAll() logger rather than deleting it, and dropped the one in getAllLong() since that was just mine mirroring yours.

naoverse06

This comment was marked as duplicate.

@naoverse06
naoverse06 dismissed their stale review September 1, 2026 20:38

Submitted by mistake.

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.

4 participants