Skip to content

Conversation

@max-nextcloud
Copy link
Collaborator

The component configured in the viewer handler
is instantiated from the vue module inside the viewer.

We want to use our own vue module so create an instance explicitely and mount it.

This fixes warnings in development like $attrs is readonly.

It also makes the vue dev tools work!

@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@max-nextcloud
Copy link
Collaborator Author

🖼️ Dev tools Screenshots

🏚️ Before 🏡 After
grafik grafik

@max-nextcloud max-nextcloud changed the title fix(viewer): merge text vue instance explicitely fix(viewer): mount text vue instance explicitely Jan 13, 2026
@max-nextcloud max-nextcloud force-pushed the fix/viewer-integration branch 3 times, most recently from c6d2f54 to c721af4 Compare January 14, 2026 06:46
@max-nextcloud max-nextcloud self-assigned this Jan 14, 2026
@max-nextcloud max-nextcloud force-pushed the fix/viewer-integration branch from a01b5e7 to a0d1f22 Compare January 14, 2026 08:28
@juliusknorr
Copy link
Member

I'm unsure if we have a test for #5531 these days but should double check this case

@max-nextcloud
Copy link
Collaborator Author

I'm unsure if we have a test for #5531 these days but should double check this case

We do have this:

it('Create a new text file as an attachment', () => {
const check = (documentId, fileName) => {
cy.log(
'Check the attachment is visible and well formed',
documentId,
fileName,
)
return cy
.get(`.text-editor [basename="${fileName}"]`)
.find('.text-editor__wrapper')
.should('be.visible')
}
cy.visit('/apps/files')
cy.openFile('test.md')
cy.log('Create a new text file as an attachment')
const requestAlias = 'create-attachment-request'
cy.intercept({ method: 'POST', url: '**/text/attachment/create' }).as(
requestAlias,
)
clickOnAttachmentAction(ACTION_CREATE_NEW_TEXT_FILE).then(() => {
return waitForRequestAndCheckAttachment(
requestAlias,
undefined,
false,
check,
)
})
})

( I know because it was broken initially.) The editor for the text file in a text file renders fine.

The component configured in the viewer handler
is instantiated from the vue module inside the viewer.

We want to use our own vue module
so create an instance with an import of our own vue and mount it.

This fixes warnings in development like $attrs is readonly.
Also makes the vue2 dev tools work.

Signed-off-by: Max <max@nextcloud.com>
It is not needed anymore now that the editor is always imported from text.

Previously the ViewerComponent was used directly from the viewer
which resulted in the editor and thus yjs being imported in two different ways.

Signed-off-by: Max <max@nextcloud.com>
@max-nextcloud max-nextcloud force-pushed the fix/viewer-integration branch from a0d1f22 to cc8e8fd Compare January 15, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants