Skip to content

chore(Resizable): restore mocks after each resizable-slot case, plus two source cleanups - #10032

Merged
cixzhang merged 2 commits into
meta:mainfrom
vjeux:resizable/c20-slot-cleanup
Nov 5, 2026
Merged

cixzhang merged 2 commits into
meta:mainfrom
vjeux:resizable/c20-slot-cleanup

Conversation

@vjeux

@vjeux vjeux commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #9300: its three non-blocking review points.

Maintainer impact

  • In resizableSlot.test.tsx, each case restored its console.warn spy only at its own end. A case that failed left the spy in place, and the next case then read the failed case's calls, so one real failure showed up as several.
  • resizablePaneBeside was exported, but only resizablePaneFor called it, and both comments said the same thing.
  • One SideNav comment restated the line after it (INV29).

Intended invariant

No product behavior changes. Each resizable-slot case reads only its own warnings, whatever the case before it did.

Change

  • The file's afterEach also calls vi.restoreAllMocks().
  • resizablePaneFor reads the handle's sibling itself (nextElementSibling when reversed, previousElementSibling otherwise), and resizablePaneBeside goes.
  • The SideNav comment goes.
  • A [chore] changeset, since src ships in the package.

Evidence

  • Failure before the change: with a local probe (not part of the change), a case that warns and then fails, placed before the boolean and config-form guard, makes that case and the next two fail on main (3 failed, 8 passed).
  • Success after the change: the same probe fails alone (1 failed, 10 passed); without it, the file passes 10 of 10.
  • Product/runtime behavior verified unchanged: the Resizable, Layout and SideNav units, interaction specs and a11y contracts below.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

Local checks at this head, on main 1fec9fa:

  • The full ui suite (20,779 passed) and node suite (16,626 passed), CI=true pnpm lint (0 errors), check:changesets, the changeset coverage check, check:knowledge, core typecheck, prettier on the changed files; after pnpm build, pnpm api:report changes nothing beyond main's own stale lines.
  • Interaction specs for Resizable, Layout and SideNav in Chromium (35 passed), and grabZone, ResizeHandle and SideNavRailMotion in WebKit (23 passed, 12 skipped); the Resizable, Layout and SideNav a11y contracts in Chromium (39 passed).
  • The leak probe: main plus the probe, 3 failed and 8 passed; this head plus the probe, 1 failed and 10 passed; this head alone, 10 of 10.

…two source cleanups

Each case in resizableSlot.test.tsx restored its `console.warn` spy only
at its own end, so a case that failed left the spy in place and the next
case read the failed case's calls. An afterEach now restores every mock.
A local probe, not part of this change, shows it: a case that fails
after a warning, put before the boolean and config-form guard, made the
next two cases fail before this change and only itself after.

resizablePaneFor finds the lent panel beside a handle itself, so
resizablePaneBeside, which only it called, goes. SideNav drops a comment
that restated `const region = ownerRegion ?? resizableHook`. No behavior
change.
@vercel

vercel Bot commented Nov 5, 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 Nov 5, 2026 7:14am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 5, 2026, 7:33 AM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 5497802

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
AppShell 76.3 kB (0) · 12.2 kB CSS (0) — — · — · —
LayoutPanel 20.4 kB (0) · 4.9 kB CSS (0) — — · — · —
SideNavCollapseButton 47.7 kB (0) · 8.7 kB CSS (0) — ✓ · ✓ · ✓
5 more components
Component Size LoC Visual · A11y · RTL
SideNavHeading 61.7 kB (0) · 10.0 kB CSS (0) — ✓ · ✓ · ✓
SideNavItem 56.7 kB (0) · 9.8 kB CSS (0) — ✓ · ✓ · ✓
SideNavSection 6.8 kB (0) · 3.7 kB CSS (0) — ✓ · ✓ · ✓
ResizeHandle 20.5 kB (−22 B) · 4.3 kB CSS (0) — ✓ · ✓ · ✓
SideNav 76.3 kB (−25 B) · 10.1 kB CSS (0) — ✓ · ✓ · ✓

Package size: measured; main has no measurement of the merge base to compare yet.

API changes: cli +8 · ~1 · −0 (against the merge base's committed report)

Committed API report behind this build: cli 9 rows, core 4 rows; run pnpm api:report.

9 API changes (advisory)
Package Where Signature Usage
+ cli ./api · Types · type SearchResultEntry deprecated?: ComponentDeprecation | undefined import type {SearchResultEntry} from '@astryxdesign/cli/api'; const x: SearchResultEntry = {deprecated: …}
+ cli ./authoring · Types · interface ComponentDeprecation interface ComponentDeprecation import type {ComponentDeprecation} from '@astryxdesign/cli/authoring'
+ cli ./authoring · Types · interface MultiComponentDoc deprecated?: ComponentDeprecation import type {MultiComponentDoc} from '@astryxdesign/cli/authoring'; const x: MultiComponentDoc = {deprecated: …}
+ cli ./authoring · Types · interface SingleComponentDoc deprecated?: ComponentDeprecation import type {SingleComponentDoc} from '@astryxdesign/cli/authoring'; const x: SingleComponentDoc = {deprecated: …}
+ cli ./doc · Types · interface ComponentBaseDoc deprecated?: ComponentDeprecation import type {ComponentBaseDoc} from '@astryxdesign/cli/doc'; const x: ComponentBaseDoc = {deprecated: …}
+ cli ./doc · Types · interface SubComponentDoc deprecated?: ComponentDeprecation import type {SubComponentDoc} from '@astryxdesign/cli/doc'; const x: SubComponentDoc = {deprecated: …}
+ cli ./doc · Also exported from an earlier entry point · ComponentDeprecation ComponentDeprecation (./authoring) import {ComponentDeprecation} from '@astryxdesign/cli/doc'
+ cli ./template · Also exported from an earlier entry point · ComponentDeprecation ComponentDeprecation (./authoring) import {ComponentDeprecation} from '@astryxdesign/cli/template'
~ cli ./api · Functions · function search function search: (query: string, options?: { cwd?: string | undefined; type?: "template" | "component" | "hook" | "theme" | "doc" | undefined; limit?: number | undefined }) => Promise<SearchResponse> → function search: (query: string, options?: { cwd?: string | undefined; type?: "template" | "component" | "doc" | "theme" | "hook" | undefined; limit?: number | undefined }) => Promise<SearchResponse> import {search} from '@astryxdesign/cli/api'; search(…)

Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet.

The afterEach restore fixes the spy leak as described. With a failing probe case added, the base test file fails three cases and this head fails only the probe. The inlined resizablePaneFor picks the same sibling for both isReversed values, and nothing public changes.

Next: mark the pull request ready for review, and a maintainer adds the ci:run label so CI runs on this fork branch.

[Automated review]

@vjeux
vjeux marked this pull request as ready for review November 5, 2026 04:15
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 5, 2026
@cixzhang
cixzhang marked this pull request as draft November 5, 2026 04:21
@cixzhang
cixzhang marked this pull request as ready for review November 5, 2026 04:21
@cixzhang
cixzhang marked this pull request as draft November 5, 2026 07:07
@cixzhang
cixzhang marked this pull request as ready for review November 5, 2026 07:07

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved.

The afterEach restore fixes the spy leak as described: with a failing case added before the boolean and config-form case, the base test file fails three cases and this change fails only the added one. The inlined resizablePaneFor picks the same sibling for both isReversed values, the removed SideNav comment only repeated the code after it, and nothing public changes.

[Automated review]

@cixzhang
cixzhang merged commit 2673998 into meta:main Nov 5, 2026
85 of 124 checks passed
@vjeux
vjeux deleted the resizable/c20-slot-cleanup branch November 5, 2026 09:07

This branch was successfully deployed

1 active deployment
Preview — 54978020 Deployed Nov 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) 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.

2 participants