Skip to content

fix: expand sidebar when clicking on toggler#4136

Merged
Julusian merged 2 commits intobitfocus:mainfrom
arikorn:fix_expand_sidebar_in_edge_case
May 2, 2026
Merged

fix: expand sidebar when clicking on toggler#4136
Julusian merged 2 commits intobitfocus:mainfrom
arikorn:fix_expand_sidebar_in_edge_case

Conversation

@arikorn
Copy link
Copy Markdown
Contributor

@arikorn arikorn commented Apr 26, 2026

Previously clicking the sidebar-mode toggler would always leave the sidebar open until you moved off of it. This behavior was fixed in 4.3 so that it would fold immediately on click, but in so doing, it "broke" the behavior in the other direction if the user is clicking back-and-forth (i.e. without moving off of the sidebar). In this edge-case the sidebar remains narrow until you move off of it, regardless of which mode is being activated.

This PR fixes the behavior so that the mode change takes place visually immediately upon click even in this edge case.

image

Summary by CodeRabbit

  • Bug Fixes
    • Fixed sidebar toggle behavior in unfoldable mode to properly expand immediately when clicking the header toggle, preventing the sidebar from remaining in narrow state after certain interaction sequences.

Previously clicking the sidebar-mode toggler would always leave the sidebar open until you moved off of it. This behavior was fixed in 4.3 so that it would fold immediately on click, but in so doing, it "broke" the behavior in the other direction if the user is clicking back-and-forth (i.e. without moving off of the sidebar). In this edge-case the sidebar remains narrow until you move off of it, regardless of which mode is being activated.

This PR fixes the toggler so that the mode behavior takes place immediately upon click even in this edge case.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 794a8238-1b87-4832-aae0-b914fa0defae

📥 Commits

Reviewing files that changed from the base of the PR and between fda31af and ee02aed.

📒 Files selected for processing (1)
  • webui/src/Layout/Sidebar.tsx

📝 Walkthrough

Walkthrough

A new control-flow branch was added to the sidebar's click handler in unfoldable mode. When the header toggler is clicked, the sidebar now immediately switches from narrow back to non-narrow state, preventing it from remaining narrow after a fold-then-click sequence.

Changes

Cohort / File(s) Summary
Sidebar Toggle Logic
webui/src/Layout/Sidebar.tsx
Added control-flow branch to immediately switch sidebar from narrow to non-narrow state when header toggler is clicked in unfoldable mode, fixing behavior after fold-then-click sequences.

Poem

The sidebar was stuck in a narrow groove,
Folding fast with nothing to prove—
Till your clever branch arrived with grace,
Toggling wide to reclaim its space! 🎭✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main fix: expanding the sidebar when the toggler is clicked, which directly addresses the edge case bug being resolved.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Julusian Julusian merged commit 9200738 into bitfocus:main May 2, 2026
8 checks passed
Julusian pushed a commit that referenced this pull request May 2, 2026
Co-authored-by: Ari Kornfeld <arikorn@users.noreply.github.com>
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.

2 participants