Skip to content

Feature: Global Settings & Trakt Account Polish#522

Merged
akitikkx merged 12 commits intomainfrom
feature/settings-and-polish
Mar 13, 2026
Merged

Feature: Global Settings & Trakt Account Polish#522
akitikkx merged 12 commits intomainfrom
feature/settings-and-polish

Conversation

@akitikkx
Copy link
Owner

@akitikkx akitikkx commented Mar 12, 2026

Feature: Global Settings & Trakt Account Polish

📝 Overview

This PR introduces a centralized Application Settings architecture backed by Android DataStore, resolving hardcoded theme logic and safely isolating Trakt OAuth lifecycle management previously scattered across the UI layer. Alongside this architectural uplift, critical Null Pointer Exceptions within the Compose grids have been heavily fortified, and the Trakt Account UI has received a comprehensive cosmetic overhaul utilizing Material 3 components and adaptive empty states.

🏗️ Architecture & Data

  • Centralized Settings State: Introduced SettingsPreferences DataStore schema defining ThemeState (Light, Dark, System) and DataSaverMode.
  • Global Theme Injection: Refactored the Root UpnextTheme composable to actively collect the global SettingsRepository flow, dynamically swapping theme contexts overriding the local OS settings if manually configured by the user.
  • Null Safety Defensive Bounds: Wrapped all Lazy component data emission collectors in DashboardScreen.kt with .orEmpty() to gracefully prevent fatal index-out-of-bounds Compose lifecycle crashes when Trakt Authorizations momentarily unhydrate during explicit logouts.

🎨 UI & UX Polish

  • Unified Settings Screen: Implemented a comprehensive SettingsScreen route hierarchy featuring categorized Material 3 list elements, switch toggles, and unified dialog structures for Trakt disconnections.
  • Robust Empty States: Built and integrated a scalable EmptyState composable across SearchScreen, DashboardScreen, and Trakt sub-screens. Missing connectivity, empty arrays, or pending load states now organically populate with subtle animations, standard icons, and generic retry boundaries avoiding abrupt white-screen pops.
  • Trakt Account Modernization: Lifted the logged-out Trakt application state into a clean Material 3 Card hierarchy. Removed redundant logout strings from the TraktProfileHeader (as this happens in Settings now) and cleared the repetitive Creative Commons copyright string rendering beneath every individual ListPosterCard.kt dynamically worldwide to deeply declutter lists.
  • Scroll-To-Top: Added a dynamic AnimatedVisibility Floating Action Button to massive Trakt grids, elegantly auto-scrolling lists of 1000+ items back to index 0.

🛡️ Quality Assurance

  • Passed app:ktlintFormat and app:detekt successfully statically without warnings/alerts.
  • Unit Testing implemented against DashboardViewModelTest.kt verifying robust empty flow mapping when Trakt access caches go null.
  • Validated new Lazy Grid null-safety patterns and captured the logic within the .agent/skills/navigation_adaptive_ui/SKILL.md repository knowledge base.

- Add unified DataStore configs for Theme, DataSaver, Trakt tracking under SettingsRepository.
- Scaffold SettingsViewModel and SettingsScreen native UI.
- Establish EmptyState abstraction component for Dashboard and Search feeds.
- Bind OS theme configuration at the Top-level MainActivity compositor instance.
- Removed nested TopAppBar in SettingsScreen.
- Added a globally accessible Settings gear icon action in TopBar.kt.
- Bound application version to robust BuildConfig dynamics gracefully.
…gation and add disconnect confirmation dialog
@akitikkx akitikkx self-assigned this Mar 12, 2026
@akitikkx akitikkx added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 12, 2026
@akitikkx akitikkx changed the title Feature/settings and polish Feature: Global Settings & Trakt Account Polish Mar 12, 2026
@akitikkx akitikkx merged commit 1a3611f into main Mar 13, 2026
2 checks passed
@akitikkx akitikkx deleted the feature/settings-and-polish branch March 13, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant