Skip to content

[Jamie] Fix Dashboard tab widths so long tab titles (e.g. "Workspaces") are not clipped - #205

Merged
tomastiminskas merged 1 commit into
masterfrom
swarm/swarm-change-aa51d844
Sep 7, 2026
Merged

tomastiminskas merged 1 commit into
masterfrom
swarm/swarm-change-aa51d844

Conversation

@tomastiminskas

Copy link
Copy Markdown
Collaborator

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.

…") are not clipped

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.
@tomastiminskas tomastiminskas added the jamie Automated PR opened by Jamie label Sep 7, 2026 — with Hive Chat PM
@tomastiminskas
tomastiminskas merged commit 4601756 into master Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jamie Automated PR opened by Jamie

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant