Skip to content

fix(canvas): prevent unnecessary page scrolling - #461

Open
mohamad-fallah wants to merge 1 commit into
widgetify-app:mainfrom
mohamad-fallah:fix/layout-scroll-overflow
Open

mohamad-fallah wants to merge 1 commit into
widgetify-app:mainfrom
mohamad-fallah:fix/layout-scroll-overflow

Conversation

@mohamad-fallah

Copy link
Copy Markdown

Problem

The widget canvas remained vertically scrollable even when all widgets fit inside the viewport.

Root cause

The canvas always reserved two extra grid rows:

const totalGridRows = Math.max(6, maxWidgetRow + 2)

These empty rows increased the canvas height during normal use and created unnecessary vertical scrolling.

Changes

The canvas height now follows the last occupied widget row in normal mode.

Two extra rows are reserved only in edit mode so users can still move widgets into empty space.

Layouts containing widgets below the viewport continue to scroll normally.

Left out

No widget positions, collision behavior, responsive layout rules, or visual styles were changed.

Testing

  • npm run compile passed
  • npm run build passed
  • The changed file passed the project formatter check
  • npm test could not start because bun is unavailable on PATH

Visual checklist

  • A layout that fully fits inside the viewport should not scroll.
  • A layout with a widget extending below the viewport should scroll.
  • Edit mode should still show two extra rows for moving widgets.

The canvas always reserved two extra grid rows, which caused vertical
scrolling even when every widget fit inside the viewport.

Only reserve the extra rows while the canvas is in edit mode. Normal mode
now follows the actual widget height while preserving scroll for overflowing
layouts.
Copilot AI balanced review requested due to automatic review settings September 29, 2026 09:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants