Skip to content

Draw the achievements tab underline as a border, not a fill-width bar - #30

Merged
simonhamp merged 1 commit into
NativePHP:mainfrom
cchampou:fix/achievements-tab-underline
Oct 20, 2026
Merged

simonhamp merged 1 commit into
NativePHP:mainfrom
cchampou:fix/achievements-tab-underline

Conversation

@cchampou

@cchampou cchampou commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

In the achievements sheet, the Unix Ranks tab was squeezed into a narrow sliver at the right edge of the tab row, its label wrapping one character per line:

"The second one is compressed on the right with the text vertical."

Root cause

The sheet drew the web's border-b-2 tab underline as a separate sibling column with w-full h-[2] under the label. On Android, a Row measures unweighted children with maxWidth = the row's own width, and a child with width: fill (from w-full) becomes Modifier.fillMaxWidth() (ComposeFlexLayout.kt, cross-axis fill branch) — so the underline claimed the entire row width, not the tab's content width:

  • the first tab ("Badges") therefore reported the full row width,
  • the second tab was measured with the leftover maxWidth ≈ 0 → the "Unix Ranks" label wrapped one character per line.

iOS measures content-sized children with .unspecified, where the bar hugs the label, which is why the two platforms disagreed.

Fix

Draw the underline the way the web does: border-b-2 on the tab itself (lane colour when selected, border-transparent otherwise). No width: fill child remains, so the pressable content-sizes on both platforms. Same height as before (2px bar ↔ 2px border).

Proof

Before/after screenshots from the same Android device, the achievements sheet on main and on this branch. Before, the first tab swallows the row and "Unix Ranks" is crushed into a 121px-wide, 530px-tall sliver, its text wrapped one character per line; after, both tabs sit side by side, "Unix Ranks" a healthy 224px wide.

Before (main) After (this branch)
Unix Ranks tab broken on main Unix Ranks tab fixed

The accessibility trees agree: on main the second tab measures [959,610][1080,1140] — narrow and tall, the vertical text — while on this branch it sits beside Badges at [330,627][554,662].

The wire trees confirm the mechanism too. Before — the underline is a fill-width node inside the first tab:

{"type": "column", "ref": "achievements-tab-badges", "children": [
    {"type": "column", "layout": {"padding": [6, 12, 6, 12]}, "children": [
        {"type": "text", "props": {"text": "Badges (4)"}}
    ]},
    {"type": "column", "layout": {"width": "fill", "height": 2}, "style": {"bg_color": "#2F9E44"}}
]}

After — no fill child; the border rides the tab:

{"type": "column", "layout": {"padding": [6, 12, 6, 12]},
 "style": {"border_width": 2, "border_color": "#2F9E44"},
 "props": {"border_b": 2}, "children": [
    {"type": "text", "props": {"text": "Badges (4)"}}
]}

Testing

  • tests/Feature/Screens/AchievementsSheetTest.php — 8 passed
  • Achievements sheet + profile suites — 23 passed, 416 assertions

The sheet's tabs drew the web's border-b-2 as a separate w-full h-[2] bar
under the label. On Android a w-full child fills to the width of the whole
row (ComposeFlexLayout hands a row's children the row's maxWidth, and
cross-axis FILL becomes fillMaxWidth), so the first tab swelled to the full
row and the second was squeezed to nothing, its label wrapping one
character per line. The web draws the underline as border-b-2 on the tab
itself; do the same, and no fill-width child remains to inflate the tab.
@cchampou
cchampou force-pushed the fix/achievements-tab-underline branch from 3cb7c5e to efe7140 Compare October 20, 2026 01:48
@simonhamp
simonhamp merged commit 58d9390 into NativePHP:main Oct 20, 2026
1 check passed
@simonhamp

Copy link
Copy Markdown
Member

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants