Skip to content

fix(ui-react): fix sidebar behavior when terminal is open#6166

Merged
gustavosbarreto merged 3 commits intomasterfrom
fix/ui-react/sidebar-terminal
Apr 13, 2026
Merged

fix(ui-react): fix sidebar behavior when terminal is open#6166
gustavosbarreto merged 3 commits intomasterfrom
fix/ui-react/sidebar-terminal

Conversation

@luizhf42
Copy link
Copy Markdown
Member

What

Fix the sidebar behavior on desktop and mobile when a web terminal instance is open.

Why

The sidebar was presenting two strange behaviors when the terminal was open:

  1. On desktop, the sidebar occupied 220px (expanded state width) even when collapsed, adding a blank space between the collapsed sidebar and the terminal window.
  2. On mobile. the sidebar was opening below the terminal, being unclickable.

The fixes:

  1. Compute the sidebar offset and pass to the terminal components in order to adapt the left space style based on it.
  2. Increase the sidebar z-index, making it appear above the terminal and be usable.

Testing

  • On desktop, open a terminal instance and ensure the sidebar and terminal behave correctly in collapsed, expanded, and terminal fullscreen states.
  • On mobile, ensure the sidebar opens, closes, and is clickable when a terminal instance is open.

Remove unnecessary pathname tracking logic, `useCallback` calls, and
buggy `prevIsDesktop` check
…ning

Add a `toggleDrawer` handler to the sidebar hook and pass it to `AppBar`
and `AdminAppBar` via `onMenuToggle`
@luizhf42 luizhf42 requested a review from a team as a code owner April 13, 2026 15:17
@luizhf42 luizhf42 added kind/bug Something isn't working area/ui labels Apr 13, 2026
@luizhf42 luizhf42 self-assigned this Apr 13, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

Claude finished @luizhf42's task in 3m 18s —— View job


Code Review Complete

Reviewed 6 files across code quality, security, testing, TypeScript/React patterns, and architecture — no issues found. The code looks good as-is.

The approach of passing sidebarOffset as a prop is clean and correctly replaces the hardcoded left-[220px]. The z-index bump to z-50 on the mobile drawer properly ensures it renders above the terminal panels (z-40). The simplified useSidebarLayout hook is sound — the old breakpoint-reset logic is no longer needed since the mobile drawer is conditionally rendered (!isDesktop), so unmounting handles state cleanup naturally.

If you push additional changes and want a new review, tag @shellhub-io/admin and a team member can trigger it.

@gustavosbarreto gustavosbarreto merged commit ba8cfdd into master Apr 13, 2026
22 checks passed
@gustavosbarreto gustavosbarreto deleted the fix/ui-react/sidebar-terminal branch April 13, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ui kind/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants