Comfy-Org / Comfy-Org/ComfyUI_frontend

fix: fitView() does not account for open parameters panel width

Open
#11,154 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
area:ui
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Description

The `fitView()` operation does not account for the width of an open parameters panel (sidebar). As a result, when the parameters panel is open, the fit-to-view operation can place part of the workflow behind/under the panel, resulting in less of the workflow being visible after the operation.

This is most noticeable on smaller browser widths where the panel takes up a larger percentage of the screen.

## Steps to Reproduce

1. Open a workflow with a parameters/sidebar panel open on the right side.
2. Trigger a fit-to-view operation (e.g., by entering a subgraph for the first time, or pressing the fit view shortcut).
3. Observe that part of the workflow nodes are obscured by the parameters panel.

## Expected Behavior

`fitView()` should factor in the width of any open panels/sidebars when computing the viewport so that all nodes remain fully visible.

## Additional Context

- Reported in PR #10995 (fix: auto fit-to-view on first subgraph entry) as a pre-existing issue not introduced by that PR.
- Exacerbated by smaller browser widths where the panel occupies a larger proportion of the visible canvas area.

Reported by @christian-byrne in https://github.com/Comfy-Org/ComfyUI_frontend/pull/10995

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-11154-fix-fitView-does-not-account-for-open-parameters-panel-width-33f6d73d3650819ba8b3f62a837344d2) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.