fix: sidebar auto close on deselect#6881
Merged
vitormattos merged 3 commits intomainfrom Feb 14, 2026
Merged
Conversation
- Centralize sidebar close logic in selectFile() method - Hide sidebar when selectFile() is called without arguments (deselection) - Simplify removeFileById() by using selectFile() instead of duplicating logic - Apply same pattern to getAllFiles() for consistency - Removes duplicate hideSidebar() calls from multiple locations This ensures the sidebar automatically closes whenever a file is deselected, following the principle that the sidebar should not be visible without an active file selection. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
- Add test for removeFileById() resetting selectedFileId - Add test for selectFile() without arguments resetting to 0 (deselection) - Add test for selectFile(fileId) setting the file correctly - Add test for selectFile(0) being treated as deselection - All 62 tests passing, ensuring business rule is fully covered This validates that the sidebar properly closes when files are deselected, either directly via selectFile() or indirectly via removeFileById(). Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…ures Use vi.doMock() with fresh mock state in beforeEach() and vi.unmock() in afterEach() to ensure proper test isolation. This prevents state leakage between tests that was causing intermittent failures in CI when multiple PRs were running in parallel. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
08fd8ad to
7048efb
Compare
Member
Author
|
/backport to stable33 |
Member
Author
|
/backport to stable32 |
This was referenced Feb 14, 2026
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.