feat(gelderlander): add a feed teaser filter and generalise the article component filter #18
Labels
No labels
area/architecture
area/build-ci
area/bytecode
area/code-quality
area/docs
area/extension
area/fingerprint
area/security
area/tests
Bug report
Feature request
review
sev/low
sev/medium
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
midas/midas-patches#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #16.
Feature description
Several roadmap issues want to drop specific blocks from De Gelderlander's section feeds and article bodies:
Build the filtering infrastructure once, so each named patch only declares which model types to drop.
Findings (9.21.1)
Feed (home and section pages)
com.kubus.module.network.model.SectionResponse.<init>(List mainContent, List navigations, List trackingEvents, String sectionUrn)is fully unobfuscated, and it is the only model that holdsList<TeaserBlock>.SectionResponseJsonAdapter(both the direct constructor and the synthetic one withint+DefaultConstructorMarker) and bycopy()._sectionContentandsectionContent.knc(TeaserType): uno, compact, divider, carousel, ticker, dossier, breakingNews, shop, ad, advertisementPack, minicarousel, imagecarousel, videocarousel, liveTeaser, localnews, promobanner, dealsbanner, regionPromotion, htmlEmbed, podcastEmbed, recommendations, pushCategories, teaserTopList, collections, recap, liveblog, gamesPromo, audiobundle, playlist, marketingPosition.c8b.b(cur, prev, ...)ins7b), so filtering at the data level leaves no gaps. Watch for twoDividerteasers ending up next to each other.s7b.R1does not decompile (4160 code units). Don't hook the UI layer.Article
g20.a(ArticleComponent): i30(anchor string"FALLBACK (") is already hooked by Hide share buttons, which returns null forShareButtons.g20.bdrops nulls, so returning null removes a component without leaving space.Approach
p1 = Filter.filterTeasers(p1)at index 0 ofSectionResponse.<init>.ArrayList(the input may be immutable).instanceofagainst a set of model classes.g20.awith the same mechanism, aninstanceofset for article components.Done when
patch-install.ps1 -NoInstallshows Hide share buttons still applied on 9.21.1.docs/apps/gelderlander.mddocuments both filter points.Midas Settings
The filters decide at runtime, through Midas Settings (#49). Each filterable type belongs to a toggle from the issue that asks for it.
MidasSettings' in-memory cache.SectionResponse.<init>runs for every section load, so it is a hot path.