Skip to content

Resizable: pin #5934's legacy maxSizePx shrink-after-drag clamp - #6041

Merged
cixzhang merged 1 commit into
mainfrom
fix/table-inbox-pane-clamp
Sep 4, 2026
Merged

Resizable: pin #5934's legacy maxSizePx shrink-after-drag clamp#6041
cixzhang merged 1 commit into
mainfrom
fix/table-inbox-pane-clamp

Conversation

@cixzhang

@cixzhang cixzhang commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

What

Test-only closure for a same-head review finding on #5934 (table-inbox).

The reading pane in the table-inbox template derives maxSizePx itself — Math.max(paneFloor, surfaceWidth - listFloor) from a plain ResizeObserver measurement, not a containerRef percentage bound. A dismissed same-head review on #5934 found that after widening the pane past a later surface-derived maximum, the pane stayed oversized and overlapped the list instead of clamping to the new ceiling.

Investigation

Reproducing the review's exact sequence — drag the pane to 1066px, then narrow the surface so the derived max drops to 834px — at both the useResizable hook level and a page.tsx-composition-level replica shows it already clamps correctly on current main. useResizable's general FR4 bounds-reclamp (landed in #5783, commit 311deefc) re-resolves resolvedMax from a changed caller-supplied maxSizePx on every render and re-clamps the committed selection — independent of whether the bound is a percentage or a plain number. No template or hook behavior change is needed.

The change

Adds the reproduction directly to useResizable's FR4/FR6 suite (AST-010) so this caller-recomputed-pixel path — distinct from the existing containerRef/percentage-basis tests already there — can't silently regress:

  • clamps the selection and the ARIA-visible _maxSizePx/_size when a legacy numeric maxSizePx shrinks below the user's chosen size;
  • leaves an in-range user choice untouched (clamping is not a second proportional-resize mode, per FR4).

Risk

None — test-only, no runtime change.

Testing

  • vitest run packages/core/src/Resizable/ — 150/150 passing (112 in useResizable.test.ts, incl. the 2 new tests)
  • tsc --noEmit, eslint on the changed file — clean
  • pnpm check:repo — clean

Refs #5934, #5783. AST-010 FR4/FR6.

The table-inbox reading pane (#5934) computes maxSizePx itself from a
plain ResizeObserver measurement (Math.max(paneFloor, surfaceWidth -
listFloor)) rather than a containerRef percentage bound. A same-head
review on #5934 found that after widening the pane past a later
surface-derived maximum, the pane stayed oversized and overlapped the
list instead of clamping down to the new ceiling.

Investigation shows this exact literal-maxSizePx-shrink path is
already covered by useResizable's general FR4 bounds-reclamp (landed
in #5783, commit 311deef): re-resolving resolvedMax from a changed
caller-supplied maxSizePx every render already re-clamps the
committed selection, independent of whether the bound is a percentage
or a plain number. Both a hook-level and a page.tsx-composition-level
reproduction of the #5934 review's exact sequence (drag to 1066px,
then narrow the derived max to 834px) already pass on current main.

Add the regression directly to useResizable's FR4/FR6 suite so this
caller-recomputed-pixel path can't silently regress again: one test
pins the clamp itself and the ARIA-visible _maxSizePx/_size, the
other pins that an in-range user choice is left untouched (AST-010
FR4: bounds clamp, they never scale).

No runtime change: the fix is already on main.
@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Sep 4, 2026 7:11pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 4, 2026

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Semantic verdict: request changes

The regression test still lets the old pane width revive after the surface grows again, so the reading pane can jump without another drag. I limited committed-bound updates to percentage bounds and all 112 tests still passed. Please grow maxSizePx back to 1500 after the 834 clamp and assert the size stays 834; that pins the committed selection this PR says it protects.

[Reviewed by Robohands]

github-actions Bot added a commit that referenced this pull request Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

Resizable (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 1325 -
Complexity N/A Very High (106) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.8KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@cixzhang
cixzhang merged commit 6e561f9 into main Sep 4, 2026
27 checks passed
@cixzhang
cixzhang deleted the fix/table-inbox-pane-clamp branch September 4, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant