Skip to content

feat: improve macOS/iOS platform integration and UI#5

Merged
0Chencc merged 1 commit intomainfrom
feat/macos-ios-improvements
Jan 31, 2026
Merged

feat: improve macOS/iOS platform integration and UI#5
0Chencc merged 1 commit intomainfrom
feat/macos-ios-improvements

Conversation

@0Chencc
Copy link
Member

@0Chencc 0Chencc commented Jan 31, 2026

Summary

  • iOS UISceneDelegate 迁移: 按照 Flutter breaking change 要求,将 iOS 迁移到 FlutterSceneDelegate + FlutterImplicitEngineDelegate 生命周期
  • macOS/iOS 授权缓存修复: 修复 SharedPreferences 初始化竞态条件,确保启动时正确恢复已缓存的 auth token,无需每次重新授权
  • macOS 单实例防护: 通过 NSRunningApplication 检测防止创建多个应用进程,点击 Dock 图标时恢复隐藏窗口
  • macOS 标题栏融合: 设置透明标题栏 (fullSizeContentView),通过 MediaQuery 注入顶部 padding 实现无缝衔接
  • macOS 托盘动态标题: 播放音乐时在系统托盘显示当前曲目和艺术家名称,停止时隐藏
  • UI 溢出修复: 修复传统调度页面底部 68px 溢出问题,使用 Flexible + SingleChildScrollView
  • 桌面端播放按钮缩小: 在 macOS/Windows/Linux 下缩小播放按钮尺寸以适配桌面 UI

Changed Files

文件 改动
ios/Runner/AppDelegate.swift UISceneDelegate 迁移
ios/Runner/Info.plist 添加 UIApplicationSceneManifest 配置
ios/Podfile.lock 依赖锁定文件
ios/Runner.xcodeproj/project.pbxproj CocoaPods 自动生成
ios/Runner.xcworkspace/contents.xcworkspacedata CocoaPods 自动生成
lib/app.dart 授权缓存修复 + macOS MediaQuery padding
lib/core/services/system_tray_service.dart 托盘动态标题
lib/presentation/screens/create_session_screen.dart 溢出修复
lib/presentation/widgets/create_session/session_settings_bottom_sheet.dart 溢出修复 + 桌面按钮缩小
macos/Runner/AppDelegate.swift 单实例防护 + Dock 点击恢复
macos/Runner/MainFlutterWindow.swift 透明标题栏

Test Plan

  • macOS 下启动应用,验证标题栏与页面无缝融合
  • macOS 下验证授权缓存,重启后无需重新授权
  • macOS 下验证单实例防护,重复打开时激活已有窗口
  • macOS 下播放音乐时验证托盘显示曲目信息
  • macOS 下验证传统调度页面无底部溢出
  • iOS 模拟器 (iPhone 17 Pro) 下验证应用正常启动
  • Windows/Linux 下验证桌面按钮缩小效果

- Migrate iOS to UISceneDelegate lifecycle (FlutterSceneDelegate)
- Fix auth token caching race condition on macOS/iOS by waiting for
  SharedPreferences initialization before checking auth status
- Add macOS single-instance guard via NSRunningApplication
- Add Dock icon click handler to restore hidden window
- Make macOS title bar transparent and blend with app content
- Inject MediaQuery top padding on macOS for seamless title bar spacing
- Show dynamic track info in macOS system tray when playing
- Fix bottom overflow in session settings bottom sheet
- Reduce play button size on desktop platforms
@codecov
Copy link

codecov bot commented Jan 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.42%. Comparing base (aebb4ab) to head (135fba7).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main       #5   +/-   ##
=======================================
  Coverage   71.42%   71.42%           
=======================================
  Files           1        1           
  Lines           7        7           
=======================================
  Hits            5        5           
  Misses          2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@0Chencc 0Chencc merged commit 4a35ac8 into main Jan 31, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant