Commit Graph

23 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
Toni Förster
4663aab3da refactor Search
- have a separate body view for each os
- macOS: set navigation title for search
- macOS: set min width to 835 for main content
- macOS: set main window min height to 600
- macOS: don’t have text behind the cancel button
- split SearchTextField into macOS and iOS/tvOS
- iOS: move search menu to the right
- iOS: unified search field
- make min width a constant
- add option to disable search suggestions

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
2024-09-10 09:38:14 +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
c6cff4dee4 Add loading status to vertical cells 2023-05-29 16:42:19 +02:00
Arkadiusz Fal
0061bd8c20 Home Settings 2023-05-25 18:36:03 +02:00
Arkadiusz Fal
d5f8e35430 Fix channel videos horizontal layout 2023-05-21 19:13:42 +02:00
Arkadiusz Fal
83dfdd6c0e tvOS filters for all views
Vertical list for trending, popular, playlists, search

Fix #413, #415
2023-04-22 23:39:43 +02:00
Arkadiusz Fal
71c666ebfe Fix placeholders 2023-02-05 14:24:11 +01:00
Arkadiusz Fal
25da312966 Listing styles 2023-02-05 14:24:09 +01:00
Arkadiusz Fal
33abe4d487 Channel pages 2022-12-05 10:13:19 +01:00
Arkadiusz Fal
a29024698e Disable cells animation on redraw 2022-10-27 18:03:57 +02:00
Arkadiusz Fal
9868a2ef01 Reorganize toolbars placement 2022-10-27 18:03:57 +02:00
Arkadiusz Fal
8b4838dca5 Fix placeholders on tvOS 2022-03-27 20:31:56 +02:00
Arkadiusz Fal
ae4796a4c5 Add placeholders 2022-03-27 13:26:38 +02:00
Arkadiusz Fal
ea6363ba65 Add infinite scroll for search (fixes #5) 2022-01-05 11:44:53 +01:00
Arkadiusz Fal
ea90f650d8 Remove unused code, minor style changes 2021-12-20 00:36:12 +01:00
Arkadiusz Fal
5ef89ac9f4 iOS 14/macOS Big Sur Support 2021-11-30 19:01:08 +01:00
Arkadiusz Fal
dd8d6b6c4a Fix removing instance 2021-11-12 21:46:15 +01:00
Arkadiusz Fal
c94687f54e UI improvements 2021-11-12 10:53:15 +01:00
Arkadiusz Fal
06bae05a66 Minor UI fixes 2021-11-05 19:23:28 +01:00
Arkadiusz Fal
60c7027429 Open videos via URL scheme 2021-10-24 11:16:04 +02:00
Arkadiusz Fal
8e0af22b94 Add Sponsor Block and settings 2021-10-23 21:11:53 +02:00
Arkadiusz Fal
0e54cbcad0 Channels search, add SDWebImage framework 2021-10-22 02:05:01 +02:00