feat: Dynamically update desktop window title#845
feat: Dynamically update desktop window title#845schembriaiden wants to merge 5 commits intoDonutWare:developfrom
Conversation
|
I was not able to test this on Windows due to having Visual Studio 2026 installed which is only supported by flutter v3.38 onwards, but it works on both Linux and Mac I have also not been able to test the music part as I do not have music on my Jellyfin server. |
| } | ||
|
|
||
| @override | ||
| String get windowTitle { |
There was a problem hiding this comment.
This should use the translated season/episode prefixes
| String get title => name; | ||
|
|
||
| String get windowTitle { | ||
| if (jellyType == dto.BaseItemKind.audio) { |
There was a problem hiding this comment.
Fladder doesn't support audio yet was this added for a reason?
| switchInCurve: Curves.easeInOutCubic, | ||
| switchOutCurve: Curves.easeInOutCubic, | ||
| child: child, | ||
| child: RepaintBoundary(child: child), |
There was a problem hiding this comment.
Not sure why this change was included. I'm not even sure the RepaintBoundary does anything here, considering the AnimatedFade/Switcher already re-paint the entire widget anyway.
| subscriptions.add(subscription); | ||
| } | ||
|
|
||
| // Reset the window title when playback stops (model becomes null). |
There was a problem hiding this comment.
Why not call this in the media_control_wrapper "stop" instead of adding a new listener.
|
|
||
| Future<bool> loadPlaybackItem(PlaybackModel model, Duration startPosition) async { | ||
| await state.stop(); | ||
| ref.read(windowTitleProvider.notifier).setPlayTitle(model.item.windowTitle); |
There was a problem hiding this comment.
Same for this, currently the OS playback controls are set in media_control_wrapper where this should also live.
| ) ?? | ||
| const SizedBox.shrink(), | ||
| ), | ||
| player.videoWidget( |
There was a problem hiding this comment.
Why was the hero removed?
| child: AspectRatio( | ||
| aspectRatio: aspectRatio, | ||
| child: VideoPlayer(controller), | ||
| child: ExcludeSemantics( |
There was a problem hiding this comment.
Why do we want to exclude semantics in the video players?
|
Thanks for the implementation, few comments here and there. Let me know if anything is unclear. |
Pull Request Description
This pull request introduces a new context-aware window title system for the application, ensuring that the window title reflects the current navigation state and playback context. The changes span across model classes, UI scaffolds, and platform-specific code, enhancing user experience and accessibility. The most important changes are grouped below.
Window Title Management
windowTitleProvider(lib/providers/window_title_provider.dart) implementing a stack-based approach to manage window titles, updating them based on navigation and playback events, and synchronizing with the OS window manager.lib/widgets/navigation_scaffold/navigation_scaffold.dart) and detail screens (lib/screens/shared/detail_scaffold.dart), including stack management and title updates on navigation changes.lib/providers/video_player_provider.dart).Model Enhancements
windowTitlegetters forItemBaseModel,EpisodeModel, andSeasonModel, providing context-rich titles for playback and navigation.UI and Accessibility Improvements
windowTitleto scaffolds, ensuring correct title display during navigation and playback (lib/screens/details_screens/episode_detail_screen.dart,lib/screens/details_screens/season_detail_screen.dart).ExcludeSemanticsto prevent redundant screen reader output (lib/wrappers/players/lib_mdk.dart,lib/wrappers/players/lib_mpv.dart).Herowidget with a simpleValueKeyfor mini player, and wrapping children inRepaintBoundaryfor performance (lib/widgets/navigation_scaffold/components/floating_player_bar.dart,lib/screens/shared/animated_fade_size.dart).Platform Title Consistency
Issue Being Fixed
Resolves #issue-number
Screenshots / Recordings
Checklist