diff --git a/CHANGELOG.md b/CHANGELOG.md index b27e76ed786d..f31e9a856fa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,8 @@ component.][11452] - [New documentation editor provides improved Markdown editing experience, and paves the way for new documentation features.][11469] +- [You can now add images to documentation panel][11547] by pasting them from + clipboard or by drag'n'dropping image files. - ["Write" button in component menu allows to evaluate it separately from the rest of the workflow][11523]. @@ -42,6 +44,7 @@ [11448]: https://github.com/enso-org/enso/pull/11448 [11452]: https://github.com/enso-org/enso/pull/11452 [11469]: https://github.com/enso-org/enso/pull/11469 +[11547]: https://github.com/enso-org/enso/pull/11547 [11523]: https://github.com/enso-org/enso/pull/11523 #### Enso Standard Library diff --git a/app/gui/e2e/project-view/rightPanel.spec.ts b/app/gui/e2e/project-view/rightPanel.spec.ts index bc907fbe2d61..3f2eb5ef73b5 100644 --- a/app/gui/e2e/project-view/rightPanel.spec.ts +++ b/app/gui/e2e/project-view/rightPanel.spec.ts @@ -7,13 +7,18 @@ import * as locate from './locate' test('Main method documentation', async ({ page }) => { await actions.goToGraph(page) + const rightDock = locate.rightDock(page) // Documentation panel hotkey opens right-dock. - await expect(locate.rightDock(page)).toBeHidden() + await expect(rightDock).toBeHidden() await page.keyboard.press(`${CONTROL_KEY}+D`) - await expect(locate.rightDock(page)).toBeVisible() + await expect(rightDock).toBeVisible() // Right-dock displays main method documentation. - await expect(locate.editorRoot(locate.rightDock(page))).toHaveText('The main method') + await expect(locate.editorRoot(rightDock)).toContainText('The main method') + // All three images are loaded properly + await expect(rightDock.getByAltText('Image')).toHaveCount(3) + for (const img of await rightDock.getByAltText('Image').all()) + await expect(img).toHaveJSProperty('naturalWidth', 3) // Documentation hotkey closes right-dock.p await page.keyboard.press(`${CONTROL_KEY}+D`) diff --git a/app/gui/src/project-view/bindings.ts b/app/gui/src/project-view/bindings.ts index 210094aeb62c..defe7cb055c6 100644 --- a/app/gui/src/project-view/bindings.ts +++ b/app/gui/src/project-view/bindings.ts @@ -12,6 +12,7 @@ export const codeEditorBindings = defineKeybinds('code-editor', { export const documentationEditorBindings = defineKeybinds('documentation-editor', { toggle: ['Mod+D'], openLink: ['Mod+PointerMain'], + paste: ['Mod+V'], }) export const interactionBindings = defineKeybinds('current-interaction', { diff --git a/app/gui/src/project-view/components/DocumentationEditor.vue b/app/gui/src/project-view/components/DocumentationEditor.vue index fc19d6b70888..240aae6e4be3 100644 --- a/app/gui/src/project-view/components/DocumentationEditor.vue +++ b/app/gui/src/project-view/components/DocumentationEditor.vue @@ -1,13 +1,17 @@