You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note: Opening this as a draft PR to get early feeback. Once we agree on the general direction, I'll continue with these remaining todos:
Implement for primitive arrays
Implement for Grid Array Inputs
Add tests (either e2e or unit tests if applicable)
Description
This adds support for the disableActions option on array fields for disabling various array input capabilities like:
add – Removes the ability to add new items to the array
addBefore – Removes the "Add item before"-menu item from the array item menu
addAfter – Removes the "Add item after"-menu item from the array item menu
remove – Removes the ability to remove items from the array
duplicate – Removes the ability to duplicate array items
copy – Removes the ability to copy items from the array
Usage example:
{name: 'someArrayField',options: {disableActions: ['add','duplicate'],},title: "Array you can't add elements to",type: 'array',of: [{type: 'object',name: 'something',title: 'Something',fields: [{name: 'first',type: 'string',title: 'First string'}],},],}
Things to note:
These changes are only about UI affordances, and doesn't imply any form of write protection for the actual data
This only applies to arrays of objects and arrays of primitive values, and not to portable text arrays.
Disabling add will also implicitly disable addBefore and addAfter, thus disable inserting new items to the array entirely (although items can still be inserted via duplicate).
There might not be a compelling use case for disabling the ability to copy here(?), but including it for completeness. If all known actions are disabled, the menu items and "add"-affordances will be removed from the UI.
If we later decide to introduce a new default action, this will appear after upgrading the Studio, and will have to be explicitly disabled.
What to review
Does the feature make sense? Could the API be less confusing?
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)
70ms
78ms
95ms
439ms
1031ms
15.4s
article (body)
20ms
22ms
45ms
164ms
346ms
6.9s
article (string inside object)
63ms
65ms
73ms
254ms
483ms
9.4s
article (string inside array)
77ms
80ms
90ms
217ms
1257ms
10.6s
recipe (name)
33ms
36ms
42ms
79ms
1ms
9.0s
recipe (description)
31ms
32ms
40ms
114ms
0ms
6.2s
recipe (instructions)
7ms
9ms
10ms
43ms
0ms
3.4s
synthetic (title)
68ms
77ms
94ms
376ms
1624ms
16.0s
synthetic (string inside object)
65ms
68ms
85ms
639ms
1837ms
10.7s
🧪 Experiment result
The performance result of this branch
Benchmark
latency
p75
p90
p99
blocking time
test duration
article (title)
68ms
73ms
135ms
227ms
529ms
14.1s
article (body)
19ms
22ms
65ms
189ms
232ms
6.4s
article (string inside object)
59ms
61ms
66ms
143ms
413ms
9.2s
article (string inside array)
74ms
77ms
83ms
215ms
1128ms
10.0s
recipe (name)
34ms
36ms
55ms
80ms
0ms
9.0s
recipe (description)
29ms
32ms
36ms
77ms
0ms
6.2s
recipe (instructions)
7ms
8ms
9ms
20ms
0ms
3.4s
synthetic (title)
66ms
68ms
76ms
139ms
837ms
14.2s
synthetic (string inside object)
66ms
73ms
83ms
484ms
1830ms
9.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.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: Opening this as a draft PR to get early feeback. Once we agree on the general direction, I'll continue with these remaining todos:
Description
This adds support for the
disableActions
option on array fields for disabling various array input capabilities like:add
– Removes the ability to add new items to the arrayaddBefore
– Removes the "Add item before"-menu item from the array item menuaddAfter
– Removes the "Add item after"-menu item from the array item menuremove
– Removes the ability to remove items from the arrayduplicate
– Removes the ability to duplicate array itemscopy
– Removes the ability to copy items from the arrayUsage example:
Things to note:
add
will also implicitly disableaddBefore
andaddAfter
, thus disable inserting new items to the array entirely (although items can still be inserted viaduplicate
).copy
here(?), but including it for completeness. If all known actions are disabled, the menu items and "add"-affordances will be removed from the UI.What to review
Does the feature make sense? Could the API be less confusing?
Testing
Notes for release
disableActions
option on array fields for disabling various array input capabilitiesNote: please include the relevant parts from the description of the feature above in the release notes.