From 08b7dbfd196c09d28551532e9e9fe5fef76dd4b9 Mon Sep 17 00:00:00 2001 From: Andy Valdez Date: Mon, 29 Jan 2024 13:12:16 -0500 Subject: [PATCH 01/19] [Lib] Bump Login-Flow library from 1.10 to 1.11 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 48b97e4000ad..284bcf07204d 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,7 @@ ext { gutenbergMobileVersion = 'v1.112.0-alpha3' wordPressAztecVersion = 'v2.0' wordPressFluxCVersion = '2.64.0' - wordPressLoginVersion = '1.10.0' + wordPressLoginVersion = '1.11.0' wordPressPersistentEditTextVersion = '1.0.2' wordPressUtilsVersion = '3.12.0' indexosMediaForMobileVersion = '43a9026f0973a2f0a74fa813132f6a16f7499c3a' From 6ba2cc286d43a83c01fb7175358d450325e39b56 Mon Sep 17 00:00:00 2001 From: Annmarie Ziegler Date: Mon, 29 Jan 2024 14:22:12 -0500 Subject: [PATCH 02/19] Add event for OPENED_SITE_MONITORING from app link --- .../java/org/wordpress/android/analytics/AnalyticsTracker.java | 3 ++- .../wordpress/android/analytics/AnalyticsTrackerNosara.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java index 766cd5e3e775..ba65e2e228ea 100644 --- a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java +++ b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java @@ -1101,7 +1101,8 @@ public enum Stat { DYNAMIC_DASHBOARD_CARD_CTA_TAPPED, DYNAMIC_DASHBOARD_CARD_HIDE_TAPPED, DEEP_LINK_FAILED, - SITE_MONITORING_SCREEN_SHOWN + SITE_MONITORING_SCREEN_SHOWN, + OPENED_SITE_MONITORING, } private static final List TRACKERS = new ArrayList<>(); diff --git a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java index 96eb82eefa83..6a83354fe74d 100644 --- a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java +++ b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java @@ -2697,6 +2697,8 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) { return "deep_link_failed"; case SITE_MONITORING_SCREEN_SHOWN: return "site_monitoring_screen_shown"; + case OPENED_SITE_MONITORING: + return "opened_site_monitoring"; } return null; } From a6633b00261981ac5ca022bf10046068a8ab248e Mon Sep 17 00:00:00 2001 From: Annmarie Ziegler Date: Mon, 29 Jan 2024 14:23:19 -0500 Subject: [PATCH 03/19] Add site-monitoring app link support. Fix miss in media https scheme --- WordPress/src/main/AndroidManifest.xml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/WordPress/src/main/AndroidManifest.xml b/WordPress/src/main/AndroidManifest.xml index edba81e6e442..f2186cac8386 100644 --- a/WordPress/src/main/AndroidManifest.xml +++ b/WordPress/src/main/AndroidManifest.xml @@ -482,13 +482,23 @@ + android:scheme="https" /> + + + + From 3a3247498797aabb602432850df5854986a89632 Mon Sep 17 00:00:00 2001 From: Annmarie Ziegler Date: Mon, 29 Jan 2024 14:24:00 -0500 Subject: [PATCH 04/19] Add navigation action OpenSiteMonitoringForSite and handle it --- .../wordpress/android/ui/deeplinks/DeepLinkNavigator.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/DeepLinkNavigator.kt b/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/DeepLinkNavigator.kt index 58b2598d1c40..470f6f149669 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/DeepLinkNavigator.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/DeepLinkNavigator.kt @@ -27,6 +27,7 @@ import org.wordpress.android.ui.deeplinks.DeepLinkNavigator.NavigateAction.ShowS import org.wordpress.android.ui.deeplinks.DeepLinkNavigator.NavigateAction.StartCreateSiteFlow import org.wordpress.android.ui.deeplinks.DeepLinkNavigator.NavigateAction.ViewPostInReader import org.wordpress.android.ui.sitecreation.misc.SiteCreationSource.DEEP_LINK +import org.wordpress.android.ui.sitemonitor.SiteMonitorType import org.wordpress.android.ui.stats.StatsTimeframe import org.wordpress.android.util.UriWrapper import javax.inject.Inject @@ -91,6 +92,11 @@ class DeepLinkNavigator navigateAction.site ) NavigateAction.DomainManagement -> ActivityLauncher.openDomainManagement(activity) + is NavigateAction.OpenSiteMonitoringForSite -> activityNavigator.openSiteMonitoringInNewStack( + activity, + navigateAction.site, + navigateAction.siteMonitorType + ) } if (navigateAction != LoginForResult) { activity.finish() @@ -126,5 +132,7 @@ class DeepLinkNavigator object OpenMedia : NavigateAction() data class OpenMediaPickerForSite(val site: SiteModel) : NavigateAction() object DomainManagement : NavigateAction() + data class OpenSiteMonitoringForSite(val site: SiteModel?, val siteMonitorType: SiteMonitorType) : + NavigateAction() } } From ac734290bb569751c83d450367f7427df585c5bd Mon Sep 17 00:00:00 2001 From: Annmarie Ziegler Date: Mon, 29 Jan 2024 14:24:27 -0500 Subject: [PATCH 05/19] Add helper for open site monitoring in a new stack from app link --- .../wordpress/android/ui/ActivityNavigator.kt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/ActivityNavigator.kt b/WordPress/src/main/java/org/wordpress/android/ui/ActivityNavigator.kt index b37b30457c37..f4966505789d 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/ActivityNavigator.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/ActivityNavigator.kt @@ -28,6 +28,7 @@ import org.wordpress.android.ui.mysite.menu.MenuActivity import org.wordpress.android.ui.mysite.personalization.PersonalizationActivity import org.wordpress.android.ui.quickstart.QuickStartEvent import org.wordpress.android.ui.sitemonitor.SiteMonitorParentActivity +import org.wordpress.android.ui.sitemonitor.SiteMonitorType import org.wordpress.android.util.ToastUtils import org.wordpress.android.util.analytics.AnalyticsUtils import javax.inject.Inject @@ -163,5 +164,23 @@ class ActivityNavigator @Inject constructor() { intent.putExtra(WordPress.SITE, site) context.startActivity(intent) } + + fun openSiteMonitoringInNewStack(context: Context, site: SiteModel?, siteMonitorType: SiteMonitorType = SiteMonitorType.METRICS) { + if (site == null) { + ToastUtils.showToast(context, R.string.site_monitoring_cannot_be_started, ToastUtils.Duration.SHORT) + return + } + val props = mutableMapOf("site_monitoring_type" to siteMonitorType.name as Any) + AnalyticsUtils.trackWithSiteDetails(AnalyticsTracker.Stat.OPENED_SITE_MONITORING, site, props) + val taskStackBuilder = TaskStackBuilder.create(context) + val mainActivityIntent = getMainActivityInNewStack(context) + val intent = Intent(context, SiteMonitorParentActivity::class.java) + intent.putExtra(WordPress.SITE, site) + intent.putExtra(SiteMonitorParentActivity.ARG_SITE_MONITOR_TYPE_KEY, siteMonitorType) + taskStackBuilder + .addNextIntent(mainActivityIntent) + .addNextIntent(intent) + .startActivities() + } } From 7650adecb8eb304ac34e53cc0d91964f259fa11c Mon Sep 17 00:00:00 2001 From: Annmarie Ziegler Date: Mon, 29 Jan 2024 14:24:55 -0500 Subject: [PATCH 06/19] Add resource for when site monitoring can not be app linked into --- WordPress/src/main/res/values/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/WordPress/src/main/res/values/strings.xml b/WordPress/src/main/res/values/strings.xml index d35b92bd2664..4fe2da0ac0f0 100644 --- a/WordPress/src/main/res/values/strings.xml +++ b/WordPress/src/main/res/values/strings.xml @@ -4857,4 +4857,5 @@ translators: %s: Select control option value e.g: "Auto, 25%". --> Metrics PHP Logs Web Server Logs + We cannot open site monitoring at the moment. Please try again later From 82e3f7cf39c3622a91cf0cba391ea02eda34e3e0 Mon Sep 17 00:00:00 2001 From: Annmarie Ziegler Date: Mon, 29 Jan 2024 14:25:30 -0500 Subject: [PATCH 07/19] Add the site monitor app link handler --- .../handlers/SiteMonitorLinkHandler.kt | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 WordPress/src/main/java/org/wordpress/android/ui/deeplinks/handlers/SiteMonitorLinkHandler.kt diff --git a/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/handlers/SiteMonitorLinkHandler.kt b/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/handlers/SiteMonitorLinkHandler.kt new file mode 100644 index 000000000000..b5f329353399 --- /dev/null +++ b/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/handlers/SiteMonitorLinkHandler.kt @@ -0,0 +1,60 @@ +package org.wordpress.android.ui.deeplinks.handlers + +import org.wordpress.android.fluxc.model.SiteModel +import org.wordpress.android.ui.deeplinks.DeepLinkNavigator +import org.wordpress.android.ui.deeplinks.DeepLinkUriUtils +import org.wordpress.android.ui.deeplinks.DeepLinkingIntentReceiverViewModel +import org.wordpress.android.ui.sitemonitor.SiteMonitorType +import org.wordpress.android.util.UriWrapper +import javax.inject.Inject + +class SiteMonitorLinkHandler +@Inject constructor(private val deepLinkUriUtils: DeepLinkUriUtils) : DeepLinkHandler { + /** + * Returns true if the URI looks like `wordpress.com/SITE_MONITORING_PATH` + */ + override fun shouldHandleUrl(uri: UriWrapper): Boolean { + return (uri.host == DeepLinkingIntentReceiverViewModel.HOST_WORDPRESS_COM && + uri.pathSegments.firstOrNull() == SITE_MONITORING_PATH) || uri.host == SITE_MONITORING_PATH + } + + override fun buildNavigateAction(uri: UriWrapper): DeepLinkNavigator.NavigateAction { + val targetHost = uri.pathSegments[1] + val site: SiteModel? = deepLinkUriUtils.hostToSite(targetHost) + val siteMonitorType = urlToType(uri.toString()) + return DeepLinkNavigator.NavigateAction.OpenSiteMonitoringForSite(site, siteMonitorType) + } + + override fun stripUrl(uri: UriWrapper): String { + return buildString { + val offset = if (uri.host == SITE_MONITORING_PATH) { + append(DeepLinkingIntentReceiverViewModel.APPLINK_SCHEME) + 0 + } else { + append("${DeepLinkingIntentReceiverViewModel.HOST_WORDPRESS_COM}/") + 1 + } + append(SITE_MONITORING_PATH) + val pathSegments = uri.pathSegments + val size = pathSegments.size + val hasSiteUrl = if (size > offset + 1) pathSegments.getOrNull(offset + 1) != null else false + if (hasSiteUrl) { + append("/${DeepLinkingIntentReceiverViewModel.SITE_DOMAIN}") + } + } + } + + private fun urlToType(url: String): SiteMonitorType { + return when { + url.contains(PHP_LOGS_PATTERN) -> SiteMonitorType.PHP_LOGS + url.contains(WEB_SERVER_LOGS_PATTERN) -> SiteMonitorType.WEB_SERVER_LOGS + else -> SiteMonitorType.METRICS + } + } + + companion object { + private const val SITE_MONITORING_PATH = "site-monitoring" + private const val PHP_LOGS_PATTERN = "/php" + private const val WEB_SERVER_LOGS_PATTERN = "/web" + } +} From 64b557993ee0e95918ea09d28b953bfbe7a8d95f Mon Sep 17 00:00:00 2001 From: Annmarie Ziegler Date: Mon, 29 Jan 2024 14:26:11 -0500 Subject: [PATCH 08/19] Add the siteMonitorLinkHandler to the list of deepLinkHandlers and update unit test --- .../android/ui/deeplinks/handlers/DeepLinkHandlers.kt | 2 ++ .../android/ui/deeplinks/handlers/DeepLinkHandlersTest.kt | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/handlers/DeepLinkHandlers.kt b/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/handlers/DeepLinkHandlers.kt index c089152827a4..3f7313f563c3 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/handlers/DeepLinkHandlers.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/handlers/DeepLinkHandlers.kt @@ -20,6 +20,7 @@ class DeepLinkHandlers mediaLinkHandler: MediaLinkHandler, domainManagementLinkHandler: DomainManagementLinkHandler, qrCodeMediaLinkHandler: QRCodeMediaLinkHandler, + siteMonitorLinkHandler: SiteMonitorLinkHandler ) { private val handlers = listOf( editorLinkHandler, @@ -33,6 +34,7 @@ class DeepLinkHandlers mediaLinkHandler, domainManagementLinkHandler, qrCodeMediaLinkHandler, + siteMonitorLinkHandler ) private val _toast by lazy { diff --git a/WordPress/src/test/java/org/wordpress/android/ui/deeplinks/handlers/DeepLinkHandlersTest.kt b/WordPress/src/test/java/org/wordpress/android/ui/deeplinks/handlers/DeepLinkHandlersTest.kt index 224de052cc95..c8aaff5ea24d 100644 --- a/WordPress/src/test/java/org/wordpress/android/ui/deeplinks/handlers/DeepLinkHandlersTest.kt +++ b/WordPress/src/test/java/org/wordpress/android/ui/deeplinks/handlers/DeepLinkHandlersTest.kt @@ -48,6 +48,9 @@ class DeepLinkHandlersTest : BaseUnitTest() { @Mock lateinit var qrCodeMediaLinkHandler: QRCodeMediaLinkHandler + @Mock + lateinit var siteMonitorLinkHandler: SiteMonitorLinkHandler + @Mock lateinit var uri: UriWrapper private lateinit var deepLinkHandlers: DeepLinkHandlers @@ -67,6 +70,7 @@ class DeepLinkHandlersTest : BaseUnitTest() { mediaLinkHandler, domainManagementLinkHandler, qrCodeMediaLinkHandler, + siteMonitorLinkHandler ) initDeepLinkHandlers() } @@ -84,6 +88,7 @@ class DeepLinkHandlersTest : BaseUnitTest() { mediaLinkHandler, domainManagementLinkHandler, qrCodeMediaLinkHandler, + siteMonitorLinkHandler ) } From 32818303b0a488e6e369d5f678ae94bf79647338 Mon Sep 17 00:00:00 2001 From: Annmarie Ziegler Date: Mon, 29 Jan 2024 14:27:52 -0500 Subject: [PATCH 09/19] Refactor: add support for passing the siteMonitorType when coming from a app link scenario. --- .../ui/sitemonitor/SiteMonitorParentActivity.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorParentActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorParentActivity.kt index 7291b52263ab..c2118117baf2 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorParentActivity.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorParentActivity.kt @@ -65,7 +65,13 @@ class SiteMonitorParentActivity: AppCompatActivity() { return requireNotNull(intent.getSerializableExtraCompat(WordPress.SITE)) as SiteModel } + private fun getInitialTab(): SiteMonitorType { + return intent?.getSerializableExtraCompat(ARG_SITE_MONITOR_TYPE_KEY) as SiteMonitorType? + ?: SiteMonitorType.METRICS + } + companion object { + const val ARG_SITE_MONITOR_TYPE_KEY = "ARG_SITE_MONITOR_TYPE_KEY" const val SAVED_STATE_CONTAINER_KEY = "ContainerKey" const val SAVED_STATE_CURRENT_TAB_KEY = "CurrentTabKey" } @@ -90,7 +96,7 @@ class SiteMonitorParentActivity: AppCompatActivity() { SiteMonitorTabNavigation(selectedTab) { selectedTab -> val item = enumValues().find { it.route == selectedTab - } ?: SiteMonitorTabItem.Metrics + } ?: initialItem(getInitialTab()) SiteMonitorFragmentContainer( modifier = Modifier.fillMaxSize(), @@ -104,6 +110,12 @@ class SiteMonitorParentActivity: AppCompatActivity() { } } + private fun initialItem(type: SiteMonitorType): SiteMonitorTabItem { + return enumValues().find { + it.siteMonitorType == type + } ?: SiteMonitorTabItem.Metrics + } + private fun getCommitFunction( fragment : Fragment, tag: String From e81dd062d36ac8864848c84d7d3f84218e3e0e3c Mon Sep 17 00:00:00 2001 From: Annmarie Ziegler Date: Mon, 29 Jan 2024 14:55:40 -0500 Subject: [PATCH 10/19] Refactor: move extract host into its own method to expand the extraction --- .../ui/deeplinks/handlers/SiteMonitorLinkHandler.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/handlers/SiteMonitorLinkHandler.kt b/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/handlers/SiteMonitorLinkHandler.kt index b5f329353399..1461d7db8755 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/handlers/SiteMonitorLinkHandler.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/deeplinks/handlers/SiteMonitorLinkHandler.kt @@ -19,12 +19,17 @@ class SiteMonitorLinkHandler } override fun buildNavigateAction(uri: UriWrapper): DeepLinkNavigator.NavigateAction { - val targetHost = uri.pathSegments[1] + val targetHost = extractHost(uri) val site: SiteModel? = deepLinkUriUtils.hostToSite(targetHost) val siteMonitorType = urlToType(uri.toString()) return DeepLinkNavigator.NavigateAction.OpenSiteMonitoringForSite(site, siteMonitorType) } + private fun extractHost(uri: UriWrapper): String { + if (uri.pathSegments.size <= 1) return "" + return uri.pathSegments[1] + } + override fun stripUrl(uri: UriWrapper): String { return buildString { val offset = if (uri.host == SITE_MONITORING_PATH) { From bc6452d98f3b1d88132d657d2863541ab336cf05 Mon Sep 17 00:00:00 2001 From: Annmarie Ziegler Date: Mon, 29 Jan 2024 15:59:25 -0500 Subject: [PATCH 11/19] Refactor: address detekt long lines --- .../main/java/org/wordpress/android/ui/ActivityNavigator.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/ActivityNavigator.kt b/WordPress/src/main/java/org/wordpress/android/ui/ActivityNavigator.kt index f4966505789d..61cb8664470a 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/ActivityNavigator.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/ActivityNavigator.kt @@ -165,7 +165,11 @@ class ActivityNavigator @Inject constructor() { context.startActivity(intent) } - fun openSiteMonitoringInNewStack(context: Context, site: SiteModel?, siteMonitorType: SiteMonitorType = SiteMonitorType.METRICS) { + fun openSiteMonitoringInNewStack( + context: Context, + site: SiteModel?, + siteMonitorType: SiteMonitorType = SiteMonitorType.METRICS + ) { if (site == null) { ToastUtils.showToast(context, R.string.site_monitoring_cannot_be_started, ToastUtils.Duration.SHORT) return From c144d637e4c0766cfdb496efeddeb6778224f49e Mon Sep 17 00:00:00 2001 From: Ravi Date: Tue, 30 Jan 2024 18:34:37 +1100 Subject: [PATCH 12/19] Show Today Card on Traffic tab Adds Today Card for default By day option --- .../granular/usecases/OverviewUseCase.kt | 130 +++++++++++++++++- 1 file changed, 127 insertions(+), 3 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/sections/granular/usecases/OverviewUseCase.kt b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/sections/granular/usecases/OverviewUseCase.kt index 46d2a1ce3a39..ef7b192d6ba7 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/sections/granular/usecases/OverviewUseCase.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/stats/refresh/lists/sections/granular/usecases/OverviewUseCase.kt @@ -14,6 +14,8 @@ import org.wordpress.android.modules.BG_THREAD import org.wordpress.android.modules.UI_THREAD import org.wordpress.android.ui.stats.refresh.lists.sections.BaseStatsUseCase import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem +import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.QuickScanItem +import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.QuickScanItem.Column import org.wordpress.android.ui.stats.refresh.lists.sections.BlockListItem.ValueItem import org.wordpress.android.ui.stats.refresh.lists.sections.granular.GranularUseCaseFactory import org.wordpress.android.ui.stats.refresh.lists.sections.granular.SelectedDateProvider @@ -21,12 +23,14 @@ import org.wordpress.android.ui.stats.refresh.lists.sections.granular.usecases.O import org.wordpress.android.ui.stats.refresh.lists.widget.WidgetUpdater.StatsWidgetUpdaters import org.wordpress.android.ui.stats.refresh.utils.StatsDateFormatter import org.wordpress.android.ui.stats.refresh.utils.StatsSiteProvider +import org.wordpress.android.ui.stats.refresh.utils.StatsUtils import org.wordpress.android.ui.stats.refresh.utils.toStatsSection import org.wordpress.android.ui.stats.refresh.utils.trackGranular import org.wordpress.android.util.AppLog import org.wordpress.android.util.AppLog.T import org.wordpress.android.util.LocaleManagerWrapper import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper +import org.wordpress.android.util.config.StatsTrafficTabFeatureConfig import org.wordpress.android.viewmodel.ResourceProvider import java.util.Calendar import javax.inject.Inject @@ -48,7 +52,9 @@ class OverviewUseCase constructor( private val analyticsTracker: AnalyticsTrackerWrapper, private val statsWidgetUpdaters: StatsWidgetUpdaters, private val localeManagerWrapper: LocaleManagerWrapper, - private val resourceProvider: ResourceProvider + private val resourceProvider: ResourceProvider, + private val statsUtils: StatsUtils, + private val trafficTabFeatureConfig: StatsTrafficTabFeatureConfig ) : BaseStatsUseCase( OVERVIEW, mainDispatcher, @@ -144,6 +150,120 @@ class OverviewUseCase constructor( domainModel: VisitsAndViewsModel, uiState: UiState ): List { + return if (trafficTabFeatureConfig.isEnabled()) { + buildTrafficOverview(domainModel, uiState) + } else { + buildGranularOverview(domainModel, uiState) + } + } + + private fun buildTrafficOverview(domainModel: VisitsAndViewsModel, uiState: UiState): List { + val items = mutableListOf() + if (domainModel.dates.isNotEmpty()) { + val dateFromProvider = selectedDateProvider.getSelectedDate(statsGranularity) + val visibleBarCount = uiState.visibleBarCount ?: domainModel.dates.size + val availableDates = domainModel.dates.map { + statsDateFormatter.parseStatsDate( + statsGranularity, + it.period + ) + } + val selectedDate = dateFromProvider ?: availableDates.last() + val index = availableDates.indexOf(selectedDate) + + selectedDateProvider.selectDate( + selectedDate, + availableDates.takeLast(visibleBarCount), + statsGranularity + ) + val selectedItem = domainModel.dates.getOrNull(index) ?: domainModel.dates.last() + val previousItem = domainModel.dates.getOrNull(domainModel.dates.indexOf(selectedItem) - 1) + + if (statsGranularity == StatsGranularity.DAYS) { + buildTodayCard(selectedItem,items) + } else { + buildGranularChart(domainModel, uiState, items, selectedItem, previousItem) + } + } else { + selectedDateProvider.onDateLoadingFailed(statsGranularity) + AppLog.e(T.STATS, "There is no data to be shown in the overview block") + } + return items + } + + private fun buildTodayCard( + selectedItem: VisitsAndViewsModel.PeriodData?, + items: MutableList + ) { + val views = selectedItem?.views ?: 0 + val visitors = selectedItem?.visitors ?: 0 + val likes = selectedItem?.likes ?: 0 + val comments = selectedItem?.comments ?: 0 + + items.add(BlockListItem.Title(R.string.stats_timeframe_today)) + items.add( + QuickScanItem( + Column( + R.string.stats_views, + statsUtils.toFormattedString(views) + ), + Column( + R.string.stats_visitors, + statsUtils.toFormattedString(visitors) + ) + ) + ) + + items.add( + QuickScanItem( + Column( + R.string.stats_likes, + statsUtils.toFormattedString(likes) + ), + Column( + R.string.stats_comments, + statsUtils.toFormattedString(comments) + ) + ) + ) + } + + private fun buildGranularChart( + domainModel: VisitsAndViewsModel, + uiState: UiState, + items: MutableList, + selectedItem: VisitsAndViewsModel.PeriodData, + previousItem: VisitsAndViewsModel.PeriodData? + ) { + items.add( + overviewMapper.buildTitle( + selectedItem, + previousItem, + uiState.selectedPosition, + isLast = selectedItem == domainModel.dates.last(), + statsGranularity = statsGranularity + ) + ) + items.addAll( + overviewMapper.buildChart( + domainModel.dates, + statsGranularity, + this::onBarSelected, + this::onBarChartDrawn, + uiState.selectedPosition, + selectedItem.period + ) + ) + items.add( + overviewMapper.buildColumns( + selectedItem, + this::onColumnSelected, + uiState.selectedPosition + ) + ) + } + + private fun buildGranularOverview(domainModel: VisitsAndViewsModel, uiState: UiState): List { val items = mutableListOf() if (domainModel.dates.isNotEmpty()) { val dateFromProvider = selectedDateProvider.getSelectedDate(statsGranularity) @@ -237,7 +357,9 @@ class OverviewUseCase constructor( private val analyticsTracker: AnalyticsTrackerWrapper, private val statsWidgetUpdaters: StatsWidgetUpdaters, private val localeManagerWrapper: LocaleManagerWrapper, - private val resourceProvider: ResourceProvider + private val resourceProvider: ResourceProvider, + private val statsUtils: StatsUtils, + private val trafficTabFeatureConfig: StatsTrafficTabFeatureConfig ) : GranularUseCaseFactory { override fun build(granularity: StatsGranularity, useCaseMode: UseCaseMode) = OverviewUseCase( @@ -252,7 +374,9 @@ class OverviewUseCase constructor( analyticsTracker, statsWidgetUpdaters, localeManagerWrapper, - resourceProvider + resourceProvider, + statsUtils, + trafficTabFeatureConfig ) } } From 88429761d57a30871953018ef2e0ebff5bda0117 Mon Sep 17 00:00:00 2001 From: Ravi Date: Tue, 30 Jan 2024 18:34:41 +1100 Subject: [PATCH 13/19] Update OverviewUseCaseTest.kt --- .../granular/usecases/OverviewUseCaseTest.kt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/WordPress/src/test/java/org/wordpress/android/ui/stats/refresh/lists/sections/granular/usecases/OverviewUseCaseTest.kt b/WordPress/src/test/java/org/wordpress/android/ui/stats/refresh/lists/sections/granular/usecases/OverviewUseCaseTest.kt index 3757b6c82b41..d0206175cee8 100644 --- a/WordPress/src/test/java/org/wordpress/android/ui/stats/refresh/lists/sections/granular/usecases/OverviewUseCaseTest.kt +++ b/WordPress/src/test/java/org/wordpress/android/ui/stats/refresh/lists/sections/granular/usecases/OverviewUseCaseTest.kt @@ -35,8 +35,10 @@ import org.wordpress.android.ui.stats.refresh.lists.sections.granular.SelectedDa import org.wordpress.android.ui.stats.refresh.lists.widget.WidgetUpdater.StatsWidgetUpdaters import org.wordpress.android.ui.stats.refresh.utils.StatsDateFormatter import org.wordpress.android.ui.stats.refresh.utils.StatsSiteProvider +import org.wordpress.android.ui.stats.refresh.utils.StatsUtils import org.wordpress.android.util.LocaleManagerWrapper import org.wordpress.android.util.analytics.AnalyticsTrackerWrapper +import org.wordpress.android.util.config.StatsTrafficTabFeatureConfig import org.wordpress.android.viewmodel.ResourceProvider import java.util.Calendar @@ -77,6 +79,13 @@ class OverviewUseCaseTest : BaseUnitTest() { @Mock lateinit var localeManagerWrapper: LocaleManagerWrapper + + @Mock + lateinit var statsUtils: StatsUtils + + @Mock + lateinit var trafficTabFeatureConfig: StatsTrafficTabFeatureConfig + private lateinit var useCase: OverviewUseCase private val site = SiteModel() private val siteId = 1L @@ -100,7 +109,9 @@ class OverviewUseCaseTest : BaseUnitTest() { analyticsTrackerWrapper, statsWidgetUpdaters, localeManagerWrapper, - resourceProvider + resourceProvider, + statsUtils, + trafficTabFeatureConfig ) site.siteId = siteId whenever(statsSiteProvider.siteModel).thenReturn(site) From 56685613756fae31f8c6ae03c6c971f00a648bf9 Mon Sep 17 00:00:00 2001 From: Pantelis Stampoulis Date: Tue, 30 Jan 2024 10:03:03 +0200 Subject: [PATCH 14/19] Modify colors for site monitor tabs --- .../ui/sitemonitor/SiteMonitorTabHeader.kt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabHeader.kt b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabHeader.kt index 1bf493f7c49d..927918afa815 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabHeader.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabHeader.kt @@ -1,9 +1,11 @@ package org.wordpress.android.ui.sitemonitor import androidx.compose.foundation.layout.Column -import androidx.compose.material3.MaterialTheme +import androidx.compose.material.MaterialTheme import androidx.compose.material3.Tab import androidx.compose.material3.TabRow +import androidx.compose.material3.TabRowDefaults +import androidx.compose.material3.TabRowDefaults.tabIndicatorOffset import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -11,8 +13,10 @@ import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp @Composable @@ -25,8 +29,16 @@ fun SiteMonitorTabHeader(navController: (String) -> Unit) { ) TabRow( selectedTabIndex = selectedTabIndex, - containerColor = MaterialTheme.colorScheme.surface, - contentColor = MaterialTheme.colorScheme.onSurface, + containerColor = MaterialTheme.colors.surface, + contentColor = MaterialTheme.colors.onSurface, + indicator = { tabPositions -> + // Customizing the indicator color and style + TabRowDefaults.Indicator( + Modifier.tabIndicatorOffset(tabPositions[selectedTabIndex]), + color = MaterialTheme.colors.onSurface, + height = 2.0.dp + ) + } ) { tabs.forEachIndexed { index, item -> Tab( From 294ac0bf4b68a4262ab86897afea4d7426303841 Mon Sep 17 00:00:00 2001 From: Pantelis Stampoulis Date: Tue, 30 Jan 2024 10:03:38 +0200 Subject: [PATCH 15/19] Add analytics for site monitor tabs --- .../android/ui/sitemonitor/SiteMonitorParentActivity.kt | 9 +++++++++ .../android/ui/sitemonitor/SiteMonitorTabViewModel.kt | 1 - .../android/ui/sitemonitor/SiteMonitorUiState.kt | 8 ++++---- .../wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt | 8 +++++++- .../wordpress/android/analytics/AnalyticsTracker.java | 1 + .../android/analytics/AnalyticsTrackerNosara.java | 2 ++ 6 files changed, 23 insertions(+), 6 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorParentActivity.kt b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorParentActivity.kt index c2118117baf2..9a9c52b4920b 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorParentActivity.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorParentActivity.kt @@ -28,15 +28,22 @@ import org.wordpress.android.ui.compose.components.MainTopAppBar import org.wordpress.android.ui.compose.components.NavigationIcons import org.wordpress.android.ui.compose.theme.AppTheme import org.wordpress.android.util.extensions.getSerializableExtraCompat +import javax.inject.Inject @AndroidEntryPoint class SiteMonitorParentActivity: AppCompatActivity() { + @Inject + lateinit var siteMonitorUtils: SiteMonitorUtils + private var savedStateSparseArray = SparseArray() private var currentSelectItemId = 0 @Suppress("DEPRECATION") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + + siteMonitorUtils.trackActivityLaunched() + if (savedInstanceState != null) { savedStateSparseArray = savedInstanceState.getSparseParcelableArray( SAVED_STATE_CONTAINER_KEY @@ -98,6 +105,8 @@ class SiteMonitorParentActivity: AppCompatActivity() { it.route == selectedTab } ?: initialItem(getInitialTab()) + siteMonitorUtils.trackTabLoaded(item.siteMonitorType) + SiteMonitorFragmentContainer( modifier = Modifier.fillMaxSize(), commit = getCommitFunction( diff --git a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabViewModel.kt b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabViewModel.kt index aaae3507f424..6da26dbb7e77 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabViewModel.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabViewModel.kt @@ -106,7 +106,6 @@ class SiteMonitorTabViewModel @Inject constructor( } fun onUrlLoaded() { - siteMonitorUtils.trackTabLoaded(siteMonitorType) postUiState(SiteMonitorUiState.Loaded) } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUiState.kt b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUiState.kt index 50bca3c0dec8..8b7dee5a31cc 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUiState.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUiState.kt @@ -51,8 +51,8 @@ data class SiteMonitorModel( val url: String, val addressToLoad: String ) -enum class SiteMonitorType { - METRICS, - PHP_LOGS, - WEB_SERVER_LOGS +enum class SiteMonitorType(val analyticsDescription: String) { + METRICS("metrics"), + PHP_LOGS("php_logs"), + WEB_SERVER_LOGS("server_logs") } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt index f4e7fe8c098d..d42bbe4c9fc6 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt @@ -21,6 +21,7 @@ class SiteMonitorUtils @Inject constructor( fun trackActivityLaunched() { + Log.i(javaClass.simpleName, "track Site Monitor screen shown") analyticsTrackerWrapper.track(AnalyticsTracker.Stat.SITE_MONITORING_SCREEN_SHOWN) } @@ -35,13 +36,18 @@ class SiteMonitorUtils @Inject constructor( } fun trackTabLoaded(siteMonitorType: SiteMonitorType) { - // todo: need to set this up properly with track events Log.i(javaClass.simpleName, "track TabLoaded with $siteMonitorType") + analyticsTrackerWrapper.track( + AnalyticsTracker.Stat.SITE_MONITORING_TAB_SHOWN, + mapOf( + TAB_TRACK_KEY to siteMonitorType + )) } companion object { const val HTTP_PATTERN = "(https?://)" const val PHP_LOGS_PATTERN = "/php" const val WEB_SERVER_LOGS_PATTERN = "/web" + const val TAB_TRACK_KEY = "tab" } } diff --git a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java index ba65e2e228ea..4ecc68844c66 100644 --- a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java +++ b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java @@ -1103,6 +1103,7 @@ public enum Stat { DEEP_LINK_FAILED, SITE_MONITORING_SCREEN_SHOWN, OPENED_SITE_MONITORING, + SITE_MONITORING_TAB_SHOWN, } private static final List TRACKERS = new ArrayList<>(); diff --git a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java index 6a83354fe74d..6bc51ec5bdbf 100644 --- a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java +++ b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTrackerNosara.java @@ -2699,6 +2699,8 @@ public static String getEventNameForStat(AnalyticsTracker.Stat stat) { return "site_monitoring_screen_shown"; case OPENED_SITE_MONITORING: return "opened_site_monitoring"; + case SITE_MONITORING_TAB_SHOWN: + return "site_monitoring_tab_shown"; } return null; } From 3a7b6d8efb42b5c3a68727782bc566ab0c49f7a9 Mon Sep 17 00:00:00 2001 From: Ajesh R Pai Date: Tue, 30 Jan 2024 15:43:52 +0530 Subject: [PATCH 16/19] - Removes: redundant logging information from the code base --- .../android/ui/sitemonitor/SiteMonitorTabViewModel.kt | 2 -- .../org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt | 3 --- 2 files changed, 5 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabViewModel.kt b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabViewModel.kt index 6da26dbb7e77..275c65087676 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabViewModel.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabViewModel.kt @@ -1,7 +1,6 @@ package org.wordpress.android.ui.sitemonitor import android.text.TextUtils -import android.util.Log import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.flow.MutableStateFlow @@ -32,7 +31,6 @@ class SiteMonitorTabViewModel @Inject constructor( val uiState: StateFlow = _uiState fun start(type: SiteMonitorType, urlTemplate: String, site: SiteModel) { - Log.i("Track", "TheViewModel start with $urlTemplate and $type") this.siteMonitorType = type this.urlTemplate = urlTemplate this.site = site diff --git a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt index d42bbe4c9fc6..f4322eaf7685 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt @@ -1,6 +1,5 @@ package org.wordpress.android.ui.sitemonitor -import android.util.Log import org.wordpress.android.WordPress import org.wordpress.android.analytics.AnalyticsTracker import org.wordpress.android.ui.WPWebViewActivity @@ -21,7 +20,6 @@ class SiteMonitorUtils @Inject constructor( fun trackActivityLaunched() { - Log.i(javaClass.simpleName, "track Site Monitor screen shown") analyticsTrackerWrapper.track(AnalyticsTracker.Stat.SITE_MONITORING_SCREEN_SHOWN) } @@ -36,7 +34,6 @@ class SiteMonitorUtils @Inject constructor( } fun trackTabLoaded(siteMonitorType: SiteMonitorType) { - Log.i(javaClass.simpleName, "track TabLoaded with $siteMonitorType") analyticsTrackerWrapper.track( AnalyticsTracker.Stat.SITE_MONITORING_TAB_SHOWN, mapOf( From 3116c92a9bfe52eed389ead82df1ff22da3248bc Mon Sep 17 00:00:00 2001 From: Ajesh R Pai Date: Tue, 30 Jan 2024 15:44:18 +0530 Subject: [PATCH 17/19] + Adds: tab tracking to the analytics event --- .../org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt index f4322eaf7685..8ab932a5b86c 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt @@ -37,7 +37,7 @@ class SiteMonitorUtils @Inject constructor( analyticsTrackerWrapper.track( AnalyticsTracker.Stat.SITE_MONITORING_TAB_SHOWN, mapOf( - TAB_TRACK_KEY to siteMonitorType + TAB_TRACK_KEY to siteMonitorType.analyticsDescription )) } From 849484fa790de77ab19178cbdb771090568587d9 Mon Sep 17 00:00:00 2001 From: Ajesh R Pai Date: Tue, 30 Jan 2024 15:44:57 +0530 Subject: [PATCH 18/19] - Removes: redundant function --- .../wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt index 8ab932a5b86c..a4b25ed2a1c7 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorUtils.kt @@ -25,14 +25,6 @@ class SiteMonitorUtils @Inject constructor( fun sanitizeSiteUrl(url: String?) = url?.replace(Regex(HTTP_PATTERN), "") ?: "" - fun urlToType(url: String): SiteMonitorType { - return when { - url.contains(PHP_LOGS_PATTERN) -> SiteMonitorType.PHP_LOGS - url.contains(WEB_SERVER_LOGS_PATTERN) -> SiteMonitorType.WEB_SERVER_LOGS - else -> SiteMonitorType.METRICS - } - } - fun trackTabLoaded(siteMonitorType: SiteMonitorType) { analyticsTrackerWrapper.track( AnalyticsTracker.Stat.SITE_MONITORING_TAB_SHOWN, From f59c5dfd27ea847c1432ec0e71ff1358c1950901 Mon Sep 17 00:00:00 2001 From: Ajesh R Pai Date: Tue, 30 Jan 2024 15:51:41 +0530 Subject: [PATCH 19/19] Updates: the tab title to default height --- .../wordpress/android/ui/sitemonitor/SiteMonitorTabHeader.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabHeader.kt b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabHeader.kt index 927918afa815..7a15059a31fc 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabHeader.kt +++ b/WordPress/src/main/java/org/wordpress/android/ui/sitemonitor/SiteMonitorTabHeader.kt @@ -17,7 +17,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp @Composable fun SiteMonitorTabHeader(navController: (String) -> Unit) { @@ -46,7 +45,6 @@ fun SiteMonitorTabHeader(navController: (String) -> Unit) { Column (horizontalAlignment = Alignment.CenterHorizontally) { Text( text = stringResource(item.title), - fontSize = 12.sp, maxLines = 1, overflow = TextOverflow.Ellipsis )