Skip to content

feat(favorites): Fix Loading Issues and Add New Display View#414

Merged
RadicalMuffinMan merged 1 commit into
Moonfin-Client:mainfrom
mattsigal:feature/favorites-update
Jun 7, 2026
Merged

feat(favorites): Fix Loading Issues and Add New Display View#414
RadicalMuffinMan merged 1 commit into
Moonfin-Client:mainfrom
mattsigal:feature/favorites-update

Conversation

@mattsigal

@mattsigal mattsigal commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

feat(favorites): Fix Loading Issues and Add New Display View

Summary

This PR implements several enhancements to the Favorites screen, introducing dynamic view style switching (Home/Rows vs Library/Grid views), restoring key focus feedback, implementing smooth row-to-row vertical jumping, and extending lazy loading support.

Related Issues

Link related issues or tickets separated by commas.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • UI/UX update
  • Documentation update
  • Build/CI change
  • Other (describe):

Changes Made

  1. Added a setting under the cog settings dialog on the Favorites page that allows users to toggle the view between Home View (categorized rows; default) and Library View (flat grid of all favorites). The preference is persisted in user preferences.
  2. Removed the logic that suppressed the focus indicator borders on MediaCards, restoring visible border feedback (essential for TV/D-pad navigation layouts like Neon Pulse).
  3. Updated LockedFocusRow key event handling to bubble unhandled vertical D-pad navigation key events (up/down) up to the system rather than trapping them. Implemented custom row-to-row jump tracking (onVerticalNavigation) in the Favorites home view to shift focus and center the viewport on the active row using Scrollable.ensureVisible. Focus bubbles back up to header buttons (Home, Sort, Settings cog) naturally when navigating UP from the top row.
  4. Added lazy loading/pagination support to both views (categorized rows and flat grid) to lazy load media items when scrolling near limits to fix the original issue reported (got there in the end).

Files Changed

  • lib/preference/preference_constants.dart: Introduced FavoritesViewStyle enum (home and library).
  • lib/preference/user_preferences.dart: Registered the favoritesViewStyle user preference.
  • lib/data/viewmodels/favorites_view_model.dart: Implemented fetching pagination offsets for flat grid paging (loadMoreGrid) and row category paging (loadMoreForType).
  • lib/ui/widgets/focus/locked_focus_row.dart: Updated isUpKey and isDownKey event logic to respect the vertical navigation handler's return state and bubble unhandled key presses.
  • lib/ui/screens/browse/favorites_screen.dart: _buildGrid(), _onRowVerticalNavigation, and added view switching UI selection tiles inside Display Settings.

Platform

  • Android
  • iOS
  • macOS
  • Windows
  • Linux
  • All / Shared code

Testing

Describe how this change was tested.

  • Tested on emulator / simulator
  • Tested on physical device
  • Manual testing completed
  • Not tested (explain why):

Test Steps

  1. Navigate to the Favorites screen.
  2. Verify that focused items correctly draw the focus border indicators.
  3. Open display settings (cog icon) and switch view to Library View. Confirm the layout displays as a grid and that scrolling to the bottom lazy-loads additional cards.
  4. Switch view back to Home View. Use the D-pad to navigate left/right within a row and verify that focus does not escape the row edges horizontally.
  5. Press D-pad Down or Up to navigate between Movie and TV Show rows; verify that focus transitions smoothly and centers the active row in the viewport.
  6. From the top row, press D-pad Up to confirm focus exits the row and targets the toolbar header actions (Home/Sort/Settings).

Screenshots (if applicable)

OLD LIBRARY VIEW

fav-old1 fav-old2

NEW LIBRARY VIEW

2026-06-07_13-17-23_moonfin 2026-06-07_13-17-38_moonfin 2026-06-07_13-18-04_moonfin 2026-06-07_13-18-11_moonfin 2026-06-07_13-18-24_moonfin

Checklist

  • Code builds successfully
  • Code follows project style and conventions
  • No unnecessary commented-out code
  • No new warnings introduced

@@ -220,72 +325,125 @@ class _FavoritesScreenState extends State<FavoritesScreen> {
final isNeon = ThemeRegistry.active.id == ThemeRegistry.neonPulseId;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
final isNeon = ThemeRegistry.active.id == ThemeRegistry.neonPulseId;

supressFocusGlow from 317 already covers this and this isnt needed

final focusColor = Color(
_prefs.get(UserPreferences.focusColor).colorValue,
);
final isNeon = ThemeRegistry.active.id == ThemeRegistry.neonPulseId;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
final isNeon = ThemeRegistry.active.id == ThemeRegistry.neonPulseId;

same thing

: 1.0;
final textHeight = (hasSubtitles ? 42.0 : 24.0) * desktopTextScale;
final childAspectRatio = cellWidth / (cellWidth / ar + textHeight);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
final focusColor = Color(_prefs.get(UserPreferences.focusColor).colorValue);
final focusExpansion = _prefs.get(UserPreferences.cardFocusExpansion);
final suppressFocusGlow = ThemeRegistry.active.borders.focusGlow.isNotEmpty;

instead of redrawing for every card just make it a constant so its computed once not per cell

delegate: SliverChildBuilderDelegate((context, index) {
final item = _vm.gridItems[index];
final itemAspectRatio = _itemAspectRatio(item);
final focusColor = Color(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
final focusColor = Color(

final item = _vm.gridItems[index];
final itemAspectRatio = _itemAspectRatio(item);
final focusColor = Color(
_prefs.get(UserPreferences.focusColor).colorValue,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_prefs.get(UserPreferences.focusColor).colorValue,

final itemAspectRatio = _itemAspectRatio(item);
final focusColor = Color(
_prefs.get(UserPreferences.focusColor).colorValue,
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
);

_prefs.get(UserPreferences.focusColor).colorValue,
);
final isNeon = ThemeRegistry.active.id == ThemeRegistry.neonPulseId;
final focusExpansion = _prefs.get(UserPreferences.cardFocusExpansion);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
final focusExpansion = _prefs.get(UserPreferences.cardFocusExpansion);

);
final isNeon = ThemeRegistry.active.id == ThemeRegistry.neonPulseId;
final focusExpansion = _prefs.get(UserPreferences.cardFocusExpansion);
final suppressFocusGlow = ThemeRegistry.active.borders.focusGlow.isNotEmpty;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
final suppressFocusGlow = ThemeRegistry.active.borders.focusGlow.isNotEmpty;

@mattsigal mattsigal force-pushed the feature/favorites-update branch from b611adf to 2f62849 Compare June 7, 2026 23:06
@mattsigal

Copy link
Copy Markdown
Contributor Author

All changes done!

…cking

- Restored focus indicator border on MediaCards on Favorites screen.
- Introduced FavoritesViewStyle enum (home/library) in preferences.
- Added 'Switch View' setting to toggled display settings dialog on the Favorites screen.
- Implemented flat grid view layout builder with scroll-to-bottom lazy-loading and focus node mixin.
- Upgraded LockedFocusRow key event handling to propagate unhandled vertical focus events instead of swallowing them.
- Implemented onVerticalNavigation row key tracking and viewport centering (via Scrollable.ensureVisible) to easily jump between Movie, TV Show, and other category rows on TV/desktop.
@mattsigal mattsigal force-pushed the feature/favorites-update branch from 2f62849 to df4df20 Compare June 7, 2026 23:07
@RadicalMuffinMan RadicalMuffinMan merged commit 14b3de9 into Moonfin-Client:main Jun 7, 2026
5 checks passed
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.

Issues while on favorites

2 participants