Skip to content

Conversation

@ecnivtwelve
Copy link

@ecnivtwelve ecnivtwelve commented Oct 28, 2025

This PR allows LaSuite Docs to run in a shell environment with a container app installed.

Known issues

  • Drive iframe can be blocked by its Content Security Policy not allowing it to run in a frame.
    • Currently requires CSP to be explicitly disabled on the browser to run

Required flags

flag example comment
docs.embedded-app-url https://docs.example.com URL to LaSuite Docs deployment

Required deployments

Changes

  • Enables communication between a controller (Drive) an embed (Docs), and a shell (Cozy LaSuite Docs)
    • Document creation, sharing modal, file explorer sync, title bar

@ecnivtwelve ecnivtwelve changed the title feat: Add shell communication feat: Integrate container and embed into shell Dec 1, 2025
@ecnivtwelve ecnivtwelve changed the title feat: Integrate container and embed into shell feat: Integrate controller and embed into shell Dec 1, 2025
@ecnivtwelve ecnivtwelve changed the title feat: Integrate controller and embed into shell feat: Integrate controller into shell Dec 1, 2025
.where({ 'metadata.externalId': externalId })
.indexFields(['metadata.externalId'])
.limitBy(1),
{ as: `io.cozy.files/${externalId}` }
Copy link

Choose a reason for hiding this comment

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

see https://github.com/cozy/cozy-guidelines?tab=readme-ov-file#naming-of-queries

because here, you named like getById so we'll share wrong cache (because cache is based on the as attributes)

const path = currentlyOpenedFile
? currentlyOpenedFile.path.replace(currentlyOpenedFile.name, '')
: ''
const sanitizedPath = path.endsWith('/') ? path.slice(0, -1) : path
Copy link

Choose a reason for hiding this comment

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

pretty sure you have all you want in cozy-client. Either is models/file or Filecollection I don't know

controllerApp.current.contentWindow.postMessage(
'selectedFile:' + currentlyOpenedFile.id,
'*'
)
Copy link

Choose a reason for hiding this comment

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

Why you don't use cozy bridge for that? You should talk to @zatteo

if (e.data === 'loaded') {
if (!controllerHasLoaded) {
setControllerHasLoaded(true)
}
Copy link

Choose a reason for hiding this comment

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

yeah cozy-bridge alredy do that

id="controllerApp"
src={controllerAppUrl}
></iframe>
)}
Copy link

Choose a reason for hiding this comment

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

At the end, maybe it should be the bridge itself that render the iframe. Like that no need to create iframe on every container.

@ecnivtwelve ecnivtwelve marked this pull request as draft December 1, 2025 15:07
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.

3 participants