Repository navigation
feat: Add Auto Picture-in-Picture Feature and Refactor Favicon Handling - #146
Merged
Merged
Conversation
- Introduced a new setting for enabling/disabling automatic Picture-in-Picture (PiP) mode on tab switch. - Updated SettingsStore to manage the autoPiPEnabled state and persist it. - Enhanced GeneralSettingsView to include a toggle for the auto PiP feature. - Modified TabManager to trigger PiP when switching to a new tab if the setting is enabled. - Implemented JavaScript function to handle PiP requests in WebViewNavigationDelegate.
- Updated Tab model to synchronize title changes with the media controller when a tab's title is set. - Refactored favicon handling in MediaPlayerCard to use AsyncImage for improved loading and display. - Modified FaviconService to cache favicons more efficiently and updated the favicon URL size for better resolution. - Enhanced MediaController to track whether media sessions were played and filter visible sessions accordingly. - Implemented session removal logic in TabManager to ensure proper cleanup of media sessions when tabs are closed. - Improved JavaScript integration for media state tracking, including handling of media play events and title updates.
- Aligned whitespace in the Tab model for better readability. - Updated favicon handling in FaviconService to streamline fetching and caching logic. - Introduced a new method for generating favicon URLs, enhancing maintainability. - Improved asynchronous favicon fetching with better error handling and completion callbacks. - Enhanced the average color computation for favicons to ensure accurate color representation.
- Updated instances of FaviconService to use the shared singleton instance across multiple files for consistency and improved memory management. - Removed unnecessary faviconService parameters from functions in SearchEngine and LauncherView to streamline code. - Cleaned up code by eliminating redundant faviconService declarations in various views.
- Updated opacity handling in BrowserSplitView to use a more concise comparison for active tab identification. - Added allowsHitTesting modifier to ensure user interactions are only enabled for the active tab, improving user experience.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds an auto picture-in-picture feature for video content with settings integration, refactors the FaviconService to use a shared singleton instance, and improves media handling across the application.
- Enhanced media tracking with "wasPlayed" state for better session filtering
- Added auto picture-in-picture functionality that activates when switching tabs
- Refactored FaviconService to use a shared singleton pattern for better performance
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| WebViewNavigationDelegate.swift | Added PiP trigger function and media element removal tracking |
| TabManager.swift | Integrated auto PiP feature with tab switching logic |
| MediaController.swift | Enhanced session tracking with wasPlayed state and improved title synchronization |
| FaviconService.swift | Refactored to singleton pattern and added favicon download functionality |
| GeneralSettingsView.swift | Added auto PiP toggle setting |
| Multiple UI files | Updated to use shared FaviconService instance |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
yonaries
approved these changes
Oct 13, 2025
kenenisa
added a commit
that referenced
this pull request
Oct 14, 2025
…ng (#146) * Add Auto Picture-in-Picture Feature and Settings Integration - Introduced a new setting for enabling/disabling automatic Picture-in-Picture (PiP) mode on tab switch. - Updated SettingsStore to manage the autoPiPEnabled state and persist it. - Enhanced GeneralSettingsView to include a toggle for the auto PiP feature. - Modified TabManager to trigger PiP when switching to a new tab if the setting is enabled. - Implemented JavaScript function to handle PiP requests in WebViewNavigationDelegate. * Enhance Media Playback Management and Favicon Handling - Updated Tab model to synchronize title changes with the media controller when a tab's title is set. - Refactored favicon handling in MediaPlayerCard to use AsyncImage for improved loading and display. - Modified FaviconService to cache favicons more efficiently and updated the favicon URL size for better resolution. - Enhanced MediaController to track whether media sessions were played and filter visible sessions accordingly. - Implemented session removal logic in TabManager to ensure proper cleanup of media sessions when tabs are closed. - Improved JavaScript integration for media state tracking, including handling of media play events and title updates. * Refactor Tab and Favicon Handling for Improved Code Clarity - Aligned whitespace in the Tab model for better readability. - Updated favicon handling in FaviconService to streamline fetching and caching logic. - Introduced a new method for generating favicon URLs, enhancing maintainability. - Improved asynchronous favicon fetching with better error handling and completion callbacks. - Enhanced the average color computation for favicons to ensure accurate color representation. * Refactor Favicon Handling to Use Shared Instance - Updated instances of FaviconService to use the shared singleton instance across multiple files for consistency and improved memory management. - Removed unnecessary faviconService parameters from functions in SearchEngine and LauncherView to streamline code. - Cleaned up code by eliminating redundant faviconService declarations in various views. * Enhance BrowserSplitView Opacity and Hit Testing Logic - Updated opacity handling in BrowserSplitView to use a more concise comparison for active tab identification. - Added allowsHitTesting modifier to ensure user interactions are only enabled for the active tab, improving user experience. * Fix Typo in FaviconService Completion Handler * chore: swiftformat --------- Co-authored-by: yonaries <yonatandejene001@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary