feat(file-browser): integrate selection mode state with actionStack for back navigation - #2546
Open
AuDevTist1C wants to merge 1 commit into
Conversation
… back navigation Integrate the file browser's multi-item selection mode directly into the application's global `actionStack` navigation controller to provide native hardware and interface back-button support. When users enter multi-selection mode (e.g., long-pressing a file or checking multiple items), pressing the hardware back button or triggering back-gestures previously caused the application to navigate away from the current folder entirely, losing active context. This update registers selection mode as an isolated state layer within the global `actionStack`. * **Action Stack Registration:** * Upon entering selection mode, the file browser pushes a `fbSelection` state descriptor to `actionStack`. * The back action handler captures `fbSelection` events to intercept back navigation, clearing all checked items and exiting selection mode first before any folder pops occur. * **Stack Lifecycle Cleanup:** * Implemented automatic cleanup hooks to pop or unregister the `fbSelection` entry from `actionStack` whenever selection mode is dismissed through UI confirmation, cancel buttons, or batch execution tasks. (AI generated commit message)
Contributor
Greptile SummaryThis PR integrates file-browser selection mode with the global back-navigation stack.
Confidence Score: 5/5The PR appears safe to merge, with selection-mode registration and cleanup consistent with the existing action-stack lifecycle. Back navigation pops the selection action before invoking its callback, explicit dismissal safely removes the matching action, and page teardown clears actions registered after the file browser’s stack mark. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Browser as File Browser
participant Stack as actionStack
User->>Browser: Enter selection mode
Browser->>Stack: push(fbSelection)
User->>Stack: Back navigation
Stack->>Browser: invoke selection callback
Browser->>Browser: toggleSelectionMode(false)
Browser->>Stack: remove(fbSelection)
Reviews (1): Last reviewed commit: "feat: integrate file selection mode with..." | Re-trigger Greptile |
2 tasks
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.
Overview
Integrates the file browser's multi-item selection mode into the application-wide
actionStack. This ensures that triggering a back navigation action (such as pressing a physical device back button, hardware key, or system gesture) while in selection mode cleanly exits selection mode before popping the current directory view or closing the page.Problem Context
Previously, entering selection mode within the file browser operated independently of the global
actionStackcontext. Consequently:Detailed Code Changes
src/pages/fileBrowser/fileBrowser.js:!actionStack.has("fbSelection")when enabling multi-selection mode. Pushes an action descriptor:isSelectionMode = false) and trigger full UI state reset viatoggleSelectionMode(false).actionStack.remove("fbSelection")to the exit/deactivation block (elsebranch) to unregister the selection frame fromactionStackwhenever selection mode is dismissed programmatically or via explicit user confirmation/cancellation.Architecture & System Impact
actionStack, prioritizing selection exit over structural application navigation.actionStack.has("fbSelection")conditional checks.Verification Checklist
fbSelectionis present inactionStack.actionStack.remove("fbSelection"), leaving no leftover frames in the stack.(PR name and description are AI generated (Gemini 3.6 Flash))