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): squash chunks in timeline. #7458

Merged
merged 4 commits into from
Sep 6, 2024
Merged

Conversation

pedrobonamin
Copy link
Contributor

@pedrobonamin pedrobonamin commented Sep 3, 2024

Description

This PR changes how the rows in the history are shown in the UI, collapsing draft edits into the publish action.
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.

The story has been updated to include this new behavior, you can check it here https://test-studio-git-corel-145.sanity.dev/test/workshop/structure;panes;documentTimelineMenu;timelineItem?scheme=light

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

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

What to review

Is this correct? Are changes clear?

Testing

Notes for release

n/a

Copy link

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

Copy link
Contributor

github-actions bot commented Sep 3, 2024

No changes to documentation

Copy link
Contributor

github-actions bot commented Sep 3, 2024

Component Testing Report Updated Sep 4, 2024 7:39 AM (UTC)

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

@pedrobonamin pedrobonamin marked this pull request as ready for review September 3, 2024 12:04
@pedrobonamin pedrobonamin requested a review from a team as a code owner September 3, 2024 12:04
@pedrobonamin pedrobonamin requested review from ryanbonial, a team and bjoerge and removed request for a team and ryanbonial September 3, 2024 12:04
@RitaDias
Copy link
Contributor

RitaDias commented Sep 5, 2024

👋
This is just a design thing and unrelated to the code itself (I'm still reviewing it)
But given that I'm used to the items being "flat" I honestly would have never gone to the "..." to even realise that I could expand them 😬

@pedrobonamin
Copy link
Contributor Author

👋 This is just a design thing and unrelated to the code itself (I'm still reviewing it) But given that I'm used to the items being "flat" I honestly would have never gone to the "..." to even realise that I could expand them 😬

@RitaDias yes, makes sense, I am thinking on proposing to @mariuslundgard using a Caret icon instead of the three dots. Specially considering that we have only 1 action the user can do in this cases. I think it will make it easier to notice that you can expand it.
Also, handling the popovers here was quite tricky, so it will also simplify things a bit

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.

@pedrobonamin pedrobonamin merged commit 4b07286 into history-updates Sep 6, 2024
43 checks passed
@pedrobonamin pedrobonamin deleted the corel-145 branch September 6, 2024 09:30
pedrobonamin added a commit that referenced this pull request Oct 1, 2024
* 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
pedrobonamin added a commit that referenced this pull request Nov 6, 2024
* 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
pedrobonamin added a commit that referenced this pull request Nov 11, 2024
* 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
pedrobonamin added a commit that referenced this pull request Nov 14, 2024
* 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
pedrobonamin added a commit that referenced this pull request Nov 18, 2024
* 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
pedrobonamin added a commit that referenced this pull request Nov 18, 2024
* 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
pedrobonamin added a commit that referenced this pull request Nov 19, 2024
* 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
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