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(portable-text-editor): preserve keys on undo/redo #5805

Merged
merged 3 commits into from Feb 28, 2024

Conversation

skogsmaskin
Copy link
Member

@skogsmaskin skogsmaskin commented Feb 20, 2024

Description

Previously when doing undo/redo in the PortableTextEditor it would generate new keys for the created content.

With this change, the keys will be preserved along with the original content. This makes it possible to support situations where something externally depends on the previous content's keys, it will be possible to restore that dependency when calling undo after an operation breaks it.

I have also introduced some unit tests for undo/redo that will test this functionality. Previously we only had e2e tests for undo/redo.

What to review

Manual testing, unit test, and e2e tests seem to verify that there are no issues with this change.
But could it be something we are not thinking of here?

Testing

It should be covered by various tests.

Notes for release

  • Preserve content keys when doing undo/redo in the Portable Text Editor.

@skogsmaskin skogsmaskin requested a review from a team as a code owner February 20, 2024 19:54
@skogsmaskin skogsmaskin requested review from sjelfull and removed request for a team February 20, 2024 19:54
Copy link

vercel bot commented Feb 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Feb 28, 2024 0:07am
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 28, 2024 0:07am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Feb 28, 2024 0:07am

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Feb 20, 2024

Component Testing Report Updated Feb 28, 2024 12:12 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 38s 14 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 5s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 12s 3 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 12s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 31s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 59s 15 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 1s 18 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 19s 9 0 0

Copy link
Member

@sjelfull sjelfull left a comment

Choose a reason for hiding this comment

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

Nice! No deep knowledge here on my part, but I can't find any issues in normal use.

@skogsmaskin skogsmaskin force-pushed the feat/pte-preserve-keys-on-undo-redo branch from 4ec9774 to 5f85425 Compare February 28, 2024 12:02
@skogsmaskin skogsmaskin added this pull request to the merge queue Feb 28, 2024
Merged via the queue into next with commit f83e8e4 Feb 28, 2024
40 checks passed
@skogsmaskin skogsmaskin deleted the feat/pte-preserve-keys-on-undo-redo branch February 28, 2024 12:17
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.

None yet

2 participants