Skip to content

[BUG] Division by zero panic in ResizablePanelGroup #894

Description

@rajpreetcodes

Bug Report

Platform

All platforms (Linux, macOS, Windows, WSL2)

Current Behavior

In �pps/desktop/src/components/resizable.rs:71-79, the drag fraction calculation divides by bounds width/height without checking for zero:

ust let fraction = match self.orientation { Orientation::Horizontal => { (event.event.position.x - bounds.left()) / (bounds.right() - bounds.left()) // Can be 0 } Orientation::Vertical => { (event.event.position.y - bounds.top()) / (bounds.bottom() - bounds.top()) // Can be 0 } };

If the panel group has zero width or height (e.g., during window initialization, minimized state, or layout edge cases), this causes a division by zero panic.

Expected Behavior

The calculation should guard against zero-size bounds and return a safe default fraction.

Steps To Reproduce

  1. Run the desktop app
  2. Resize window to minimum size or trigger a layout where panel bounds collapse to zero
  3. Attempt to drag the resizable handle

Recurrence Probability

Sometimes - depends on window state and layout timing

Additional Context

Critical bug - causes immediate panic/crash. Should be fixed before any PRs are accepted.

Activity

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

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions