-
Notifications
You must be signed in to change notification settings - Fork 447
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: add diff view #7907
base: feat/content-releases
Are you sure you want to change the base?
feat: add diff view #7907
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
No changes to documentation |
f9c9ce5
to
cca9390
Compare
Component Testing Report Updated Jan 30, 2025 4:21 PM (UTC) ❌ Failed Tests (1) -- expand for details
|
⚡️ Editor Performance ReportUpdated Thu, 30 Jan 2025 16:26:47 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
2a7e87e
to
229ecf3
Compare
43a180d
to
3adf9ed
Compare
3adf9ed
to
6ea4097
Compare
Co-Authored-By: Jordan Lawrence <jordanl17@me.com> Co-Authored-By: Bjørge Næss <bjoerge@gmail.com> Co-Authored-By: Rita <anarita151@gmail.com> Co-Authored-By: pedrobonamin <pedrobonamin@gmail.com> Co-Authored-By: Ash <ash@sanity.io> Co-Authored-By: Cody Olsen <81981+stipsan@users.noreply.github.com> Co-Authored-By: Robin Neatherway <rneatherway@sanity.io>
This component is required for rendering the new document comparison view.
f3eb161
to
9c6881b
Compare
9c6881b
to
e0cb7b0
Compare
93d76ce
to
1b4edb7
Compare
Description
This branch adds a diff view for comparing documents. Primarily, this is for use with versions, but it has been designed to support comparing any two documents.
Most of the commits are supporting work (this should probably be a stack). The main feature addition occurs in 2048903.
Navigating to diff view
Users can navigate to the diff view by setting the following URL search parameters:
Example: specifying both
previousDocument
andnextDocument
New dependency: ScrollMirror
I've added ScrollMirror to handle scroll position syncing between two panes that may have different heights. This is achieved by syncing the percentage scroll position of each pane. We could implement this directly in the Studio codebase if we wish.
What to review
ScrollMirror
dependency.Testing
There are no tests just yet, as I've spent more time than I expected making the code render in a test environment. First, I needed to move the diff view code that was originally organised as a plugin to be part of
sanity/structure
. Then I encountered many issues with existing imports insanity/structure
resolving toundefined
when running in a test environment.I will follow up with tests as soon as these problems are resolved.