Skip to content

fix(common): skip content resize when DataView has no items - #2778

Merged
ghiscoding merged 1 commit into
masterfrom
bugfix/skip-resize-by-content
Aug 29, 2026
Merged

fix(common): skip content resize when DataView has no items#2778
ghiscoding merged 1 commit into
masterfrom
bugfix/skip-resize-by-content

Conversation

@ghiscoding

Copy link
Copy Markdown
Owner

Summary

Prevent double-click column auto-resize from changing the column width when a custom DataView does not expose any items.

Why

Windowed or custom DataViews may return an empty array from getItems(). Resizing in that situation incorrectly recalculates the column width from its minimum width.

Changes

  • Skip single-column resize-by-content when getItems() is unavailable or empty.
  • Preserve the current column width.
  • Add regression coverage for empty custom DataViews.

Validation

  • pnpm exec vitest run packages/common/src/services/__tests__/resizer.service.spec.ts --config test/vitest.config.mts
  • pnpm exec prettier --check packages/common/src/services/resizer.service.ts packages/common/src/services/__tests__/resizer.service.spec.ts

Comments

Custom or windowed DataViews can provide their own asynchronous resize handler when they need to fetch rows before measuring content.

AI / LLM assistance

  • AI / LLM assistance used:
    • No
    • Yes
  • If Yes:
    • which tool/model: OpenAI Codex, GPT-5
    • how was it used: Reviewed the implementation, proposed the defensive guard, added tests, and verified formatting and unit tests.

Checklist

  • The changes are limited to only one scope.
  • Tests were added or updated where appropriate.
  • Documentation was updated where appropriate.

@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (53ee739) to head (4c142bd).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2778   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files         199      199           
  Lines       25773    25776    +3     
  Branches     9131     9132    +1     
=======================================
+ Hits        25773    25776    +3     
Flag Coverage Δ
angular 100.0% <ø> (ø)
universal 100.0% <100.0%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new

pkg-pr-new Bot commented Aug 29, 2026

Copy link
Copy Markdown
angular-slickgrid

npm i https://pkg.pr.new/angular-slickgrid@2778

aurelia-slickgrid

npm i https://pkg.pr.new/aurelia-slickgrid@2778

slickgrid-react

npm i https://pkg.pr.new/slickgrid-react@2778

slickgrid-vue

npm i https://pkg.pr.new/slickgrid-vue@2778

@slickgrid-universal/angular-row-detail-plugin

npm i https://pkg.pr.new/@slickgrid-universal/angular-row-detail-plugin@2778

@slickgrid-universal/aurelia-row-detail-plugin

npm i https://pkg.pr.new/@slickgrid-universal/aurelia-row-detail-plugin@2778

@slickgrid-universal/react-row-detail-plugin

npm i https://pkg.pr.new/@slickgrid-universal/react-row-detail-plugin@2778

@slickgrid-universal/vue-row-detail-plugin

npm i https://pkg.pr.new/@slickgrid-universal/vue-row-detail-plugin@2778

@slickgrid-universal/binding

npm i https://pkg.pr.new/@slickgrid-universal/binding@2778

@slickgrid-universal/common

npm i https://pkg.pr.new/@slickgrid-universal/common@2778

@slickgrid-universal/composite-editor-component

npm i https://pkg.pr.new/@slickgrid-universal/composite-editor-component@2778

@slickgrid-universal/custom-footer-component

npm i https://pkg.pr.new/@slickgrid-universal/custom-footer-component@2778

@slickgrid-universal/custom-tooltip-plugin

npm i https://pkg.pr.new/@slickgrid-universal/custom-tooltip-plugin@2778

@slickgrid-universal/empty-warning-component

npm i https://pkg.pr.new/@slickgrid-universal/empty-warning-component@2778

@slickgrid-universal/event-pub-sub

npm i https://pkg.pr.new/@slickgrid-universal/event-pub-sub@2778

@slickgrid-universal/excel-export

npm i https://pkg.pr.new/@slickgrid-universal/excel-export@2778

@slickgrid-universal/graphql

npm i https://pkg.pr.new/@slickgrid-universal/graphql@2778

@slickgrid-universal/odata

npm i https://pkg.pr.new/@slickgrid-universal/odata@2778

@slickgrid-universal/pagination-component

npm i https://pkg.pr.new/@slickgrid-universal/pagination-component@2778

@slickgrid-universal/pdf-export

npm i https://pkg.pr.new/@slickgrid-universal/pdf-export@2778

@slickgrid-universal/row-detail-view-plugin

npm i https://pkg.pr.new/@slickgrid-universal/row-detail-view-plugin@2778

@slickgrid-universal/rxjs-observable

npm i https://pkg.pr.new/@slickgrid-universal/rxjs-observable@2778

@slickgrid-universal/sql

npm i https://pkg.pr.new/@slickgrid-universal/sql@2778

@slickgrid-universal/text-export

npm i https://pkg.pr.new/@slickgrid-universal/text-export@2778

@slickgrid-universal/utils

npm i https://pkg.pr.new/@slickgrid-universal/utils@2778

@slickgrid-universal/vanilla-bundle

npm i https://pkg.pr.new/@slickgrid-universal/vanilla-bundle@2778

@slickgrid-universal/vanilla-force-bundle

npm i https://pkg.pr.new/@slickgrid-universal/vanilla-force-bundle@2778

@slickgrid-universal/web-mcp

npm i https://pkg.pr.new/@slickgrid-universal/web-mcp@2778

commit: 4c142bd

@ghiscoding
ghiscoding merged commit 2414a21 into master Aug 29, 2026
13 checks passed
@ghiscoding
ghiscoding deleted the bugfix/skip-resize-by-content branch August 29, 2026 04:23
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.

1 participant