Skip to content
This repository was archived by the owner on Apr 28, 2026. It is now read-only.

feat(onboarding): 首次启动引导、运行时依赖管理与构建系统增强#1

Open
yblpoi wants to merge 24 commits into
superpickyapp:devfrom
yblpoi:dev-online-dl
Open

feat(onboarding): 首次启动引导、运行时依赖管理与构建系统增强#1
yblpoi wants to merge 24 commits into
superpickyapp:devfrom
yblpoi:dev-online-dl

Conversation

@yblpoi
Copy link
Copy Markdown

@yblpoi yblpoi commented Apr 22, 2026

变更概述 / Summary of Changes

本 PR 引入了全新的"首次启动引导"(Onboarding)流程,并配套完善了运行时依赖管理、模型自动下载、补丁与更新检查机制,同时改进了构建系统以支持 macOS / Windows 双平台 Lite 版本发布。

This PR introduces a brand-new first-launch onboarding wizard, runtime dependency management, automatic model downloads, patch/update checking, and improved build tooling for both macOS and Windows Lite distributions.

主要改动 / Key Changes

🚀 首次启动引导 / First-Launch Onboarding

  • 新增欢迎向导(ui/welcome_onboarding_dialog.py),支持用户设置摄影等级、自动更新选项、运行时安装位置
  • 统一首次启动调度逻辑,避免重复弹窗
  • 新增运行时状态页,展示详细环境信息

⚙️ 运行时与初始化 / Runtime & Initialization

  • 新增初始化模式管理,增强被中断时的环境修复对话框(core/initialization_manager.py
  • 重构进度事件模型(core/initialization_progress.py),引入结构化进度事件,分离 UI 与进度跟踪逻辑
  • 改进进度条渲染,支持浮点填充和动画平滑过渡
  • 优化 pip 参数构建,为依赖安装添加原生进度条显示(core/runtime_bootstrap.py

📥 模型下载 / Model Download

  • 新增下载失败回退机制,支持从多个源(含国内镜像)自动切换下载(scripts/download_models.py
  • 增强模型路径处理,确保返回绝对路径并验证文件存在
  • 添加国内 PyTorch CUDA 镜像源以提升下载速度

🔧 配置与路径 / Config & Paths

  • 统一使用 get_app_config_dir() 获取标准配置目录,新增 migrate_old_data() 用于旧数据迁移(config.py
  • 新增 BirdName IOC 设置路径及旧设置迁移功能
  • 引入 _MEIPASS / 应用根路径辅助函数,提升 PyInstaller 打包环境兼容性

🔄 补丁与更新 / Patch & Update

  • 增强补丁管理:支持发布渠道识别(release channel)、补丁清理、回归检查脚本
  • 增强更新检查逻辑,支持多渠道识别

📦 构建系统 / Build System

  • 新增 macOS Lite 版安装脚本(build_release_lite_mac.sh),支持多语言界面和桌面图标创建
  • 新增完整 macOS 构建脚本,含代码签名和 DMG 打包流程
  • 完成 Windows Lite 包构建,已在本地环境、沙箱环境、源码运行中验证

🔍 批量处理 / Batch Processing

  • 更新批量处理和递归扫描功能,支持更灵活的目录扫描策略,增加安全检查提示

测试说明 / Testing Notes

  • [✅] Windows Lite 包:本地环境、沙箱环境、源码运行测试通过
  • [✅] 初始化菜单尺寸及 UI 位置重叠问题已修复
  • [✅] 进度条动画问题已修复
  • [ ?] macOS 签名包运行状态:待验证 / macOS signed build: pending verification
  • [✅] macOS CI 构建验证

yblpoi added 23 commits April 13, 2026 13:46
修改多处代码路径获取逻辑,统一使用 get_app_config_dir() 获取标准配置目录
新增 migrate_old_data() 函数用于将旧路径数据迁移到新目录
 - 仅在Macos上进行测试
 - 后续在windows上测试稳定后,尝试修改打包
feat(ui): 更新欢迎向导以支持新特性复选框和运行时检查
完成win版本的 lite包构建,已在本地环境、沙箱环境和源码运行中测试。
尝试按照PEP8标准规范化代码

mac环境暂未测试,CI构建暂未测试

已知bug:
 - 初始化菜单的大小不固定,有时出现UI位置重叠
 - 进度条显示存在问题,需要调整动画时间
- Introduced helper functions to retrieve `_MEIPASS` and application root paths in config.py for better compatibility with PyInstaller.
- Updated FlightDetector and KeypointDetector to utilize the new runtime path functions, ensuring correct model loading in frozen environments.
- Refactored main.py to inject patch paths and set the application root dynamically, improving the handling of runtime configurations.
- Enhanced BirdID dock panel to use runtime paths for resource loading, ensuring consistent behavior across different environments.
- Improved type hinting and error handling across various modules for better code clarity and robustness.
…alog on interrupted initialization

- Adjusted button widths in StyledMessageBox based on the number of buttons.
- Added a check in SuperPickyMainWindow to show an environment repair dialog if initialization was interrupted.
- Updated WelcomeOnboardingDialog to include a runtime status page with detailed runtime information.
- Introduced new scripts for building full and lite versions of the application on macOS.
- Implemented a comprehensive build script for macOS that includes signing and DMG creation.
- Introduced structured progress events for onboarding flows in `core/initialization_progress.py`.
- Updated `ui/welcome_onboarding_dialog.py` to utilize the new progress model, improving the separation of UI logic and progress tracking.
- Refactored progress emission in `scripts/download_models.py` to provide detailed feedback during resource downloads.
- Improved pip argument construction in `core/runtime_bootstrap.py` to include a raw progress bar.
- Enhanced runtime requirements management in `core/runtime_requirements.py` with additional documentation and improved method signatures.
- Removed legacy requirements file path function to streamline dependency management.
Copilot AI review requested due to automatic review settings April 22, 2026 16:56
Copy link
Copy Markdown

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 introduces a first-launch onboarding + initialization pipeline for Lite builds, strengthens runtime/resource provisioning (including source probing, downloads, and patch gating/cleanup), and modernizes release/build tooling across Windows/macOS.

Changes:

  • Added initialization subsystems (source probing, structured progress model, runtime requirements/bootstrap, safer patch validation/cleanup, directory scan safety checks).
  • Updated UI + i18n to support onboarding/repair flows and improved dialogs/batch scanning UX.
  • Reworked build/release automation (Python build scripts, new Lite specs, CI workflow, Inno templates, legacy script wrappers).

Reviewed changes

Copilot reviewed 54 out of 55 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
workflows/intel-build.md Updates macOS Intel build instructions to new Python build script.
workflows/dev_docs/project_structure.md Documents new build script entrypoints.
ui/custom_dialogs.py Adjusts dialog button sizing/centering.
ui/birdname_search_widget.py Migrates BirdName paths to config helpers and refactors minor UI/style.
tools/update_checker.py Skips patch checks safely when runtime/channel disallows patches.
tools/patch_manager.py Adds patch channel validation + safer patch cleanup and application guards.
superpicky_cli.py Updates batch scanning to new scanner API + adds dangerous-root guard.
scripts/verify_patch_cleanup_regression.py Adds manual regression checker for patch cleanup during init flows.
scripts/ci_release.py Adds CI helper utilities for release metadata, assets, patch packaging, secrets.
requirements_cuda.txt Adds NJU PyTorch CUDA extra index mirror.
main.py Refactors early bootstrap: patch overlay gating, runtime bootstrap dispatch, migrations, logging.
locales/zh_CN.json Adds onboarding/repair/scan safety strings and renames update menu label.
locales/en_US.json Adds onboarding/repair/scan safety strings and renames update menu label.
inno/SuperPicky_CUDA_Patch.iss Parameterizes version/hash/exe naming for patch installer.
inno/SuperPicky.iss Simplifies and parameterizes Full installer script.
inno/SuperPicky-lite.iss Adds Lite installer script template.
core/source_probe.py Adds HTTP-based mirror probing and selection helpers.
core/runtime_requirements.py Centralizes platform runtime requirements in Python.
core/runtime_bootstrap.py Adds frozen-runtime pip bootstrapper for Windows Lite.
core/recursive_scanner.py Adds DFS scan results model + dangerous-root detection and new scan API.
core/keypoint_detector.py Switches model path resolution to install-scoped helpers; improves typing/guards.
core/initialization_progress.py Adds structured progress events + deterministic animation model.
core/flight_detector.py Switches model path resolution to install-scoped helpers; improves typing/guards.
core/build_info.py Updates injected build metadata and release channel.
core/batch_processor.py Accepts scanned directory summaries and reduces redundant counting.
build_release_win.py Adds Lite build support, new spec selection, zip creation via stdlib, templated Inno injection.
build_release_lite_win.bat Adds Lite Windows wrapper invoking Python build script.
build_release_lite_mac.sh Adds Lite macOS wrapper invoking Python build script.
build_release_full_mac.sh Adds Full macOS wrapper invoking Python build script.
build_release_cuda.bat Redirects CUDA build to Python build script with consistent args.
build_release_cpu.bat Simplifies CPU wrapper to call consolidated build script.
build_release_all.bat Builds CPU + Lite in sequence.
build_release.sh Replaces legacy macOS shell build with compatibility wrapper to Python script.
build_release.bat Replaces legacy Windows shell build with compatibility wrapper to Python script.
birdid/osea_classifier.py Migrates resource path logic to install-scoped helpers; formatting cleanups.
ai_model.py Ensures YOLO model path is absolute and exists before loading.
advanced_config.py Adds initialization/runtime selection state and defaults auto update to false.
SuperPicky_lite_win.spec Adds Windows Lite spec excluding torch bundles and includes bootstrap hiddenimports/data.
SuperPicky_lite.spec Adds macOS Lite spec.
SuperPicky_full.spec Adds wrapper spec to keep legacy full spec stable.
SuperPicky.spec Adds env overrides for target arch/codesign/entitlements and version injection.
CLAUDE.md Expands verification and repo guidance.
AGENTS.md Expands agent/dev guidelines and verification notes.
.gitignore Ignores .python-version.
.github/workflows/build-release-lite.yml Adds GitHub Actions workflow to build/release Lite for Windows/macOS.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/recursive_scanner.py
Comment thread core/source_probe.py
@yblpoi yblpoi marked this pull request as draft April 23, 2026 01:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants