# Epic OP-10747 - Optimise block image resizing in CKEditor

Project: OpenProject
Status: specified
URL: https://community.openproject.org/work_packages/OP-10747

## Detailed specification

### Motivation and background information

### Acceptance criteria

### Out of scope

| Attribute | Value |
| --- | --- |
| Mockups |  |

## Planning

| Attribute | Value |
| --- | --- |
| Roadmap |  |
| Date |  |
| Votes |  |
| List |  |
| Target versions | Wish List |
| Sprint |  |
| Backlog bucket |  |
| Relevance |  |

## Subitems

_No work packages_

## Bugs and other work packages

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Module |  |
| Enterprise plan |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Feature Lead |  |
| Designer | Parimal Satyal |
| Developers |  |
| Requested by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| Work |  |

## Description

**Note:** This work package extends changes to image resizing in CKEditor handled in ticket <mention class="mention" data-id="42197" data-type="work_package" data-text="#42197">\#42197</mention>.

### Context

In 12.2, we changed the resizing behaviour of images in CKEditor such that dragging and dropping an image places it at the cursor location and by default:

  - Sets the mode to inline
  - With resize-handles
  - Without paragraph helpers
  - Captions not enabled

Available actions are:

  - Add caption (but this makes the image block, taking 100% of editor width, whilst neverless retaining 100% of original size when published)
  - Change alt text
  - Toggle inline vs. centered (block)
  - Resize image to original size

<img class="op-uc-image op-uc-image_inline" style="width:205px;" src="/api/v3/attachments/37016/content">

### Identified problems with current version (12.2)

The current approach has these downsides:

  - Resize handles only available in inline-mode but no paragraph helpers
  - Paragraph helpers only available in block/centered mode, but no resize handles
  - Adding a caption to an inline image automatically changes mode to centered, which isn't logical to the user
      - Disabling the caption doesn't change it back

### Acceptance criteria (for 12.3)

Ideally, we are looking for behaviour consistent with the first example on this page: <https://ckeditor.com/docs/ckeditor5/latest/features/images/images-captions.html#demo>

  - Inline images have both resize handles *and* paragraph helpers
  - Inline images can have captions (without switching to block mode)
  - Switching to centered only changes position (preserves handles and helpers)
  - These actions continue to exist:
      - Caption on/off
      - Change alt text
      - Toggle inline vs. centered
      - Resize image to original size
