Repository navigation
chore(Resizable): restore mocks after each resizable-slot case, plus two source cleanups - #10032
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| 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
There was a problem hiding this comment.
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]
There was a problem hiding this comment.
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]
Follow-up to #9300: its three non-blocking review points.
Maintainer impact
resizableSlot.test.tsx, each case restored itsconsole.warnspy 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.resizablePaneBesidewas exported, but onlyresizablePaneForcalled it, and both comments said the same thing.Intended invariant
No product behavior changes. Each resizable-slot case reads only its own warnings, whatever the case before it did.
Change
afterEachalso callsvi.restoreAllMocks().resizablePaneForreads the handle's sibling itself (nextElementSiblingwhen reversed,previousElementSiblingotherwise), andresizablePaneBesidegoes.[chore]changeset, sincesrcships in the package.Evidence
Scope
Testing
Local checks at this head, on main 1fec9fa:
CI=true pnpm lint(0 errors), check:changesets, the changeset coverage check, check:knowledge, core typecheck, prettier on the changed files; afterpnpm build,pnpm api:reportchanges nothing beyond main's own stale lines.grabZone,ResizeHandleandSideNavRailMotionin WebKit (23 passed, 12 skipped); the Resizable, Layout and SideNav a11y contracts in Chromium (39 passed).