OpenCut-app / OpenCut-app/OpenCut
[BUG] Division by zero panic in ResizablePanelGroup
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 89.8k
- Forks
- 8.9k
- PR merge metrics
- No merged PRs in 30d
Description
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
- Run the desktop app
- Resize window to minimum size or trigger a layout where panel bounds collapse to zero
- 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in desktop/src/components/resizable.rs:71-79 and inspect the horizontal and vertical drag fraction calculations. Reproduce the issue by collapsing or minimizing the window, then verify that zero-size bounds produce a safe default fraction without a panic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100