Skip to content

feat(home): shrink slot text until every app fits on screen - #59

Merged
thypon merged 1 commit into
masterfrom
feat/fit-home-slots
Nov 12, 2026
Merged

thypon merged 1 commit into
masterfrom
feat/fit-home-slots

Conversation

@thypon

@thypon thypon commented Nov 12, 2026

Copy link
Copy Markdown
Owner

What

When the configured app count overflows the screen at the default 32dip slot size, the launcher now scales the slot text and the interline spacing (the 50px bottom padding) down by available / natural content height, with one pixel per child reserved for the framework's per-line rounding, until every listing is visible. Content that already fits keeps the default size.

Behavior

  • 40 apps on a small screen: text shrinks to whatever fits (~3.7px in the Robolectric sandbox; proportionally larger on real hardware) and all rows are visible.
  • 3 apps: unchanged (scale stays 1).
  • Applied once after the first layout pass (homescreen.post), so it picks up the real screen bounds including fitsSystemWindows insets.
  • No floor: as requested, it shrinks "up to the point it's possible to see all the listings".

BDD

  • homescreen.feature: Many apps shrink the slot text so every app stays visible (40 slots → every slot visible + text scaled down), Few apps keep the slot text at its default size.
  • LauncherWorld: allHomeSlotsVisible (measures natural content height vs display height), homeSlotTextScaledDown, homeSlotTextDefaultSize.

Test infra note

Robolectric's legacy font renderer keeps line height constant regardless of text size, which makes any fit-by-shrinking assertion impossible to verify — the suite now runs with robolectric.graphicsMode=NATIVE (real font metrics) via app/build.gradle. Full suite + 80% JaCoCo gate green under it.

Testing

./gradlew check BUILD SUCCESSFUL (unit + BDD + coverage gate + lint).

Commits are unsigned (signing key passphrase-locked).

When the configured app count overflows the screen at the 32dip slot
size, the launcher now scales the slot text and the interline spacing
by available/natural content height (one pixel per child reserved for
per-line rounding) so every listing stays visible. Screens that already
fit keep the default size.

Verified under Robolectric NATIVE graphics mode: the legacy font
renderer keeps line height constant regardless of text size, which made
any fit-by-shrinking assertion impossible to verify, so the sandbox now
runs with real font metrics.
@github-actions

Copy link
Copy Markdown

The following commits were not verified:
cf2f6e7 (unsigned)

@thypon
thypon merged commit 9463a68 into master Nov 12, 2026
5 checks passed
@thypon
thypon deleted the feat/fit-home-slots branch November 12, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant