Enhanced file explorer performance fix 4216163802957571506#495
Merged
theovilardo merged 13 commits intobckp/file-explorer-currfrom Dec 11, 2025
Merged
Conversation
…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`.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.