Commit Graph

35 Commits

Author SHA1 Message Date
Arkadiusz Fal
be4e1adb9b Fix all SwiftLint violations across codebase
Resolves 130+ violations including deployment target checks, code style issues, and formatting inconsistencies. Adds SwiftLint disable comments for compiler-required availability checks while maintaining deployment target compliance.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:14:35 +01:00
Arkadiusz Fal
f4d4daccd0 Optimize SwiftUI performance throughout the app
This commit addresses multiple SwiftUI performance bottlenecks identified
through code analysis, focusing on view rendering efficiency, list
performance, and memory usage optimization.

Key improvements:

- HomeView: Optimize async task management using structured concurrency
  with async let to handle multiple Defaults updates in a single task

- VideoCell: Remove GeometryReader from VideoCellThumbnail to eliminate
  layout thrashing; change @ObservedObject to computed property for shared
  ThumbnailsModel

- ThumbnailView: Cache URL extension computation in init() instead of
  recalculating on every body evaluation

- FavoriteItemView: Replace filter().prefix() with early-exit loop and
  capacity reservation for significant performance gain on large lists

- ContentItemView: Optimize FetchRequest creation with direct predicate
  construction only for video items, empty predicate for others

- VideoPlayerView: Fix playerSize didSet trigger by moving
  updateSidebarQueue() calls to explicit onChange/onAppear handlers

- FeedView: Replace .unique() with Set-based deduplication for O(n)
  performance and reduced allocations

- VerticalCells: Remove expensive sorting on every redraw; items should
  be pre-sorted from source

These optimizations follow SwiftUI best practices by minimizing expensive
computations in view bodies, caching computed values, using efficient data
structures, and avoiding unnecessary redraws and layout passes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 18:14:35 +01:00
Arkadiusz Fal
89dfbdb5c7 Fix swiftformat offenses 2024-07-06 11:48:49 +02:00
Toni Förster
94f19d55c8 more responsive UI when Favorites are used.
- The reloading of items in the favorite widgets is now done async, so it does not block the UI when opening Home.
- Tasks that check for changes of the widget and favorites are now terminated when another view e.g. Subscriptions is opened.
- We only update the Favourites when the player is not in the foreground, to avoid unresponsiveness.
2024-05-24 19:46:42 +02:00
Arkadiusz Fal
f28cec79ba Merge pull request #672 from stonerl/favorites-view-tweaks
HomeView: Changes to Favourites and History Widget
2024-05-18 11:41:57 +02:00
Toni Förster
38c4ddbe43 HomeView: Changes to Favourites and History Widget
The History Widget in the Home View was hard-coded to 10 items. Now it uses the limit set in the settings.

The items weren't immediate updated when the limit was changed.

List Views had a hard-coded limit of 10 items. Now they use the limit supplied in the parameter.
2024-05-18 00:36:40 +02:00
Toni Förster
e35f8b7892 Snappy UI - Offloading non UI task to background threads
This gives a huge increase in perceived performance. The UI is now much more responsive since some tasks are run in the background and don't block the UI anymore.
2024-05-17 21:36:02 +02:00
Arkadiusz Fal
7741e531f4 Swiftformat fixes 2024-05-16 19:01:02 +02:00
Arkadiusz Fal
44045b9e19 Don't observe favorites settings change 2023-07-24 19:45:31 +02:00
Arkadiusz Fal
2c5eb18bc9 Fix crash 2023-06-07 23:37:27 +02:00
Arkadiusz Fal
56c2e552f7 Revert "Add loading status to vertical cells"
This reverts commit c6cff4dee4.
2023-06-07 23:37:27 +02:00
Arkadiusz Fal
5ee869c02c Fix lists padding in favorites 2023-06-07 23:37:27 +02:00
Arkadiusz Fal
c6cff4dee4 Add loading status to vertical cells 2023-05-29 16:42:19 +02:00
Arkadiusz Fal
713570dfd6 Fix navigatable in favorite item view 2023-05-29 16:13:13 +02:00
Arkadiusz Fal
b1637c5ef1 Fix buttons on tvOS 2023-05-29 16:13:12 +02:00
Arkadiusz Fal
0061bd8c20 Home Settings 2023-05-25 18:36:03 +02:00
Arkadiusz Fal
5c0cf7452c Remove unused code 2023-04-22 23:39:43 +02:00
Arkadiusz Fal
4851db4879 Fix loading channels data in Favorites 2023-03-12 22:52:54 +01:00
Arkadiusz Fal
f1e132a909 Add channel tabs and pagination
Fix #135
2023-02-28 21:04:42 +01:00
Arkadiusz Fal
cfd85a018e Fix Invidious channel videos 2023-02-06 21:42:16 +01:00
Arkadiusz Fal
fcf527fa87 Player bar visibility modes and settings 2023-02-05 14:24:13 +01:00
Arkadiusz Fal
8e5bafba58 Documents navigation 2023-02-05 14:24:13 +01:00
Arkadiusz Fal
894b9bdcd7 Fix favorite subscriptions visibility 2023-02-05 14:24:13 +01:00
Arkadiusz Fal
f39b440b21 Refactor 2023-02-05 14:24:13 +01:00
Arkadiusz Fal
b8f693e213 Caching for favorites 2023-02-05 14:24:12 +01:00
Arkadiusz Fal
3b31f21c81 Channels caching 2023-02-05 14:24:11 +01:00
Arkadiusz Fal
09ff16d464 Favorited playlists belong to account 2023-02-05 14:24:09 +01:00
Arkadiusz Fal
115f9fea67 Fix playlists in favorites 2023-02-05 14:24:09 +01:00
Arkadiusz Fal
899e66b204 Channel view and other small improvements 2023-02-05 14:24:08 +01:00
Arkadiusz Fal
f6a261662c Favorites improvements 2023-02-05 14:24:08 +01:00
Arkadiusz Fal
971beddc8d Feed cache 2023-02-05 14:24:07 +01:00
Arkadiusz Fal
0d333b5583 Replace environment objects with observed objects 2022-12-05 10:13:19 +01:00
Arkadiusz Fal
780b7ab130 Localizations fixes 2022-12-04 13:32:28 +01:00
Arkadiusz Fal
ab5afbc9a4 Add Edit favorites 2022-12-04 13:32:25 +01:00
Arkadiusz Fal
dbb7134eb7 Rename Favorites to Home
Fix #329
2022-12-04 13:32:22 +01:00