Skip to content

test(query-devtools/Devtools): add test for clamping the width when resizing below min width#10702

Merged
sukvvon merged 2 commits into
mainfrom
test/query-devtools-devtools-resize-handle-min-width-clamp
May 13, 2026
Merged

test(query-devtools/Devtools): add test for clamping the width when resizing below min width#10702
sukvvon merged 2 commits into
mainfrom
test/query-devtools-devtools-resize-handle-min-width-clamp

Conversation

@sukvvon
Copy link
Copy Markdown
Collaborator

@sukvvon sukvvon commented May 13, 2026

🎯 Changes

Adds a test for Devtools.tsx covering the resize handle minWidth clamp branch:

  • should clamp the width to the minimum when dragging shrinks the panel below the minimum width

In left/right positions, when the user drags the resize handle past the 192px (12rem) minimum, the panel width is clamped to that minimum. This is the horizontal counterpart of the vertical minHeight clamp covered in #10698. No existing case covered this branch.

getBoundingClientRect is read twice during drag: once as the base size, and again after the clamp to detect when the panel has hit its minimum. The first call is stubbed to initialWidth and the second to 0, so only the newSize < minWidth clamp branch is observed (the localStore.width < newWidth restore branch stays inactive).

Coverage delta on Devtools.tsx: Stmts 95.30 → 95.40, Branch 78.19 → 78.88, Lines 96.07 → 96.18.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 13, 2026

View your CI Pipeline Execution ↗ for commit 7c52a91

Command Status Duration Result
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 26s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-13 17:12:10 UTC

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

🚀 Changeset Version Preview

No changeset entries found. Merging this PR will not cause a version bump for any packages.

@sukvvon sukvvon self-assigned this May 13, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 13, 2026

More templates

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@10702

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@10702

@tanstack/lit-query

npm i https://pkg.pr.new/@tanstack/lit-query@10702

@tanstack/preact-query

npm i https://pkg.pr.new/@tanstack/preact-query@10702

@tanstack/preact-query-devtools

npm i https://pkg.pr.new/@tanstack/preact-query-devtools@10702

@tanstack/preact-query-persist-client

npm i https://pkg.pr.new/@tanstack/preact-query-persist-client@10702

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@10702

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@10702

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@10702

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@10702

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@10702

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@10702

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@10702

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@10702

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@10702

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@10702

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@10702

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@10702

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@10702

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@10702

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@10702

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@10702

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@10702

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@10702

commit: 57129cf

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
react full 12.1 KB (0%)
react minimal 9.07 KB (0%)

@sukvvon sukvvon merged commit 57f7301 into main May 13, 2026
13 of 14 checks passed
@sukvvon sukvvon deleted the test/query-devtools-devtools-resize-handle-min-width-clamp branch May 13, 2026 17:13
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.

1 participant