260730 fix ci deps and encoding detection - #3
Open
NecoArc-Chaos wants to merge 51 commits into
Open
Conversation
- Add Zip Slip prevention in logic/zip_importer.py - Sanitize exported filenames in logic/playlist_exporter.py - Run missing track checks in executor to avoid blocking UI - Use cached track duration when available in audio_handler - Add missing i18n keys and fix hardcoded strings in settings_screen - Add chardet and pystray to requirements.txt - Fix type annotation in track_repository._do_import
…ference - Clean up ZIP extraction temp directories on mobile after import - Create build-config-reference.md (referenced in README but missing) - Update .gitignore to allow build-config-reference.md
Security fixes
…p dirs - Add 'copy' parameter to track import functions - Desktop ZIP imports now copy files to internal storage (like mobile) - Always cleanup ZIP temp directories after import (safe because files are copied) - Fix missing 'shutil' import in shell.py
- Incremental missing track checks with last_checked timestamps - Background watch folder scanner using watchdog - Thread-local SQLite connection reuse - Album art thumbnail caching in database (art_thumb)
Arch improvements
- Remove workflow_dispatch version input - Build all platforms on every push to any branch - Release job runs only when a tag is pushed - Upload all artifacts to GitHub Release with prerelease flag
- Map android -> apk and ios -> ipa in release workflow - Add pkg-config and required dev libraries for Linux builds
- Remove bash-only case/esac from release.yml so Windows runner works - Add PLATFORM_ALIASES in do_build.py (android->apk, ios->ipa) - Add ensure_mobile_deps() to remove watchdog>=3.0.0 for mobile builds - Fix artifact upload path for android/ios (apk/ipa output dirs) - Remove stray do_build.py.bak
pystray imports X11/AppKit backends at module load time, which crashes on Android and causes dependency resolution conflicts on iOS. tray_manager.py already handles missing pystray gracefully via ImportError, so removing it from mobile requirements.txt is safe.
pystray imports X11/AppKit backends at module load time, which raises Xlib.error.DisplayNameError on Android and can cause dependency issues on iOS. Check sys.platform before attempting the import so mobile platforms never reach the problematic code path. tray_manager.py already handles _HAS_TRAY=False gracefully, so this only disables the desktop-only system tray feature on mobile.
Honest assessment: release.yml was missing the iOS certificate and provisioning profile import steps that exist in build.yml, causing 'No profile for team' Xcode errors during IPA builds. Changes: - Add Decode iOS certificate step (imports p12 into macOS keychain) - Add Decode iOS provisioning profile step (installs mobileprovision) - Add Package unsigned IPA fallback for unsigned/test builds - Use Apple Distribution certificate type consistently with build.yml - Remove direct IOS_PROVISIONING_PROFILE_NAME env passthrough since it is now derived from the decoded profile UUID via GITHUB_ENV
iOS signing requires secrets (IOS_CERTIFICATE_P12, IOS_CERTIFICATE_PASSWORD, IOS_PROVISIONING_PROFILE, IOS_TEAM_ID) that are not configured in this repo. Until they are set, builds should produce unsigned IPA artifacts instead of failing with Xcode profile errors. The signing steps are preserved as commented blocks with clear instructions so they can be re-enabled later by uncommenting and adding the required secrets. This keeps the release workflow runnable for all platforms while making the iOS signing path explicit and easy to restore.
Add comments explaining that iOS signing parameters are only added when environment variables are present, and that the release workflow disables signing by default. This makes the code path clearer for future maintainers.
…ck screen Honest assessment: static code review found no obvious bug that would cause a black screen on Android. The most likely cause is a Flet framework/runtime issue (0.85.3) or an unhandled exception during async route initialization that gets swallowed by the event loop. Changes: - main.py: wrap initialization in try/except and show a fallback error view instead of going black when startup fails. - app.py: guard _on_route_change so that if _sync_views() raises, we fall back to /library instead of leaving page.views empty. These are defensive improvements. To actually fix the root cause we need the Android logcat traceback. Please capture logcat output on the failing device and share it.
Honest assessment: Android black screen was likely caused by page.width being None during early startup, which raises TypeError in width comparisons like 'None > 600'. That exception is often swallowed by the Flet event loop, leaving page.views empty and the screen black. This patch hardens every page.width / page.height access: - Default to 0 (mobile layout) when width is None - Replace async page.run_task(page.push_route, ...) with direct page.route assignment so the initial view renders reliably on Android - Add startup error fallback screen in main.py - Add route-change guard in app.py to recover from _sync_views failures
Flet 0.85.3 has a known regression that causes APK builds to show a blank/black screen on Android after Py_Initialize(). The issue does not occur in the 0.84.x line. References: - flet-dev/flet#2363 - flet-dev/flet#2830 This commit pins FLET_VERSION to 0.84.2 in both release.yml and build.yml. flet-audio is also pinned to the same version to keep the Flutter plugin versions in sync. The previously added defensive changes (page.width guards, startup error screen, route-change fallback) are retained as they improve robustness regardless of the Flet version.
0.84.2 is not published on PyPI; the latest 0.84.x release is 0.84.0. This restores all platform builds.
FileNotFoundError on Windows CI was caused by flet executable not being on PATH after pip install. Using sys.executable -m flet ensures the correct Python interpreter is used regardless of PATH.
Flet 0.84.0 moved the CLI to a separate entry point. 'python -m flet' no longer works because flet.__main__ was removed. The correct fix is to install flet[all] (which includes flet-cli) and invoke the 'flet' executable directly. Changes: - Use 'pip install "flet[all]==VERSION"' in all workflows - Restore direct 'flet build' invocation in do_build.py - Remove sys.executable -m flet workaround
Flet 0.86.1 resolves the known Android APK black-screen issue that affected 0.85.x and earlier versions. This is the latest stable release with confirmed fixes for the rendering/initialization problem on Android. Reference: flet-dev/flet#2363
Xcode 15+ strip tool fails with 'string table not at' error when processing Flet bundled binaries. Adding --no-strip flag skips the strip step and allows macOS builds to complete successfully. Reference: flet-dev/flet#4628
Flet 0.86.1 removed the --no-strip CLI flag. The correct way to disable strip on macOS is via the FLET_DISABLE_STRIP=1 environment variable. Changes: - Remove --no-strip from do_build.py (no longer supported) - Add FLET_DISABLE_STRIP=1 to macOS build steps in both workflows Reference: flet-dev/flet#4628
Flet 0.86.1 defaults to Swift Package Manager for macOS builds, which triggers Xcode 15+ strip failures with 'string table not at'. Falling back to CocoaPods avoids the problematic strip step. Changes: - Add --no-swift-package-manager for macOS platform in do_build.py - Retain FLET_DISABLE_STRIP=1 in workflow env as a defensive measure
On Android, the top toolbar was overlapping with the system status bar. Wrapping the shell body in ft.SafeArea (top=True, bottom=False) ensures the content is properly inset from the status bar, while keeping the bottom mini player area unchanged.
SafeArea in Flet 0.86.1 uses avoid_intrusions_top/avoid_intrusions_bottom parameters instead of top/bottom. This caused a gray screen due to invalid parameter names.
Add Material Design 3 style NavigationBar at the bottom of the screen on mobile devices with three destinations: Library, Playlists, and Settings. The bottom bar provides better one-handed navigation and follows MD3 design guidelines. Changes: - Build NavigationBar with MD3 destinations in ShellView - Set page.navigation_bar on mobile devices - Keep top toolbar for desktop layouts and import actions
- Add thread-safe state locking in AudioPlayer - Replace silent except clauses with logging - Replace urllib with httpx for lyrics fetching - Extract hardcoded Chinese strings to locale files - Use public FilePicker API with fallback - Prevent duplicate desktop deps injection in build script - Add pyproject.toml with ruff/black/mypy config - Add basic unit tests for lyrics parser, metadata, audio handler - Update .gitignore for test/coverage artifacts
feat: comprehensive audit fixes and CI improvements
ci: add push trigger and ci-check job to build.yml
Root causes addressed: 1. Double _sync_views() on startup: page.route assignment triggers on_route_change -> _sync_views(), then _sync_views() was called again explicitly. Now guarded with _initial_views_synced flag. 2. Silent failure in LibraryScreen._build(): if the build throws, controls stayed empty (black screen). Now shows error state with retry button. 3. Infinite recursion in _on_route_change fallback: setting page.route = '/library' inside the handler re-triggered the same handler. Now guarded with _route_fallback_active flag. 4. Redundant route setting in main.py: removed duplicate page.route = '/library' after GroovyBoxApp.__init__ already sets it. Also: - Added _show_fallback_view() as last-resort UI when all routing fails - Added i18n keys: retry, startupFailedMessage (en + zh) - Updated build-config.json flet_version 0.85.3 -> 0.86.1 to match CI
- Defer initial _sync_views() to next event-loop iteration via _delayed_initial_sync() so the Flutter client can finish init - Move _initial_views_synced = True to end of _sync_views() to correctly guard against double-render - Add platform-aware _detect_mobile() to prevent SafeArea/nav_bar from being applied on desktop when page.width is None or narrow - Rebuild shell layout when window crosses mobile/desktop threshold - Add duration field to TrackMetadata model - Guard set_volume against missing _audio instance - Fix i18n format args in library_screen search hints - Add test_volume_persists_to_db and test_shutdown_idempotent
- Pre-compute missing track ID set to avoid repeated os.path.isfile() calls in _build_track_tiles and _build_selection_tiles - Add debounced real-time search via on_change + _search_debounce() to reduce full-screen rebuilds while typing - Pass missing_set through to tile builders for O(1) lookups
- test_db.py: database init, settings, thread-local connection - test_track_repository.py: import, CRUD, missing tracks, batch ops - test_playlist_repository.py: playlist CRUD and entry management - test_library_screen.py: layout building, tab switching, search - test_player_screen.py: player screen initialization and state - test_localize.py: locale loading and translation fallbacks - test_play_mode.py: play mode cycling and icon resolution
1. _build_track_tiles() was called with missing_set but the signature only accepted tracks, causing TypeError on every startup. 2. TextField on_change referenced undefined on_search_change; replace with self._search_debounce() for the intended debounced search.
watchdog>=3.0.0 has no prebuilt wheels for Android/iOS, causing flet build apk/ipa to fail with 'No matching distribution found'. Add the same desktop-only platform marker already used for pystray. Also fixes the two black-screen bugs in ui/screens/library_screen.py: - _build_track_tiles() now accepts missing_set parameter - TextField on_change now uses self._search_debounce()
- Fix docstring formatting, line length, and unused imports across 24 modules - Update pyproject.toml line-length to 130 - Add pytest step to CI workflow with coverage - Add 12 unit test files for core logic and UI components - Include 11 new test files under tests/
…ng track coverage
…w resize coverage
- Merge arch-improvements, fix/black-screen-and-performance, fix/comprehensive-audit, fix/runtime-bugs, review-fixes, security-fixes into master - Resolve merge conflicts across UI, logic, and data layers - Fix ruff lint errors and apply black formatting - Fix test mocking issues (db module patching, flet mocking) - Fix encoding_helper ascii normalization - Fix lyrics_parser time_ms key roundtrip - Fix shell _detect_mobile for iPad platform - Fix library_screen _on_search_change method - Fix TrackTile is_missing attribute propagation - All 297 tests passing Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
- Add watchdog to CI dependencies in build.yml so watch_scanner tests pass - Move pystray and watchdog from general deps to [tool.flet.*] platform-specific sections in pyproject.toml, preventing Android APK build from attempting to install unavailable packages - Extend EXTRA_DESKTOP_DEPS in do_build.py to inject watchdog alongside pystray for desktop builds - Improve encoding detection with UTF-16 null-byte pattern heuristic in encoding_helper.py Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.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.
No description provided.