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

feat(vision): link to edit documents #6124

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

sgulseth
Copy link
Member

@sgulseth sgulseth commented Mar 24, 2024

Description

Suggestion: Add a link icon next to each _id and _ref attributes

image.png

What to review

Is this "safe"? Ref #6074 the user might be querying another dataset 🤔 Though it provides an easy way to inspect a document.

Testing

N/A

Notes for release

n/a - no notes needed

Copy link

vercel bot commented Mar 24, 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 Dec 4, 2024 11:33pm
performance-studio ✅ Ready (Inspect) Visit Preview Dec 4, 2024 11:33pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 4, 2024 11:33pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 4, 2024 11:33pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Dec 4, 2024 11:33pm

Copy link
Member Author

sgulseth commented Mar 24, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

No changes to documentation

@sgulseth sgulseth requested a review from rexxars March 24, 2024 23:50
@sgulseth sgulseth marked this pull request as ready for review March 24, 2024 23:50
@sgulseth sgulseth requested a review from a team as a code owner March 24, 2024 23:50
Copy link
Contributor

github-actions bot commented Mar 24, 2024

Component Testing Report Updated Dec 4, 2024 11:30 PM (UTC)

✅ All Tests Passed -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 7s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 13s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 40s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 53s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 27s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 14s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 2m 7s 2 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 8s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 2m 50s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 45s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 13s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 40s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 53s 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
Member

@rexxars rexxars left a comment

Choose a reason for hiding this comment

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

Love the feature! Been wanting this for a while :)

Is this "safe"? Ref #6074 the user might be querying another dataset 🤔 Though it provides an easy way to inspect a document.

For both features, perhaps we should grab all workspaces and try to narrow down the workspace in question based on the dataset. If we can find a single one, then use that workspace/schema. Else do not show the link, or show it as disabled with a tooltip ("no workspace configured for this dataset"). If there are multiple workspaces that references a dataset, we can temporarily show a "unable to resolve workspace for dataset", and then later expand it with a "select workspace to use"?

We'll need to expand our intent resolving, however - it currently does not allow specifying a workspace. It's something we've been wanting for other reasons though, so would make sense to add.

@sgulseth
Copy link
Member Author

sgulseth commented Mar 26, 2024

Agree 😄 However, I had a look at injecting workspace into intent links, and from what I could tell it was a bigger refactor. So instead of that I pushed a change where we only render the document links if the workspace you are on matches the dataset vision is querying. Then the current behavior should work as is?

@rexxars rexxars merged commit 2379f2b into next Dec 4, 2024
46 of 49 checks passed
@rexxars rexxars deleted the 03-25-feat_vision_link_to_edit_documents branch December 4, 2024 23:27
Copy link
Contributor

github-actions bot commented Dec 4, 2024

⚡️ Editor Performance Report

Updated Wed, 04 Dec 2024 23:32:26 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 24.1 efps (42ms) 23.8 efps (42ms) +1ms (+1.2%)
article (body) 44.0 efps (23ms) 48.5 efps (21ms) -2ms (-9.5%)
article (string inside object) 23.8 efps (42ms) 25.6 efps (39ms) -3ms (-7.1%)
article (string inside array) 22.7 efps (44ms) 20.8 efps (48ms) +4ms (+9.1%)
recipe (name) 45.5 efps (22ms) 46.5 efps (22ms) -1ms (-2.3%)
recipe (description) 52.6 efps (19ms) 52.6 efps (19ms) +0ms (-/-%)
recipe (instructions) 99.9+ efps (7ms) 99.9+ efps (7ms) +0ms (-/-%)
synthetic (title) 18.9 efps (53ms) 18.2 efps (55ms) +2ms (+3.8%)
synthetic (string inside object) 19.2 efps (52ms) 18.3 efps (55ms) +3ms (+4.8%)

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) 42ms 44ms 50ms 178ms 200ms 10.6s
article (body) 23ms 26ms 45ms 220ms 256ms 6.4s
article (string inside object) 42ms 44ms 47ms 173ms 151ms 7.0s
article (string inside array) 44ms 46ms 50ms 66ms 153ms 7.1s
recipe (name) 22ms 24ms 33ms 51ms 0ms 7.7s
recipe (description) 19ms 20ms 22ms 30ms 0ms 4.7s
recipe (instructions) 7ms 9ms 10ms 11ms 0ms 3.3s
synthetic (title) 53ms 55ms 59ms 84ms 301ms 12.7s
synthetic (string inside object) 52ms 55ms 65ms 94ms 525ms 9.0s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 42ms 46ms 51ms 70ms 224ms 11.8s
article (body) 21ms 25ms 64ms 168ms 231ms 6.3s
article (string inside object) 39ms 42ms 44ms 243ms 275ms 7.0s
article (string inside array) 48ms 50ms 52ms 185ms 150ms 7.5s
recipe (name) 22ms 24ms 26ms 61ms 0ms 7.6s
recipe (description) 19ms 20ms 22ms 32ms 0ms 4.7s
recipe (instructions) 7ms 8ms 10ms 21ms 3ms 3.5s
synthetic (title) 55ms 59ms 67ms 312ms 729ms 13.5s
synthetic (string inside object) 55ms 58ms 63ms 525ms 1118ms 8.8s

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

@sgulseth
Copy link
Member Author

sgulseth commented Dec 5, 2024

image
Awesome!

bjoerge added a commit that referenced this pull request Dec 6, 2024
* next:
  test(sanity): update timeout to avoid slow test from being flaky (#7969)
  v3.66.1
  fix(deps): update dependency @sanity/presentation to v1.19.7 (#7966)
  fix(core): guard against missing process variable (#7967)
  fix(sanity): reset search cursor state when any parameter changes (#7889)
  fix(deps): allow react v19 as peer dependency (#7962)
  v3.66.0
  fix: reword warning about vector images not support crop/hotspot (#7960)
  fix(deps): Update dev-non-major (#7959)
  fix(core): add telemetry debug/noop logger (#7958)
  fix(deps): update dependency @sanity/presentation to v1.19.5 (#7957)
  fix(core): only open one annotation object edit modal at a time (#7898)
  fix(cli): remove v2 commands (#5750)
  feat(cli): generate read token conditionally for remote template (#7953)
  fix(deps): update dependency @sanity/mutate to ^0.11.1 (#7903)
  fix(deps): update dependency @sanity/ui to ^2.9.1 (#7948)
  feat(vision): link to edit documents on `_id`, `_ref` attributes (#6124)
  fix(core): disable scheduledPublishing and tasks if `/features` returns error (#7517)
  test(e2e): restore last e2e tests (#7926)
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.

2 participants