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

fix(LinkBubble): Don't open bubble at initialization and on remote changes #5924

Merged
merged 7 commits into from
Jun 25, 2024

Conversation

mejo-
Copy link
Member

@mejo- mejo- commented Jun 18, 2024

Fixes: #5855
Fixes: nextcloud/collectives#1296

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits

@mejo- mejo- added this to the Nextcloud 30 milestone Jun 18, 2024
@mejo- mejo- self-assigned this Jun 18, 2024
@mejo-
Copy link
Member Author

mejo- commented Jun 18, 2024

/backport to stable29

@mejo- mejo- changed the title fix(LinkBubble): Don't open bubble when initializing the editor fix(LinkBubble): Don't open bubble at initialization and on remote changes Jun 19, 2024
Undo button should be disabled after initial content got loaded and only
get enabled after typing something.

Signed-off-by: Jonas <jonas@freesources.org>
Hide was called with a timeout of 100ms, while update was not. This
could lead to a race condition and flaky link bubble behaviour.

Signed-off-by: Jonas <jonas@freesources.org>
`active` object from prosemirror state and oldState are never similar
anyway.

Signed-off-by: Jonas <jonas@freesources.org>
Signed-off-by: Jonas <jonas@freesources.org>
Should make the workspace link bubble test less flaky.

Signed-off-by: Jonas <jonas@freesources.org>
Copy link
Collaborator

@max-nextcloud max-nextcloud left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@@ -69,9 +69,17 @@ export function linkBubble(options) {
}),

appendTransaction: (transactions, oldState, state) => {
// Don't open bubble at editor initialisation
if (oldState?.doc.content.size === 2) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will also be in effect if you paste into an empty document. I can't think of any case where that's a problem. Just wanted to mention.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Uuhh... what if you insert a link via the link picker on an empty document. Actually would be nice if that behaved exactly as in a doc that already contains some characters. Not so important - but still a bit inconsistent.

Oh... doesn't the initial load happen through the ydoc? That would be caught by the other conditions later on - wouldn't it?

@juliushaertl juliushaertl merged commit f9dc579 into main Jun 25, 2024
58 of 61 checks passed
@juliushaertl juliushaertl deleted the fix/link_bubble_init branch June 25, 2024 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Link bubble should not open when opening a document popup with link preview overlaps every exported page
3 participants