Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Start in Create type exclusion now recursively checks for sanityCreate.exclude options #7890

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

snorrees
Copy link
Contributor

@snorrees snorrees commented Nov 27, 2024

Description

Turns out that "Start in Create" button did not correctly check for options.sanityCreate.exclude: true, and it was essentially not possible to opt-out per document type.

This new implementation checks options recursively (and more importantly maybe; it checks the base type 🤦 ). Recursion stops at the first boolean sanityCreate.exclude. This allows alias types to override parent options.

What to review

Read the unit-tests and 👍 👎

Testing

I deployed a new version of the test studio for this:

https://create-integration-test.sanity.studio/

Check that:

  • New "Documentation Article" documents has a "Start in Sanity Create" button.
  • New "Sanity Create Excluded" documents does does NOT have a "Start in Sanity Create" button.

Notes for release

Fixes an issue where the options.sanityCreate.exclude: true was not respected when determining if the "Start in Sanity Create" button should be shown for studios with beta.create.startInCreateEnabled: true set in sanity.config.

Setting options.sanityCreate.exclude: true on a document type will now correctly hide "Start in Sanity Create" for new documents of that type.

@snorrees snorrees requested a review from a team as a code owner November 27, 2024 12:55
@snorrees snorrees requested review from jordanl17 and removed request for a team November 27, 2024 12:55
Copy link

vercel bot commented Nov 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2024 0:58am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2024 0:58am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2024 0:58am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Nov 27, 2024 0:58am
page-building-studio ⬜️ Skipped (Inspect) Nov 27, 2024 0:58am

Copy link
Contributor

No changes to documentation

Copy link
Contributor

Component Testing Report Updated Nov 27, 2024 1:01 PM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 50s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 9s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 32s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 39s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 18s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 11s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 3m 0s 0 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 48s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 51s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 20s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 9s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 28s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 19s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 37s 12 0 0
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

Copy link
Contributor

⚡️ Editor Performance Report

Updated Wed, 27 Nov 2024 13:07:22 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 23.3 efps (43ms) 21.5 efps (47ms) +4ms (+8.1%)
article (body) 59.3 efps (17ms) 56.3 efps (18ms) +1ms (+5.3%)
article (string inside object) 23.8 efps (42ms) 23.3 efps (43ms) +1ms (+2.4%)
article (string inside array) 23.3 efps (43ms) 20.4 efps (49ms) +6ms (+14.0%)
recipe (name) 50.0 efps (20ms) 48.8 efps (21ms) +1ms (+2.5%)
recipe (description) 55.6 efps (18ms) 58.8 efps (17ms) -1ms (-5.6%)
recipe (instructions) 99.9+ efps (6ms) 99.9+ efps (6ms) +0ms (-/-%)
synthetic (title) 16.9 efps (59ms) 16.9 efps (59ms) +0ms (-/-%)
synthetic (string inside object) 17.5 efps (57ms) 16.9 efps (59ms) +2ms (+3.5%)

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 50ms 55ms 70ms 85ms 11.2s
article (body) 17ms 21ms 41ms 157ms 216ms 5.7s
article (string inside object) 42ms 43ms 52ms 93ms 212ms 7.1s
article (string inside array) 43ms 44ms 50ms 193ms 162ms 7.2s
recipe (name) 20ms 22ms 26ms 37ms 0ms 7.2s
recipe (description) 18ms 19ms 20ms 29ms 0ms 4.5s
recipe (instructions) 6ms 7ms 8ms 9ms 0ms 3.1s
synthetic (title) 59ms 63ms 67ms 318ms 995ms 14.0s
synthetic (string inside object) 57ms 61ms 68ms 611ms 1312ms 9.3s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 47ms 51ms 62ms 189ms 214ms 11.7s
article (body) 18ms 20ms 26ms 93ms 244ms 5.8s
article (string inside object) 43ms 46ms 52ms 89ms 140ms 7.2s
article (string inside array) 49ms 52ms 58ms 192ms 172ms 7.6s
recipe (name) 21ms 22ms 25ms 45ms 0ms 7.0s
recipe (description) 17ms 20ms 22ms 29ms 0ms 4.5s
recipe (instructions) 6ms 8ms 9ms 10ms 0ms 3.1s
synthetic (title) 59ms 62ms 69ms 113ms 545ms 13.6s
synthetic (string inside object) 59ms 64ms 85ms 149ms 698ms 9.3s

📚 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.

Copy link
Contributor

@RitaDias RitaDias left a comment

Choose a reason for hiding this comment

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

Thanks for this!

@snorrees snorrees added this pull request to the merge queue Nov 27, 2024
Merged via the queue into next with commit af03b86 Nov 27, 2024
56 checks passed
@snorrees snorrees deleted the bug/start-in-create-exclude branch November 27, 2024 15:08
RitaDias pushed a commit that referenced this pull request Nov 28, 2024
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