Skip to content

Sidebar resize can persist a zero or negative width #2203

Description

@kmcginnes

Description

setSidebarWidth adds an unbounded delta to the stored width with no clamping, and nothing downstream clamps it either — CollapsibleSidebar passes re-resizable's delta.width straight through on onResizeStop, and no minWidth is set on the resizable. Dragging the handle far enough past the left edge therefore persists a zero or negative sidebar.width into the layout, for both the Graph View and the Schema View.

Both writers have the same shape:

  • packages/graph-explorer/src/core/StateProvider/graphViewLayout.ts — setSidebarWidth
  • packages/graph-explorer/src/modules/SchemaGraph/Sidebar/schemaViewLayout.ts — setSidebarWidth

This surfaced while reviewing whether the layout codec should reject non-positive dimensions. Rejecting at the storage boundary is the wrong layer: it would throw away the user's entire layout over a width the app itself wrote. The fix belongs in the setter.

Environment

  • OS: any
  • Browser: any
  • Graph Explorer Version: main
  • Graph Database & Version: n/a (UI state only)

Steps to Reproduce

  1. Open the Graph View and open any sidebar panel.
  2. Drag the sidebar resize handle well past the left edge of the sidebar in one motion.
  3. Inspect the persisted layout (graph-view-layout) and observe a width at or below zero.

Expected Behavior

setSidebarWidth clamps to a sensible minimum (and the layout never stores a non-positive width). A maximum is deliberately out of scope — the usable ceiling depends on the viewport, which the state layer cannot know.

Activity

  1. added theissue type on Sep 21, 2026
  2. danielvanza commented on Sep 22, 2026

    @danielvanza
    Contributor

    I'd like to work on this. Draft PR: #2239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions