feat(volkskrant): open Midas Settings from the settings menu #50
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#50
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. Depends on #49.
Feature description
Add a row Midas Settings to de Volkskrant's own settings menu that opens
MidasSettingsActivity(#49).Findings (7.52.0, unobfuscated)
The menu is bundled, not server-driven
res/raw/service_menu.json.ServiceMenuDataSourceImpl.getServiceMenureads it withopenRawResource.nl.persgroep.edition.domain.data.settings.data.ServiceMenu, thenServiceMenuSection(title, showHeader, items), thenServiceMenuItem(title, subtitle, type, url, extra, submenu).{"title","subtitle","type","url","accessory"}.typebecomesServiceMenuItemType.UNKNOWN, which maps toSettingItemType.Other(SettingsMenuMapperKt.mapToSettingItemType).SettingsMenuMapperonly touch LOG_IN, PROFILE/LOG_OUT, DARKMODE, DEVELOPER_MENU and READ_STATE, so they don't remove such a row.Click path
SettingsMenuViewModel.onSettingItemClicked(SettingsItem)emitsNavigationEvent.Url(url, title)forOtherrows with a url.MainActivityhandles that event inprivate void navigateToUrl(NavHostController, String url, String title). It triesDeeplinkDestinationConverter.toDeeplink(Uri), and otherwise opens the in-app WebView.Approach
service_menu.json, at the end of an appropriate section or as a new section:MainActivity.navigateToUrl(Landroidx/navigation/NavHostController;Ljava/lang/String;Ljava/lang/String;)V, callMidasSettings.handleUrl(Activity, String): booleanandreturn-voidwhen it returns true. The Activity isp0; mind register aliasing.ServiceMenuSectionat the start ofSettingsMenuMapper.invoke(ServiceMenu, UserSession)(anchors "Debug menu is activated for: ", "Current user email: ").Risks
method, notmethodOrNull).Not this
The app's hidden developer menu (
DebugDeveloperScreen, gated bySettingsMenuMapper.isDeveloperMenuEnabled) can switch backend environments and feature toggles. Don't expose it.Done when
docs/apps/volkskrant.md.Done in
8126fee(pre-release v1.6.0-dev.1). Device-tested on de Volkskrant 7.52.0: the Midas Settings row in Instellingen opens the screen, back returns to the menu, toggle persists.