Skip to content

"Insert from cloud" in the text editor is a dead end on public links #3631

Closed

Description

@AlexAndBear

Initial Checklist

  • I understand this is a bug report and questions should be posted in the Community Discussions
  • I searched issues and couldn’t find anything (or linked relevant results below)

Bug Description

On public links, the text editor offers "Insert image" → "Insert from cloud", but the file picker can't offer anything useful there. It opens the parent folder of the edited file (openCloudImagePicker in packages/web-pkg/src/editor/composables/useEditorActions.ts, parentFolderLink: getParentFolderLink(resource)), and an anonymous user can't browse anywhere else:

  • Link to a single file: the picker only shows that very file – a dead end.
  • Link to a folder: only images inside the shared folder can be picked.

Proposal: hide "Insert from cloud" on public links (e.g. when the current space is a public link space / no user is logged in), like other actions that need a user's own files. "Image from file" and "Image from URL" stay available.

Alternative: hide it only for links to a single file and keep it for folder links, where picking an image from the shared folder can be useful.

The same applies to apps using the same pattern (e.g. "Add image → From cloud" in PDF Studio from web-extensions), so a shared check (e.g. in FilePickerModal or a small composable) would help them too.

Reproduction Steps

  1. Create a public link with edit permission for a markdown file (link to the file itself).
  2. Open the link in a private window and open the file in the text editor.
  3. Insert image → "Insert from cloud".

Expected Outcome

The action isn't offered when there is nothing to pick from (or only offers images that can actually be reached).

Actual Outcome

The file picker opens and only shows the edited file itself; there is nothing to pick and nowhere to navigate to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions