Skip to content

Conversation

@stipsan
Copy link
Member

@stipsan stipsan commented Jan 7, 2026

Description

I didn't like some of the auto fixes in #11725 so I've decided to handle them manually here. Since the no-unnecessary-boolean-literal-compare) rule now supports --fix it doesn't make sense to have it stay a warn, it should be error so it's explicit or visible. Otherwise someone might PR a change that spawns a follow up PR like #11725 that risks changing program behavior since we sometimes lie in our type-system 😅

What to review

Everything makes sense? I've tried to balance letting the rule work its magic, except for in specific places where it risks changing runtime behavior where we should be using unknown and parsing untrusted input where custom code can choose to suppress contracts with // @ts-expect-error and // @ts-ignore.

Testing

If the CI is happy we good.

Notes for release

N/A

@stipsan stipsan requested review from a team as code owners January 7, 2026 17:33
@stipsan stipsan requested review from jordanl17 and removed request for a team January 7, 2026 17:33
@vercel
Copy link

vercel bot commented Jan 7, 2026

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

Project Deployment Review Updated (UTC)
page-building-studio Ready Ready Preview, Comment Jan 7, 2026 5:34pm
test-studio Ready Ready Preview, Comment Jan 7, 2026 5:34pm
3 Skipped Deployments
Project Deployment Review Updated (UTC)
e2e-studio Ignored Ignored Jan 7, 2026 5:34pm
studio-workshop Ignored Ignored Jan 7, 2026 5:34pm
test-next-studio Ignored Ignored Jan 7, 2026 5:34pm

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

🧪 E2E Preview environment

🔑 Environment Variables for Local Testing

This is the preview URL for the E2E tests: https://e2e-studio-kqmfeupgd.sanity.dev

To run the E2E tests locally, you can use the following environment variables, then run pnpm test:e2e --ui to open the Playwright test runner.

💬 Remember to build the project first with pnpm build:e2e.

  SANITY_E2E_PROJECT_ID=ittbm412
  SANITY_E2E_BASE_URL=https://e2e-studio-kqmfeupgd.sanity.dev
  SANITY_E2E_DATASET="update depending the project you want to test (pr-11734-chromium-20790534663 || pr-11734-firefox-20790534663 )"
  SANITY_E2E_DATASET_CHROMIUM=pr-11734-chromium-20790534663
  SANITY_E2E_DATASET_FIREFOX=pr-11734-firefox-20790534663

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

📊 Playwright Test Report

Download Full E2E Report

This report contains test results, including videos of failing tests.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

⚡️ Editor Performance Report

Updated Wed, 07 Jan 2026 17:50:42 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 23.3 efps (43ms) 21.7 efps (46ms) +3ms (+7.0%)
article (body) 50.6 efps (20ms) 56.2 efps (18ms) -2ms (-9.9%)
article (string inside object) 23.8 efps (42ms) 25.6 efps (39ms) -3ms (-7.1%)
article (string inside array) 23.8 efps (42ms) 20.6 efps (49ms) +7ms (+15.5%)
recipe (name) 39.2 efps (26ms) 41.7 efps (24ms) -2ms (-5.9%)
recipe (description) 58.8 efps (17ms) 58.8 efps (17ms) +0ms (-/-%)
recipe (instructions) 99.9+ efps (6ms) 99.9+ efps (5ms) -1ms (-/-%)
singleString (stringField) 54.1 efps (19ms) 55.6 efps (18ms) -1ms (-2.7%)
synthetic (title) 16.9 efps (59ms) 15.9 efps (63ms) +4ms (+6.8%)
synthetic (string inside object) 16.1 efps (62ms) 16.7 efps (60ms) -2ms (-3.2%)

efps — editor "frames per second". The number of updates assumed to be possible within a second.

Derived from input latency. efps = 1000 / input_latency

Detailed information

🏠 Reference result

The performance result of sanity@latest

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 43ms 51ms 78ms 164ms 104ms 10.4s
article (body) 20ms 33ms 76ms 161ms 234ms 5.6s
article (string inside object) 42ms 46ms 63ms 147ms 86ms 6.4s
article (string inside array) 42ms 46ms 59ms 160ms 86ms 6.6s
recipe (name) 26ms 28ms 37ms 61ms 0ms 7.6s
recipe (description) 17ms 22ms 27ms 48ms 0ms 4.3s
recipe (instructions) 6ms 9ms 11ms 31ms 0ms 3.0s
singleString (stringField) 19ms 21ms 23ms 58ms 0ms 7.5s
synthetic (title) 59ms 61ms 69ms 123ms 433ms 15.5s
synthetic (string inside object) 62ms 66ms 117ms 194ms 595ms 8.0s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 46ms 49ms 61ms 127ms 72ms 10.7s
article (body) 18ms 19ms 26ms 108ms 99ms 4.8s
article (string inside object) 39ms 43ms 46ms 63ms 0ms 6.2s
article (string inside array) 49ms 52ms 61ms 184ms 107ms 6.9s
recipe (name) 24ms 27ms 30ms 61ms 0ms 7.4s
recipe (description) 17ms 20ms 24ms 41ms 0ms 4.2s
recipe (instructions) 5ms 9ms 10ms 23ms 0ms 3.0s
singleString (stringField) 18ms 21ms 23ms 31ms 0ms 6.8s
synthetic (title) 63ms 65ms 119ms 232ms 636ms 16.4s
synthetic (string inside object) 60ms 63ms 79ms 205ms 384ms 7.9s

📚 Glossary

column definitions

  • benchmark — the name of the test, e.g. "article", followed by the label of the field being measured, e.g. "(title)".
  • latency — the time between when a key was pressed and when it was rendered. derived from a set of samples. the median (p50) is shown to show the most common latency.
  • p75 — the 75th percentile of the input latency in the test run. 75% of the sampled inputs in this benchmark were processed faster than this value. this provides insight into the upper range of typical performance.
  • p90 — the 90th percentile of the input latency in the test run. 90% of the sampled inputs were faster than this. this metric helps identify slower interactions that occurred less frequently during the benchmark.
  • p99 — the 99th percentile of the input latency in the test run. only 1% of sampled inputs were slower than this. this represents the worst-case scenarios encountered during the benchmark, useful for identifying potential performance outliers.
  • blocking time — the total time during which the main thread was blocked, preventing user input and UI updates. this metric helps identify performance bottlenecks that may cause the interface to feel unresponsive.
  • test duration — how long the test run took to complete.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 44.48% 64249 / 144421
🔵 Statements 44.48% 64249 / 144421
🔵 Functions 47.99% 3371 / 7023
🔵 Branches 79.66% 12984 / 16298
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/@sanity/schema/src/sanity/extractSchema.ts 93.68% 89.3% 100% 93.68% 102-103, 125-126, 162, 172-173, 180-181, 249-250, 270-277, 304-305, 337-338, 422-423, 432, 580-587, 644-645, 691, 791-792
packages/sanity/src/core/comments/plugin/inspector/CommentsInspector.tsx 5.36% 100% 0% 5.36% 52-448
packages/sanity/src/core/components/collapseMenu/CollapseMenu.tsx 10% 100% 0% 10% 75-77, 92-124, 131-334, 342-367
packages/sanity/src/core/create/components/CreateLinkedDocumentBannerContent.tsx 12.5% 100% 0% 12.5% 25-104
packages/sanity/src/core/form/FormBuilderProvider.tsx 67.6% 6.25% 25% 67.6% 71-76, 80-130
packages/sanity/src/core/form/inputs/PortableText/hooks/useSpellCheck.tsx 28.57% 100% 0% 28.57% 5-13
packages/sanity/src/core/form/inputs/PortableText/toolbar/InsertMenu.tsx 14.7% 100% 0% 14.7% 24-101
packages/sanity/src/core/form/store/conditional-property/resolveConditionalProperty.ts 100% 100% 100% 100%
packages/sanity/src/core/releases/components/documentHeader/contextMenu/CanonicalReleaseContextMenu.tsx 87.3% 65% 100% 87.3% 71-79
packages/sanity/src/core/releases/store/useOrgActiveReleaseCount.ts 12.5% 100% 0% 12.5% 17-66, 79-101
packages/sanity/src/core/store/_legacy/history/useTimelineStore.ts 19.51% 100% 0% 19.51% 100-253
packages/sanity/src/core/studio/components/navbar/new-document/NewDocumentList.tsx 13.23% 100% 0% 13.23% 28-111
packages/sanity/src/core/studio/router/helpers.ts 72.44% 24% 83.33% 72.44% 20-23, 30-31, 34-35, 60-61, 64-65, 70, 74, 79, 91-92, 101-108, 132-135, 147-152, 163-164
packages/sanity/src/core/tasks/context/navigation/TasksNavigationProvider.tsx 30.71% 18.18% 25% 30.71% 19-72, 81-102, 106, 110, 114, 118-135, 148, 150-151
packages/sanity/src/presentation/PresentationToolGrantsCheck.tsx 0% 0% 0% 0% 1-67
packages/sanity/src/presentation/overlays/schema/extract.tsx 0% 100% 100% 0% 26-482
packages/sanity/src/structure/hasObsoleteDraft.ts 100% 100% 100% 100%
packages/sanity/src/structure/documentActions/PublishAction.tsx 12.5% 100% 0% 12.5% 34-48, 54-249
packages/sanity/src/structure/panes/documentList/DocumentListPaneContent.tsx 14.36% 51.72% 33.33% 14.36% 66-74, 79-258, 262, 274-280, 282-301
packages/sanity/src/structure/panes/list/ListPaneContent.tsx 0% 0% 0% 0% 1-148
Generated in workflow #49463 for commit 7abb4e4 by the Vitest Coverage Report Action

Copy link
Member

@jordanl17 jordanl17 left a comment

Choose a reason for hiding this comment

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

Yay - I like this!!

@stipsan stipsan merged commit 94462ad into main Jan 8, 2026
66 checks passed
@stipsan stipsan deleted the fix-no-unnecessary-boolean-literal-compare branch January 8, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants