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(sanity): support viewing and editing document versions #7251

Merged
merged 6 commits into from
Aug 13, 2024

Conversation

juice49
Copy link
Contributor

@juice49 juice49 commented Jul 26, 2024

Description

This branch introduces a new, optional, version property to document pairs and their various associated constructs. When a bundle is checked out, the version document takes precedence over the published and draft documents. If no version document exists, the draft and published documents are used.

This branch also moves the checked-out bundle state up to the structure pane node context. This allows each pane to have its own bundle checked out.

Example multi-version split pane URL: http://localhost:3333/test/structure/book;243dbfde-e1e0-4289-a72e-445e8926b4d4;243dbfde-e1e0-4289-a72e-445e8926b4d4%2Ctype%3Dbook%2Cperspective%3Dbundle.autumn-drop?perspective=bundle.summer-drop.

I'm wondering whether it might be beneficial to try to get these changes into next sooner rather than later.

Todo

  • Resolve double data loading / rendering when opening documents.
  • API for checking out a bundle in a single pane.
  • Resolve lingering type errors.
  • Resolve failing tests.
  • We do perspective?.startsWith('bundle.') and similar in a lot of places. Now might be a good time to to abstract that.
  • Add tests.
  • Fix live edit badge incorrectly appearing for documents that don't exist in the checked-out bundle.
  • Improve handling of revision list when viewing a document that does not exist in the checked-out bundle (currently shows "No document history").
  • Fix bundle identification in DocumentPerspectiveMenu.
  • Account for version document in getDocumentPairPermissions.
  • Fix "reference has changed" banner.
  • Make comments version aware.

What to review

It would be great to get some thoughts about the general approach taken. Does adding a new version property to constructs make sense, instead of reusing the existing draft property? My reasons for this decision are:

  1. There are likely scenarios in which we'll need to make a distinction based on whether we're working with a draft or a version.
  2. It's useful to track both the version and the draft, so we can fall back to showing the draft if the version doesn't exist.

Very open to opposing thoughts!

Testing

Notes for release

Copy link

vercel bot commented Jul 26, 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 Aug 13, 2024 8:38am
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 13, 2024 8:38am
test-compiled-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 13, 2024 8:38am
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 13, 2024 8:38am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 13, 2024 8:38am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Aug 13, 2024 8:38am

@juice49 juice49 force-pushed the feat/corel-3/multiple-document-versions branch from 89dfced to 9a6f456 Compare July 26, 2024 09:19
@juice49 juice49 changed the title Feat/corel 3/multiple document versions feat(sanity): support viewing and editing document versions Jul 26, 2024
@juice49 juice49 force-pushed the feat/corel-3/multiple-document-versions branch from 9a6f456 to 9fe8ba4 Compare July 29, 2024 08:18
@juice49 juice49 force-pushed the feat/corel-3/multiple-document-versions branch from 7921fd9 to e9aa1cd Compare August 12, 2024 13:37
@juice49 juice49 force-pushed the feat/corel-3/multiple-document-versions branch from 7002e84 to 70b2876 Compare August 12, 2024 14:35
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.

4 participants