Skip to content

fix: cozy, centered loading UI across screens - #11

Merged
jvsena42 merged 1 commit into
mainfrom
fix/cozy-loading-ui
Jun 16, 2026
Merged

fix: cozy, centered loading UI across screens#11
jvsena42 merged 1 commit into
mainfrom
fix/cozy-loading-ui

Conversation

@jvsena42

Copy link
Copy Markdown
Owner

Problem

Loading UI was broken across most Android screens:

  1. Swipe spinner showed with no swipe. Home, Decks, and Discover wrapped content in PullToRefreshBox(isRefreshing = state is Loading). The ViewModels start in Loading, so the pull-to-refresh indicator auto-appeared on every initial load even though the user never swiped.
  2. On-screen spinner not centered. Each screen's inline LoadingBlock placed the spinner in a Column(fillMaxSize()) inside a verticalScroll column — unbounded height collapses fillMaxSize() to wrap-content, so the spinner sat just under the header. Discover was worst: hardcoded padding(top = 80.dp) with no vertical centering.

Changes

  • New shared EchoLoadingScreen (ui/components/): three accent-orange dots bouncing in a staggered wave with a friendly caption, truly centered on the full viewport. Respects "Remove animations" / Reduce Motion (dots render static). rememberReduceMotion() moved here as a shared helper (removed StudySession's private copy).
  • Home / Decks / Discover: initial Loading now renders the loader outside PullToRefreshBox (no spurious swipe spinner, properly centered); pull-to-refresh still works via isRefreshing = false. Old LoadingBlocks removed.
  • Consistency pass: DeckDetail, StudySession, Settings, Profile, FriendProfile now use the same loader. Button-level spinners (publish/save/sign-in) left unchanged.
  • Added contextual loading captions to strings.xml.

Verification

  • ./gradlew :composeApp:compileDebugKotlin — BUILD SUCCESSFUL
  • ./gradlew detektAll — clean

Not yet visually confirmed on a device.

🤖 Generated with Claude Code

Replace broken loading states with a shared EchoLoadingScreen (bouncing
accent dots + caption, centered, respects Reduce Motion).

- Fix spurious pull-to-refresh spinner on Home/Decks/Discover: the
  PullToRefreshBox bound isRefreshing to the initial Loading state, so the
  swipe indicator showed with no swipe. Initial load now renders the loader
  outside PullToRefreshBox.
- Fix off-center spinners: old LoadingBlock used fillMaxSize() inside a
  verticalScroll column (unbounded height -> collapsed under the header);
  Discover also hardcoded a top padding. The loader now centers on the full
  viewport.
- Apply the same loader to DeckDetail, StudySession, Settings, Profile and
  FriendProfile for consistency. Button-level spinners left unchanged.
- Share rememberReduceMotion() via ui/components; add loading captions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jvsena42
jvsena42 merged commit a6bd926 into main Jun 16, 2026
2 checks passed
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.

1 participant