Skip to content

Conversation

@graycreate
Copy link
Member

Summary

  • Safari view now properly respects the current UI mode (light/dark)
  • Settings page external links now all use SafariView without opening empty intermediate pages

Changes

  1. Safari View UI Mode Support

    • Added @Environment(\.colorScheme) to track current color scheme
    • Safari view controller inherits interface style from root view controller
    • Properly handles system, light, and dark appearance modes
    • Sets appropriate tint colors based on effective UI style
  2. Settings Page External Links

    • Replaced WebBrowserView and SafariWebView with direct SafariView usage
    • Added IdentifiableURL wrapper to support sheet presentation
    • Eliminated empty intermediate pages when opening external links
    • All external links now open consistently in SafariView

Test Plan

  • Build succeeds without errors
  • Safari view respects light mode setting
  • Safari view respects dark mode setting
  • Safari view follows system appearance when set to auto
  • All Settings page external links open in Safari view
  • No empty pages appear when tapping external links

🤖 Generated with Claude Code

graycreate and others added 2 commits September 14, 2025 12:18
- Added Environment property to track colorScheme in SafariView
- Safari view controller now inherits interface style from root view controller
- Properly handles system, light, and dark appearance modes
- Sets appropriate tint colors based on effective UI style

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Replaced WebBrowserView and SafariWebView with direct SafariView usage
- Added IdentifiableURL wrapper to support sheet presentation
- Eliminated empty intermediate pages when opening external links
- All external links now open in SafariView with proper UI mode support

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 14, 2025 04:25
@graycreate graycreate merged commit 4e7f244 into main Sep 14, 2025
6 checks passed
@graycreate graycreate deleted the bugfix/safari-view-ui-mode branch September 14, 2025 04:25
Copy link

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 fixes Safari view appearance to respect the app's UI mode settings and streamlines external link handling in the Settings page by removing intermediate views.

  • Safari view now properly inherits and applies the current UI mode (light/dark/system)
  • Settings page external links use direct SafariView presentation instead of intermediate web views
  • Eliminated empty pages that appeared when opening external links

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
V2er/View/Settings/SettingsPage.swift Replaced web view components with direct SafariView usage and added IdentifiableURL wrapper for sheet presentation
V2er/General/Extentions.swift Enhanced SafariView to track color scheme and apply appropriate UI styles and tint colors

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +309 to +317
if effectiveStyle {
// Dark mode colors
safariVC.preferredControlTintColor = UIColor.systemBlue
safariVC.preferredBarTintColor = UIColor.systemBackground
} else {
// Light mode colors
safariVC.preferredControlTintColor = UIColor.systemBlue
safariVC.preferredBarTintColor = UIColor.systemBackground
}
Copy link

Copilot AI Sep 14, 2025

Choose a reason for hiding this comment

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

The tint color configuration is identical for both dark and light modes. This duplicated logic should be extracted outside the conditional or the conditional should be removed entirely since both branches set the same values.

Suggested change
if effectiveStyle {
// Dark mode colors
safariVC.preferredControlTintColor = UIColor.systemBlue
safariVC.preferredBarTintColor = UIColor.systemBackground
} else {
// Light mode colors
safariVC.preferredControlTintColor = UIColor.systemBlue
safariVC.preferredBarTintColor = UIColor.systemBackground
}
// Tint color configuration is identical for both dark and light modes
safariVC.preferredControlTintColor = UIColor.systemBlue
safariVC.preferredBarTintColor = UIColor.systemBackground

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

Code Coverage Report ❌

Current coverage: 0%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants