Skip to content

feat(structure): add telemetry for the history and review changes pane - #13875

Draft
jordanl17 wants to merge 1 commit into
mainfrom
feat/history-review-changes-telemetry
Draft

feat(structure): add telemetry for the history and review changes pane#13875
jordanl17 wants to merge 1 commit into
mainfrom
feat/history-review-changes-telemetry

Conversation

@jordanl17

Copy link
Copy Markdown
Member

Description

The studio has no telemetry for the history and review changes side pane, so we cannot tell how often it is opened and from where, which tab people use, or whether they revert changes wholesale or field by field. The inspector, its tabs, and the revert actions were entirely uninstrumented.

This PR adds three events. Document History Inspector Opened carries the tab, the trigger path (status_line, change_indicator, pane_menu, or url), and whether the events-API implementation rendered. Document History Inspector Tab Changed records tab switches with the previous and new tab. Document Changes Reverted records confirmed reverts with a scope of all, group, or field and a change count.

What to review

  • The open event fires from an effect watching the inspector transition open in useDocumentPaneInspector.ts, not from the click handlers, so deep-link, reload, and back/forward opens are captured as path: 'url'. An intent ref carries the source and tab across the transition because the pane-router params round-trip asynchronously.
  • path reuses the shared vocabulary documented in docs/TELEMETRY.md rather than a new per-feature property; the four open triggers are registered in that table.
  • Revert events log on confirm, not on the button that opens the confirmation dialog. The three revert sites are reachable only from the review changes pane today, since every revert button is gated on isComparingCurrent.

Testing

Added unit tests for all three events: the four open entry points plus the no-fire cases (close, a different inspector, no double-fire) in useDocumentPaneInspector.test.tsx, tab-change logging in ChangesTabs.test.tsx, and the three revert scopes with confirm and cancel in RevertTelemetry.test.tsx. 18 new tests; the scoped suite of 282 tests, lint, types, format, and build all pass.

Notes for release

N/A


@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
auth-test-studio Ready Ready Preview Aug 4, 2026 3:42pm
page-building-studio Ready Ready Preview Aug 4, 2026 3:42pm
studio-metrics Ready Ready Preview Aug 4, 2026 3:42pm
test-studio Ready Ready Preview Aug 4, 2026 3:42pm
test-studio-preview-iframe Ready Ready Preview Aug 4, 2026 3:42pm

Request Review

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Stats — sanity

Compared against main (6712f2d6) · v6.9.0 (npm)

sanity

Metric Value vs main (6712f2d) vs v6.9.0
Internal (raw) 4.17 MB +750 B, +0.0% +3.0 KB, +0.1%
Internal (gzip) 1.03 MB +178 B, +0.0% +1014 B, +0.1%
Bundled (raw) 12.50 MB +750 B, +0.0% +103.3 KB, +0.8%
Bundled (gzip) 2.93 MB +162 B, +0.0% +26.6 KB, +0.9%
Import time 1.72s -9ms, -0.5% +49ms, +2.9%

bin:sanity

Metric Value vs main (6712f2d) vs v6.9.0
Internal (raw) 7.1 KB - -
Internal (gzip) 2.9 KB - -
Bundled (raw) 7.1 KB - -
Bundled (gzip) 2.8 KB - -
Import time 5ms +0ms, +1.2% +0ms, +2.5%

🗺️ View treemap · Artifacts

Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

📚 TypeDoc Generation Result

TypeDoc generated successfully!

  • File size: 8.4M
  • Total exports: 1085
  • Artifact: sanity-typedoc-a2e351871ef003b1d483f9910978aa73337b7e23

The TypeDoc JSON file has been generated and validated. All documentation scripts completed successfully.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

⚡️ Editor Performance Report

Updated Tue, 04 Aug 2026 15:52:07 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
arrayI18n (simple-en) 99.9+ efps (8ms) 99.9+ efps (6ms) -2ms (-/-%)
article (title) 99.9+ efps (7ms) 99.9+ efps (8ms) +1ms (-/-%)
article (body) 84.0 efps (12ms) 91.7 efps (11ms) -1ms (-/-%)
article (string inside object) 99.9+ efps (8ms) 99.9+ efps (7ms) -1ms (-/-%)
article (string inside array) 99.9+ efps (7ms) 99.9+ efps (8ms) +1ms (-/-%)
recipe (name) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
recipe (description) 71.4 efps (14ms) 71.4 efps (14ms) +0ms (-/-%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
singleString (stringField) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
synthetic (title) 99.9+ efps (6ms) 99.9+ efps (6ms) +0ms (-/-%)
synthetic (string inside object) 99.9+ efps (6ms) 99.9+ efps (6ms) +0ms (-/-%)

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
arrayI18n (simple-en) 8ms 28ms 30ms 45ms 0ms 5.8s
article (title) 7ms 9ms 15ms 49ms 6ms 11.2s
article (body) 12ms 15ms 22ms 37ms 231ms 5.7s
article (string inside object) 8ms 8ms 13ms 23ms 2ms 5.5s
article (string inside array) 7ms 9ms 11ms 17ms 4ms 5.8s
recipe (name) 5ms 7ms 9ms 11ms 51ms 4.7s
recipe (description) 14ms 16ms 20ms 36ms 0ms 3.7s
recipe (instructions) 5ms 6ms 8ms 10ms 0ms 2.7s
singleString (stringField) 5ms 7ms 10ms 18ms 8ms 3.8s
synthetic (title) 6ms 6ms 7ms 9ms 1113ms 11.6s
synthetic (string inside object) 6ms 7ms 8ms 27ms 792ms 7.9s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
arrayI18n (simple-en) 6ms 8ms 10ms 20ms 0ms 5.7s
article (title) 8ms 11ms 23ms 59ms 10ms 10.2s
article (body) 11ms 14ms 21ms 27ms 220ms 5.4s
article (string inside object) 7ms 10ms 15ms 37ms 4ms 5.6s
article (string inside array) 8ms 8ms 10ms 16ms 0ms 5.6s
recipe (name) 5ms 6ms 9ms 15ms 53ms 4.6s
recipe (description) 14ms 16ms 18ms 26ms 0ms 3.7s
recipe (instructions) 5ms 6ms 8ms 17ms 0ms 2.8s
singleString (stringField) 5ms 6ms 11ms 16ms 0ms 3.8s
synthetic (title) 6ms 6ms 7ms 10ms 1016ms 11.5s
synthetic (string inside object) 6ms 7ms 8ms 22ms 685ms 7.7s

📚 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

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 44.85% 32758 / 73027
🔵 Statements 37.9% 43030 / 113523
🔵 Functions 36.3% 7004 / 19292
🔵 Branches 29.78% 28248 / 94851
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/sanity/src/core/field/diff/components/ChangeList.tsx 66.41% 64.95% 36.84% 86.56% 44, 48, 72, 75, 101, 104, 108, 112, 119-120, 142, 160, 161, 169, 170, 43-170
packages/sanity/src/core/field/diff/components/FieldChange.tsx 55.41% 34.22% 21.05% 80.51% 42-50, 67, 81, 82, 92-93, 102, 108, 111-112, 116, 119-120, 123-124, 129, 136, 138, 140-141, 147, 173, 186, 187, 188, 189, 190, 198, 199, 59-129, 43-52, 67-199
packages/sanity/src/core/field/diff/components/GroupChange.tsx 51.56% 32.4% 23.07% 73.33% 43, 57, 59, 67-68, 76, 80, 89, 95, 98-99, 103, 152, 175, 188, 36-175, 199-207, 209, 43-211
packages/sanity/src/structure/panes/document/DocumentPaneContext.ts 0% 0% 0% 0%
packages/sanity/src/structure/panes/document/constants.ts 100% 100% 100% 100%
packages/sanity/src/structure/panes/document/useDocumentPaneInspector.ts 74.76% 54.59% 90% 86.32% 42, 48-49, 51, 54, 86, 93, 97, 112-120, 129, 135, 142-146, 155, 162, 166, 174, 181-187, 192, 199-200, 203, 209, 220-222, 245, 57-60, 70-86, 88-122, 118-157, 158-162, 164-176, 178-189, 183-194, 196-231
packages/sanity/src/structure/panes/document/document-layout/DocumentLayout.tsx 1.98% 0% 0% 2.22% 52-195, 53-259
packages/sanity/src/structure/panes/document/inspectors/changes/ChangesTabs.tsx 75.42% 59.5% 55.55% 89.85% 66, 82, 83, 85, 89, 90, 92, 93, 95, 99, 102, 114, 120, 125, 129, 131, 162, 171, 178-90
packages/sanity/src/structure/panes/document/statusBar/DocumentStatusLine.tsx 6.52% 0% 0% 8.84% 42-45, 48-50, 59-82, 106-142, 150-162, 172-187, 198-175, 49-55, 72-102, 111-146, 154-168, 174-256
Generated in workflow #63886 for commit c8a4b9b by the Vitest Coverage Report Action

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.

1 participant