Commit Graph

34 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
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
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
Arkadiusz Fal
2be6f04e37 Import export settings 2024-02-02 11:16:27 +01:00
Toni Förster
36ecf63b6c defaults move from .observe() to .updates()
https://github.com/sindresorhus/Defaults/releases/tag/v7.0.0
2023-12-27 17:27:24 +01:00
Arkadiusz Fal
91290d4736 Fix #486 2023-06-07 23:37:28 +02:00
Arkadiusz Fal
0061bd8c20 Home Settings 2023-05-25 18:36:03 +02:00
Arkadiusz Fal
35867ba14a Home changes 2023-05-25 18:36:03 +02:00
Arkadiusz Fal
1f0a2d25e9 Localization fix 2023-05-18 11:32:45 +02:00
Arkadiusz Fal
a763e1d097 Fix Favorites performance 2023-02-05 14:24:17 +01:00
Arkadiusz Fal
2ce903b6c3 Settings for new features 2023-02-05 14:24:14 +01:00
Arkadiusz Fal
bdb1f032a9 Home queue 2023-02-05 14:24:14 +01:00
Arkadiusz Fal
eca685ae29 Watch next view 2023-02-05 14:24:14 +01:00
Arkadiusz Fal
8e5bafba58 Documents navigation 2023-02-05 14:24:13 +01:00
Arkadiusz Fal
a9c8053474 Rename button 2023-02-05 14:24:12 +01:00
Arkadiusz Fal
d02bb23e57 New account selection menu 2023-02-05 14:24:09 +01:00
Arkadiusz Fal
f6a261662c Favorites improvements 2023-02-05 14:24:08 +01:00
Arkadiusz Fal
74d65f6ab8 Browser player bar as overlay 2023-02-05 14:24:07 +01:00
Arkadiusz Fal
33abe4d487 Channel pages 2022-12-05 10:13:19 +01:00
Arkadiusz Fal
0d333b5583 Replace environment objects with observed objects 2022-12-05 10:13:19 +01:00
Arkadiusz Fal
54334d2ce5 Fix button on macOS 2022-12-04 13:32:30 +01:00
Arkadiusz Fal
5ded159dec Minor fixes 2022-12-04 13:32:29 +01:00
Arkadiusz Fal
708c6fc112 Fix buttons on tvOS 2022-12-04 13:32:29 +01:00
Arkadiusz Fal
99769380fc Localization and platform availability fixes 2022-12-04 13:32:28 +01:00
Arkadiusz Fal
780b7ab130 Localizations fixes 2022-12-04 13:32:28 +01:00
Arkadiusz Fal
bc1571a746 Add recent documents to home on iOS 2022-12-04 13:32:28 +01:00
Arkadiusz Fal
78ff495927 Add clear history button to home 2022-12-04 13:32:27 +01:00
Arkadiusz Fal
61d235780d Various minor fixes 2022-12-04 13:32:25 +01:00
Arkadiusz Fal
eb9924bd4a Layout fixes 2022-12-04 13:32:25 +01:00
Arkadiusz Fal
51bd46b3ae Home settings 2022-12-04 13:32:25 +01:00
Arkadiusz Fal
730ba1ea2e Improve open videos layouts 2022-12-04 13:32:24 +01:00
Arkadiusz Fal
402d1a2f79 Opening videos by URL and local files 2022-12-04 13:32:22 +01:00
Arkadiusz Fal
dbb7134eb7 Rename Favorites to Home
Fix #329
2022-12-04 13:32:22 +01:00