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: restore support for defaultOrdering. #7626

Merged
merged 1 commit into from
Oct 17, 2024
Merged

Conversation

bjoerge
Copy link
Member

@bjoerge bjoerge commented Oct 17, 2024

fixes #7586

Description

#7554 broke default sorting because useStructureToolSetting always returned null from localStorage synchronously, therefore overriding the passed defaultValue. This fixes the issue by always falling back to the defaultValue whenever the settings store emits null.

What to review

Does it make sense?

Testing

Ideally useStructureToolSetting should have unit tests, but I'm not able to prioritize spending time on that right now.

I've manually tested and verified that the behavior is as intended.

Notes for release

  • Fixes a bug causing default sorting for document lists to not be applied

@bjoerge bjoerge requested a review from binoy14 October 17, 2024 12:22
@bjoerge bjoerge requested a review from a team as a code owner October 17, 2024 12:22
Copy link

vercel bot commented Oct 17, 2024

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

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2024 0:26am
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2024 0:26am
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2024 0:26am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2024 0:26am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2024 0:26am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Oct 17, 2024 0:26am

Copy link
Contributor

No changes to documentation

Copy link
Contributor

Component Testing Report Updated Oct 17, 2024 12:30 PM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 45s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 8s 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) 46s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 43s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 18s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 9s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 26s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 18s 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 Thu, 17 Oct 2024 12:33:34 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 16.5 efps (61ms) 16.4 efps (61ms) +1ms (+0.8%)
article (body) 56.7 efps (18ms) 60.1 efps (17ms) -1ms (-5.7%)
article (string inside object) 17.5 efps (57ms) 18.5 efps (54ms) -3ms (-5.3%)
article (string inside array) 14.1 efps (71ms) 14.7 efps (68ms) -3ms (-4.2%)
recipe (name) 30.3 efps (33ms) 31.3 efps (32ms) -1ms (-3.0%)
recipe (description) 34.5 efps (29ms) 34.5 efps (29ms) +0ms (-/-%)
recipe (instructions) 99.9+ efps (6ms) 99.9+ efps (7ms) +1ms (-/-%)
synthetic (title) 15.4 efps (65ms) 15.9 efps (63ms) -2ms (-3.1%)
synthetic (string inside object) 16.1 efps (62ms) 15.7 efps (64ms) +2ms (+2.4%)

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) 61ms 66ms 87ms 191ms 466ms 14.5s
article (body) 18ms 22ms 33ms 189ms 230ms 6.0s
article (string inside object) 57ms 60ms 104ms 181ms 314ms 8.9s
article (string inside array) 71ms 75ms 83ms 227ms 1042ms 9.8s
recipe (name) 33ms 35ms 38ms 85ms 7ms 9.2s
recipe (description) 29ms 30ms 47ms 90ms 18ms 6.0s
recipe (instructions) 6ms 9ms 10ms 24ms 0ms 3.3s
synthetic (title) 65ms 67ms 74ms 214ms 1136ms 14.8s
synthetic (string inside object) 62ms 65ms 77ms 194ms 1531ms 9.5s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 61ms 65ms 90ms 178ms 340ms 13.8s
article (body) 17ms 18ms 23ms 177ms 210ms 5.6s
article (string inside object) 54ms 56ms 62ms 192ms 187ms 8.4s
article (string inside array) 68ms 72ms 82ms 195ms 778ms 9.3s
recipe (name) 32ms 35ms 38ms 70ms 16ms 9.2s
recipe (description) 29ms 31ms 35ms 74ms 0ms 5.9s
recipe (instructions) 7ms 9ms 9ms 20ms 0ms 3.3s
synthetic (title) 63ms 65ms 73ms 158ms 978ms 14.1s
synthetic (string inside object) 64ms 67ms 75ms 179ms 1526ms 9.5s

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

@bjoerge bjoerge enabled auto-merge October 17, 2024 12:46
Copy link
Contributor

@binoy14 binoy14 left a comment

Choose a reason for hiding this comment

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

working as expected, thanks!

@bjoerge bjoerge added this pull request to the merge queue Oct 17, 2024
Merged via the queue into next with commit 02da757 Oct 17, 2024
66 checks passed
@bjoerge bjoerge deleted the fix-default-ordering branch October 17, 2024 15:22
bjoerge added a commit that referenced this pull request Oct 23, 2024
* next:
  chore(deps): update dependency sanity-diff-patch to v4 (#7630)
  feat: validate PR title against conventional commits (#7580)
  chore(deps): update dependency @sanity/tsdoc to v1.0.113 (#7627)
  fix(deps): update dependency @sanity/client to ^6.22.2 (#7625)
  chore(deps): update typescript-tooling (#7605)
  fix: restore support for defaultOrdering. (#7626)
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.

defaultOrdering stopped working in sanity 3.59.0
2 participants