Repository navigation
fix(structure): suppress deprecated selectedVariantName lint error in useListPaneCounts - #15061
Conversation
… useListPaneCounts
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📦 Bundle Stats —
|
| Metric | Value | vs main (f5821c3) | vs v6.16.0 |
|---|---|---|---|
| Internal (raw) | 4.48 MB | - | +45.5 KB, +1.0% |
| Internal (gzip) | 1.11 MB | - | +17.0 KB, +1.5% |
| Bundled (raw) | 13.32 MB | - | +64.4 KB, +0.5% |
| Bundled (gzip) | 3.16 MB | - | +21.3 KB, +0.7% |
| Import time | 1.76s | -17ms, -0.9% | +20ms, +1.2% |
bin:sanity
| Metric | Value | vs main (f5821c3) | vs v6.16.0 |
|---|---|---|---|
| Internal (raw) | 7.1 KB | - | - |
| Internal (gzip) | 2.9 KB | - | - |
| Bundled (raw) | 7.1 KB | - | - |
| Bundled (gzip) | 2.8 KB | - | - |
| Import time | 5ms | -0ms, -2.2% | +0ms, +2.4% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
❌ E2E Tests🟢 212 passed • 🔴 1 failed • 🟡 4 flaky • (⚪ 93 skipped) • view full report • view run 🤖 Share with an AI agent: Debug failing tests locallySANITY_E2E_PROJECT_ID=ittbm412 \
SANITY_E2E_BASE_URL=https://e2e-studio-9b8v5w7ag.sanity.dev \
SANITY_E2E_DATASET=pr-15061-chromium-36429092765 \
SANITY_E2E_DATASET_CHROMIUM=pr-15061-chromium-36429092765 \
SANITY_E2E_DATASET_FIREFOX=pr-15061-firefox-36429092765 \
pnpm test:e2e --headed \
e2e/tests/default-layout/versionStatus.spec.ts |
📚 TypeDoc Generation Result✅ TypeDoc generated successfully!
The TypeDoc JSON file has been generated and validated. All documentation scripts completed successfully. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The deprecated API has a straightforward supported replacement and should be migrated rather than suppressed.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds a lint suppression for deprecated perspective API usage in list-pane counts.
Changes:
- Suppresses the
selectedVariantNamedeprecation warning.
| File | Description |
|---|---|
packages/sanity/src/structure/panes/list/useListPaneCounts.ts |
Adds the lint suppression. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| enabled = true, | ||
| ): ListPaneCounts { | ||
| const documentPreviewStore = useDocumentPreviewStore() | ||
| // oxlint-disable-next-line no-deprecated -- will fix in follow up PR |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||

Description
Alternative to #15059. The
Should the linter fix? 🤔job fails onmainbecauseuseListPaneCountsdestructures the deprecatedselectedVariantNamefield fromusePerspective(), trippingtypescript/no-deprecated:Instead of refactoring the hook (and its test mocks) to
selectedVariantNames+getDefaultVariant, this adds a single-line suppression:This matches the existing precedent for the same deprecation elsewhere in
src/structure(StructureToolProvider.tsx,createPaneResolver.ts,ParameterizedLink.tsx,DocumentActionsProvider.tsx,PaneHeaderActions.tsx), so the migration offselectedVariantNamecan happen in one sweep rather than piecemeal. No runtime behavior or test changes.What to review
packages/sanity/src/structure/panes/list/useListPaneCounts.ts.Testing
oxlint --disable-nested-config packages/sanity/src/structure/panes/list/useListPaneCounts.ts: reports theno-deprecatederror onmain, exits 0 with this change.oxfmt --checkon the file passes.pnpm vitest run --project=sanity packages/sanity/src/structure/panes/list/useListPaneCounts.test.tsx: 9/9 pass, no type errors.Notes for release
N/A: Internal only (lint suppression)