From bea9aeeb88c6af63eb38bdbe98c1afae19b320c0 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 7 Sep 2026 19:36:24 +0000 Subject: [PATCH] [Jamie] Fix Dashboard tab widths so long tab titles (e.g. "Workspaces") are not clipped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Dashboard's TabLayout (Feed / Friends / Tribes / Workspaces) currently uses Material's default `MODE_FIXED` + equal-width `tabGravity`, forcing all four tabs into equal ~25% slots regardless of label length. Combined with `android:lines="1"` and no `ellipsize` on the tab title TextView, the longest label ("Workspaces") gets clipped at the view boundary instead of showing in full or ellipsizing. Fix: switch the TabLayout to a mode that sizes each tab to its content (scrollable) instead of equal fixed-width slots, so "Feed" stays narrow and "Workspaces" gets the width it needs. As a safety net for any future long label, also add `android:ellipsize="end"` to the tab title TextView so text is truncated gracefully instead of hard-clipped if it ever again exceeds available width. Files involved (confirmed via repo_agent read of the actual merged code from PR #194): - sphinx/screens/dashboard/dashboard/src/main/res/layout/fragment_dashboard.xml (the TabLayout — add app:tabMode="scrollable") - sphinx/screens/dashboard/dashboard/src/main/res/layout/layout_dashboard_custom_tab.xml (the custom tab view — outer layout switched from match_parent to wrap_content so each tab sizes to its label) - sphinx/screens/dashboard/dashboard/src/main/res/values/styles.xml (the DashboardTab style — add android:ellipsize="end" alongside the existing android:lines="1") Do not change the tab selection/activation logic in DashboardFragment.kt or DashboardViewModel.kt — this is a layout-only fix. --- .../dashboard/src/main/res/layout/fragment_dashboard.xml | 1 + .../src/main/res/layout/layout_dashboard_custom_tab.xml | 2 +- .../screens/dashboard/dashboard/src/main/res/values/styles.xml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sphinx/screens/dashboard/dashboard/src/main/res/layout/fragment_dashboard.xml b/sphinx/screens/dashboard/dashboard/src/main/res/layout/fragment_dashboard.xml index 1c6e383e..7b572da0 100644 --- a/sphinx/screens/dashboard/dashboard/src/main/res/layout/fragment_dashboard.xml +++ b/sphinx/screens/dashboard/dashboard/src/main/res/layout/fragment_dashboard.xml @@ -28,6 +28,7 @@ app:tabSelectedTextColor="@color/text" app:tabRippleColor="@null" app:tabTextAppearance="@style/DashboardTab" + app:tabMode="scrollable" app:layout_constraintTop_toBottomOf="@+id/layout_dashboard_header" /> @font/roboto_medium 1 + end false false @dimen/default_text_size_tab