Skip to content

feat(composer): insert images from Files - #13477

Merged
kesselb merged 1 commit into
mainfrom
ckeditor-files-picker
Aug 13, 2026
Merged

feat(composer): insert images from Files#13477
kesselb merged 1 commit into
mainfrom
ckeditor-files-picker

Conversation

@kesselb

@kesselb kesselb commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Register an integration in CKEditor's insert image dropdown that opens the Nextcloud file picker.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@kesselb kesselb self-assigned this Aug 12, 2026
@nextcloud-command nextcloud-command added the AI assisted This PR contains AI-assisted commits label Aug 12, 2026
@kesselb
kesselb requested review from hamza221 and madbob August 12, 2026 11:53
@kesselb

kesselb commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author
  • Bug: Picker allows to select multiple files, only the first is processed.

@madbob

madbob commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Very cool!

I'm a little hesitant about introducing TypeScript parts just out of the blue, and mix different styles in the codebase.
Do it exists some directive/guideline/reccomendation about TypeScript adoption in Nextcloud?

Side note not meant to be targetted in this PR: the list of mime types is OK, but different from the one in MessageController, which is different from the one in AvatarService. Sooner or later, we should have a single list of "mimetypes that can be considered an image and put into an img tag"...

@hamza221 hamza221 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good.
+1 for the centralized Mime types allowlist especially with lib/Controller/MessagesController.php but not a blocker.
Using ts is the right call for new files as we aim to fully switch to typescript at some point ✅

@hamza221

hamza221 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
  • Bug: Picker allows to select multiple files, only the first is processed.

I can't reproduce 🤔
Edit:

current (expected) multiple (wrong in this case)
image image

try {
const nodes = await getFilePickerBuilder(t('mail', 'Choose an image'))
.setMimeTypeFilter(MIME_TYPES)
.setMultiSelect(false)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Set to false here, which is correct if you're expecting one file

@kesselb

kesselb commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

I can't reproduce 🤔

Thanks for checking. It's actually something different. In single mode it's currently not possible to select a different node when one is already selected. I'd overlooked that it's necessary to unselect the last node first. I filed an issue upstream because it looks unintended to me: nextcloud-libraries/nextcloud-dialogs#2567.

Similar to moveOrCopyAction.ts in files the picker now disabled the button if no node is selected and also inserts the filename to be added.

Screencast showing the old state:

Screencast.From.2026-08-13.10-30-54.mp4

@kesselb
kesselb force-pushed the ckeditor-files-picker branch from 6272769 to 6324fbf Compare August 13, 2026 10:25
@kesselb
kesselb enabled auto-merge August 13, 2026 10:25
Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb
kesselb force-pushed the ckeditor-files-picker branch from 6324fbf to feb8e15 Compare August 13, 2026 10:54
@kesselb
kesselb disabled auto-merge August 13, 2026 11:45
@kesselb
kesselb merged commit 3d28b46 into main Aug 13, 2026
32 of 43 checks passed
@kesselb
kesselb deleted the ckeditor-files-picker branch August 13, 2026 11:45
@kesselb

kesselb commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Similar to moveOrCopyAction.ts in files the picker now disabled the button if no node is selected and also inserts the filename to be added.

#13484

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

Labels

3. to review AI assisted This PR contains AI-assisted commits enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants