Skip to content

Conversation

DiegoCardoso
Copy link
Contributor

Description

Use the top and left frozen panel size to calculate the number of headers and rows to be rendered when the user scrolls. Currently, the size of the frozen panels are not accounted which causes some of the columns and rows to not be rendered even when there's available space for that.

Fixes #7507

Type of change

  • Bugfix

Use the top and left frozen panel size to calculate the amount of
headers and rows to be rendered when the user scrolls. Currently, the
size of the frozen panels are not accounted which causes some of the
columns and rows to not be rendered even when there's available space
for that.

Fixes #7507
@WoozyG
Copy link
Contributor

WoozyG commented Jul 19, 2025

One more test that would be helpful is one where a frozen row and/or column is also hidden, to make sure all the math still works.

Some of our spreadsheets hide the first two rows when displaying in the browser as they hold headers already present in the ui, but we unhide them on download so they show in excel. Many workbooks freeze the top 5 or so rows, including those hidden ones.

@DiegoCardoso
Copy link
Contributor Author

One more test that would be helpful is one where a frozen row and/or column is also hidden, to make sure all the math still works.

That was a good call. Thanks to your comment, I was able to find another issue with hidden columns/rows in the freeze pane area. The calculation for the left/right shift was not working as expected. Added a fix for that. Thanks!

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where frozen panel sizes were not properly accounted for when calculating the number of visible rows and columns during scrolling. This led to some columns and rows not being rendered even when there was available space for them.

  • Corrects the calculation logic for determining visible columns and rows by including frozen panel dimensions
  • Refactors scroll handling methods to improve clarity and maintainability
  • Adds comprehensive test coverage for freeze pane functionality with various scrolling scenarios

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
SheetWidget.java Core fix to include frozen panel sizes in scroll calculations and refactored scroll handling methods
FreezePaneIT.java Added extensive test coverage for freeze pane scrolling behavior and column resizing
CustomEditorIT.java Added tests for custom editor behavior in frozen cells
TestFixtures.java Added new test fixtures for custom editors and column hiding
HideSecondColumnFixture.java New test fixture to hide the second column for testing purposes
CustomEditorRowFixture.java New test fixture for testing custom editors in frozen rows
Comments suppressed due to low confidence (1)

vaadin-spreadsheet-flow-parent/vaadin-spreadsheet-flow-integration-tests/src/test/java/com/vaadin/flow/component/spreadsheet/test/FreezePaneIT.java:221

  • The error message states 'Should have the last column header visible' but the test is checking for the last row header (row200). The message should be 'Should have the last row header visible'.
        Assert.assertNotNull("Should have the last column header visible",

@DiegoCardoso DiegoCardoso enabled auto-merge (squash) July 28, 2025 10:30
Copy link

@DiegoCardoso DiegoCardoso merged commit ed322b3 into main Jul 28, 2025
5 checks passed
@DiegoCardoso DiegoCardoso deleted the fix/spreadsheet/frozen-pane branch July 28, 2025 10:58
vaadin-bot pushed a commit that referenced this pull request Jul 28, 2025
…ll (#7719)

* fix: use frozen panel size to calculate the visible rows/cols on scroll

Use the top and left frozen panel size to calculate the amount of
headers and rows to be rendered when the user scrolls. Currently, the
size of the frozen panels are not accounted which causes some of the
columns and rows to not be rendered even when there's available space
for that.

Fixes #7507

* test: add tests for the frozen pane

* test: add tests for frozen pane with custom editors

* test: add tests for frozen pane with custom editors

* test: split key commands

* test: change selector in expected row headers count

* test: align the test execution in EscWithArrowKeys test

* fix: adjust top/left shift calculation

* test: temporary disable one assertion to check CI

* test: undo last commit and disable test for the first column

* test: use selectcell instead of clickcell

* test: scale down always visible custom editor test

* address copilot review comments
vaadin-bot pushed a commit that referenced this pull request Jul 28, 2025
…ll (#7719)

* fix: use frozen panel size to calculate the visible rows/cols on scroll

Use the top and left frozen panel size to calculate the amount of
headers and rows to be rendered when the user scrolls. Currently, the
size of the frozen panels are not accounted which causes some of the
columns and rows to not be rendered even when there's available space
for that.

Fixes #7507

* test: add tests for the frozen pane

* test: add tests for frozen pane with custom editors

* test: add tests for frozen pane with custom editors

* test: split key commands

* test: change selector in expected row headers count

* test: align the test execution in EscWithArrowKeys test

* fix: adjust top/left shift calculation

* test: temporary disable one assertion to check CI

* test: undo last commit and disable test for the first column

* test: use selectcell instead of clickcell

* test: scale down always visible custom editor test

* address copilot review comments
DiegoCardoso added a commit that referenced this pull request Jul 28, 2025
…ll (#7719) (#7756)

* fix: use frozen panel size to calculate the visible rows/cols on scroll

Use the top and left frozen panel size to calculate the amount of
headers and rows to be rendered when the user scrolls. Currently, the
size of the frozen panels are not accounted which causes some of the
columns and rows to not be rendered even when there's available space
for that.

Fixes #7507

* test: add tests for the frozen pane

* test: add tests for frozen pane with custom editors

* test: add tests for frozen pane with custom editors

* test: split key commands

* test: change selector in expected row headers count

* test: align the test execution in EscWithArrowKeys test

* fix: adjust top/left shift calculation

* test: temporary disable one assertion to check CI

* test: undo last commit and disable test for the first column

* test: use selectcell instead of clickcell

* test: scale down always visible custom editor test

* address copilot review comments

Co-authored-by: Diego Cardoso <diego@vaadin.com>
DiegoCardoso added a commit that referenced this pull request Jul 28, 2025
…ll (#7719) (#7757)

* fix: use frozen panel size to calculate the visible rows/cols on scroll

Use the top and left frozen panel size to calculate the amount of
headers and rows to be rendered when the user scrolls. Currently, the
size of the frozen panels are not accounted which causes some of the
columns and rows to not be rendered even when there's available space
for that.

Fixes #7507

* test: add tests for the frozen pane

* test: add tests for frozen pane with custom editors

* test: add tests for frozen pane with custom editors

* test: split key commands

* test: change selector in expected row headers count

* test: align the test execution in EscWithArrowKeys test

* fix: adjust top/left shift calculation

* test: temporary disable one assertion to check CI

* test: undo last commit and disable test for the first column

* test: use selectcell instead of clickcell

* test: scale down always visible custom editor test

* address copilot review comments

Co-authored-by: Diego Cardoso <diego@vaadin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spreadsheets with Freeze Pane not fully rendering all columns/rows upon resizing of Window or rows/columns
4 participants