Skip to content

fix: sidebar auto close on deselect#6881

Merged
vitormattos merged 3 commits intomainfrom
fix/sidebar-auto-close-on-deselect
Feb 14, 2026
Merged

fix: sidebar auto close on deselect#6881
vitormattos merged 3 commits intomainfrom
fix/sidebar-auto-close-on-deselect

Conversation

@vitormattos
Copy link
Member

No description provided.

@vitormattos vitormattos added this to the Next Major (34) milestone Feb 14, 2026
@github-project-automation github-project-automation bot moved this to 0. Needs triage in Roadmap Feb 14, 2026
- 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>
@vitormattos vitormattos force-pushed the fix/sidebar-auto-close-on-deselect branch from 08fd8ad to 7048efb Compare February 14, 2026 00:41
@vitormattos
Copy link
Member Author

/backport to stable33

@vitormattos
Copy link
Member Author

/backport to stable32

@vitormattos vitormattos merged commit 039077b into main Feb 14, 2026
62 checks passed
@vitormattos vitormattos deleted the fix/sidebar-auto-close-on-deselect branch February 14, 2026 00:44
@github-project-automation github-project-automation bot moved this from 0. Needs triage to 4. to release in Roadmap Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 4. to release

Development

Successfully merging this pull request may close these issues.

1 participant

Comments