Skip to content

Codex/optimize allowed directories functionality#497

Merged
theovilardo merged 17 commits intomasterfrom
codex/optimize-allowed-directories-functionality
Dec 11, 2025
Merged

Codex/optimize allowed directories functionality#497
theovilardo merged 17 commits intomasterfrom
codex/optimize-allowed-directories-functionality

Conversation

@theovilardo
Copy link
Copy Markdown
Owner

No description provided.

theovilardo and others added 17 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`.
…rmance-fix-4216163802957571506

Enhanced file explorer performance fix 4216163802957571506
@chatgpt-codex-connector
Copy link
Copy Markdown

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 c7ad8cf into master Dec 11, 2025
@lostf1sh lostf1sh deleted the codex/optimize-allowed-directories-functionality branch January 16, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant