Skip to content

Enhanced file explorer performance fix 4216163802957571506#495

Merged
theovilardo merged 13 commits intobckp/file-explorer-currfrom
enhanced-file-explorer-performance-fix-4216163802957571506
Dec 11, 2025
Merged

Enhanced file explorer performance fix 4216163802957571506#495
theovilardo merged 13 commits intobckp/file-explorer-currfrom
enhanced-file-explorer-performance-fix-4216163802957571506

Conversation

@theovilardo
Copy link
Owner

No description provided.

theovilardo and others added 13 commits December 10, 2025 23:29
…on logic

- Optimized `FileExplorerStateHolder` to offload heavy file scanning to `Dispatchers.IO` and perform UI state mapping on `Dispatchers.Default`.
- Implemented `combine` flow to efficiently merge raw directory data with selection state (`allowedDirectories`), preventing unnecessary file re-scans on selection toggles.
- Introduced `DirectoryEntry.isSelected` property to pre-calculate selection state in the ViewModel, removing expensive calculations from `FileExplorerBottomSheet` composition.
- Implemented "Smart View" (Flattened Mode) logic to strictly show folders with direct audio files and allow independent selection.
- Fixed logic in "Navigation Mode" (subtree selection) to correctly handle deselection of subtrees by stopping traversal when an excluded node is encountered.
- Optimized audio file counting to early-exit for performance while maintaining support for "99+" UI indicators.
- Ensured stable keys in `LazyColumn` for smoother scrolling and animations.
- Updated `SettingsViewModel.kt` to call the correct method `isDirectorySelected` from `FileExplorerStateHolder`, resolving an "Unresolved reference" error.
- Refactored `FileExplorerStateHolder` to optimize directory loading and selection logic, moving heavy tasks to background threads (`Dispatchers.IO`) and using `combine` for efficient state updates.
- Implemented `DirectoryEntry.isSelected` property to pre-calculate selection state, removing expensive calculations from UI composition.
- Implemented "Smart View" (Flattened Mode) logic to strictly show folders with direct audio files and allow independent selection.
- Fixed logic in "Navigation Mode" (subtree selection) to correctly handle deselection of subtrees by stopping traversal when an excluded node is encountered.
- Optimized audio file counting to early-exit for performance while maintaining support for "99+" UI indicators.
- Ensured stable keys in `LazyColumn` for smoother scrolling and animations.
- Resolved 'Unresolved reference' errors in `SettingsViewModel` and `SetupViewModel` by updating method calls to use `isDirectorySelected`.
- Updated `FileExplorerStateHolder` to expose `isDirectorySelected` correctly.
- Optimized file explorer performance by offloading scanning to `Dispatchers.IO` and using `combine` for state updates.
- Implemented robust 'Navigation Mode' (subtree selection) and 'Flattened Mode' (direct audio selection) logic.
- Added UI optimizations including `isSelected` pre-calculation and stable keys for `LazyColumn`.
Refactors `FileExplorerContent` to use a `Scaffold` for a more structured layout, moving the "Done" `ExtendedFloatingActionButton` to the `floatingActionButton` slot. The lazy column for file items now uses `weight(1f)` to fill available space.

The breadcrumb generation in `FileExplorerHeader` is moved to a background thread using `withContext(Dispatchers.IO)` to prevent UI freezes. The autoscroll behavior is also updated to use `animateScrollTo` for a smoother animation. Additionally, `AbsoluteSmoothCornerShape` has been replaced with the standard `RoundedCornerShape`.
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@theovilardo theovilardo merged commit 7d897e1 into bckp/file-explorer-curr Dec 11, 2025
@lostf1sh lostf1sh deleted the enhanced-file-explorer-performance-fix-4216163802957571506 branch January 16, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant