Skip to content

Conversation

@kenenisa
Copy link
Contributor

Summary

  • Add auto picture-in-picture feature with settings integration for improved media handling
  • Refactor favicon service to use shared instance for better performance and code clarity
  • Enhance media playback management and tab handling
  • Improve browser split view opacity and hit testing logic

- 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.
Copilot AI review requested due to automatic review settings October 13, 2025 13:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kenenisa kenenisa changed the title Add Auto Picture-in-Picture Feature and Refactor Favicon Handling feat: Add Auto Picture-in-Picture Feature and Refactor Favicon Handling Oct 13, 2025
@yonaries yonaries merged commit 5eb4074 into main Oct 13, 2025
2 checks passed
@yonaries yonaries deleted the feat/auto-pip branch October 13, 2025 19:59
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants