Commit Graph

15 Commits

Author SHA1 Message Date
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
12afb31c03 Fix issue with navigation links and lists 2023-05-25 18:36:03 +02:00
Arkadiusz Fal
50e1491990 Refactor hide shorts 2023-05-25 18:36:03 +02:00
Arkadiusz Fal
eed9330c0c Add buttons for hiding watched videos
Fix #448
2023-05-25 18:36:02 +02:00
Arkadiusz Fal
2b18f0cffa Add hiding short videos 2023-02-25 17:18:35 +01:00
Arkadiusz Fal
bdb1f032a9 Home queue 2023-02-05 14:24:14 +01:00
Arkadiusz Fal
f39b440b21 Refactor 2023-02-05 14:24:13 +01:00
Arkadiusz Fal
71c666ebfe Fix placeholders 2023-02-05 14:24:11 +01:00
Arkadiusz Fal
1cd2dbe5f7 Add list views for channels, playlists and placeholders 2023-02-05 14:24:09 +01:00
Arkadiusz Fal
b351b31e05 UI improvements 2023-02-05 14:24:09 +01:00
Arkadiusz Fal
25da312966 Listing styles 2023-02-05 14:24:09 +01:00
Arkadiusz Fal
c51b9dd8e8 Code style change 2022-10-27 18:03:57 +02:00
Arkadiusz Fal
ae4796a4c5 Add placeholders 2022-03-27 13:26:38 +02:00
Arkadiusz Fal
734bb31260 Channel playlists support 2021-10-23 01:04:03 +02:00
Arkadiusz Fal
0e54cbcad0 Channels search, add SDWebImage framework 2021-10-22 02:05:01 +02:00