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(structure): History UI updates #7462

Open
wants to merge 15 commits into
base: next
Choose a base branch
from
Open

Conversation

pedrobonamin
Copy link
Contributor

@pedrobonamin pedrobonamin commented Sep 4, 2024

Description

This PR introduces UI changes into the history and revision panel.

  • Chunks are squashed together on publish.
  • Moves the revision selector to the history panel.
  • Timeline item are updated with new looks.
  • Footer shown when seeing a revision is updated with new looks.
  • The inspector panel now includes two tabs the user can navigate history and review changes

What does "chunks are squashed together on publish" means?

Once the draft changes are published all the draft edits done before that publish will be squashed and shown as 1 change, that could be expanded, showing also the collaborators for that published.
This means:
If we have the following mutations:
[draftEdit, publish, draftEdit, draftEdit, create]
it will be shown as
[draftEdit, publish (expandable), create]
On expand, it will show the two collapsed draftEdit actions

The changes are not removed from the history, they are only visually squashed for easier navigation in the UI.

This is achieved by creating a relation between parents publish action and children draftEdit actions, in the addChunksMetadata function.

Collapsed Expanded
Screenshot 2024-09-03 at 11 11 33 Screenshot 2024-09-03 at 11 11 50
Collapsable.history.items.mov

What to review

Are the changes correct? Is something missing?

Testing

Notes for release

Updates to history inspector UI

Copy link

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

Copy link
Contributor

github-actions bot commented Sep 4, 2024

No changes to documentation

Copy link
Contributor

github-actions bot commented Sep 4, 2024

Component Testing Report Updated Nov 7, 2024 5:35 PM (UTC)

❌ Failed Tests (1) -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 46s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 9s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 31s 6 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 39s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 18s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 11s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 3m 0s 0 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 46s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 48s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 17s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 9s 3 9 0
formBuilder/inputs/PortableText/RangeDecoration.spec.tsx ✅ Passed (Inspect) 27s 9 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 18s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ❌ Failed (Inspect) 47s 11 0 1
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

RitaDias and others added 4 commits November 6, 2024 10:37
* feat(sanity): update restore button

* chore(sanity): update translations

* feat(sanity): add left side information on footer (revision status line)
…el (#7435)

* feat(structure): add history and review tabs to changes inspector panel

* fix(structure): move changes inspector navigation to paneRouter

* fix(structure): update isReviewChangesOpen check in ChangeConnectorRoot

* fix(structure): rename uses of version to revision

* chore(core): rename review changes action to history
…nks (#7449)

* feat(structure): update TimelineItem to match new UI, prepare for chunks

* chore(core): export getCalendarLabels to support DateTimeInput reusability
* feat(structure): add squashed chunks to timeline

* feat(structure): refactor expandable item, all items need to be rendered in the same virtual list

* feat(structure): expand elements on menu click

* chore(structure): clean timeline item
@@ -194,7 +194,6 @@ export function useTimelineStore({
findRangeForSince: (chunk: Chunk) => controller.findRangeForNewSince(chunk),
loadMore: () => {
controller.setLoadMore(true)
timelineStateRef.current.isLoading = true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed this in some cases was blocking the ui in a loading state, which never ended because the load more action was not actually fetching new data, so the controller was not triggering any update, so the isLoading returned in line 220 was never resetting to false.

Comment on lines -114 to -119
if (didPublish) {
if (changesOpen) {
// Re-open the panel
onHistoryOpen()
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not necessary, the history panel won't close when a publish action happens.

@pedrobonamin pedrobonamin requested review from a team, juice49 and RitaDias November 11, 2024 08:22
Copy link
Contributor

@RitaDias RitaDias left a comment

Choose a reason for hiding this comment

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

This is clean Pedro, fantastic job! ✨

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