[Jamie] Fix Dashboard tab widths so long tab titles (e.g. "Workspaces") are not clipped - #205
Merged
Merged
Conversation
…") 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Dashboard's TabLayout (Feed / Friends / Tribes / Workspaces) currently uses Material's default
MODE_FIXED+ equal-widthtabGravity, forcing all four tabs into equal ~25% slots regardless of label length. Combined withandroid:lines="1"and noellipsizeon 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):
Do not change the tab selection/activation logic in DashboardFragment.kt or DashboardViewModel.kt — this is a layout-only fix.