Skip to content

Sidebar toggle icon does not close the sidebar when a file is open #95

@germanescobar

Description

@germanescobar

Description

When the sidebar is open and a file has been opened (e.g. selecting a file from the sidebar opens it in the main pane), clicking the sidebar toggle icon (the icon that opens/closes the sidebar, typically in the top bar) no longer closes the sidebar.

Steps to reproduce

  1. Open the application.
  2. Click the sidebar toggle icon to open the sidebar.
  3. Click on a file in the sidebar to open it.
  4. Click the sidebar toggle icon again.

Expected behavior

The sidebar closes, returning the user to a sidebar-less view while keeping the opened file visible in the main pane.

Actual behavior

The sidebar remains open; clicking the toggle icon has no effect once a file is open.

Likely cause

In client/src/App.tsx, the toggle button at the icon in the top bar calls setSidebarOpen(!sidebarOpen) (around line 314). After a file is opened, something (likely a focus trap, click-outside handler, or a re-render in the file viewer) is intercepting the click and preventing state from toggling, or the click is being absorbed by the now-focused file view.

Environment

  • Repo: germanescobar/coding-orchestrator
  • Affected component: client/src/components/sidebar.tsx, client/src/App.tsx

Acceptance criteria

  • Clicking the sidebar toggle icon closes the sidebar whether or not a file is currently open in the main pane.
  • Opening a file does not change the behavior of the sidebar toggle.
  • No regression in the existing open/close sidebar flow when no file is open.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions