feat(volkskrant): add feed, overview and article block filters #19

Closed
opened 2026-10-10 12:22:19 +02:00 by midas · 0 comments
Owner

Part of #16.

Feature description

Several roadmap issues need to drop specific tiles or blocks from de Volkskrant:

  • push boxes (#37);
  • games teasers (#41);
  • the Google "preferred source" button (#44).

All three content surfaces already have a mapper that drops null, so one small infrastructure patch can give each of them a type filter.

Findings (7.52.0, all unobfuscated)

Home feed tiles

  • nl.persgroep.edition.teasers.data.converters.SectionDtoToModelExtensionsKt.toModel(TileDto, TrackingData): Tile.
  • Its caller toModel(SectionDto, int) already drops null. It returns null for UnknownTileDto, logging "Unknown tile type encountered".
  • Tile types:
    • "advertisement" (AdvertisementTileDto);
    • "pushCategoryBox" (SubscribableCategoriesTileDto);
    • teaser group;
    • teaser.
  • Teaser types: basicTeaser, balconyTeaser, columnTeaser, imageTeaser, podcastTeaser, quoteTeaser, list, duo.
  • Puzzle teasers are normal teasers whose destination is TeaserDestination.Game (set in SectionDtoToModelExtensionsKt.getDestination from gameIdentifier).

Overview pages

  • nl.persgroep.edition.overview.presentation.model.OverviewViewDataMapper.map(OverviewPage) and its private toViewData(OverviewPageComponent, String, int) already return null for Unknown, and nulls are dropped.
  • There is also a client-side InlineMessage (the audio page onboarding hint), added in GetOverviewPageUseCase.

Article body

  • The mapper is nl.persgroep.edition.article.data.converters.ArticleBodyBlockDtoMapper.invoke(List<BlockDto>): List<Block>.
  • Remove blocks there rather than mapping them to Block.Unknown: unknown blocks trigger the "update app" banner (#23).
  • GoogleSourceButton blocks are injected separately, by article/data/converters/GoogleSourceButtonBlockInjector (shouldInject).

Approach

  • One unnamed patch with three hooks (feed tile, overview component, article block list).
  • Each hook calls an extension filter with a configurable set of DTO/model classes or predicates.
  • Fingerprint on the unobfuscated class and method names plus the log strings.

Done when

  • Infrastructure in place and used by at least one named patch from #16.
  • Build passes; patch-install.ps1 -NoInstall applies on 7.52.0.
  • docs/apps/volkskrant.md documents the three 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.

  • Read the toggles through MidasSettings' in-memory cache; the feed and article mappers are hot paths.
  • Changes apply on the next feed or article load, without a restart.
Part of #16. ## Feature description Several roadmap issues need to drop specific tiles or blocks from de Volkskrant: - push boxes (#37); - games teasers (#41); - the Google "preferred source" button (#44). All three content surfaces already have a mapper that drops `null`, so one small infrastructure patch can give each of them a type filter. ## Findings (7.52.0, all unobfuscated) ### Home feed tiles - `nl.persgroep.edition.teasers.data.converters.SectionDtoToModelExtensionsKt.toModel(TileDto, TrackingData): Tile`. - Its caller `toModel(SectionDto, int)` already drops null. It returns null for `UnknownTileDto`, logging "Unknown tile type encountered". - Tile types: - `"advertisement"` (`AdvertisementTileDto`); - `"pushCategoryBox"` (`SubscribableCategoriesTileDto`); - teaser group; - teaser. - Teaser types: basicTeaser, balconyTeaser, columnTeaser, imageTeaser, podcastTeaser, quoteTeaser, list, duo. - Puzzle teasers are normal teasers whose destination is `TeaserDestination.Game` (set in `SectionDtoToModelExtensionsKt.getDestination` from `gameIdentifier`). ### Overview pages - `nl.persgroep.edition.overview.presentation.model.OverviewViewDataMapper.map(OverviewPage)` and its private `toViewData(OverviewPageComponent, String, int)` already return null for `Unknown`, and nulls are dropped. - There is also a client-side `InlineMessage` (the audio page onboarding hint), added in `GetOverviewPageUseCase`. ### Article body - The mapper is `nl.persgroep.edition.article.data.converters.ArticleBodyBlockDtoMapper.invoke(List<BlockDto>): List<Block>`. - Remove blocks there rather than mapping them to `Block.Unknown`: unknown blocks trigger the "update app" banner (#23). - `GoogleSourceButton` blocks are injected separately, by `article/data/converters/GoogleSourceButtonBlockInjector` (`shouldInject`). ## Approach - One unnamed patch with three hooks (feed tile, overview component, article block list). - Each hook calls an extension filter with a configurable set of DTO/model classes or predicates. - Fingerprint on the unobfuscated class and method names plus the log strings. ## Done when - [ ] Infrastructure in place and used by at least one named patch from #16. - [ ] Build passes; `patch-install.ps1 -NoInstall` applies on 7.52.0. - [ ] `docs/apps/volkskrant.md` documents the three 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. - Read the toggles through `MidasSettings`' in-memory cache; the feed and article mappers are hot paths. - Changes apply on the next feed or article load, without a restart.
midas closed this issue 2026-10-10 15:59:25 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
midas/midas-patches#19
No description provided.